@imj_media/tareas 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tareas.es.js CHANGED
@@ -1,39 +1,39 @@
1
- import { jsx as e, jsxs as o, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as o, Fragment as j } from "react/jsx-runtime";
2
2
  import "@imj_media/imj-ui/styles.css";
3
- import { useQueryClient as H, useQuery as ae, useMutation as Ke, useInfiniteQuery as ne, QueryClient as Ue, QueryClientProvider as Qe } from "@tanstack/react-query";
4
- import { useState as y, useEffect as _, useRef as L, createContext as V, useContext as G } from "react";
5
- import { Tooltip as K, Icons as C } from "@imj_media/tasks-modules";
6
- import X from "react-dom";
7
- import ve from "axios";
8
- import Ce from "qs";
9
- import { parseISO as He, formatDistanceToNow as Ve, format as _e } from "date-fns";
10
- import { es as re } from "date-fns/locale";
11
- import { Button as Fe, Avatar as J, AvatarImage as Z, AvatarFallback as k, Input as Ge, Label as Ye, Accordion as Xe, AccordionItem as Je, AccordionTrigger as Ze, AccordionContent as ke } from "@imj_media/imj-ui";
12
- import { useForm as et } from "react-hook-form";
13
- import { Paginator as tt } from "primereact/paginator";
14
- const at = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE__ */ e(K, { dispatch: /* @__PURE__ */ o("button", { className: "text-texts-placeholder text-xs font-semibold cursor-help", children: [
3
+ import { useQueryClient as V, useQuery as re, useMutation as Ce, useInfiniteQuery as se, QueryClient as Ge, QueryClientProvider as Ye } from "@tanstack/react-query";
4
+ import { useState as y, useEffect as F, useRef as O, createContext as G, useContext as Y } from "react";
5
+ import { Tooltip as H, Icons as C } from "@imj_media/tasks-modules";
6
+ import Z from "react-dom";
7
+ import Se from "axios";
8
+ import Ae from "qs";
9
+ import { parseISO as Xe, formatDistanceToNow as Je, format as qe } from "date-fns";
10
+ import { es as le } from "date-fns/locale";
11
+ import { Button as je, Avatar as k, AvatarImage as ee, AvatarFallback as te, Input as Ze, Label as ke, Accordion as et, AccordionItem as tt, AccordionTrigger as at, AccordionContent as nt } from "@imj_media/imj-ui";
12
+ import { useForm as rt } from "react-hook-form";
13
+ import { Paginator as st } from "primereact/paginator";
14
+ const lt = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE__ */ e(H, { dispatch: /* @__PURE__ */ o("button", { className: "text-texts-placeholder text-xs font-semibold cursor-help", children: [
15
15
  " ",
16
16
  a,
17
17
  " "
18
- ] }), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center px-3 py-2 bg-bg-card rounded-lg border border-border-card", children: /* @__PURE__ */ e("p", { className: "text-texts-placeholder text-xs font-semibold", children: "Espéralo muy pronto..." }) }) }) : /* @__PURE__ */ e("button", { disabled: n, onClick: r, className: `${t ? "text-texts-enfasis border-b-2 border-texts-enfasis" : ""} text-xs font-semibold ${n ? "cursor-not-allowed text-texts-placeholder" : "text-texts-subtext"} `, children: a }), nt = ({ tabs: a, renderItem: t, initialTab: r }) => {
19
- const [n, l] = y(r ?? a[0].toLowerCase());
20
- _(() => {
21
- r && l(r);
18
+ ] }), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center px-3 py-2 bg-bg-card rounded-lg border border-border-card", children: /* @__PURE__ */ e("p", { className: "text-texts-placeholder text-xs font-semibold", children: "Espéralo muy pronto..." }) }) }) : /* @__PURE__ */ e("button", { disabled: n, onClick: r, className: `${t ? "text-texts-enfasis border-b-2 border-texts-enfasis" : ""} text-xs font-semibold ${n ? "cursor-not-allowed text-texts-placeholder" : "text-texts-subtext"} `, children: a }), it = ({ tabs: a, renderItem: t, initialTab: r }) => {
19
+ const [n, s] = y(r ?? a[0].toLowerCase());
20
+ F(() => {
21
+ r && s(r);
22
22
  }, [r]);
23
- const s = (i) => {
24
- l(i), t(i);
23
+ const l = (i) => {
24
+ s(i), t(i);
25
25
  };
26
26
  return /* @__PURE__ */ e("div", { className: "flex", children: a.map((i, u) => /* @__PURE__ */ e("div", { className: `${u === 0 ? "border-l-2" : ""} border-r-2 border-gray-200 px-m`, children: /* @__PURE__ */ e(
27
- at,
27
+ lt,
28
28
  {
29
- onClick: () => s(i.toLowerCase()),
29
+ onClick: () => l(i.toLowerCase()),
30
30
  label: i,
31
31
  active: i.toLowerCase() === n,
32
32
  disabled: ["gantt"].includes(i.toLowerCase())
33
33
  },
34
34
  u
35
35
  ) })) });
36
- }, P = {
36
+ }, S = {
37
37
  bg: {
38
38
  DEFAULT: "#EFEFEF",
39
39
  content: "#FAFAFA",
@@ -95,161 +95,161 @@ const at = ({ label: a, active: t, onClick: r, disabled: n }) => n ? /* @__PURE_
95
95
  regular: "#0EA5E9",
96
96
  pastel: "#0EA5E9"
97
97
  }
98
- }, le = () => {
98
+ }, ie = () => {
99
99
  const [a, t] = y(null);
100
100
  return {
101
101
  //Properties
102
102
  position: a,
103
103
  //Methods
104
- setElementPosition: (s) => {
105
- var p;
106
- let i = (p = s.current) == null ? void 0 : p.getBoundingClientRect(), u = (i == null ? void 0 : i.x) + ((i == null ? void 0 : i.width) ?? 0), c = (i == null ? void 0 : i.y) + (i == null ? void 0 : i.height);
104
+ setElementPosition: (l) => {
105
+ var x;
106
+ let i = (x = l.current) == null ? void 0 : x.getBoundingClientRect(), u = (i == null ? void 0 : i.x) + ((i == null ? void 0 : i.width) ?? 0), c = (i == null ? void 0 : i.y) + (i == null ? void 0 : i.height);
107
107
  t(a ? null : { x: u ?? 0, y: c ?? 0 });
108
108
  },
109
- getChildrenSize: (s) => {
109
+ getChildrenSize: (l) => {
110
110
  var i;
111
- return (i = s.current) == null ? void 0 : i.getBoundingClientRect();
111
+ return (i = l.current) == null ? void 0 : i.getBoundingClientRect();
112
112
  },
113
113
  clearPosition: () => {
114
114
  t(null);
115
115
  }
116
116
  };
117
- }, rt = ({ children: a, filterChildren: t }) => {
118
- const { position: r, setElementPosition: n } = le(), l = L(null), s = ({ children: i }) => {
117
+ }, ot = ({ children: a, filterChildren: t }) => {
118
+ const { position: r, setElementPosition: n } = ie(), s = O(null), l = ({ children: i }) => {
119
119
  const [u, c] = y();
120
- return _(() => {
121
- var p, d;
122
- t.current && c(((r == null ? void 0 : r.x) ?? 0) - (((d = (p = t.current) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : d.width) ?? 0));
123
- }, [t == null ? void 0 : t.current, r == null ? void 0 : r.x]), r && X.createPortal(
120
+ return F(() => {
121
+ var x, d;
122
+ t.current && c(((r == null ? void 0 : r.x) ?? 0) - (((d = (x = t.current) == null ? void 0 : x.getBoundingClientRect()) == null ? void 0 : d.width) ?? 0));
123
+ }, [t == null ? void 0 : t.current, r == null ? void 0 : r.x]), r && Z.createPortal(
124
124
  /* @__PURE__ */ e("div", { className: `absolute w-fit h-fit ${u ? "block" : "hidden"}`, style: { top: `${r == null ? void 0 : r.y}px`, left: `${u}px`, zIndex: 1 }, children: i }),
125
125
  document.body
126
126
  );
127
127
  };
128
- return /* @__PURE__ */ o(q, { children: [
128
+ return /* @__PURE__ */ o(j, { children: [
129
129
  /* @__PURE__ */ o(
130
130
  "label",
131
131
  {
132
- ref: l,
132
+ ref: s,
133
133
  htmlFor: "filter-button",
134
134
  className: "flex cursor-pointer items-center gap-m p-s text-texts-enfasis fill-texts-enfasis bg-bg rounded-lg px-l h-[30px] shadow-button-primary hover:shadow-button-primary-hover ",
135
135
  children: [
136
- /* @__PURE__ */ e(C, { icon: "filter", size: "xs", strokeWidth: 5, color: P.primary.regular }),
136
+ /* @__PURE__ */ e(C, { icon: "filter", size: "xs", strokeWidth: 5, color: S.primary.regular }),
137
137
  "Filtrar"
138
138
  ]
139
139
  }
140
140
  ),
141
141
  /* @__PURE__ */ e("button", { className: "hidden", id: "filter-button", onClick: () => {
142
- n(l);
142
+ n(s);
143
143
  } }),
144
- /* @__PURE__ */ e(s, { children: a })
144
+ /* @__PURE__ */ e(l, { children: a })
145
145
  ] });
146
- }, ye = (a) => {
146
+ }, _e = (a) => {
147
147
  let t = {};
148
148
  return Object.entries(a).forEach(([r, n]) => {
149
149
  if (r.includes(".")) {
150
- let [l, s] = r.split(".");
151
- t[l] = t[l] || {}, t[l][s] = n;
150
+ let [s, l] = r.split(".");
151
+ t[s] = t[s] || {}, t[s][l] = n;
152
152
  } else
153
153
  t[r] = n;
154
154
  }), t;
155
- }, Te = V({}), lt = ({ children: a }) => {
156
- const [t, r] = y({}), [n, l] = y({}), [s, i] = y([]), [u, c] = y(""), p = ({ name: m, value: x }) => {
157
- function w(v) {
155
+ }, De = G({}), ct = ({ children: a }) => {
156
+ const [t, r] = y({}), [n, s] = y({}), [l, i] = y([]), [u, c] = y(""), x = ({ name: p, value: m }) => {
157
+ function g(v) {
158
158
  return !isNaN(v) && v !== null && v !== "" ? parseFloat(v) : null;
159
159
  }
160
- let f = w(x);
161
- l((v) => {
162
- let b = { ...v }, N = s == null ? void 0 : s.find((F) => F.label.toLowerCase().replace(/ /g, "_") === m);
163
- return N ? b[N.id] = f ?? x : b[m] = f ?? x, b;
160
+ let b = g(m);
161
+ s((v) => {
162
+ let w = { ...v }, N = l == null ? void 0 : l.find((T) => T.label.toLowerCase().replace(/ /g, "_") === p);
163
+ return N ? w[N.id] = b ?? m : w[p] = b ?? m, w;
164
164
  });
165
165
  };
166
- _(() => {
167
- let m = s.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
168
- l(
169
- Object.fromEntries(m)
166
+ F(() => {
167
+ let p = l.map((m) => m.id === "owner.config" ? [m.id, "yo_y_mis_equipos"] : m.id === "dependency" ? [m.id, "ambas"] : [m.id, null]);
168
+ s(
169
+ Object.fromEntries(p)
170
170
  );
171
- }, [s]);
171
+ }, [l]);
172
172
  const d = () => {
173
- let m = s.map((x) => x.id === "owner.config" ? [x.id, "yo_y_mis_equipos"] : x.id === "dependency" ? [x.id, "ambas"] : [x.id, null]);
174
- l(Object.fromEntries(m)), r(ye(Object.fromEntries(m)));
175
- }, g = () => {
176
- let m = ye(n);
177
- console.log({ filtersWithEstructure: m }), r(m);
173
+ let p = l.map((m) => m.id === "owner.config" ? [m.id, "yo_y_mis_equipos"] : m.id === "dependency" ? [m.id, "ambas"] : [m.id, null]);
174
+ s(Object.fromEntries(p)), r(_e(Object.fromEntries(p)));
175
+ }, f = () => {
176
+ let p = _e(n);
177
+ console.log({ filtersWithEstructure: p }), r(p);
178
178
  };
179
- return /* @__PURE__ */ e(Te.Provider, { value: {
179
+ return /* @__PURE__ */ e(De.Provider, { value: {
180
180
  //properties
181
- fields: s,
181
+ fields: l,
182
182
  filters: t,
183
183
  path: u,
184
184
  //methods
185
185
  defineFields: i,
186
- updateFilters: p,
186
+ updateFilters: x,
187
187
  cleanFilters: d,
188
- applyFilters: g,
188
+ applyFilters: f,
189
189
  initialFilters: n,
190
190
  selectPath: c
191
191
  }, children: a });
192
- }, $ = () => G(Te);
193
- function Pe(a, t = 300, r = { leading: !1, trailing: !0 }) {
194
- let n, l = null;
195
- return function(...s) {
196
- const i = Date.now(), u = r.leading && !l;
197
- clearTimeout(n), u && a(...s), l = i, n = setTimeout(() => {
198
- r.trailing && (!r.leading || i - l >= t) && (a(...s), l = null);
192
+ }, $ = () => Y(De);
193
+ function $e(a, t = 300, r = { leading: !1, trailing: !0 }) {
194
+ let n, s = null;
195
+ return function(...l) {
196
+ const i = Date.now(), u = r.leading && !s;
197
+ clearTimeout(n), u && a(...l), s = i, n = setTimeout(() => {
198
+ r.trailing && (!r.leading || i - s >= t) && (a(...l), s = null);
199
199
  }, t);
200
200
  };
201
201
  }
202
- const st = () => {
202
+ const dt = () => {
203
203
  const {
204
204
  fields: a,
205
205
  updateFilters: t,
206
206
  cleanFilters: r,
207
207
  applyFilters: n,
208
- initialFilters: l
208
+ initialFilters: s
209
209
  } = $();
210
210
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-l min-w-[250px] z-[100]", children: [
211
211
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
212
212
  /* @__PURE__ */ e("p", { className: "text-texts text-m", children: "Filtros" }),
213
213
  /* @__PURE__ */ e("button", { className: "text-xs font-semibold flex cursor-pointer items-center gap-m p-s text-texts-enfasis fill-texts-enfasis bg-bg rounded-lg px-l h-fit shadow-button-primary hover:shadow-button-primary-hover ", onClick: r, children: "Limpiar" })
214
214
  ] }),
215
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: a == null ? void 0 : a.map((s, i) => {
215
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: a == null ? void 0 : a.map((l, i) => {
216
216
  var u;
217
217
  return /* @__PURE__ */ o("div", { children: [
218
- /* @__PURE__ */ e("p", { className: "text-sm", children: s.label }),
219
- (s == null ? void 0 : s.type) === "select" ? /* @__PURE__ */ e(
218
+ /* @__PURE__ */ e("p", { className: "text-sm", children: l.label }),
219
+ (l == null ? void 0 : l.type) === "select" ? /* @__PURE__ */ e(
220
220
  "select",
221
221
  {
222
222
  onChange: (c) => {
223
- var p, d;
223
+ var x, d;
224
224
  t({
225
- name: (p = c == null ? void 0 : c.target) == null ? void 0 : p.name,
225
+ name: (x = c == null ? void 0 : c.target) == null ? void 0 : x.name,
226
226
  value: (d = c == null ? void 0 : c.target) == null ? void 0 : d.value
227
227
  });
228
228
  },
229
- value: l == null ? void 0 : l[s == null ? void 0 : s.id],
229
+ value: s == null ? void 0 : s[l == null ? void 0 : l.id],
230
230
  className: "w-full h-[30px] shadow-input rounded-lg p-s",
231
- name: s.id,
232
- id: s.id,
233
- children: (u = s == null ? void 0 : s.options) == null ? void 0 : u.map((c, p) => /* @__PURE__ */ e(
231
+ name: l.id,
232
+ id: l.id,
233
+ children: (u = l == null ? void 0 : l.options) == null ? void 0 : u.map((c, x) => /* @__PURE__ */ e(
234
234
  "option",
235
235
  {
236
236
  value: c.id,
237
237
  children: c.name
238
238
  },
239
- p
239
+ x
240
240
  ))
241
241
  }
242
242
  ) : /* @__PURE__ */ e(
243
243
  "input",
244
244
  {
245
245
  className: "w-full h-[30px] shadow-input rounded-lg p-s",
246
- type: s.type,
247
- value: l == null ? void 0 : l[s == null ? void 0 : s.id],
248
- name: s.label.toLowerCase().replace(/ /g, "_"),
249
- onChange: Pe((c) => {
250
- var p, d;
246
+ type: l.type,
247
+ value: s == null ? void 0 : s[l == null ? void 0 : l.id],
248
+ name: l.label.toLowerCase().replace(/ /g, "_"),
249
+ onChange: $e((c) => {
250
+ var x, d;
251
251
  return t({
252
- name: (p = c == null ? void 0 : c.target) == null ? void 0 : p.name,
252
+ name: (x = c == null ? void 0 : c.target) == null ? void 0 : x.name,
253
253
  value: (d = c == null ? void 0 : c.target) == null ? void 0 : d.value
254
254
  });
255
255
  }, 1e3)
@@ -259,31 +259,31 @@ const st = () => {
259
259
  }) }),
260
260
  /* @__PURE__ */ e("button", { className: "btn-primary rounded-md py-s", onClick: n, children: "Filtrar" })
261
261
  ] });
262
- }, z = (a) => {
262
+ }, K = (a) => {
263
263
  const t = (n) => Object.prototype.toString.call(n) === "[object Object]", r = (n) => n.attributes ? {
264
264
  id: n.id,
265
265
  ...n.attributes
266
266
  } : n;
267
267
  if (Array.isArray(a))
268
- return a.map((n) => z(n));
268
+ return a.map((n) => K(n));
269
269
  if (t(a)) {
270
270
  Array.isArray(a.data) ? a = [...a.data] : t(a.data) ? a = r({ ...a.data }) : a.data === null ? a = null : a = r(a);
271
271
  for (const n in a)
272
- a[n] = z(a[n]);
272
+ a[n] = K(a[n]);
273
273
  return a;
274
274
  }
275
275
  return a;
276
276
  };
277
- class it {
277
+ class ut {
278
278
  static toCampaignTasks(t) {
279
- var n, l, s, i, u, c, p, d, g, m, x, w;
279
+ var n, s, l, i, u, c, x, d, f, p, m, g;
280
280
  let r = [];
281
- return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (s = (l = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : l.imagen) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), console.log("task", t), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((f) => {
282
- var v, b, N, F;
283
- r != null && r.find((T) => T.id === f.idUser.id) || f.idUser && r.push({ id: f.idUser.id, name: f.idUser.nombre, image: (F = (N = (b = (v = f == null ? void 0 : f.userOBP) == null ? void 0 : v.imagen) == null ? void 0 : b.formats) == null ? void 0 : N.thumbnail) == null ? void 0 : F.url });
281
+ return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (l = (s = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : s.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), console.log("task", t), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((b) => {
282
+ var v, w, N, T;
283
+ r != null && r.find((_) => _.id === b.idUser.id) || b.idUser && r.push({ id: b.idUser.id, name: b.idUser.nombre, image: (T = (N = (w = (v = b == null ? void 0 : b.userOBP) == null ? void 0 : v.imagen) == null ? void 0 : w.formats) == null ? void 0 : N.thumbnail) == null ? void 0 : T.url });
284
284
  }), {
285
285
  isPrincipalTask: (t == null ? void 0 : t.tarea_principal) ?? !1,
286
- projectName: ((p = t == null ? void 0 : t.proyecto) == null ? void 0 : p.nombre) ?? null,
286
+ projectName: ((x = t == null ? void 0 : t.proyecto) == null ? void 0 : x.nombre) ?? null,
287
287
  orden: (t == null ? void 0 : t.orden) ?? null,
288
288
  id: (t == null ? void 0 : t.id) ?? null,
289
289
  task: (t == null ? void 0 : t.texto_corto) ?? null,
@@ -298,16 +298,16 @@ class it {
298
298
  repeats: (t == null ? void 0 : t.repeticiones_realizadas) ?? null,
299
299
  comments: ((d = t == null ? void 0 : t.comentarios) == null ? void 0 : d.length) ?? null,
300
300
  willBePaused: t == null ? void 0 : t.es_pausable,
301
- statusRequiredTask: ((g = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : g.estatus) ?? null,
302
- nameRequiredTask: ((m = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : m.texto_corto) ?? null,
303
- responsible: ((x = t == null ? void 0 : t.responsable) == null ? void 0 : x.id) ?? null,
304
- tasks: ((w = t == null ? void 0 : t.tareas) == null ? void 0 : w.map((f) => ({ id: f.id, name: f.texto_corto, status: f.estatus }))) ?? null
301
+ statusRequiredTask: ((f = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : f.estatus) ?? null,
302
+ nameRequiredTask: ((p = t == null ? void 0 : t.id_t_requerida) == null ? void 0 : p.texto_corto) ?? null,
303
+ responsible: ((m = t == null ? void 0 : t.responsable) == null ? void 0 : m.id) ?? null,
304
+ tasks: ((g = t == null ? void 0 : t.tareas) == null ? void 0 : g.map((b) => ({ id: b.id, name: b.texto_corto, status: b.estatus }))) ?? null
305
305
  };
306
306
  }
307
307
  }
308
- const ot = async ({ filters: a, tasks_api: t, project: r }) => {
308
+ const mt = async ({ filters: a, tasks_api: t, project: r }) => {
309
309
  try {
310
- const n = await t.get("/api/listado_tareas", {
310
+ const n = await t.get("/api/listado_tareas_flujo", {
311
311
  params: {
312
312
  ...a,
313
313
  project: {
@@ -316,20 +316,20 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
316
316
  includeAllTasks: !0
317
317
  }
318
318
  });
319
- return z(n.data.tareas).map(it.toCampaignTasks);
319
+ return K(n.data.tareas).map(ut.toCampaignTasks);
320
320
  } catch (n) {
321
321
  console.log(n);
322
322
  }
323
- }, Ae = V({}), ct = ({ children: a, user: t, url: r }) => {
324
- const n = ve.create({
323
+ }, Ee = G({}), pt = ({ children: a, user: t, url: r }) => {
324
+ const n = Se.create({
325
325
  baseURL: r,
326
326
  headers: {
327
327
  Authorization: `Bearer ${t.accessToken}`
328
328
  },
329
- paramsSerializer: (l) => Ce.stringify(l, { encodeValuesOnly: !0 })
329
+ paramsSerializer: (s) => Ae.stringify(s, { encodeValuesOnly: !0 })
330
330
  });
331
331
  return /* @__PURE__ */ e(
332
- Ae.Provider,
332
+ Ee.Provider,
333
333
  {
334
334
  value: {
335
335
  //methods
@@ -338,16 +338,16 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
338
338
  children: a
339
339
  }
340
340
  );
341
- }, E = () => G(Ae), Se = V({}), dt = ({ children: a, user: t, url: r }) => {
342
- const n = ve.create({
341
+ }, E = () => Y(Ee), Me = G({}), ht = ({ children: a, user: t, url: r }) => {
342
+ const n = Se.create({
343
343
  baseURL: r,
344
344
  headers: {
345
345
  Authorization: `Bearer ${t.accessToken}`
346
346
  },
347
- paramsSerializer: (l) => Ce.stringify(l, { encodeValuesOnly: !0 })
347
+ paramsSerializer: (s) => Ae.stringify(s, { encodeValuesOnly: !0 })
348
348
  });
349
349
  return /* @__PURE__ */ e(
350
- Se.Provider,
350
+ Me.Provider,
351
351
  {
352
352
  value: {
353
353
  //properties
@@ -358,19 +358,19 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
358
358
  children: a
359
359
  }
360
360
  );
361
- }, I = () => G(Se), qe = V({}), ut = ({ children: a, project: t }) => {
361
+ }, W = () => Y(Me), Le = G({}), xt = ({ children: a, project: t }) => {
362
362
  var v;
363
- const r = H(), [n, l] = y([]), [s, i] = y([]), { tasks_api: u } = E(), { filters: c } = $(), { user: p } = I(), [d, g] = y({
363
+ const r = V(), [n, s] = y([]), [l, i] = y([]), { tasks_api: u } = E(), { filters: c } = $(), { user: x } = W(), [d, f] = y({
364
364
  owner: {
365
- user: p.id,
365
+ user: x.id,
366
366
  config: ((v = c == null ? void 0 : c.owner) == null ? void 0 : v.config) ?? "yo_y_mis_equipos"
367
367
  },
368
368
  project: {
369
369
  id: t
370
370
  }
371
- }), m = ae({
371
+ }), p = re({
372
372
  queryKey: ["tasksProject", c, t],
373
- queryFn: () => ot({
373
+ queryFn: () => mt({
374
374
  filters: {
375
375
  ...d
376
376
  },
@@ -378,45 +378,45 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
378
378
  tasks_api: u
379
379
  })
380
380
  });
381
- _(() => {
382
- var b;
383
- Object.keys(c).length > 0 && g({
381
+ F(() => {
382
+ var w;
383
+ Object.keys(c).length > 0 && f({
384
384
  ...c,
385
385
  owner: {
386
- user: p.id,
387
- config: ((b = c == null ? void 0 : c.owner) == null ? void 0 : b.config) ?? "yo_y_mis_equipos"
386
+ user: x.id,
387
+ config: ((w = c == null ? void 0 : c.owner) == null ? void 0 : w.config) ?? "yo_y_mis_equipos"
388
388
  },
389
389
  project: {
390
390
  id: t
391
391
  }
392
392
  });
393
- }, [c]), _(() => {
393
+ }, [c]), F(() => {
394
394
  r.invalidateQueries({
395
395
  queryKey: ["tasksProject", c, t]
396
396
  });
397
397
  }, [d]);
398
- const x = (b) => {
399
- l((N) => [...N, b]);
400
- }, w = (b) => {
401
- i((N) => N.includes(b) ? N.filter((F) => F !== b) : [...N, b]);
402
- }, f = t ?? null;
398
+ const m = (w) => {
399
+ s((N) => [...N, w]);
400
+ }, g = (w) => {
401
+ i((N) => N.includes(w) ? N.filter((T) => T !== w) : [...N, w]);
402
+ }, b = t ?? null;
403
403
  return /* @__PURE__ */ e(
404
- qe.Provider,
404
+ Le.Provider,
405
405
  {
406
406
  value: {
407
407
  //properties
408
- tasksProject: m,
408
+ tasksProject: p,
409
409
  selectedTasks: n,
410
- projectID: f,
411
- openTasks: s,
410
+ projectID: b,
411
+ openTasks: l,
412
412
  //methods
413
- selectTask: x,
414
- openTask: w
413
+ selectTask: m,
414
+ openTask: g
415
415
  },
416
416
  children: a
417
417
  }
418
418
  );
419
- }, Y = () => G(qe), mt = [
419
+ }, X = () => Y(Le), gt = [
420
420
  {
421
421
  label: "Tipo de dependencia",
422
422
  type: "select",
@@ -467,51 +467,102 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
467
467
  name: "Muy dificil"
468
468
  }]
469
469
  }
470
- ], pt = ({ id: a }) => {
471
- const [t, r] = y(!1);
470
+ ], oe = () => {
471
+ const { tasks_api: a } = E(), { user: t } = W(), { filters: r, path: n } = $(), s = V(), { projectID: l } = X(), i = async ({ id: m }) => (await a.put(`/api/tareas/${m}`, {
472
+ data: {
473
+ estatus: 1,
474
+ responsable: t == null ? void 0 : t.id,
475
+ updated_by: t == null ? void 0 : t.id
476
+ }
477
+ })).data, u = async ({ id: m }) => (await a.post("/api/terminarTarea", {
478
+ id_task: m,
479
+ ended_at: (/* @__PURE__ */ new Date()).toISOString(),
480
+ id_user: t == null ? void 0 : t.id
481
+ })).data, c = async ({ id: m, data: g, user: b }) => {
482
+ }, x = async ({ id: m }) => {
483
+ await d({ id: m });
484
+ }, { mutateAsync: d } = Ce({
485
+ mutationFn: i,
486
+ onSuccess: () => {
487
+ const m = {
488
+ "kanban-general": "to_do_tasks",
489
+ "kanban-campania": "tasksProject"
490
+ };
491
+ try {
492
+ n === "kanban-general" && (s.invalidateQueries({ queryKey: [m[n], r] }), s.invalidateQueries({ queryKey: ["working_tasks", r] })), n === "kanban-campania" && s.invalidateQueries({ queryKey: [m[n], r, l] });
493
+ } catch (g) {
494
+ console.error("Error updating the element:", g);
495
+ }
496
+ },
497
+ onError: (m) => {
498
+ console.error("Failed to update the task.", m);
499
+ }
500
+ }), { mutateAsync: f } = Ce({
501
+ mutationFn: u,
502
+ onSuccess: () => {
503
+ const m = {
504
+ "kanban-general": "to_do_tasks",
505
+ "kanban-campania": "tasksProject"
506
+ };
507
+ n === "kanban-general" && (s.invalidateQueries({ queryKey: [m[n], r] }), s.invalidateQueries({ queryKey: ["done_tasks", r] })), n === "kanban-campania" && s.invalidateQueries({ queryKey: [m[n], r, l] });
508
+ },
509
+ onError: (m) => {
510
+ console.error("Failed to update the task.", m);
511
+ }
512
+ });
513
+ return {
514
+ //* Methods
515
+ updateTask: c,
516
+ startWorking: x,
517
+ completeTask: async ({ id: m }) => {
518
+ await f({ id: m });
519
+ }
520
+ };
521
+ }, ft = ({ id: a }) => {
522
+ const [t, r] = y(!1), { completeTask: n } = oe();
472
523
  return { checked: t, checkTask: () => {
473
- r(!t), console.log("completar tarea", a);
524
+ r(!t), n({ id: a });
474
525
  } };
475
- }, De = ({ id: a, nameRequiredTask: t, statusRequiredTask: r, status: n }) => {
476
- const { checked: l, checkTask: s } = pt({ id: a });
526
+ }, ze = ({ id: a, nameRequiredTask: t, statusRequiredTask: r, status: n }) => {
527
+ const { checked: s, checkTask: l } = ft({ id: a });
477
528
  let i = Math.random().toString();
478
- return /* @__PURE__ */ o(q, { children: [
479
- n === 1 && (r < 2 && t !== "" ? /* @__PURE__ */ e(K, { dispatch: /* @__PURE__ */ e("label", { htmlFor: i, children: /* @__PURE__ */ e(C, { icon: "info_circle", color: P.warning.regular, strokeWidth: 4 }) }), children: /* @__PURE__ */ o("div", { className: "px-m py-s max-w-[200px] bg-warning-light rounded-lg border-l-[5px] border-warning-regular text-warning-dark text-xs", children: [
480
- /* @__PURE__ */ e("p", { className: "font-bold", children: "Requiere completar su tarea requerida:" }),
529
+ return /* @__PURE__ */ o(j, { children: [
530
+ t !== "" && r === 2 || !t ? n === 1 ? /* @__PURE__ */ e("label", { htmlFor: i, className: s ? "bg-success-regular rounded-full w-[20px] h-[20px] flex items-center justify-center mx-[2px] transition-all" : " transition-colors", children: /* @__PURE__ */ e(
531
+ C,
532
+ {
533
+ icon: s ? "check_outline" : "circle_checked",
534
+ color: s ? "white" : S.texts.placeholder,
535
+ strokeWidth: 4,
536
+ size: s ? "xs" : "s"
537
+ }
538
+ ) }) : /* @__PURE__ */ e(j, { children: " " }) : /* @__PURE__ */ e(H, { dispatch: /* @__PURE__ */ e("label", { className: "cursor-help", children: /* @__PURE__ */ e(C, { icon: "info_circle", color: S.warning.regular, strokeWidth: 4 }) }), children: /* @__PURE__ */ o("div", { className: " p-l max-w-[400px] w-fit bg-warning-light rounded-lg border-l-[5px] border-warning-regular text-warning-dark text-xs flex flex-col gap-m", children: [
539
+ /* @__PURE__ */ e("p", { className: "font-bold", children: " Requiere completar su tarea requerida: " }),
481
540
  /* @__PURE__ */ o("p", { children: [
482
541
  " ",
483
542
  t,
484
543
  " "
485
544
  ] })
486
- ] }) }) : /* @__PURE__ */ e("label", { htmlFor: i, className: l ? "bg-success-regular rounded-full w-[20px] h-[20px] flex items-center justify-center mx-[2px] transition-all" : " transition-colors", children: /* @__PURE__ */ e(
487
- C,
488
- {
489
- icon: l ? "check_outline" : "circle_checked",
490
- color: l ? "white" : P.texts.placeholder,
491
- strokeWidth: 4,
492
- size: l ? "xs" : "s"
493
- }
494
- ) })),
495
- /* @__PURE__ */ e("input", { id: i, checked: l, onChange: s, type: "checkbox", className: "hidden" })
545
+ ] }) }),
546
+ /* @__PURE__ */ e("input", { id: i, checked: s, onChange: l, type: "checkbox", className: "hidden" })
496
547
  ] });
497
- }, O = ({ imageUrl: a = "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png", alt: t = "avatar" }) => /* @__PURE__ */ e(
548
+ }, U = ({ imageUrl: a = "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png", alt: t = "avatar" }) => /* @__PURE__ */ e(
498
549
  "img",
499
550
  {
500
551
  src: a === "" ? "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png" : a,
501
552
  alt: t ?? "avatar",
502
553
  className: "w-[28px] h-[28px] min-w-[28px] min-h-[28px] rounded-full bg-containers border-2 border-white"
503
554
  }
504
- ), we = ({ trigger: a, user: t, showUser: r = !0 }) => /* @__PURE__ */ e(K, { dispatch: a, children: r && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: [
505
- /* @__PURE__ */ e(O, { imageUrl: t.image ?? "", alt: t.name }),
555
+ ), Fe = ({ trigger: a, user: t, showUser: r = !0 }) => /* @__PURE__ */ e(H, { dispatch: a, children: r && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: [
556
+ /* @__PURE__ */ e(U, { imageUrl: t.image ?? "", alt: t.name }),
506
557
  /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: t.name })
507
- ] }) }), ht = ({ options: a, onselect: t }) => {
508
- const [r, n] = y(null), l = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), s = [...a].filter((i) => i.name.toLowerCase().includes((r == null ? void 0 : r.toLowerCase()) ?? ""));
558
+ ] }) }), bt = ({ options: a, onselect: t }) => {
559
+ const [r, n] = y(null), s = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), l = [...a].filter((i) => i.name.toLowerCase().includes((r == null ? void 0 : r.toLowerCase()) ?? ""));
509
560
  return /* @__PURE__ */ o("div", { className: "h-fit w-full min-w-max", children: [
510
561
  /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
511
562
  /* @__PURE__ */ e(
512
563
  "input",
513
564
  {
514
- id: l,
565
+ id: s,
515
566
  value: r ?? "",
516
567
  onChange: (i) => n(i.target.value),
517
568
  type: "text",
@@ -521,15 +572,15 @@ const ot = async ({ filters: a, tasks_api: t, project: r }) => {
521
572
  ),
522
573
  /* @__PURE__ */ e("div", { className: "absolute right-[8px]", children: /* @__PURE__ */ e(C, { icon: "search", size: "xs", strokeWidth: 3 }) })
523
574
  ] }),
524
- /* @__PURE__ */ e("div", { className: "bg-bg-card border-cards rounded-lg p-2 flex flex-col gap-s overflow-y-auto max-h-[120px] min-w-max", children: s.map((i) => /* @__PURE__ */ o("button", { onClick: () => {
575
+ /* @__PURE__ */ e("div", { className: "bg-bg-card border-cards rounded-lg p-2 flex flex-col gap-s overflow-y-auto max-h-[120px] min-w-max", children: l.map((i) => /* @__PURE__ */ o("button", { onClick: () => {
525
576
  t(i);
526
577
  }, className: "flex gap-s items-center max-w-[200px] min-w-full hover:bg-primary-light cursor-pointer", children: [
527
- /* @__PURE__ */ e(O, { imageUrl: i.image, alt: i.name }),
578
+ /* @__PURE__ */ e(U, { imageUrl: i.image, alt: i.name }),
528
579
  /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: i.name })
529
580
  ] })) })
530
581
  ] });
531
582
  };
532
- class xt {
583
+ class yt {
533
584
  static toDomain(t) {
534
585
  return {
535
586
  id: t.id,
@@ -538,141 +589,141 @@ class xt {
538
589
  };
539
590
  }
540
591
  }
541
- const gt = () => {
592
+ const wt = () => {
542
593
  const { tasks_api: a } = E();
543
- return { teams: ae({
594
+ return { teams: re({
544
595
  queryKey: ["teams", "all"],
545
596
  queryFn: async () => {
546
597
  const r = await a.get("/api/equipos");
547
- return z(r.data).map(xt.toDomain);
598
+ return K(r.data).map(yt.toDomain);
548
599
  }
549
600
  }) };
550
601
  };
551
- class ft {
602
+ class Nt {
552
603
  static toUsers(t) {
553
- var r, n, l;
604
+ var r, n, s;
554
605
  return {
555
606
  id: t.id,
556
607
  name: t.nombre,
557
- image: (l = (n = (r = t.imagen) == null ? void 0 : r.formats) == null ? void 0 : n.thumbnail) == null ? void 0 : l.url
608
+ image: (s = (n = (r = t.imagen) == null ? void 0 : r.formats) == null ? void 0 : n.thumbnail) == null ? void 0 : s.url
558
609
  };
559
610
  }
560
611
  }
561
- const bt = async ({
612
+ const vt = async ({
562
613
  tasks_api: a
563
614
  }) => {
564
615
  try {
565
616
  const t = await a.get("/api/allOBPUsers");
566
- return z(t.data).map(ft.toUsers);
617
+ return K(t.data).map(Nt.toUsers);
567
618
  } catch (t) {
568
619
  throw console.log("Error al obtener los usuarios comerciales", t), `Error al obtener los usuarios comerciales: ${t}`;
569
620
  }
570
- }, yt = () => {
621
+ }, Ct = () => {
571
622
  const { tasks_api: a } = E();
572
623
  return {
573
- users: ae({
624
+ users: re({
574
625
  queryKey: ["users"],
575
- queryFn: () => bt({ tasks_api: a }),
626
+ queryFn: () => vt({ tasks_api: a }),
576
627
  staleTime: 1e3 * 60 * 60 * 24
577
628
  })
578
629
  };
579
- }, je = (a) => new Intl.DateTimeFormat("es-MX", { month: "long" }).format(a);
580
- function wt(a) {
630
+ }, Be = (a) => new Intl.DateTimeFormat("es-MX", { month: "long" }).format(a);
631
+ function _t(a) {
581
632
  const t = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], r = new Date(a).getDay();
582
633
  return t[r];
583
634
  }
584
- const Ne = (a) => {
585
- let t = a || /* @__PURE__ */ new Date(), r = t.getDate(), n = je(t.getMonth()).slice(0, 3), l = t.getFullYear().toString().slice(-2), s = wt(t).slice(0, 3);
586
- return `${s.charAt(0).toUpperCase() + s.slice(1)} ${r} ${n.charAt(0).toUpperCase() + n.slice(1)} ${l}`;
587
- }, se = (a) => ({
635
+ const Te = (a) => {
636
+ let t = a || /* @__PURE__ */ new Date(), r = t.getDate(), n = Be(t.getMonth()).slice(0, 3), s = t.getFullYear().toString().slice(-2), l = _t(t).slice(0, 3);
637
+ return `${l.charAt(0).toUpperCase() + l.slice(1)} ${r} ${n.charAt(0).toUpperCase() + n.slice(1)} ${s}`;
638
+ }, ce = (a) => ({
588
639
  ...a,
589
640
  image: a.image ? `https://devobp.imjmedia.com.mx${a.image}` : ""
590
- }), $e = ({
641
+ }), Ie = ({
591
642
  users: a,
592
643
  onClick: t,
593
644
  responsible: r
594
645
  }) => {
595
646
  let n = `button-assign-users-${Math.random().toString(36).substring(2, 15)}`;
596
- const { setElementPosition: l, position: s, clearPosition: i } = le(), u = L(null), c = () => r ? null : a.length > 3 && /* @__PURE__ */ e(
597
- K,
647
+ const { setElementPosition: s, position: l, clearPosition: i } = ie(), u = O(null), c = () => r ? null : a.length > 3 && /* @__PURE__ */ e(
648
+ H,
598
649
  {
599
650
  dispatch: /* @__PURE__ */ e("div", { className: "w-[28px] h-[28px] rounded-full btn-primary flex items-center justify-center border-2 border-white ml-[-8px]", children: /* @__PURE__ */ e("p", { className: "text-xs font-bold text-white ", children: `+${a.length - 3}` }) }),
600
- children: /* @__PURE__ */ e("div", { className: "bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: a == null ? void 0 : a.slice(3).map((m, x) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2 ", children: [
601
- /* @__PURE__ */ e(O, { imageUrl: m.image ?? "", alt: m.name }, x),
602
- /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: m.name })
603
- ] }, x)) })
651
+ children: /* @__PURE__ */ e("div", { className: "bg-containers w-fit h-fit p-2 rounded-lg border-containers", children: a == null ? void 0 : a.slice(3).map((p, m) => /* @__PURE__ */ o("div", { className: "flex items-center gap-2 ", children: [
652
+ /* @__PURE__ */ e(U, { imageUrl: p.image ?? "", alt: p.name }, m),
653
+ /* @__PURE__ */ e("p", { className: "text-xs font-bold content-text", children: p.name })
654
+ ] }, m)) })
604
655
  }
605
- ), p = () => {
656
+ ), x = () => {
606
657
  if (r) {
607
- let m = a.find(
608
- (x) => x.id === r
658
+ let p = a.find(
659
+ (m) => m.id === r
609
660
  );
610
661
  return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
611
- we,
662
+ Fe,
612
663
  {
613
664
  trigger: /* @__PURE__ */ e(
614
- O,
665
+ U,
615
666
  {
616
- imageUrl: m == null ? void 0 : m.image,
617
- alt: m == null ? void 0 : m.name
667
+ imageUrl: p == null ? void 0 : p.image,
668
+ alt: p == null ? void 0 : p.name
618
669
  },
619
670
  r
620
671
  ),
621
- user: m,
622
- showUser: !(s != null && s.x)
672
+ user: p,
673
+ showUser: !(l != null && l.x)
623
674
  }
624
675
  ) });
625
676
  }
626
- return (a == null ? void 0 : a.length) > 0 && a.slice(0, 3).map((m, x) => /* @__PURE__ */ e("div", { className: `${x === 0 ? "" : "ml-[-8px]"}`, children: /* @__PURE__ */ e(
627
- we,
677
+ return (a == null ? void 0 : a.length) > 0 && a.slice(0, 3).map((p, m) => /* @__PURE__ */ e("div", { className: `${m === 0 ? "" : "ml-[-8px]"}`, children: /* @__PURE__ */ e(
678
+ Fe,
628
679
  {
629
- trigger: /* @__PURE__ */ e(O, { imageUrl: m.image, alt: m.name }, x),
630
- user: m,
631
- showUser: !(s != null && s.x)
680
+ trigger: /* @__PURE__ */ e(U, { imageUrl: p.image, alt: p.name }, m),
681
+ user: p,
682
+ showUser: !(l != null && l.x)
632
683
  }
633
684
  ) }));
634
- }, d = ({ children: m }) => /* @__PURE__ */ e("label", { ref: u, htmlFor: n, className: "cursor-pointer flex items-center", children: m });
685
+ }, d = ({ children: p }) => /* @__PURE__ */ e("label", { ref: u, htmlFor: n, className: "cursor-pointer flex items-center", children: p });
635
686
  if (a.length === 0)
636
687
  return /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(C, { icon: "user", size: "xs", strokeWidth: 3 }) });
637
- const g = () => {
638
- var F;
639
- const [m, x] = y(), [w, f] = y("team"), { teams: v } = gt(), { users: b } = yt();
640
- _(() => {
641
- var T, A;
642
- u.current && x(((s == null ? void 0 : s.x) ?? 0) - (((A = (T = u.current) == null ? void 0 : T.getBoundingClientRect()) == null ? void 0 : A.width) ?? 0));
643
- }, [u == null ? void 0 : u.current, s == null ? void 0 : s.x]);
688
+ const f = () => {
689
+ var T;
690
+ const [p, m] = y(), [g, b] = y("team"), { teams: v } = wt(), { users: w } = Ct();
691
+ F(() => {
692
+ var _, A;
693
+ u.current && m(((l == null ? void 0 : l.x) ?? 0) - (((A = (_ = u.current) == null ? void 0 : _.getBoundingClientRect()) == null ? void 0 : A.width) ?? 0));
694
+ }, [u == null ? void 0 : u.current, l == null ? void 0 : l.x]);
644
695
  const N = () => {
645
- const T = [
696
+ const _ = [
646
697
  { id: "team", label: "Equipo" },
647
698
  { id: "responsible", label: "Responsable" }
648
699
  ];
649
- return /* @__PURE__ */ e("div", { className: "w-full flex justify-center gap-l text-texts-placeholder font-bold", children: T.map((A, h) => /* @__PURE__ */ e(
700
+ return /* @__PURE__ */ e("div", { className: "w-full flex justify-center gap-l text-texts-placeholder font-bold", children: _.map((A, R) => /* @__PURE__ */ e(
650
701
  "button",
651
702
  {
652
- className: `w-full text-sm border-texts-placeholder text-center ${w === A.id ? "text-primary-pastel" : ""} ${h === T.length - 1 ? "border-r-0" : " border-r-2"}`,
653
- onClick: () => f(A.id),
703
+ className: `w-full text-sm border-texts-placeholder text-center ${g === A.id ? "text-primary-pastel" : ""} ${R === _.length - 1 ? "border-r-0" : " border-r-2"}`,
704
+ onClick: () => b(A.id),
654
705
  children: A.label
655
706
  }
656
707
  )) });
657
708
  };
658
- return (s == null ? void 0 : s.x) && X.createPortal(
709
+ return (l == null ? void 0 : l.x) && Z.createPortal(
659
710
  /* @__PURE__ */ e(
660
711
  "div",
661
712
  {
662
- className: `absolute w-[300px] h-fit ${m ? "block" : "hidden"}`,
663
- style: { top: `${s == null ? void 0 : s.y}px`, left: `${m}px`, zIndex: 1 },
713
+ className: `absolute w-[300px] h-fit ${p ? "block" : "hidden"}`,
714
+ style: { top: `${l == null ? void 0 : l.y}px`, left: `${p}px`, zIndex: 1 },
664
715
  children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-m bg-bg-card border-cards rounded-lg p-2 max-h-[200px] overflow-y-hidden", children: [
665
716
  /* @__PURE__ */ e(N, {}),
666
717
  /* @__PURE__ */ e(
667
- ht,
718
+ bt,
668
719
  {
669
- options: w === "team" ? v.data.map((T) => ({
670
- id: T.id,
671
- name: T.name,
720
+ options: g === "team" ? v.data.map((_) => ({
721
+ id: _.id,
722
+ name: _.name,
672
723
  image: ""
673
- })) : (F = b.data) == null ? void 0 : F.map(se),
674
- onselect: (T) => {
675
- i(), t && t(T);
724
+ })) : (T = w.data) == null ? void 0 : T.map(ce),
725
+ onselect: (_) => {
726
+ i(), t && t(_);
676
727
  }
677
728
  }
678
729
  )
@@ -682,9 +733,9 @@ const Ne = (a) => {
682
733
  document.body
683
734
  );
684
735
  };
685
- return /* @__PURE__ */ o(q, { children: [
736
+ return /* @__PURE__ */ o(j, { children: [
686
737
  /* @__PURE__ */ o(d, { children: [
687
- p(),
738
+ x(),
688
739
  c()
689
740
  ] }),
690
741
  /* @__PURE__ */ e(
@@ -692,61 +743,29 @@ const Ne = (a) => {
692
743
  {
693
744
  className: "hidden",
694
745
  id: n,
695
- onClick: () => l(u)
746
+ onClick: () => s(u)
696
747
  }
697
748
  ),
698
- /* @__PURE__ */ e(g, {})
749
+ /* @__PURE__ */ e(f, {})
699
750
  ] });
700
- }, Ee = () => {
701
- const { tasks_api: a } = E(), { user: t } = I(), { filters: r, path: n } = $(), l = H(), { projectID: s } = Y(), i = async ({ id: d }) => (await a.put(`/api/tareas/${d}`, {
702
- data: {
703
- estatus: 1,
704
- responsable: t == null ? void 0 : t.id,
705
- updated_by: t == null ? void 0 : t.id
706
- }
707
- })).data, u = async ({ id: d, data: g, user: m }) => {
708
- }, c = async ({ id: d }) => {
709
- await p({ id: d });
710
- }, { mutateAsync: p } = Ke({
711
- mutationFn: i,
712
- onSuccess: () => {
713
- const d = {
714
- "kanban-general": "to_do_tasks",
715
- "kanban-campania": "tasksProject"
716
- };
717
- try {
718
- n === "kanban-general" && (l.invalidateQueries({ queryKey: [d[n], r] }), l.invalidateQueries({ queryKey: ["working_tasks", r] })), n === "kanban-campania" && l.invalidateQueries({ queryKey: [d[n], r, s] });
719
- } catch (g) {
720
- console.error("Error updating the element:", g);
721
- }
722
- },
723
- onError: (d) => {
724
- console.error("Failed to update the task.", d);
725
- }
726
- });
727
- return {
728
- //* Methods
729
- updateTask: u,
730
- startWorking: c
731
- };
732
- }, Be = ({ priority: a, id: t }) => {
733
- const { updateTask: r } = Ee(), n = Math.random().toString(36), [l, s] = y(null), i = (c) => ({
734
- 0: P.primary.regular,
735
- 1: P.success.regular,
736
- 2: P.warning.regular,
737
- 3: P.danger.regular
751
+ }, Oe = ({ priority: a, id: t }) => {
752
+ const { updateTask: r } = oe(), n = Math.random().toString(36), [s, l] = y(null), i = (c) => ({
753
+ 0: S.primary.regular,
754
+ 1: S.success.regular,
755
+ 2: S.warning.regular,
756
+ 3: S.danger.regular
738
757
  })[c], u = () => {
739
- if (!l) return null;
740
- const c = ({ priority: p, text: d }) => /* @__PURE__ */ o("button", { onClick: () => {
741
- r({ id: t, data: { prioridad: p }, user: 272 }), s(null);
758
+ if (!s) return null;
759
+ const c = ({ priority: x, text: d }) => /* @__PURE__ */ o("button", { onClick: () => {
760
+ r({ id: t, data: { prioridad: x }, user: 272 }), l(null);
742
761
  }, className: "flex gap-m items-center px-l py-s hover:bg-primary-light", children: [
743
- /* @__PURE__ */ e(C, { icon: "flag", size: "xs", strokeWidth: 3, color: i(p) }),
744
- /* @__PURE__ */ e("p", { className: "text-sm", style: { color: i(p) }, children: d })
762
+ /* @__PURE__ */ e(C, { icon: "flag", size: "xs", strokeWidth: 3, color: i(x) }),
763
+ /* @__PURE__ */ e("p", { className: "text-sm", style: { color: i(x) }, children: d })
745
764
  ] });
746
- return X.createPortal(
765
+ return Z.createPortal(
747
766
  /* @__PURE__ */ o("div", { onBlur: () => {
748
- s(null);
749
- }, id: `${n}-options`, style: { top: `${l.y + 5}px`, left: `${l.x + 5}px`, zIndex: 1 }, className: `absolute h-fit p-m flex flex-col gap-2 bg-bg-card rounded-xl shadow-lg
767
+ l(null);
768
+ }, id: `${n}-options`, style: { top: `${s.y + 5}px`, left: `${s.x + 5}px`, zIndex: 1 }, className: `absolute h-fit p-m flex flex-col gap-2 bg-bg-card rounded-xl shadow-lg
750
769
  w-max`, children: [
751
770
  /* @__PURE__ */ e(c, { priority: 0, text: "Baja" }),
752
771
  /* @__PURE__ */ e(c, { priority: 1, text: "Normal" }),
@@ -761,7 +780,7 @@ const Ne = (a) => {
761
780
  "label",
762
781
  {
763
782
  onBlur: () => {
764
- s(null);
783
+ l(null);
765
784
  },
766
785
  htmlFor: n,
767
786
  className: "flex items-center gap-2 cursor-pointer active:opacity-50",
@@ -773,7 +792,7 @@ const Ne = (a) => {
773
792
  {
774
793
  id: n,
775
794
  onClick: (c) => {
776
- s(l ? null : { x: c.clientX, y: c.clientY });
795
+ l(s ? null : { x: c.clientX, y: c.clientY });
777
796
  },
778
797
  className: "hidden"
779
798
  }
@@ -781,54 +800,54 @@ const Ne = (a) => {
781
800
  /* @__PURE__ */ e(u, {})
782
801
  ] });
783
802
  };
784
- function Nt({ items: a }) {
803
+ function Ft({ items: a }) {
785
804
  var n;
786
805
  const [t, r] = y(1);
787
- return /* @__PURE__ */ o(q, { children: [
788
- /* @__PURE__ */ e("div", { className: "flex flex-row mb-2 border-b border-neutral-100 bg-white mt-4", children: a.map((l, s) => /* @__PURE__ */ e(
806
+ return /* @__PURE__ */ o(j, { children: [
807
+ /* @__PURE__ */ e("div", { className: "flex flex-row mb-2 border-b border-neutral-100 bg-white mt-4", children: a.map((s, l) => /* @__PURE__ */ e(
789
808
  "div",
790
809
  {
791
- className: `border-r border-neutral-100 pr-3 py-1 ${s !== 0 ? "px-3" : ""}`,
810
+ className: `border-r border-neutral-100 pr-3 py-1 ${l !== 0 ? "px-3" : ""}`,
792
811
  children: /* @__PURE__ */ e(
793
- Fe,
812
+ je,
794
813
  {
795
814
  variant: "ghost",
796
- onClick: () => r(l.id),
797
- className: `text-sm font-normal rounded-none py-1 h-8 ${t === l.id ? "text-primary border-b border-primary" : "text-neutral-400 border-b-0"}`,
798
- children: l.label
815
+ onClick: () => r(s.id),
816
+ className: `text-sm font-normal rounded-none py-1 h-8 ${t === s.id ? "text-primary border-b border-primary" : "text-neutral-400 border-b-0"}`,
817
+ children: s.label
799
818
  },
800
- l.id
819
+ s.id
801
820
  )
802
821
  },
803
- l.id
822
+ s.id
804
823
  )) }),
805
- /* @__PURE__ */ e("div", { className: "pt-4 flex-1 overflow-y-auto bg-white", children: (n = a.find((l) => l.id === t)) == null ? void 0 : n.component })
824
+ /* @__PURE__ */ e("div", { className: "pt-4 flex-1 overflow-y-auto bg-white", children: (n = a.find((s) => s.id === t)) == null ? void 0 : n.component })
806
825
  ] });
807
826
  }
808
- const Le = "https://devobp.imjmedia.com.mx";
809
- function ie(a) {
827
+ const We = "https://devobp.imjmedia.com.mx";
828
+ function de(a) {
810
829
  return a ? a.split(" ").map((n) => {
811
- var l;
812
- return (l = n[0]) == null ? void 0 : l.toUpperCase();
830
+ var s;
831
+ return (s = n[0]) == null ? void 0 : s.toUpperCase();
813
832
  }).slice(0, 2).join("") : "";
814
833
  }
815
- const vt = "https://devobp.imjmedia.com.mx";
816
- function Ct({ comment: a }) {
817
- var r, n, l, s, i, u;
834
+ const Tt = "https://devobp.imjmedia.com.mx";
835
+ function Pt({ comment: a }) {
836
+ var r, n, s, l, i, u;
818
837
  function t(c) {
819
- const p = He(c);
820
- return Ve(p, { locale: re, addSuffix: !0 });
838
+ const x = Xe(c);
839
+ return Je(x, { locale: le, addSuffix: !0 });
821
840
  }
822
841
  return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o("div", { className: "flex flex-row gap-3 items-start", children: [
823
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
842
+ /* @__PURE__ */ o(k, { className: "w-[28px] h-[28px]", children: [
824
843
  /* @__PURE__ */ e(
825
- Z,
844
+ ee,
826
845
  {
827
- src: `${vt}${(s = (l = (n = (r = a == null ? void 0 : a.autor) == null ? void 0 : r.imagen) == null ? void 0 : n.formats) == null ? void 0 : l.thumbnail) == null ? void 0 : s.url}`,
846
+ src: `${Tt}${(l = (s = (n = (r = a == null ? void 0 : a.autor) == null ? void 0 : r.imagen) == null ? void 0 : n.formats) == null ? void 0 : s.thumbnail) == null ? void 0 : l.url}`,
828
847
  alt: "@shadcn"
829
848
  }
830
849
  ),
831
- /* @__PURE__ */ e(k, { children: ie((i = a == null ? void 0 : a.autor) == null ? void 0 : i.nombre) })
850
+ /* @__PURE__ */ e(te, { children: de((i = a == null ? void 0 : a.autor) == null ? void 0 : i.nombre) })
832
851
  ] }),
833
852
  /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
834
853
  /* @__PURE__ */ o("div", { className: "flex flex-row gap-2", children: [
@@ -839,64 +858,64 @@ function Ct({ comment: a }) {
839
858
  ] })
840
859
  ] }) });
841
860
  }
842
- function _t({ currentUser: a, data: t, taskId: r, onNewComment: n }) {
843
- var g, m, x;
844
- const { tasks_api: l } = E(), { register: s, handleSubmit: i, reset: u } = et(), [c, p] = y([]);
845
- return _(() => {
861
+ function St({ currentUser: a, data: t, taskId: r, onNewComment: n }) {
862
+ var f, p, m;
863
+ const { tasks_api: s } = E(), { register: l, handleSubmit: i, reset: u } = rt(), [c, x] = y([]);
864
+ return F(() => {
846
865
  if (t != null && t.comentarios) {
847
- const w = [...t.comentarios].sort(
848
- (f, v) => new Date(v.createdAt).getTime() - new Date(f.createdAt).getTime()
866
+ const g = [...t.comentarios].sort(
867
+ (b, v) => new Date(v.createdAt).getTime() - new Date(b.createdAt).getTime()
849
868
  );
850
- p(w);
869
+ x(g);
851
870
  }
852
871
  }, [t]), /* @__PURE__ */ o("div", { className: "flex flex-col h-full gap-4", children: [
853
- /* @__PURE__ */ o("form", { onSubmit: i(async (w) => {
872
+ /* @__PURE__ */ o("form", { onSubmit: i(async (g) => {
854
873
  try {
855
- const f = {
874
+ const b = {
856
875
  autor: {
857
876
  id: a == null ? void 0 : a.id,
858
877
  email: a == null ? void 0 : a.email,
859
878
  nombre: a == null ? void 0 : a.nombre,
860
879
  imagen: a == null ? void 0 : a.imagen
861
880
  },
862
- comentario: w == null ? void 0 : w.comment,
881
+ comentario: g == null ? void 0 : g.comment,
863
882
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
864
883
  };
865
- await l.post("/api/comentarios", {
884
+ await s.post("/api/comentarios", {
866
885
  data: {
867
886
  autor: a == null ? void 0 : a.id,
868
- comentario: w.comment,
887
+ comentario: g.comment,
869
888
  tarea: r
870
889
  }
871
- }), n(!0), p((v) => [f, ...v]), u();
872
- } catch (f) {
873
- console.error("Error al agregar comentario:", f);
890
+ }), n(!0), x((v) => [b, ...v]), u();
891
+ } catch (b) {
892
+ console.error("Error al agregar comentario:", b);
874
893
  }
875
894
  }), className: "flex flex-row items-center gap-3", children: [
876
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
895
+ /* @__PURE__ */ o(k, { className: "w-[28px] h-[28px]", children: [
877
896
  /* @__PURE__ */ e(
878
- Z,
897
+ ee,
879
898
  {
880
- src: `${Le}${(x = (m = (g = a == null ? void 0 : a.imagen) == null ? void 0 : g.formats) == null ? void 0 : m.thumbnail) == null ? void 0 : x.url}`,
899
+ src: `${We}${(m = (p = (f = a == null ? void 0 : a.imagen) == null ? void 0 : f.formats) == null ? void 0 : p.thumbnail) == null ? void 0 : m.url}`,
881
900
  alt: "@shadcn"
882
901
  }
883
902
  ),
884
- /* @__PURE__ */ e(k, { className: "border border-x-primary-pastel", children: ie(a == null ? void 0 : a.nombre) })
903
+ /* @__PURE__ */ e(te, { className: "border border-x-primary-pastel", children: de(a == null ? void 0 : a.nombre) })
885
904
  ] }),
886
905
  /* @__PURE__ */ e(
887
- Ge,
906
+ Ze,
888
907
  {
889
- ...s("comment", { required: !0 }),
908
+ ...l("comment", { required: !0 }),
890
909
  autoComplete: "off",
891
910
  placeholder: "Escribe un comentario",
892
911
  className: "w-full bg-white border border-neutral-200"
893
912
  }
894
913
  )
895
914
  ] }),
896
- c.map((w, f) => /* @__PURE__ */ e(Ct, { comment: w }, f))
915
+ c.map((g, b) => /* @__PURE__ */ e(Pt, { comment: g }, b))
897
916
  ] });
898
917
  }
899
- function Ft({ data: a }) {
918
+ function At({ data: a }) {
900
919
  const t = {
901
920
  0: {
902
921
  color: "bg-gray-400",
@@ -914,21 +933,21 @@ function Ft({ data: a }) {
914
933
  color: "bg-success-regular",
915
934
  label: "Finalizada"
916
935
  }
917
- }, r = (n) => n ? _e(new Date(n), "d MMM", { locale: re }) : "";
936
+ }, r = (n) => n ? qe(new Date(n), "d MMM", { locale: le }) : "";
918
937
  return /* @__PURE__ */ o("div", { children: [
919
938
  /* @__PURE__ */ o("div", { className: "flex flex-row items-center gap-4", children: [
920
- /* @__PURE__ */ e(Ye, { className: "text-lg font-medium text-neutral-900", children: "Tareas dependientes" }),
939
+ /* @__PURE__ */ e(ke, { className: "text-lg font-medium text-neutral-900", children: "Tareas dependientes" }),
921
940
  /* @__PURE__ */ e("span", { className: "text-sm font-normal text-neutral-600 bg-[#E1EBF9] w-6 h-6 rounded-full flex items-center justify-center text-primary", children: a == null ? void 0 : a.length })
922
941
  ] }),
923
942
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 border border-neutral-200 rounded-lg mt-3", children: a == null ? void 0 : a.map((n) => {
924
- var l, s, i, u, c;
943
+ var s, l, i, u, c;
925
944
  return /* @__PURE__ */ o(
926
945
  "div",
927
946
  {
928
947
  className: "flex flex-row w-full items-center justify-between gap-s border-b border-neutral-200 py-1 px-2",
929
948
  children: [
930
949
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
931
- /* @__PURE__ */ e(O, { imageUrl: (u = (i = (s = (l = n.responsable) == null ? void 0 : l.image) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }),
950
+ /* @__PURE__ */ e(U, { imageUrl: (u = (i = (l = (s = n.responsable) == null ? void 0 : s.image) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }),
932
951
  /* @__PURE__ */ e("p", { className: "text-sm font-normal w-[400px] text-nowrap text-ellipsis overflow-hidden", children: n == null ? void 0 : n.texto_corto })
933
952
  ] }),
934
953
  /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
@@ -947,26 +966,26 @@ function Ft({ data: a }) {
947
966
  }) })
948
967
  ] });
949
968
  }
950
- const Tt = "https://devobp.imjmedia.com.mx";
951
- function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
952
- var w, f, v, b, N, F, T, A, h, S, D;
953
- const [n, l] = y(null), [s, i] = y(!1), [u, c] = y(null), { tasks_api: p } = E(), { user: d } = I();
954
- _(() => {
955
- if (a && r || s) {
956
- const j = async () => {
957
- const B = await p.get(`/api/detalleTarea/${r}`);
958
- l(B == null ? void 0 : B.data);
959
- }, M = async () => {
960
- var U, Q;
961
- const B = await p.get(`/api/users/${d.id}`), R = await p.post("/api/obtenerUsuarioOBP/", {
962
- emailList: [(U = B == null ? void 0 : B.data) == null ? void 0 : U.email]
969
+ const qt = "https://devobp.imjmedia.com.mx";
970
+ function jt({ isOpen: a, setIsOpen: t, taskId: r }) {
971
+ var g, b, v, w, N, T, _, A, R, M, z;
972
+ const [n, s] = y(null), [l, i] = y(!1), [u, c] = y(null), { tasks_api: x } = E(), { user: d } = W();
973
+ F(() => {
974
+ if (a && r || l) {
975
+ const h = async () => {
976
+ const P = await x.get(`/api/detalleTarea/${r}`);
977
+ s(P == null ? void 0 : P.data);
978
+ }, q = async () => {
979
+ var I, L;
980
+ const P = await x.get(`/api/users/${d.id}`), D = await x.post("/api/obtenerUsuarioOBP/", {
981
+ emailList: [(I = P == null ? void 0 : P.data) == null ? void 0 : I.email]
963
982
  });
964
- c((Q = R == null ? void 0 : R.data) == null ? void 0 : Q.data[0]);
983
+ c((L = D == null ? void 0 : D.data) == null ? void 0 : L.data[0]);
965
984
  };
966
- j(), M();
985
+ h(), q();
967
986
  }
968
- }, [a, r, s]);
969
- const g = {
987
+ }, [a, r, l]);
988
+ const f = {
970
989
  0: {
971
990
  label: "Sin prioridad",
972
991
  color: "text-primary-regular",
@@ -987,14 +1006,14 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
987
1006
  color: "text-danger-regular",
988
1007
  iconColor: "#C34335"
989
1008
  }
990
- }, m = (j) => j ? _e(j, "d MMM yyyy, h:mmaaa", {
991
- locale: re
992
- }) : "Fecha no disponible", x = [
1009
+ }, p = (h) => h ? qe(h, "d MMM yyyy, h:mmaaa", {
1010
+ locale: le
1011
+ }) : "Fecha no disponible", m = [
993
1012
  {
994
1013
  id: 1,
995
1014
  label: "Todo",
996
1015
  component: /* @__PURE__ */ e(
997
- _t,
1016
+ St,
998
1017
  {
999
1018
  taskId: r,
1000
1019
  currentUser: u,
@@ -1006,10 +1025,10 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1006
1025
  {
1007
1026
  id: 2,
1008
1027
  label: "Dependencias",
1009
- component: /* @__PURE__ */ e(Ft, { data: n == null ? void 0 : n.ids_t_dependientes })
1028
+ component: /* @__PURE__ */ e(At, { data: n == null ? void 0 : n.ids_t_dependientes })
1010
1029
  }
1011
1030
  ];
1012
- return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ o(q, { children: [
1031
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ o(j, { children: [
1013
1032
  /* @__PURE__ */ e(
1014
1033
  "div",
1015
1034
  {
@@ -1025,7 +1044,7 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1025
1044
  /* @__PURE__ */ o("div", { className: "w-full flex flex-row justify-between pb-4 gap-10 border-none", children: [
1026
1045
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-neutral-900", children: n == null ? void 0 : n.texto_corto }),
1027
1046
  /* @__PURE__ */ e(
1028
- Fe,
1047
+ je,
1029
1048
  {
1030
1049
  variant: "shadow",
1031
1050
  size: "sm",
@@ -1045,29 +1064,29 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1045
1064
  /* @__PURE__ */ e("p", { className: "text-neutral-600 font-normal text-sm", children: (n == null ? void 0 : n.texto_largo) ?? "Sin descripción" })
1046
1065
  ] }),
1047
1066
  /* @__PURE__ */ e(
1048
- Xe,
1067
+ et,
1049
1068
  {
1050
1069
  type: "single",
1051
1070
  collapsible: !0,
1052
1071
  defaultValue: "item-1",
1053
1072
  className: "w-full flex flex-col border border-neutral-200 rounded-xl mt-4",
1054
- children: /* @__PURE__ */ o(Je, { value: "item-1", className: "border-none", children: [
1055
- /* @__PURE__ */ e(Ze, { className: "text-neutral-900 font-medium text-sm w-full flex flex-row border-b border-neutral-200 p-4 ", children: "Detalles" }),
1056
- /* @__PURE__ */ e(ke, { className: "border-none", children: /* @__PURE__ */ o("div", { className: "w-full grid grid-cols-3 gap-4 p-4", children: [
1073
+ children: /* @__PURE__ */ o(tt, { value: "item-1", className: "border-none", children: [
1074
+ /* @__PURE__ */ e(at, { className: "text-neutral-900 font-medium text-sm w-full flex flex-row border-b border-neutral-200 p-4 ", children: "Detalles" }),
1075
+ /* @__PURE__ */ e(nt, { className: "border-none", children: /* @__PURE__ */ o("div", { className: "w-full grid grid-cols-3 gap-4 p-4", children: [
1057
1076
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1058
1077
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Responsable" }),
1059
- (w = n == null ? void 0 : n.responsable) != null && w.nombre ? /* @__PURE__ */ o("div", { className: "flex flex-row gap-2 items-center", children: [
1060
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
1078
+ (g = n == null ? void 0 : n.responsable) != null && g.nombre ? /* @__PURE__ */ o("div", { className: "flex flex-row gap-2 items-center", children: [
1079
+ /* @__PURE__ */ o(k, { className: "w-[28px] h-[28px]", children: [
1061
1080
  /* @__PURE__ */ e(
1062
- Z,
1081
+ ee,
1063
1082
  {
1064
- src: `${Tt}${(N = (b = (v = (f = n == null ? void 0 : n.responsable) == null ? void 0 : f.imagen) == null ? void 0 : v.formats) == null ? void 0 : b.thumbnail) == null ? void 0 : N.url}`,
1083
+ src: `${qt}${(N = (w = (v = (b = n == null ? void 0 : n.responsable) == null ? void 0 : b.imagen) == null ? void 0 : v.formats) == null ? void 0 : w.thumbnail) == null ? void 0 : N.url}`,
1065
1084
  alt: "@shadcn"
1066
1085
  }
1067
1086
  ),
1068
- /* @__PURE__ */ e(k, { children: ie((F = n == null ? void 0 : n.responsable) == null ? void 0 : F.nombre) })
1087
+ /* @__PURE__ */ e(te, { children: de((T = n == null ? void 0 : n.responsable) == null ? void 0 : T.nombre) })
1069
1088
  ] }),
1070
- /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (T = n == null ? void 0 : n.responsable) == null ? void 0 : T.nombre })
1089
+ /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: (_ = n == null ? void 0 : n.responsable) == null ? void 0 : _.nombre })
1071
1090
  ] }) : /* @__PURE__ */ e("span", { className: "text-xs text-neutral-600 font-normal", children: "Sin responsable" })
1072
1091
  ] }),
1073
1092
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
@@ -1083,14 +1102,14 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1083
1102
  icon: "flag",
1084
1103
  size: "xs",
1085
1104
  strokeWidth: 5,
1086
- color: (h = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : h.iconColor
1105
+ color: (R = f[n == null ? void 0 : n.prioridad]) == null ? void 0 : R.iconColor
1087
1106
  }
1088
1107
  ),
1089
1108
  /* @__PURE__ */ e(
1090
1109
  "span",
1091
1110
  {
1092
- className: `text-sm text-neutral-600 font-normal ${(S = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : S.color}`,
1093
- children: ((D = g[n == null ? void 0 : n.prioridad]) == null ? void 0 : D.label) ?? "Sin prioridad"
1111
+ className: `text-sm text-neutral-600 font-normal ${(M = f[n == null ? void 0 : n.prioridad]) == null ? void 0 : M.color}`,
1112
+ children: ((z = f[n == null ? void 0 : n.prioridad]) == null ? void 0 : z.label) ?? "Sin prioridad"
1094
1113
  }
1095
1114
  )
1096
1115
  ] })
@@ -1101,110 +1120,110 @@ function Pt({ isOpen: a, setIsOpen: t, taskId: r }) {
1101
1120
  ] }),
1102
1121
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1103
1122
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha estimada de inicio" }),
1104
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.f_inicio_estimada) })
1123
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: p(n == null ? void 0 : n.f_inicio_estimada) })
1105
1124
  ] }),
1106
1125
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1107
1126
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha estimada de fin" }),
1108
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.f_fin_estimada) })
1127
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: p(n == null ? void 0 : n.f_fin_estimada) })
1109
1128
  ] }),
1110
1129
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1111
1130
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Fecha de fin" }),
1112
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.ffin) })
1131
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: p(n == null ? void 0 : n.ffin) })
1113
1132
  ] }),
1114
1133
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1115
1134
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Creado" }),
1116
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.createdAt) })
1135
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: p(n == null ? void 0 : n.createdAt) })
1117
1136
  ] }),
1118
1137
  /* @__PURE__ */ o("div", { className: "flex flex-col w-auto gap-2", children: [
1119
1138
  /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 font-medium", children: "Última modificación" }),
1120
- /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: m(n == null ? void 0 : n.updatedAt) })
1139
+ /* @__PURE__ */ e("p", { className: "text-xs text-neutral-600 font-normal", children: p(n == null ? void 0 : n.updatedAt) })
1121
1140
  ] })
1122
1141
  ] }) })
1123
1142
  ] })
1124
1143
  }
1125
1144
  ),
1126
- /* @__PURE__ */ e(Nt, { items: x })
1145
+ /* @__PURE__ */ e(Ft, { items: m })
1127
1146
  ] })
1128
1147
  }
1129
1148
  )
1130
1149
  ] }) });
1131
1150
  }
1132
- const At = ({
1151
+ const Dt = ({
1133
1152
  id: a,
1134
1153
  task: t,
1135
1154
  endDate: r,
1136
1155
  users: n,
1137
- willBePaused: l,
1138
- nameProject: s,
1156
+ willBePaused: s,
1157
+ nameProject: l,
1139
1158
  idProject: i,
1140
1159
  comments: u,
1141
1160
  priority: c,
1142
- responsible: p,
1161
+ responsible: x,
1143
1162
  nameRequiredTask: d,
1144
- statusRequiredTask: g,
1145
- status: m
1163
+ statusRequiredTask: f,
1164
+ status: p
1146
1165
  }) => {
1147
- const x = L(null), [w, f] = y(!1), { setElementPosition: v, position: b } = le(), { startWorking: N } = Ee(), F = L(!1), T = ({ children: h }) => {
1148
- const [S, D] = y();
1149
- return _(() => {
1150
- var j, M;
1151
- x.current && D(
1152
- ((b == null ? void 0 : b.x) ?? 0) - (((M = (j = x.current) == null ? void 0 : j.getBoundingClientRect()) == null ? void 0 : M.width) ?? 0)
1166
+ const m = O(null), [g, b] = y(!1), { setElementPosition: v, position: w } = ie(), { startWorking: N, completeTask: T } = oe(), _ = O(!1), A = ({ children: M }) => {
1167
+ const [z, h] = y();
1168
+ return F(() => {
1169
+ var q, P;
1170
+ m.current && h(
1171
+ ((w == null ? void 0 : w.x) ?? 0) - (((P = (q = m.current) == null ? void 0 : q.getBoundingClientRect()) == null ? void 0 : P.width) ?? 0)
1153
1172
  );
1154
- }, [x == null ? void 0 : x.current, b == null ? void 0 : b.x]), b && X.createPortal(
1173
+ }, [m == null ? void 0 : m.current, w == null ? void 0 : w.x]), w && Z.createPortal(
1155
1174
  /* @__PURE__ */ e(
1156
1175
  "div",
1157
1176
  {
1158
- className: `absolute w-fit h-fit ${S ? "block" : "hidden"}`,
1159
- style: { top: `${b == null ? void 0 : b.y}px`, left: `${S}px`, zIndex: 1 },
1160
- children: h
1177
+ className: `absolute w-fit h-fit ${z ? "block" : "hidden"}`,
1178
+ style: { top: `${w == null ? void 0 : w.y}px`, left: `${z}px`, zIndex: 1 },
1179
+ children: M
1161
1180
  }
1162
1181
  ),
1163
1182
  document.body
1164
1183
  );
1165
1184
  };
1166
- return /* @__PURE__ */ o(q, { children: [
1185
+ return /* @__PURE__ */ o(j, { children: [
1167
1186
  /* @__PURE__ */ o("div", { className: "bg-bg-card border-cards max-w-[350px] rounded-lg relative h-fit p-[12px_12px] hover:border-active hover:bg-active cursor-pointer ", children: [
1168
1187
  /* @__PURE__ */ e(() => /* @__PURE__ */ o("div", { className: "flex justify-between items-center w-full h-fit relative", children: [
1169
1188
  /* @__PURE__ */ o("div", { className: "flex items-center gap-[8px] w-[calc(100%-32px)] ", children: [
1170
- /* @__PURE__ */ e(
1171
- De,
1189
+ p < 2 && /* @__PURE__ */ e(
1190
+ ze,
1172
1191
  {
1173
1192
  id: a,
1174
1193
  nameRequiredTask: d ?? "",
1175
- statusRequiredTask: g ?? 0,
1176
- status: m
1194
+ statusRequiredTask: f ?? 0,
1195
+ status: p
1177
1196
  }
1178
1197
  ),
1179
- /* @__PURE__ */ e("p", { className: "title-text", onClick: () => f(!0), children: t })
1198
+ /* @__PURE__ */ e("p", { className: "title-text", onClick: () => b(!0), children: t })
1180
1199
  ] }),
1181
- m < 2 && /* @__PURE__ */ e(
1200
+ p < 2 && (d !== "" && f === 2 || !d) && /* @__PURE__ */ e(
1182
1201
  "button",
1183
1202
  {
1184
- ref: x,
1203
+ ref: m,
1185
1204
  onClick: () => {
1186
- v(x);
1205
+ v(m);
1187
1206
  },
1188
1207
  className: "flex items-center justify-center text-sm font-extrabold bg-bg hover:filter-[drop-shadow(0_0_10px_#000000)] rounded-full w-[24px] h-[24px] m-block",
1189
1208
  children: /* @__PURE__ */ e("span", { className: "rotate-90", children: /* @__PURE__ */ e(C, { icon: "elipsis", size: "xs" }) })
1190
1209
  }
1191
1210
  ),
1192
- /* @__PURE__ */ e(T, { children: F != null && F.current ? /* @__PURE__ */ e("div", { className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light", children: /* @__PURE__ */ e("p", { className: "text-sm font-normal text-primary-pastel font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ o(
1211
+ /* @__PURE__ */ e(A, { children: _ != null && _.current ? /* @__PURE__ */ e("div", { className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light", children: /* @__PURE__ */ e("p", { className: "text-sm font-normal text-primary-pastel font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ o(
1193
1212
  "button",
1194
1213
  {
1195
1214
  className: "w-max h-fit bg-bg-card rounded-lg p-l shadow-lg flex items-center gap-2 hover:bg-primary-light",
1196
1215
  onClick: () => {
1197
- F.current = !0, m === 0 && N({ id: a });
1216
+ _.current = !0, p === 0 ? N({ id: a }) : T({ id: a });
1198
1217
  },
1199
1218
  children: [
1200
- /* @__PURE__ */ e("p", { className: "text-sm font-normal text-texts-placeholder font-regular", children: m === 0 ? "Mover a trabajando" : "Mover a completadas" }),
1219
+ /* @__PURE__ */ e("p", { className: "text-sm font-normal text-texts-placeholder font-regular", children: p === 0 ? "Mover a trabajando" : "Mover a completadas" }),
1201
1220
  /* @__PURE__ */ e(
1202
1221
  C,
1203
1222
  {
1204
1223
  icon: "arrow_right",
1205
1224
  size: "xs",
1206
1225
  strokeWidth: 4,
1207
- color: P.primary.regular
1226
+ color: S.primary.regular
1208
1227
  }
1209
1228
  )
1210
1229
  ]
@@ -1212,23 +1231,23 @@ const At = ({
1212
1231
  ) })
1213
1232
  ] }), {}),
1214
1233
  /* @__PURE__ */ o("div", { className: "flex flex-col gap-[4px] py-2", children: [
1215
- /* @__PURE__ */ e("p", { className: "subtitle-text", children: s }),
1234
+ /* @__PURE__ */ e("p", { className: "subtitle-text", children: l }),
1216
1235
  i && // TODO: Add nameMEDIUM
1217
1236
  /* @__PURE__ */ e("p", { className: "content-text", children: i })
1218
1237
  ] }),
1219
1238
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center w-full h-fit relative pt-5 pb-1", children: [
1220
1239
  /* @__PURE__ */ o("div", { className: "flex items-center relative", children: [
1221
1240
  /* @__PURE__ */ e(
1222
- $e,
1241
+ Ie,
1223
1242
  {
1224
- responsible: p,
1225
- users: n.filter((h) => p ? h.id === p : !0).map(se),
1243
+ responsible: x,
1244
+ users: n.filter((M) => x ? M.id === x : !0).map(ce),
1226
1245
  onClick: () => {
1227
1246
  }
1228
1247
  }
1229
1248
  ),
1230
- l && /* @__PURE__ */ e(
1231
- K,
1249
+ s && /* @__PURE__ */ e(
1250
+ H,
1232
1251
  {
1233
1252
  dispatch: /* @__PURE__ */ o("button", { className: "text-sm font-regular text-gray-400 flex items-center gap-2", children: [
1234
1253
  /* @__PURE__ */ e(C, { icon: "pause", size: "s", strokeWidth: 2 }),
@@ -1240,17 +1259,17 @@ const At = ({
1240
1259
  ] }),
1241
1260
  /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1242
1261
  /* @__PURE__ */ e(C, { icon: "difficulty", size: "xs" }),
1243
- /* @__PURE__ */ e(Be, { priority: c, id: a }),
1262
+ /* @__PURE__ */ e(Oe, { priority: c, id: a }),
1244
1263
  /* @__PURE__ */ e(
1245
1264
  C,
1246
1265
  {
1247
1266
  icon: "calendar",
1248
1267
  size: "xs",
1249
1268
  strokeWidth: 3,
1250
- color: P.texts.subtext
1269
+ color: S.texts.subtext
1251
1270
  }
1252
1271
  ),
1253
- /* @__PURE__ */ e("p", { className: "text-sm font-regular text-texts-subtext", children: `${r.getDate()} ${je(r.getMonth()).slice(0, 3)}` })
1272
+ /* @__PURE__ */ e("p", { className: "text-sm font-regular text-texts-subtext", children: `${r.getDate()} ${Be(r.getMonth()).slice(0, 3)}` })
1254
1273
  ] })
1255
1274
  ] }),
1256
1275
  u > 0 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 mt-4 pt-2", children: /* @__PURE__ */ o("button", { className: "flex items-center gap-2", children: [
@@ -1258,9 +1277,9 @@ const At = ({
1258
1277
  /* @__PURE__ */ e("span", { className: "text-sm font-regular text-gray-400", children: u })
1259
1278
  ] }) })
1260
1279
  ] }),
1261
- /* @__PURE__ */ e(Pt, { taskId: a, isOpen: w, setIsOpen: f })
1280
+ /* @__PURE__ */ e(jt, { taskId: a, isOpen: g, setIsOpen: b })
1262
1281
  ] });
1263
- }, St = () => /* @__PURE__ */ o("div", { className: "bg-gray-200 h-[150px] w-full animate-pulse rounded-md flex flex-col gap-[50px] p-4", children: [
1282
+ }, $t = () => /* @__PURE__ */ o("div", { className: "bg-gray-200 h-[150px] w-full animate-pulse rounded-md flex flex-col gap-[50px] p-4", children: [
1264
1283
  /* @__PURE__ */ o("div", { className: "flex h-[30px] gap-3", children: [
1265
1284
  /* @__PURE__ */ e("div", { className: "w-[30px] min-w-[30px] h-full bg-gray-300 rounded-full" }),
1266
1285
  /* @__PURE__ */ e("div", { className: "w-full h-full bg-gray-300" }),
@@ -1270,23 +1289,23 @@ const At = ({
1270
1289
  /* @__PURE__ */ e("div", { className: "w-full h-[30px] bg-gray-300" }),
1271
1290
  /* @__PURE__ */ e("div", { className: "w-full h-[30px] bg-gray-300" })
1272
1291
  ] })
1273
- ] }), ee = ({ title: a, tasks: t, loadNextPage: r, isFetching: n, total: l }) => {
1274
- const s = L(null), i = L(null), u = L(!1);
1275
- _(() => {
1292
+ ] }), ae = ({ title: a, tasks: t, loadNextPage: r, isFetching: n, total: s }) => {
1293
+ const l = O(null), i = O(null), u = O(!1);
1294
+ F(() => {
1276
1295
  var d;
1277
- s != null && s.current && (i != null && i.current) && (i.current.style.minHeight = `${((d = s == null ? void 0 : s.current) == null ? void 0 : d.clientHeight) - 50}px`);
1278
- }, [s == null ? void 0 : s.current]);
1296
+ l != null && l.current && (i != null && i.current) && (i.current.style.minHeight = `${((d = l == null ? void 0 : l.current) == null ? void 0 : d.clientHeight) - 50}px`);
1297
+ }, [l == null ? void 0 : l.current]);
1279
1298
  const c = (d) => {
1280
1299
  if (u.current) return;
1281
- const { scrollTop: g, clientHeight: m, scrollHeight: x } = d == null ? void 0 : d.target, w = g / (x - m) * 100;
1282
- w <= 95 || w >= 95 && (u.current = !0, r && r(), setTimeout(() => {
1300
+ const { scrollTop: f, clientHeight: p, scrollHeight: m } = d == null ? void 0 : d.target, g = f / (m - p) * 100;
1301
+ g <= 95 || g >= 95 && (u.current = !0, r && r(), setTimeout(() => {
1283
1302
  u.current = !1;
1284
1303
  }, 200));
1285
1304
  };
1286
1305
  return /* @__PURE__ */ o(
1287
1306
  "div",
1288
1307
  {
1289
- ref: s,
1308
+ ref: l,
1290
1309
  className: ` flex flex-col bg-containers w-fit max-w-[400px] min-w-[400px] h-full min-h-[100%] pb-[200px] relative p-[16px] rounded-lg overflow-hidden border-t-4 ${{
1291
1310
  "Por hacer": "border-texts-placeholder",
1292
1311
  Trabajando: "border-primary-regular",
@@ -1302,10 +1321,10 @@ const At = ({
1302
1321
  icon: "group_files",
1303
1322
  size: "xs",
1304
1323
  strokeWidth: 5,
1305
- color: P.texts.placeholder
1324
+ color: S.texts.placeholder
1306
1325
  }
1307
1326
  ),
1308
- /* @__PURE__ */ e("p", { className: "text-md text-texts-placeholder", children: l ?? 0 })
1327
+ /* @__PURE__ */ e("p", { className: "text-md text-texts-placeholder", children: s ?? 0 })
1309
1328
  ] }) })
1310
1329
  ] }),
1311
1330
  /* @__PURE__ */ o(
@@ -1315,34 +1334,34 @@ const At = ({
1315
1334
  className: "flex flex-col gap-[12px] overflow-y-auto scrollbar-none py-4",
1316
1335
  onScroll: c,
1317
1336
  children: [
1318
- t == null ? void 0 : t.map((d) => /* @__PURE__ */ e(At, { ...d }, d.id)),
1319
- n ? /* @__PURE__ */ e(St, {}) : /* @__PURE__ */ e("p", { className: "text-center text-gray-500", children: "No hay más tareas por mostrar..." })
1337
+ t == null ? void 0 : t.map((d) => /* @__PURE__ */ e(Dt, { ...d }, d.id)),
1338
+ n ? /* @__PURE__ */ e($t, {}) : /* @__PURE__ */ e("p", { className: "text-center text-gray-500", children: "No hay más tareas por mostrar..." })
1320
1339
  ]
1321
1340
  }
1322
1341
  )
1323
1342
  ]
1324
1343
  }
1325
1344
  );
1326
- }, qt = () => {
1327
- var l;
1328
- const { defineFields: a } = $(), { tasksProject: t } = Y();
1329
- _(() => {
1345
+ }, Et = () => {
1346
+ var s;
1347
+ const { defineFields: a } = $(), { tasksProject: t } = X();
1348
+ F(() => {
1330
1349
  (async () => {
1331
- let i = [...mt];
1350
+ let i = [...gt];
1332
1351
  a(i);
1333
1352
  })();
1334
1353
  }, []);
1335
- let r = (l = t == null ? void 0 : t.data) == null ? void 0 : l.filter((s) => {
1354
+ let r = (s = t == null ? void 0 : t.data) == null ? void 0 : s.filter((l) => {
1336
1355
  var i;
1337
- return ((i = s == null ? void 0 : s.tasks) == null ? void 0 : i.length) === 0;
1338
- }).reduce((s, i) => (s[i.status] = s[i.status] || [], s[i.status].push(i), s), {});
1339
- return /* @__PURE__ */ e("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: ["Por hacer", "Trabajando", "Completadas"].map((s, i) => {
1356
+ return ((i = l == null ? void 0 : l.tasks) == null ? void 0 : i.length) === 0;
1357
+ }).reduce((l, i) => (l[i.status] = l[i.status] || [], l[i.status].push(i), l), {});
1358
+ return /* @__PURE__ */ e("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: ["Por hacer", "Trabajando", "Completadas"].map((l, i) => {
1340
1359
  var u;
1341
1360
  return /* @__PURE__ */ e(
1342
- ee,
1361
+ ae,
1343
1362
  {
1344
1363
  total: ((u = r == null ? void 0 : r[i]) == null ? void 0 : u.length) ?? 0,
1345
- title: s,
1364
+ title: l,
1346
1365
  tasks: (r == null ? void 0 : r[i]) ?? [],
1347
1366
  isFetching: t == null ? void 0 : t.isFetching,
1348
1367
  isLoadingData: t == null ? void 0 : t.isLoading
@@ -1350,16 +1369,16 @@ const At = ({
1350
1369
  );
1351
1370
  }) });
1352
1371
  };
1353
- class Dt {
1372
+ class Mt {
1354
1373
  static toKanbanTasks(t) {
1355
- var n, l, s, i, u, c, p, d, g, m, x;
1374
+ var n, s, l, i, u, c, x, d, f, p, m;
1356
1375
  let r = [];
1357
- return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (s = (l = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : l.imagen) == null ? void 0 : s.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((w) => {
1358
- var f, v, b, N;
1359
- r != null && r.find((F) => F.id === w.idUser.id) || w.idUser && r.push({ id: w.idUser.id, name: w.idUser.nombre, image: (N = (b = (v = (f = w == null ? void 0 : w.userOBP) == null ? void 0 : f.imagen) == null ? void 0 : v.formats) == null ? void 0 : b.thumbnail) == null ? void 0 : N.url });
1376
+ return t != null && t.responsable && r.push({ id: t.responsable.id, name: t.responsable.nombre, image: (u = (i = (l = (s = (n = t.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : s.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : u.url }), (c = t == null ? void 0 : t.equipo) != null && c.miembros && t.equipo.miembros.forEach((g) => {
1377
+ var b, v, w, N;
1378
+ r != null && r.find((T) => T.id === g.idUser.id) || g.idUser && r.push({ id: g.idUser.id, name: g.idUser.nombre, image: (N = (w = (v = (b = g == null ? void 0 : g.userOBP) == null ? void 0 : b.imagen) == null ? void 0 : v.formats) == null ? void 0 : w.thumbnail) == null ? void 0 : N.url });
1360
1379
  }), {
1361
1380
  comments: 0,
1362
- nameProject: (p = t == null ? void 0 : t.proyecto) == null ? void 0 : p.nombre,
1381
+ nameProject: (x = t == null ? void 0 : t.proyecto) == null ? void 0 : x.nombre,
1363
1382
  idProject: (d = t == null ? void 0 : t.proyecto) == null ? void 0 : d.id,
1364
1383
  willBePaused: t.es_pausable,
1365
1384
  difficulty: t.nivel_dificultad,
@@ -1369,55 +1388,55 @@ class Dt {
1369
1388
  status: t.estatus,
1370
1389
  task: t.texto_corto,
1371
1390
  users: r,
1372
- responsible: ((g = t == null ? void 0 : t.responsable) == null ? void 0 : g.id) ?? null,
1373
- statusRequiredTask: ((m = t.id_t_requerida) == null ? void 0 : m.estatus) ?? null,
1374
- nameRequiredTask: ((x = t.id_t_requerida) == null ? void 0 : x.texto_corto) ?? null
1391
+ responsible: ((f = t == null ? void 0 : t.responsable) == null ? void 0 : f.id) ?? null,
1392
+ statusRequiredTask: ((p = t.id_t_requerida) == null ? void 0 : p.estatus) ?? null,
1393
+ nameRequiredTask: ((m = t.id_t_requerida) == null ? void 0 : m.texto_corto) ?? null
1375
1394
  };
1376
1395
  }
1377
1396
  }
1378
- const oe = async ({ filters: a, tasks_api: t }) => {
1397
+ const ue = async ({ filters: a, tasks_api: t }) => {
1379
1398
  try {
1380
- return (await t.get("/api/listado_tareas", { params: a })).data.tareas.map(z).map(Dt.toKanbanTasks);
1399
+ return (await t.get("/api/listado_tareas", { params: a })).data.tareas.map(K).map(Mt.toKanbanTasks);
1381
1400
  } catch (r) {
1382
1401
  throw console.log({ error: r }), `Error al obtener las tareas: ${r}`;
1383
1402
  }
1384
- }, ce = (a) => {
1403
+ }, me = (a) => {
1385
1404
  var t;
1386
1405
  if (a != null && a.hasNextPage) {
1387
1406
  const r = (t = a == null ? void 0 : a.data) == null ? void 0 : t.pages[a.data.pages.length - 1];
1388
1407
  (r == null ? void 0 : r.length) === 30 && (a == null || a.fetchNextPage());
1389
1408
  }
1390
- }, W = (a) => ({
1409
+ }, Q = (a) => ({
1391
1410
  pagination: {
1392
1411
  page: a,
1393
1412
  pageSize: 30,
1394
1413
  withCount: !0
1395
1414
  }
1396
- }), jt = () => {
1397
- var p;
1398
- const a = H(), { tasks_api: t } = E(), { user: r } = I(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1415
+ }), Lt = () => {
1416
+ var x;
1417
+ const a = V(), { tasks_api: t } = E(), { user: r } = W(), { filters: n } = $(), [s, l] = y(0), [i, u] = y({
1399
1418
  owner: {
1400
1419
  user: r.id,
1401
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1420
+ config: ((x = n == null ? void 0 : n.owner) == null ? void 0 : x.config) ?? "yo_y_mis_equipos"
1402
1421
  },
1403
1422
  status: "por_hacer"
1404
- }), c = ne({
1423
+ }), c = se({
1405
1424
  initialPageParam: 1,
1406
1425
  queryKey: ["to_do_tasks", i],
1407
- queryFn: ({ pageParam: d }) => oe({
1426
+ queryFn: ({ pageParam: d }) => ue({
1408
1427
  filters: {
1409
1428
  ...i,
1410
1429
  status: "por_hacer",
1411
- ...W(d)
1430
+ ...Q(d)
1412
1431
  },
1413
1432
  tasks_api: t,
1414
1433
  page: d
1415
1434
  }),
1416
1435
  staleTime: 1e3 * 60 * 60 * 24,
1417
1436
  // mantains the data for 24 hours
1418
- getNextPageParam: (d, g) => g.length + 1
1437
+ getNextPageParam: (d, f) => f.length + 1
1419
1438
  });
1420
- return _(() => {
1439
+ return F(() => {
1421
1440
  var d;
1422
1441
  Object.keys(n).length > 0 && u({
1423
1442
  ...n,
@@ -1427,57 +1446,57 @@ const oe = async ({ filters: a, tasks_api: t }) => {
1427
1446
  },
1428
1447
  status: "por_hacer"
1429
1448
  });
1430
- }, [n]), _(() => {
1449
+ }, [n]), F(() => {
1431
1450
  a.invalidateQueries({
1432
1451
  queryKey: ["to_do_tasks", i]
1433
1452
  });
1434
- }, [i]), _(() => {
1453
+ }, [i]), F(() => {
1435
1454
  (async () => {
1436
- const g = await t.get("/api/listado_tareas", {
1455
+ const f = await t.get("/api/listado_tareas", {
1437
1456
  params: {
1438
1457
  ...i,
1439
1458
  status: "por_hacer",
1440
- ...W(1),
1459
+ ...Q(1),
1441
1460
  tasks_api: t,
1442
1461
  justCount: !0
1443
1462
  }
1444
1463
  });
1445
- s(g.data.total);
1464
+ l(f.data.total);
1446
1465
  })();
1447
1466
  }, [i, c == null ? void 0 : c.data]), {
1448
1467
  //Properties
1449
1468
  toDoTasks: c,
1450
- total: l
1469
+ total: s
1451
1470
  };
1452
- }, $t = () => {
1453
- var n, l;
1454
- const { toDoTasks: a, total: t } = jt(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1455
- return /* @__PURE__ */ e(ee, { total: t, title: "Por hacer", tasks: r, loadNextPage: () => ce(a), isFetching: a == null ? void 0 : a.isFetching, isLoadingData: a == null ? void 0 : a.isLoading });
1456
- }, Et = () => {
1457
- var p;
1458
- const a = H(), { tasks_api: t } = E(), { user: r } = I(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1471
+ }, zt = () => {
1472
+ var n, s;
1473
+ const { toDoTasks: a, total: t } = Lt(), r = [...((s = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : s.flat()) ?? []];
1474
+ return /* @__PURE__ */ e(ae, { total: t, title: "Por hacer", tasks: r, loadNextPage: () => me(a), isFetching: a == null ? void 0 : a.isFetching, isLoadingData: a == null ? void 0 : a.isLoading });
1475
+ }, Bt = () => {
1476
+ var x;
1477
+ const a = V(), { tasks_api: t } = E(), { user: r } = W(), { filters: n } = $(), [s, l] = y(0), [i, u] = y({
1459
1478
  owner: {
1460
1479
  user: r.id,
1461
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1480
+ config: ((x = n == null ? void 0 : n.owner) == null ? void 0 : x.config) ?? "yo_y_mis_equipos"
1462
1481
  },
1463
1482
  status: "trabajando"
1464
- }), c = ne({
1483
+ }), c = se({
1465
1484
  initialPageParam: 1,
1466
1485
  queryKey: ["working_tasks", n],
1467
- queryFn: ({ pageParam: d }) => oe({
1486
+ queryFn: ({ pageParam: d }) => ue({
1468
1487
  filters: {
1469
1488
  ...i,
1470
1489
  status: "trabajando",
1471
- ...W(d)
1490
+ ...Q(d)
1472
1491
  },
1473
1492
  tasks_api: t,
1474
1493
  page: d
1475
1494
  }),
1476
1495
  staleTime: 1e3 * 60 * 60 * 24,
1477
1496
  // mantains the data for 24 hours
1478
- getNextPageParam: (d, g) => g.length + 1
1497
+ getNextPageParam: (d, f) => f.length + 1
1479
1498
  });
1480
- return _(() => {
1499
+ return F(() => {
1481
1500
  var d;
1482
1501
  Object.keys(n).length > 0 && u({
1483
1502
  ...n,
@@ -1487,66 +1506,66 @@ const oe = async ({ filters: a, tasks_api: t }) => {
1487
1506
  },
1488
1507
  status: "trabajando"
1489
1508
  });
1490
- }, [n]), _(() => {
1509
+ }, [n]), F(() => {
1491
1510
  a.invalidateQueries({
1492
1511
  queryKey: ["working_tasks", n]
1493
1512
  });
1494
- }, [i]), _(() => {
1513
+ }, [i]), F(() => {
1495
1514
  (async () => {
1496
- const g = await t.get("/api/listado_tareas", {
1515
+ const f = await t.get("/api/listado_tareas", {
1497
1516
  params: {
1498
1517
  ...i,
1499
1518
  status: "trabajando",
1500
- ...W(1),
1519
+ ...Q(1),
1501
1520
  tasks_api: t,
1502
1521
  justCount: !0
1503
1522
  }
1504
1523
  });
1505
- s(g.data.total);
1524
+ l(f.data.total);
1506
1525
  })();
1507
1526
  }, [i, c == null ? void 0 : c.data]), {
1508
1527
  //Properties
1509
1528
  workingTasks: c,
1510
- total: l
1529
+ total: s
1511
1530
  };
1512
- }, Bt = () => {
1513
- var n, l;
1514
- const { workingTasks: a, total: t } = Et(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1531
+ }, It = () => {
1532
+ var n, s;
1533
+ const { workingTasks: a, total: t } = Bt(), r = [...((s = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : s.flat()) ?? []];
1515
1534
  return /* @__PURE__ */ e(
1516
- ee,
1535
+ ae,
1517
1536
  {
1518
1537
  total: t,
1519
1538
  title: "Trabajando",
1520
1539
  tasks: r,
1521
- loadNextPage: () => ce(a),
1540
+ loadNextPage: () => me(a),
1522
1541
  isFetching: a == null ? void 0 : a.isFetching
1523
1542
  }
1524
1543
  );
1525
- }, Lt = () => {
1526
- var p;
1527
- const a = H(), { user: t } = I(), { tasks_api: r } = E(), { filters: n } = $(), [l, s] = y(0), [i, u] = y({
1544
+ }, Ot = () => {
1545
+ var x;
1546
+ const a = V(), { user: t } = W(), { tasks_api: r } = E(), { filters: n } = $(), [s, l] = y(0), [i, u] = y({
1528
1547
  owner: {
1529
1548
  user: t.id,
1530
- config: ((p = n == null ? void 0 : n.owner) == null ? void 0 : p.config) ?? "yo_y_mis_equipos"
1549
+ config: ((x = n == null ? void 0 : n.owner) == null ? void 0 : x.config) ?? "yo_y_mis_equipos"
1531
1550
  },
1532
1551
  status: "completadas"
1533
- }), c = ne({
1552
+ }), c = se({
1534
1553
  initialPageParam: 1,
1535
1554
  queryKey: ["done_tasks", i],
1536
- queryFn: ({ pageParam: d }) => oe({
1555
+ queryFn: ({ pageParam: d }) => ue({
1537
1556
  filters: {
1538
1557
  ...i,
1539
1558
  status: "completadas",
1540
- ...W(d)
1559
+ ...Q(d)
1541
1560
  },
1542
1561
  tasks_api: r,
1543
1562
  page: d
1544
1563
  }),
1545
1564
  staleTime: 1e3 * 60 * 60 * 24,
1546
1565
  // mantains the data for 24 hours
1547
- getNextPageParam: (d, g) => g.length + 1
1566
+ getNextPageParam: (d, f) => f.length + 1
1548
1567
  });
1549
- return _(() => {
1568
+ return F(() => {
1550
1569
  var d;
1551
1570
  Object.keys(n).length > 0 && u({
1552
1571
  ...n,
@@ -1556,43 +1575,43 @@ const oe = async ({ filters: a, tasks_api: t }) => {
1556
1575
  },
1557
1576
  status: "completadas"
1558
1577
  });
1559
- }, [n]), _(() => {
1578
+ }, [n]), F(() => {
1560
1579
  a.invalidateQueries({
1561
1580
  queryKey: ["done_tasks", i]
1562
1581
  });
1563
- }, [i]), _(() => {
1582
+ }, [i]), F(() => {
1564
1583
  (async () => {
1565
- const g = await r.get("/api/listado_tareas", {
1584
+ const f = await r.get("/api/listado_tareas", {
1566
1585
  params: {
1567
1586
  ...i,
1568
1587
  status: "completadas",
1569
- ...W(1),
1588
+ ...Q(1),
1570
1589
  justCount: !0,
1571
1590
  tasks_api: r
1572
1591
  }
1573
1592
  });
1574
- s(g.data.total);
1593
+ l(f.data.total);
1575
1594
  })();
1576
1595
  }, [c == null ? void 0 : c.data, i]), {
1577
1596
  // Properties
1578
1597
  doneTasks: c,
1579
- total: l
1598
+ total: s
1580
1599
  };
1581
- }, Mt = () => {
1582
- var n, l;
1583
- const { doneTasks: a, total: t } = Lt(), r = [...((l = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : l.flat()) ?? []];
1600
+ }, Wt = () => {
1601
+ var n, s;
1602
+ const { doneTasks: a, total: t } = Ot(), r = [...((s = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : s.flat()) ?? []];
1584
1603
  return /* @__PURE__ */ e(
1585
- ee,
1604
+ ae,
1586
1605
  {
1587
1606
  title: "Completadas",
1588
1607
  tasks: r,
1589
- loadNextPage: () => ce(a),
1608
+ loadNextPage: () => me(a),
1590
1609
  isFetching: a == null ? void 0 : a.isFetching,
1591
1610
  total: t
1592
1611
  }
1593
1612
  );
1594
1613
  };
1595
- class te {
1614
+ class ne {
1596
1615
  static toSalesmanUsers(t) {
1597
1616
  return {
1598
1617
  id: t.id,
@@ -1600,8 +1619,8 @@ class te {
1600
1619
  };
1601
1620
  }
1602
1621
  }
1603
- const zt = () => {
1604
- const { tasks_api: a } = E(), { filters: t } = $(), { user: r } = I();
1622
+ const Rt = () => {
1623
+ const { tasks_api: a } = E(), { filters: t } = $(), { user: r } = W();
1605
1624
  return {
1606
1625
  //methods
1607
1626
  getSalesmanAndProjects: async () => {
@@ -1622,7 +1641,7 @@ const zt = () => {
1622
1641
  }), */
1623
1642
  ]);
1624
1643
  return {
1625
- salesmanUsers: i.data.map(te.toSalesmanUsers)
1644
+ salesmanUsers: i.data.map(ne.toSalesmanUsers)
1626
1645
  // projects: projects.data.map(SalesmanUsersMapper.toSalesmanUsers),
1627
1646
  };
1628
1647
  },
@@ -1637,11 +1656,11 @@ const zt = () => {
1637
1656
  },
1638
1657
  justProjects: !0
1639
1658
  }
1640
- })).data.map(te.toSalesmanUsers);
1659
+ })).data.map(ne.toSalesmanUsers);
1641
1660
  },
1642
- getSalesmans: async () => (await a.get("/api/obtener-comerciales")).data.map(te.toSalesmanUsers)
1661
+ getSalesmans: async () => (await a.get("/api/obtener-comerciales")).data.map(ne.toSalesmanUsers)
1643
1662
  };
1644
- }, It = [
1663
+ }, Kt = [
1645
1664
  {
1646
1665
  label: "Tipo de dependencia",
1647
1666
  type: "select",
@@ -1687,53 +1706,76 @@ const zt = () => {
1687
1706
  label: "Por dificultad",
1688
1707
  type: "select",
1689
1708
  id: "difficulty",
1690
- options: [{
1691
- id: 0,
1692
- name: "Muy facil"
1693
- }, {
1694
- id: 1,
1695
- name: "Facil"
1696
- }, {
1697
- id: 2,
1698
- name: "Media"
1699
- }, {
1700
- id: 3,
1701
- name: "Dificil"
1702
- }, {
1703
- id: 4,
1704
- name: "Muy dificil"
1705
- }]
1709
+ options: [
1710
+ {
1711
+ id: 0,
1712
+ name: "Muy facil"
1713
+ },
1714
+ {
1715
+ id: 1,
1716
+ name: "Facil"
1717
+ },
1718
+ {
1719
+ id: 2,
1720
+ name: "Media"
1721
+ },
1722
+ {
1723
+ id: 3,
1724
+ name: "Dificil"
1725
+ },
1726
+ {
1727
+ id: 4,
1728
+ name: "Muy dificil"
1729
+ }
1730
+ ]
1706
1731
  }
1707
- ], Rt = () => {
1708
- const { defineFields: a } = $(), { getSalesmanAndProjects: t } = zt();
1709
- return _(() => {
1732
+ ], Pe = [
1733
+ {
1734
+ label: "Responsable",
1735
+ type: "select",
1736
+ id: "responsable.responsableType",
1737
+ options: [
1738
+ { id: "yo_y_mis_equipos", name: "Yo y mis equipos" },
1739
+ { id: "mis_equipos", name: "Mis equipos" },
1740
+ { id: "yo", name: "Yo" }
1741
+ ]
1742
+ },
1743
+ {
1744
+ label: "Por Ejecutivo",
1745
+ type: "select",
1746
+ id: "ejecutivo",
1747
+ options: []
1748
+ }
1749
+ ], Ut = () => {
1750
+ const { defineFields: a } = $(), { getSalesmanAndProjects: t } = Rt();
1751
+ return F(() => {
1710
1752
  (async () => {
1711
- let n = [...It], {
1712
- salesmanUsers: l
1753
+ let n = [...Kt], {
1754
+ salesmanUsers: s
1713
1755
  /* , projects */
1714
1756
  } = await t();
1715
- a(n.map((s) => (s.id === "salesman.name" && (s.options = l), s)));
1757
+ a(n.map((l) => (l.id === "salesman.name" && (l.options = s), l)));
1716
1758
  })();
1717
1759
  }, []), /* @__PURE__ */ o("div", { className: "flex gap-4 w-full h-full min-h-[100%] relative ", children: [
1718
- /* @__PURE__ */ e($t, {}),
1719
- /* @__PURE__ */ e(Bt, {}),
1720
- /* @__PURE__ */ e(Mt, {})
1760
+ /* @__PURE__ */ e(zt, {}),
1761
+ /* @__PURE__ */ e(It, {}),
1762
+ /* @__PURE__ */ e(Wt, {})
1721
1763
  ] });
1722
- }, Me = V({}), Ot = ({ children: a }) => {
1764
+ }, Re = G({}), Qt = ({ children: a }) => {
1723
1765
  const [t, r] = y([]);
1724
- _(() => {
1766
+ F(() => {
1725
1767
  console.log({ selectedTasks: t });
1726
1768
  }, [t]);
1727
- const n = (l) => {
1728
- r((s) => s.includes(l) ? s.filter((i) => i !== l) : [...s, l]);
1769
+ const n = (s) => {
1770
+ r((l) => l.includes(s) ? l.filter((i) => i !== s) : [...l, s]);
1729
1771
  };
1730
- return /* @__PURE__ */ e(Me.Provider, { value: {
1772
+ return /* @__PURE__ */ e(Re.Provider, { value: {
1731
1773
  //properties
1732
1774
  selectedTasks: t,
1733
1775
  //methods
1734
1776
  selectTask: n
1735
1777
  }, children: a });
1736
- }, Wt = () => G(Me), ze = () => {
1778
+ }, Ht = () => Y(Re), Ke = () => {
1737
1779
  const a = () => /* @__PURE__ */ o("div", { className: "w-full flex gap-m", children: [
1738
1780
  /* @__PURE__ */ e("div", { className: "w-[30px] h-[30px] min-w-[30px] min-h-[30px] bg-gray-200 rounded-full animate-pulse" }),
1739
1781
  /* @__PURE__ */ e("div", { className: "w-[30%] h-[30px] bg-gray-200 rounded-md animate-pulse" }),
@@ -1758,152 +1800,155 @@ const zt = () => {
1758
1800
  /* @__PURE__ */ e("div", { className: "pl-5", children: /* @__PURE__ */ e(a, {}) })
1759
1801
  ] })
1760
1802
  ] });
1761
- }, Ie = ({
1803
+ }, Ue = ({
1762
1804
  startDate: a,
1763
1805
  endDate: t
1764
- }) => /* @__PURE__ */ o(q, { children: [
1806
+ }) => /* @__PURE__ */ o(j, { children: [
1765
1807
  /* @__PURE__ */ o("div", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-fit flex justify-center items-center px-xxxl", children: [
1766
- /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: P.texts.subtext }),
1808
+ /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: S.texts.subtext }),
1767
1809
  /* @__PURE__ */ o("p", { className: "text-sm", children: [
1768
1810
  " ",
1769
- Ne(a)
1811
+ Te(a)
1770
1812
  ] })
1771
1813
  ] }),
1772
- /* @__PURE__ */ e(C, { icon: "arrow_right", size: "xs", strokeWidth: 4, color: P.texts.DEFAULT }),
1814
+ /* @__PURE__ */ e(C, { icon: "arrow_right", size: "xs", strokeWidth: 4, color: S.texts.DEFAULT }),
1773
1815
  /* @__PURE__ */ o("div", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-fit flex justify-center items-center px-xxxl", children: [
1774
- /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: P.texts.subtext }),
1816
+ /* @__PURE__ */ e(C, { icon: "calendar", size: "xs", strokeWidth: 4, color: S.texts.subtext }),
1775
1817
  /* @__PURE__ */ o("p", { className: "text-sm", children: [
1776
1818
  " ",
1777
- Ne(t)
1819
+ Te(t)
1778
1820
  ] })
1779
1821
  ] })
1780
- ] }), Kt = ({ id: a }) => /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e("button", { onClick: () => alert("pausar tarea " + a), children: /* @__PURE__ */ e(C, { icon: "pause", size: "xs", strokeWidth: 4, color: P.texts.subtext }) }) }), Re = ({ id: a, priority: t }) => /* @__PURE__ */ o(q, { children: [
1781
- /* @__PURE__ */ e("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-[30px] flex justify-center items-center hover:bg-gray-200", children: /* @__PURE__ */ e(C, { icon: "align_center", size: "xs", strokeWidth: 4, color: P.texts.subtext }) }),
1782
- /* @__PURE__ */ e("div", { className: "gap-s bg-success-medium border border-success-pastel rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(Be, { id: a, priority: t }) }),
1783
- /* @__PURE__ */ e("button", { className: "gap-s bg-danger-light border border-danger-regular rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(C, { icon: "difficulty", size: "xs", strokeWidth: 4, color: P.danger.regular }) })
1784
- ] }), Ut = ({ id: a }) => {
1785
- const { selectedTasks: t, selectTask: r } = Wt();
1786
- return /* @__PURE__ */ o(q, { children: [
1787
- /* @__PURE__ */ e("label", { className: "cursor-pointer w-[20px] h-[20px] border-2 border-gray-200 rounded-md flex justify-center items-center", htmlFor: a.toString(), children: /* @__PURE__ */ e("span", { className: `${t.includes(a) ? "opacity-100" : "opacity-0"} transition-opacity duration-500`, children: /* @__PURE__ */ e(C, { icon: "check_outline", size: "xs", color: P.primary.regular, strokeWidth: 6 }) }) }),
1822
+ ] }), Vt = ({ id: a }) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("button", { onClick: () => alert("pausar tarea " + a), children: /* @__PURE__ */ e(C, { icon: "pause", size: "xs", strokeWidth: 4, color: S.texts.subtext }) }) }), Qe = ({ id: a, priority: t }) => /* @__PURE__ */ o(j, { children: [
1823
+ /* @__PURE__ */ e("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] w-[30px] flex justify-center items-center hover:bg-gray-200", children: /* @__PURE__ */ e(C, { icon: "align_center", size: "xs", strokeWidth: 4, color: S.texts.subtext }) }),
1824
+ /* @__PURE__ */ e("div", { className: "gap-s bg-success-medium border border-success-pastel rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(Oe, { id: a, priority: t }) }),
1825
+ /* @__PURE__ */ e("button", { className: "gap-s bg-danger-light border border-danger-regular rounded-md h-[30px] w-[30px] flex justify-center items-center", children: /* @__PURE__ */ e(C, { icon: "difficulty", size: "xs", strokeWidth: 4, color: S.danger.regular }) })
1826
+ ] }), Gt = ({ id: a }) => {
1827
+ const { selectedTasks: t, selectTask: r } = Ht();
1828
+ return /* @__PURE__ */ o(j, { children: [
1829
+ /* @__PURE__ */ e("label", { className: "cursor-pointer w-[20px] h-[20px] border-2 border-gray-200 rounded-md flex justify-center items-center", htmlFor: a.toString(), children: /* @__PURE__ */ e("span", { className: `${t.includes(a) ? "opacity-100" : "opacity-0"} transition-opacity duration-500`, children: /* @__PURE__ */ e(C, { icon: "check_outline", size: "xs", color: S.primary.regular, strokeWidth: 6 }) }) }),
1788
1830
  /* @__PURE__ */ e("input", { className: "hidden", id: a.toString(), type: "checkbox", onChange: () => r(a) })
1789
1831
  ] });
1790
- }, Oe = ({ task: a }) => /* @__PURE__ */ e(
1791
- K,
1832
+ }, He = ({ task: a }) => /* @__PURE__ */ e(
1833
+ H,
1792
1834
  {
1793
1835
  dispatch: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext max-w-[400px] truncate", children: a }),
1794
1836
  children: /* @__PURE__ */ e("p", { className: "text-sm text-texts-subtext p-2 max-w-[400px]", children: a })
1795
1837
  }
1796
- ), Qt = ({ id: a }) => {
1797
- var n, l;
1798
- const { tasksProject: t } = Y(), r = (n = t == null ? void 0 : t.data) == null ? void 0 : n.find((s) => s.id === a);
1838
+ ), Yt = ({ id: a }) => {
1839
+ var n, s;
1840
+ const { tasksProject: t } = X(), r = (n = t == null ? void 0 : t.data) == null ? void 0 : n.find((l) => l.id === a);
1799
1841
  return /* @__PURE__ */ o("div", { className: "ml-[30px] mb-3 mt-1 flex flex-wrap items-center gap-xl", children: [
1800
- !(r != null && r.nameRequiredTask) || (r == null ? void 0 : r.nameRequiredTask) !== "" && (r == null ? void 0 : r.statusRequiredTask) === 2 && /* @__PURE__ */ e(Ut, { id: a }),
1801
- /* @__PURE__ */ e(De, { id: a, nameRequiredTask: (r == null ? void 0 : r.nameRequiredTask) ?? "", status: r == null ? void 0 : r.status, statusRequiredTask: (r == null ? void 0 : r.statusRequiredTask) ?? 0 }, a),
1802
- (r == null ? void 0 : r.willBePaused) && /* @__PURE__ */ e(Kt, { id: a }),
1842
+ !(r != null && r.nameRequiredTask) || (r == null ? void 0 : r.nameRequiredTask) !== "" && (r == null ? void 0 : r.statusRequiredTask) === 2 && /* @__PURE__ */ e(Gt, { id: a }),
1843
+ /* @__PURE__ */ e(ze, { id: a, nameRequiredTask: (r == null ? void 0 : r.nameRequiredTask) ?? "", status: r == null ? void 0 : r.status, statusRequiredTask: (r == null ? void 0 : r.statusRequiredTask) ?? 0 }, a),
1844
+ (r == null ? void 0 : r.willBePaused) && /* @__PURE__ */ e(Vt, { id: a }),
1803
1845
  /* @__PURE__ */ e(
1804
- $e,
1846
+ Ie,
1805
1847
  {
1806
1848
  onClick: () => {
1807
1849
  },
1808
1850
  responsible: r == null ? void 0 : r.responsible,
1809
- users: ((l = r == null ? void 0 : r.users) == null ? void 0 : l.map(se)) ?? []
1851
+ users: ((s = r == null ? void 0 : r.users) == null ? void 0 : s.map(ce)) ?? []
1810
1852
  }
1811
1853
  ),
1812
- /* @__PURE__ */ e(Oe, { task: (r == null ? void 0 : r.task) ?? "" }),
1813
- /* @__PURE__ */ e(Re, { id: a, priority: r == null ? void 0 : r.priority }),
1814
- /* @__PURE__ */ e(Ie, { startDate: r == null ? void 0 : r.startDate, endDate: r == null ? void 0 : r.endDate })
1854
+ /* @__PURE__ */ e(He, { task: (r == null ? void 0 : r.task) ?? "" }),
1855
+ /* @__PURE__ */ e(Qe, { id: a, priority: r == null ? void 0 : r.priority }),
1856
+ /* @__PURE__ */ e(Ue, { startDate: r == null ? void 0 : r.startDate, endDate: r == null ? void 0 : r.endDate })
1815
1857
  ] });
1816
- }, We = ({ id: a }) => {
1817
- var s, i, u, c, p, d, g;
1818
- const { tasksProject: t, openTasks: r, openTask: n } = Y(), l = (s = t == null ? void 0 : t.data) == null ? void 0 : s.find((m) => m.id === a);
1819
- return l ? (console.log({ task: l }), /* @__PURE__ */ o("div", { className: "flex flex-col gap-m mb-2 ", children: [
1858
+ }, Ve = ({ id: a }) => {
1859
+ var l, i, u, c, x, d, f;
1860
+ const { tasksProject: t, openTasks: r, openTask: n } = X(), s = (l = t == null ? void 0 : t.data) == null ? void 0 : l.find((p) => p.id === a);
1861
+ return s ? (console.log({ task: s }), /* @__PURE__ */ o("div", { className: "flex flex-col gap-m mb-2 ", children: [
1820
1862
  /* @__PURE__ */ o("div", { className: "flex items-center gap-m flex-wrap hover:bg-gray-100", children: [
1821
- /* @__PURE__ */ e("button", { className: `${r.includes(a) ? "" : "-rotate-90"} transition-all duration-300`, onClick: () => n(a), children: /* @__PURE__ */ e(C, { icon: "angle_down_outline", color: P.texts.subtext }) }),
1822
- /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-w-[20px] min-h-[20px] w-fit h-[20px] mx-1 bg-primary-medium rounded-full", children: /* @__PURE__ */ e("p", { className: "text-sm text-primary", children: ((i = l == null ? void 0 : l.tasks) == null ? void 0 : i.length) === 0 ? 1 : (u = l == null ? void 0 : l.tasks) == null ? void 0 : u.length }) }),
1823
- /* @__PURE__ */ e(Oe, { task: (l == null ? void 0 : l.task) ?? "" }),
1824
- /* @__PURE__ */ e(Re, { id: a, priority: l == null ? void 0 : l.priority }),
1825
- /* @__PURE__ */ e(Ie, { startDate: l == null ? void 0 : l.startDate, endDate: l == null ? void 0 : l.endDate }),
1863
+ /* @__PURE__ */ e("button", { className: `${r.includes(a) ? "" : "-rotate-90"} transition-all duration-300`, onClick: () => n(a), children: /* @__PURE__ */ e(C, { icon: "angle_down_outline", color: S.texts.subtext }) }),
1864
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-w-[20px] min-h-[20px] w-fit h-[20px] mx-1 bg-primary-medium rounded-full", children: /* @__PURE__ */ e("p", { className: "text-sm text-primary", children: ((i = s == null ? void 0 : s.tasks) == null ? void 0 : i.length) === 0 ? 1 : (u = s == null ? void 0 : s.tasks) == null ? void 0 : u.length }) }),
1865
+ /* @__PURE__ */ e(He, { task: (s == null ? void 0 : s.task) ?? "" }),
1866
+ /* @__PURE__ */ e(Qe, { id: a, priority: s == null ? void 0 : s.priority }),
1867
+ /* @__PURE__ */ e(Ue, { startDate: s == null ? void 0 : s.startDate, endDate: s == null ? void 0 : s.endDate }),
1826
1868
  /* @__PURE__ */ o("button", { className: "gap-s bg-gray-100 rounded-md h-[30px] flex justify-center items-center w-fit px-m hover:bg-gray-200", children: [
1827
- /* @__PURE__ */ e(C, { icon: "subtasks", size: "xs", strokeWidth: 5, color: P.texts.subtext }),
1828
- /* @__PURE__ */ e("p", { children: ((c = l == null ? void 0 : l.tasks) == null ? void 0 : c.length) === 0 ? 1 : (p = l == null ? void 0 : l.tasks) == null ? void 0 : p.length })
1869
+ /* @__PURE__ */ e(C, { icon: "subtasks", size: "xs", strokeWidth: 5, color: S.texts.subtext }),
1870
+ /* @__PURE__ */ e("p", { children: ((c = s == null ? void 0 : s.tasks) == null ? void 0 : c.length) === 0 ? 1 : (x = s == null ? void 0 : s.tasks) == null ? void 0 : x.length })
1829
1871
  ] })
1830
1872
  ] }),
1831
- r.includes(a) && /* @__PURE__ */ e("div", { className: "ml-[30px]", children: ((d = l == null ? void 0 : l.tasks) == null ? void 0 : d.length) > 0 ? (g = l == null ? void 0 : l.tasks) == null ? void 0 : g.map((m) => /* @__PURE__ */ e(We, { id: m == null ? void 0 : m.id })) : /* @__PURE__ */ e(Qt, { id: l == null ? void 0 : l.id }) })
1873
+ r.includes(a) && /* @__PURE__ */ e("div", { className: "ml-[30px]", children: ((d = s == null ? void 0 : s.tasks) == null ? void 0 : d.length) > 0 ? (f = s == null ? void 0 : s.tasks) == null ? void 0 : f.map((p) => /* @__PURE__ */ e(Ve, { id: p == null ? void 0 : p.id })) : /* @__PURE__ */ e(Yt, { id: s == null ? void 0 : s.id }) })
1832
1874
  ] })) : null;
1833
- }, Ht = () => {
1875
+ }, Xt = () => {
1834
1876
  var n;
1835
- const { tasksProject: a, projectID: t } = Y();
1836
- if (a != null && a.isFetching || a != null && a.isLoading) return /* @__PURE__ */ e(ze, {});
1837
- let r = [...(n = a == null ? void 0 : a.data) == null ? void 0 : n.filter((l) => l.isPrincipalTask)];
1838
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: /* @__PURE__ */ e(Ot, { project: t, children: r == null ? void 0 : r.sort((l, s) => l.orden - s.orden).map((l) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-m border-b border-gray-200 pb-m", children: /* @__PURE__ */ e(We, { id: l.id }) })) }) });
1839
- }, Vt = ({
1877
+ const { tasksProject: a, projectID: t } = X();
1878
+ if (a != null && a.isFetching || a != null && a.isLoading) return /* @__PURE__ */ e(Ke, {});
1879
+ let r = [...(n = a == null ? void 0 : a.data) == null ? void 0 : n.filter((s) => s.isPrincipalTask)];
1880
+ return /* @__PURE__ */ e("div", { className: "flex flex-col gap-m", children: /* @__PURE__ */ e(Qt, { project: t, children: r == null ? void 0 : r.sort((s, l) => s.orden - l.orden).map((s) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-m border-b border-gray-200 pb-m", children: /* @__PURE__ */ e(Ve, { id: s.id }) })) }) });
1881
+ }, Jt = ({
1840
1882
  setPath: a,
1841
1883
  setProject: t
1842
1884
  }) => {
1843
- const [r, n] = y([]), [l, s] = y(!0), [i, u] = y(0), [c, p] = y(10), [d, g] = y(0), [m, x] = y("nombre"), { defineFields: w } = $(), { tasks_api: f } = E(), v = async (h, S) => {
1885
+ const [r, n] = y([]), [s, l] = y(!0), [i, u] = y(0), [c, x] = y(10), [d, f] = y(0), [p, m] = y("nombre"), { filters: g, defineFields: b } = $(), { tasks_api: v } = E(), { user: w } = W(), N = async (h, q) => {
1886
+ var P, D, I;
1844
1887
  try {
1845
- s(!0);
1846
- const D = await f.get("/api/listado_campanias", {
1888
+ l(!0);
1889
+ const L = {
1890
+ filters: {
1891
+ search: (g == null ? void 0 : g.taskName) ?? "",
1892
+ responsable: {
1893
+ idUser: w.id,
1894
+ responsableType: (P = g == null ? void 0 : g.responsable) == null ? void 0 : P.responsableType
1895
+ },
1896
+ ejecutivo: (g == null ? void 0 : g.ejecutivo) ?? ""
1897
+ }
1898
+ };
1899
+ console.log("FiltrosPARAMS: ", L);
1900
+ const B = await v.get("/api/listado_campanias", {
1847
1901
  params: {
1848
1902
  pagination: {
1849
1903
  page: h,
1850
- pageSize: S
1904
+ pageSize: q
1851
1905
  },
1852
- orderBy: m
1853
- // Agregar orderBy a los parámetros
1854
- //agrega consulta de filtros
1906
+ orderBy: p,
1907
+ ...L
1855
1908
  }
1856
- }), j = z(D.data);
1857
- n(j), g(D.data.meta.total);
1858
- } catch (D) {
1859
- console.error("Error fetching data en Lista Campaña:", D);
1909
+ }), J = K(B == null ? void 0 : B.data);
1910
+ n(J), f((I = (D = B == null ? void 0 : B.data) == null ? void 0 : D.meta) == null ? void 0 : I.total);
1911
+ } catch (L) {
1912
+ console.error("Error fetching data en Lista Campaña:", L);
1860
1913
  } finally {
1861
- s(!1);
1914
+ l(!1);
1915
+ }
1916
+ }, T = async () => {
1917
+ try {
1918
+ const h = await v.get("/api/obtener-comerciales");
1919
+ return [...Pe].map((P) => (P.id === "ejecutivo" && (P.options = h.data.map((D) => ({
1920
+ id: D.nombre,
1921
+ name: D.nombre
1922
+ }))), P));
1923
+ } catch (h) {
1924
+ return console.error("Error fetching salesman data:", h), [...Pe];
1862
1925
  }
1863
1926
  };
1864
- _(() => {
1865
- w([
1866
- {
1867
- label: "Búsqueda",
1868
- type: "text",
1869
- id: "search"
1870
- },
1871
- {
1872
- label: "Responsable",
1873
- type: "select",
1874
- id: "responsable.responsableType",
1875
- options: [
1876
- { id: "yo_y_mis_equipos", name: "Yo y mis equipos" },
1877
- { id: "mis_equipos", name: "Mis equipos" },
1878
- { id: "yo", name: "Yo" }
1879
- ]
1880
- },
1881
- {
1882
- label: "Ejecutivo",
1883
- type: "text",
1884
- id: "ejecutivo"
1885
- }
1886
- ]);
1887
- }, []), _(() => {
1927
+ F(() => {
1928
+ (async () => {
1929
+ const q = await T();
1930
+ b(q);
1931
+ })();
1932
+ }, []), F(() => {
1888
1933
  const h = Math.floor(i / c) + 1;
1889
- v(h, c);
1890
- }, [i, c, m]);
1891
- const b = (h) => {
1892
- u(h.first), p(h.rows);
1893
- }, N = [
1934
+ N(h, c);
1935
+ }, [i, c, p, g]);
1936
+ const _ = (h) => {
1937
+ u(h.first), x(h.rows);
1938
+ }, A = [
1894
1939
  { label: "5 filas", value: 5 },
1895
1940
  { label: "10 filas", value: 10 },
1896
1941
  { label: "15 filas", value: 15 },
1897
1942
  { label: "20 filas", value: 20 },
1898
1943
  { label: "25 filas", value: 25 },
1899
1944
  { label: "50 filas", value: 50 }
1900
- ], F = (h) => {
1901
- const S = parseInt(h.target.value, 10);
1902
- p(S), b({ first: 0, rows: S });
1903
- }, T = (h) => {
1904
- x((S) => S === h ? `${h}:desc` : h);
1905
- }, A = (h) => m === h ? "↑↓" : m === `${h}:desc` ? "↓↑" : "↑↓";
1906
- return /* @__PURE__ */ e("div", { className: "table-container", children: l ? /* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(ze, {}) }) : /* @__PURE__ */ o(q, { children: [
1945
+ ], R = (h) => {
1946
+ const q = parseInt(h.target.value, 10);
1947
+ x(q), _({ first: 0, rows: q });
1948
+ }, M = (h) => {
1949
+ m((q) => q === h ? `${h}:desc` : h);
1950
+ }, z = (h) => p === h ? "↑↓" : p === `${h}:desc` ? "↓↑" : "↑↓";
1951
+ return /* @__PURE__ */ e("div", { className: "table-container", children: s ? /* @__PURE__ */ e("div", { style: { width: "100%" }, children: /* @__PURE__ */ e(Ke, {}) }) : /* @__PURE__ */ o(j, { children: [
1907
1952
  /* @__PURE__ */ o(
1908
1953
  "table",
1909
1954
  {
@@ -1914,15 +1959,15 @@ const zt = () => {
1914
1959
  borderSpacing: "0"
1915
1960
  },
1916
1961
  children: [
1917
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
1918
- /* @__PURE__ */ o("th", { onClick: () => T("nombre"), children: [
1919
- /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: A("nombre") }),
1962
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { style: { color: "#F5F5F5" }, children: [
1963
+ /* @__PURE__ */ o("th", { onClick: () => M("nombre"), children: [
1964
+ /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: z("nombre") }),
1920
1965
  "Campaña"
1921
1966
  ] }),
1922
1967
  /* @__PURE__ */ e(
1923
1968
  "th",
1924
1969
  {
1925
- onClick: () => T("inicia"),
1970
+ onClick: () => M("inicia"),
1926
1971
  style: { textAlign: "center", whiteSpace: "nowrap" },
1927
1972
  children: /* @__PURE__ */ o(
1928
1973
  "div",
@@ -1933,7 +1978,7 @@ const zt = () => {
1933
1978
  width: "fit-content"
1934
1979
  },
1935
1980
  children: [
1936
- /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: A("inicia") }),
1981
+ /* @__PURE__ */ e("label", { style: { color: "#C4C4C4", fontSize: "10px" }, children: z("inicia") }),
1937
1982
  " ",
1938
1983
  /* @__PURE__ */ e(
1939
1984
  C,
@@ -1953,7 +1998,7 @@ const zt = () => {
1953
1998
  /* @__PURE__ */ e(
1954
1999
  "th",
1955
2000
  {
1956
- onClick: () => T("termina"),
2001
+ onClick: () => M("termina"),
1957
2002
  style: { whiteSpace: "nowrap", textAlign: "center" },
1958
2003
  children: /* @__PURE__ */ o(
1959
2004
  "div",
@@ -1971,7 +2016,7 @@ const zt = () => {
1971
2016
  color: "#C4C4C4",
1972
2017
  fontSize: "10px"
1973
2018
  },
1974
- children: A("termina")
2019
+ children: z("termina")
1975
2020
  }
1976
2021
  ),
1977
2022
  /* @__PURE__ */ e(
@@ -1992,98 +2037,111 @@ const zt = () => {
1992
2037
  /* @__PURE__ */ e("th", { children: "Status" }),
1993
2038
  /* @__PURE__ */ e("th", { children: "Responsable" })
1994
2039
  ] }) }),
1995
- /* @__PURE__ */ e("tbody", { children: r == null ? void 0 : r.map((h, S) => {
1996
- var D, j, M, B, R, U, Q, de, ue, me, pe, he, xe, ge, fe, be;
1997
- return /* @__PURE__ */ o("tr", { className: "table-row", children: [
1998
- /* @__PURE__ */ e("td", { children: (D = h == null ? void 0 : h.campania) == null ? void 0 : D.nombre }),
1999
- /* @__PURE__ */ o("td", { children: [
2000
- " ",
2001
- (j = h == null ? void 0 : h.campania) == null ? void 0 : j.inicia
2002
- ] }),
2003
- /* @__PURE__ */ e("td", { children: (M = h == null ? void 0 : h.campania) == null ? void 0 : M.termina }),
2004
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o(
2005
- "div",
2006
- {
2007
- style: {
2008
- display: "flex",
2009
- alignItems: "center",
2010
- gap: "15px",
2011
- padding: "none",
2012
- fontSize: "10px",
2013
- width: "auto",
2014
- minWidth: "170px"
2015
- },
2016
- children: [
2017
- /* @__PURE__ */ o(
2018
- "label",
2019
- {
2020
- style: {
2021
- width: "50px",
2022
- minWidth: "50px",
2023
- textAlign: "right",
2024
- color: "#000"
2025
- },
2026
- children: [
2027
- h == null ? void 0 : h.progreso,
2028
- "%"
2029
- ]
2030
- }
2031
- ),
2032
- /* @__PURE__ */ e(
2033
- "div",
2034
- {
2035
- style: {
2036
- position: "relative",
2037
- height: "10px",
2038
- flex: 1,
2039
- backgroundColor: "#C4C4C4",
2040
- borderRadius: "10px",
2041
- overflow: "hidden"
2042
- },
2043
- children: /* @__PURE__ */ e(
2040
+ /* @__PURE__ */ e("tbody", { children: r == null ? void 0 : r.map((h, q) => {
2041
+ var P, D, I, L, B, J, pe, he, xe, ge, fe, be, ye, we, Ne, ve;
2042
+ return /* @__PURE__ */ o(
2043
+ "tr",
2044
+ {
2045
+ className: "table-row",
2046
+ onClick: () => {
2047
+ t({
2048
+ id: h == null ? void 0 : h.id,
2049
+ project: h == null ? void 0 : h.nombre
2050
+ }), a("kanban-campania");
2051
+ },
2052
+ children: [
2053
+ /* @__PURE__ */ e("td", { children: (P = h == null ? void 0 : h.campania) == null ? void 0 : P.nombre }),
2054
+ /* @__PURE__ */ o("td", { children: [
2055
+ " ",
2056
+ (D = h == null ? void 0 : h.campania) == null ? void 0 : D.inicia
2057
+ ] }),
2058
+ /* @__PURE__ */ e("td", { children: (I = h == null ? void 0 : h.campania) == null ? void 0 : I.termina }),
2059
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o(
2060
+ "div",
2061
+ {
2062
+ style: {
2063
+ display: "flex",
2064
+ alignItems: "center",
2065
+ gap: "15px",
2066
+ padding: "none",
2067
+ fontSize: "10px",
2068
+ width: "auto",
2069
+ minWidth: "170px"
2070
+ },
2071
+ children: [
2072
+ /* @__PURE__ */ o(
2073
+ "label",
2074
+ {
2075
+ style: {
2076
+ width: "50px",
2077
+ minWidth: "50px",
2078
+ textAlign: "right",
2079
+ color: "#000"
2080
+ },
2081
+ children: [
2082
+ h == null ? void 0 : h.progreso,
2083
+ "%"
2084
+ ]
2085
+ }
2086
+ ),
2087
+ /* @__PURE__ */ e(
2044
2088
  "div",
2045
2089
  {
2046
2090
  style: {
2047
- position: "absolute",
2048
- top: 0,
2049
- left: 0,
2050
- height: "100%",
2051
- width: `${h.progreso}%`,
2052
- backgroundColor: h.progreso === 100 ? "#039B59" : h.progreso > 50 ? "#3658C1" : h.progreso > 0 ? "#DC8921" : "#C4C4C4",
2091
+ position: "relative",
2092
+ height: "10px",
2093
+ flex: 1,
2094
+ backgroundColor: "#C4C4C4",
2053
2095
  borderRadius: "10px",
2054
- transition: "width 0.3s ease-in-out"
2055
- }
2096
+ overflow: "hidden"
2097
+ },
2098
+ children: /* @__PURE__ */ e(
2099
+ "div",
2100
+ {
2101
+ style: {
2102
+ position: "absolute",
2103
+ top: 0,
2104
+ left: 0,
2105
+ height: "100%",
2106
+ width: `${h.progreso}%`,
2107
+ backgroundColor: h.progreso === 100 ? "#039B59" : h.progreso > 50 ? "#3658C1" : h.progreso > 0 ? "#DC8921" : "#C4C4C4",
2108
+ borderRadius: "10px",
2109
+ transition: "width 0.3s ease-in-out"
2110
+ }
2111
+ }
2112
+ )
2056
2113
  }
2057
2114
  )
2058
- }
2059
- )
2060
- ]
2061
- }
2062
- ) }),
2063
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("div", { className: "avatar-container", children: [
2064
- /* @__PURE__ */ o(J, { className: "w-[28px] h-[28px]", children: [
2065
- /* @__PURE__ */ e(
2066
- Z,
2067
- {
2068
- src: `${Le}${(de = (Q = (U = (R = (B = h == null ? void 0 : h.campania) == null ? void 0 : B.responsable) == null ? void 0 : R.imagen) == null ? void 0 : U.formats) == null ? void 0 : Q.thumbnail) == null ? void 0 : de.url}`,
2069
- alt: (pe = (me = (ue = h == null ? void 0 : h.campania) == null ? void 0 : ue.responsable) == null ? void 0 : me.nombre) == null ? void 0 : pe.charAt(
2070
- 0
2071
- )
2115
+ ]
2072
2116
  }
2073
- ),
2074
- /* @__PURE__ */ e(
2075
- k,
2076
- {
2077
- style: {
2078
- boxShadow: "10px 5px 10px rgba(0, 0, 0, 0.5)"
2079
- },
2080
- children: (ge = (xe = (he = h == null ? void 0 : h.campania) == null ? void 0 : he.responsable) == null ? void 0 : xe.nombre) == null ? void 0 : ge.charAt(0)
2081
- }
2082
- )
2083
- ] }),
2084
- /* @__PURE__ */ e("span", { style: { marginLeft: "8px", fontSize: "10px" }, children: (be = (fe = h == null ? void 0 : h.campania) == null ? void 0 : fe.responsable) == null ? void 0 : be.nombre })
2085
- ] }) })
2086
- ] }, S);
2117
+ ) }),
2118
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("div", { className: "avatar-container", children: [
2119
+ /* @__PURE__ */ o(k, { className: "avatar w-[28px] h-[28px]", children: [
2120
+ /* @__PURE__ */ e(
2121
+ ee,
2122
+ {
2123
+ src: `${We}${(he = (pe = (J = (B = (L = h == null ? void 0 : h.campania) == null ? void 0 : L.responsable) == null ? void 0 : B.imagen) == null ? void 0 : J.formats) == null ? void 0 : pe.thumbnail) == null ? void 0 : he.url}`,
2124
+ alt: (fe = (ge = (xe = h == null ? void 0 : h.campania) == null ? void 0 : xe.responsable) == null ? void 0 : ge.nombre) == null ? void 0 : fe.charAt(
2125
+ 0
2126
+ )
2127
+ }
2128
+ ),
2129
+ /* @__PURE__ */ e(
2130
+ te,
2131
+ {
2132
+ style: {
2133
+ boxShadow: "10px 5px 10px rgba(0, 0, 0, 0.5)"
2134
+ },
2135
+ children: (we = (ye = (be = h == null ? void 0 : h.campania) == null ? void 0 : be.responsable) == null ? void 0 : ye.nombre) == null ? void 0 : we.charAt(0)
2136
+ }
2137
+ )
2138
+ ] }),
2139
+ /* @__PURE__ */ e("span", { style: { marginLeft: "8px", fontSize: "10px" }, children: (ve = (Ne = h == null ? void 0 : h.campania) == null ? void 0 : Ne.responsable) == null ? void 0 : ve.nombre })
2140
+ ] }) })
2141
+ ]
2142
+ },
2143
+ q
2144
+ );
2087
2145
  }) })
2088
2146
  ]
2089
2147
  }
@@ -2107,7 +2165,6 @@ const zt = () => {
2107
2165
  textAlign: "left",
2108
2166
  width: "auto",
2109
2167
  height: "auto",
2110
- padding: "12px",
2111
2168
  whiteSpace: "nowrap"
2112
2169
  },
2113
2170
  children: [
@@ -2118,13 +2175,13 @@ const zt = () => {
2118
2175
  }
2119
2176
  ),
2120
2177
  /* @__PURE__ */ e(
2121
- tt,
2178
+ st,
2122
2179
  {
2123
2180
  first: i,
2124
2181
  rows: c,
2125
2182
  totalRecords: d,
2126
2183
  rowsPerPageOptions: [5, 10, 20, 50],
2127
- onPageChange: b,
2184
+ onPageChange: _,
2128
2185
  className: "pagination",
2129
2186
  template: "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink"
2130
2187
  }
@@ -2144,8 +2201,8 @@ const zt = () => {
2144
2201
  {
2145
2202
  className: "select",
2146
2203
  value: c,
2147
- onChange: (h) => F(h),
2148
- children: N.map((h) => /* @__PURE__ */ e(
2204
+ onChange: (h) => R(h),
2205
+ children: A.map((h) => /* @__PURE__ */ e(
2149
2206
  "option",
2150
2207
  {
2151
2208
  className: "option-select",
@@ -2164,51 +2221,51 @@ const zt = () => {
2164
2221
  }
2165
2222
  )
2166
2223
  ] }) });
2167
- }, Gt = ({ path: a, tab: t, setPath: r, project: n, setProject: l }) => {
2168
- const s = {
2169
- "kanban-general": { kanban: /* @__PURE__ */ e(Rt, {}) },
2224
+ }, Zt = ({ path: a, tab: t, setPath: r, project: n, setProject: s }) => {
2225
+ const l = {
2226
+ "kanban-general": { kanban: /* @__PURE__ */ e(Ut, {}) },
2170
2227
  "lista-campanias": {
2171
- lista: /* @__PURE__ */ e(Vt, { setPath: r, setProject: l }),
2228
+ lista: /* @__PURE__ */ e(Jt, { setPath: r, setProject: s }),
2172
2229
  gantt: /* @__PURE__ */ e("div", { children: "gantt-campanias" })
2173
2230
  },
2174
2231
  "kanban-campania": {
2175
- kanban: /* @__PURE__ */ e(qt, {}),
2176
- lista: /* @__PURE__ */ e(Ht, {}),
2232
+ kanban: /* @__PURE__ */ e(Et, {}),
2233
+ lista: /* @__PURE__ */ e(Xt, {}),
2177
2234
  gantt: /* @__PURE__ */ e("div", { children: "kanban-campania-gantt" })
2178
2235
  }
2179
2236
  };
2180
- return a === "kanban-campania" ? /* @__PURE__ */ e(ut, { project: n == null ? void 0 : n.id, children: s[a][t] }) : s[a][t];
2181
- }, Yt = ({ path: a }) => /* @__PURE__ */ e(lt, { children: /* @__PURE__ */ e(() => {
2182
- const { selectPath: r, updateFilters: n, applyFilters: l } = $(), [s, i] = y("kanban"), [u, c] = y(a), [p, d] = y({
2237
+ return a === "kanban-campania" ? /* @__PURE__ */ e(xt, { project: n == null ? void 0 : n.id, children: l[a][t] }) : l[a][t];
2238
+ }, kt = ({ path: a }) => /* @__PURE__ */ e(ct, { children: /* @__PURE__ */ e(() => {
2239
+ const { selectPath: r, updateFilters: n, applyFilters: s } = $(), [l, i] = y("kanban"), [u, c] = y(a), [x, d] = y({
2183
2240
  id: 1839,
2184
2241
  project: "Kanban de Campania"
2185
- }), [g, m] = y(""), x = L(null);
2186
- _(() => {
2242
+ }), [f, p] = y(""), m = O(null);
2243
+ F(() => {
2187
2244
  i("kanban"), r(u);
2188
- }, [a]), _(() => {
2189
- (g == null ? void 0 : g.trim()) === "" && n({
2245
+ }, [a]), F(() => {
2246
+ (f == null ? void 0 : f.trim()) === "" && n({
2190
2247
  name: "taskName",
2191
2248
  value: null
2192
- }), l();
2193
- }, [g]);
2194
- const w = (N) => ({
2249
+ }), s();
2250
+ }, [f]);
2251
+ const g = (N) => ({
2195
2252
  "kanban-general": "Kanban General",
2196
2253
  "lista-campanias": "Campanias",
2197
- "kanban-campania": `Kanban de ${p.project}`
2198
- })[N], f = (N) => {
2254
+ "kanban-campania": `Kanban de ${x.project}`
2255
+ })[N], b = (N) => {
2199
2256
  c(N);
2200
- }, v = ["lista-campanias", "kanban-campania"], b = {
2257
+ }, v = ["lista-campanias", "kanban-campania"], w = {
2201
2258
  "lista-campanias": ["lista", "gantt"],
2202
2259
  "kanban-campania": ["kanban", "lista", "gantt"]
2203
2260
  };
2204
2261
  return /* @__PURE__ */ o("div", { className: "bg-bg-card p-m rounded-lg border border-gray-200 flex flex-col gap-m w-full h-full min-h-[100%] relative overflow-hidden", children: [
2205
2262
  /* @__PURE__ */ o("div", { className: "w-full justify-between flex items-end border-b border-gray-200 pb-m px-l flex-wrap gap-l", children: [
2206
2263
  /* @__PURE__ */ o("div", { className: "flex gap-xl", children: [
2207
- /* @__PURE__ */ e("h2", { className: "text-texts font-medium", children: w(u) }),
2264
+ /* @__PURE__ */ e("h2", { className: "text-texts font-medium", children: g(u) }),
2208
2265
  v.includes(u) && /* @__PURE__ */ e(
2209
- nt,
2266
+ it,
2210
2267
  {
2211
- tabs: b[u],
2268
+ tabs: w[u],
2212
2269
  renderItem: (N) => {
2213
2270
  i(N);
2214
2271
  }
@@ -2219,13 +2276,13 @@ const zt = () => {
2219
2276
  /* @__PURE__ */ e(
2220
2277
  "input",
2221
2278
  {
2222
- onChange: Pe(
2279
+ onChange: $e(
2223
2280
  (N) => {
2224
- var F, T, A;
2281
+ var T, _, A;
2225
2282
  n({
2226
2283
  name: "taskName",
2227
- value: (T = (F = N == null ? void 0 : N.target) == null ? void 0 : F.value) == null ? void 0 : T.trim()
2228
- }), m((A = N == null ? void 0 : N.target) == null ? void 0 : A.value);
2284
+ value: (_ = (T = N == null ? void 0 : N.target) == null ? void 0 : T.value) == null ? void 0 : _.trim()
2285
+ }), p((A = N == null ? void 0 : N.target) == null ? void 0 : A.value);
2229
2286
  },
2230
2287
  1e3
2231
2288
  ),
@@ -2235,15 +2292,15 @@ const zt = () => {
2235
2292
  }
2236
2293
  ),
2237
2294
  /* @__PURE__ */ e(
2238
- rt,
2295
+ ot,
2239
2296
  {
2240
- filterChildren: x,
2297
+ filterChildren: m,
2241
2298
  children: /* @__PURE__ */ e(
2242
2299
  "div",
2243
2300
  {
2244
- ref: x,
2301
+ ref: m,
2245
2302
  className: "w-max max-w-[400px] h-fit bg-bg-card shadow-lg rounded-lg p-l",
2246
- children: /* @__PURE__ */ e(st, {})
2303
+ children: /* @__PURE__ */ e(dt, {})
2247
2304
  }
2248
2305
  )
2249
2306
  }
@@ -2251,34 +2308,34 @@ const zt = () => {
2251
2308
  ] })
2252
2309
  ] }),
2253
2310
  /* @__PURE__ */ e("div", { className: "overflow-auto scrollbar-none", children: /* @__PURE__ */ e(
2254
- Gt,
2311
+ Zt,
2255
2312
  {
2256
2313
  path: u,
2257
- tab: s,
2258
- setPath: f,
2259
- project: p,
2314
+ tab: l,
2315
+ setPath: b,
2316
+ project: x,
2260
2317
  setProject: d
2261
2318
  }
2262
2319
  ) })
2263
2320
  ] });
2264
- }, {}) }), Xt = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2321
+ }, {}) }), ea = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2265
2322
  /* @__PURE__ */ e("div", { className: "w-10 h-10 bg-primary-regular rounded-full animate-pulse" }),
2266
2323
  /* @__PURE__ */ e("p", { className: "text-l text-texts-enfasis", children: "un momento..." }),
2267
2324
  /* @__PURE__ */ e("p", { className: "text-sm text-texts-placeholder", children: "estamos buscando tu usuario" })
2268
- ] }) }) }), Jt = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2325
+ ] }) }) }), ta = () => /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ o("div", { className: "text-2xl font-bold flex flex-col items-center", children: [
2269
2326
  /* @__PURE__ */ e("div", { className: "w-10 h-10 bg-primary-regular rounded-full animate-pulse" }),
2270
2327
  /* @__PURE__ */ e("p", { className: "text-l text-texts-enfasis", children: "No encontramos tu acceso" }),
2271
2328
  /* @__PURE__ */ e("p", { className: "text-sm text-texts-placeholder", children: "por favor, contacta al administrador" })
2272
- ] }) }) }), ua = ({ path: a, user: t, url: r }) => {
2273
- const n = new Ue();
2274
- if (!t) return /* @__PURE__ */ e(Xt, {});
2275
- if (!t.accessToken) return /* @__PURE__ */ e(Jt, {});
2276
- let l = { user: t, url: r };
2277
- return /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(dt, { ...l, children: /* @__PURE__ */ e(ct, { ...l, children: /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ o(Qe, { client: n, children: [
2278
- /* @__PURE__ */ e(Yt, { path: a }),
2329
+ ] }) }) }), xa = ({ path: a, user: t, url: r }) => {
2330
+ const n = new Ge();
2331
+ if (!t) return /* @__PURE__ */ e(ea, {});
2332
+ if (!t.accessToken) return /* @__PURE__ */ e(ta, {});
2333
+ let s = { user: t, url: r };
2334
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(ht, { ...s, children: /* @__PURE__ */ e(pt, { ...s, children: /* @__PURE__ */ e("div", { className: "w-full h-full min-h-[100%] relative", children: /* @__PURE__ */ o(Ye, { client: n, children: [
2335
+ /* @__PURE__ */ e(kt, { path: a }),
2279
2336
  " "
2280
2337
  ] }) }) }) }) });
2281
2338
  };
2282
2339
  export {
2283
- ua as AppTasks
2340
+ xa as AppTasks
2284
2341
  };