@imj_media/tareas 1.4.2 → 1.4.4

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,7 +1,7 @@
1
1
  import { jsxs as w, Fragment as I, jsx as t } from "react/jsx-runtime";
2
2
  import "@imj_media/imj-ui/styles.css";
3
3
  import { useQuery as it, useQueryClient as st, useMutation as X, useInfiniteQuery as ht, QueryClient as ce, QueryClientProvider as we } from "@tanstack/react-query";
4
- import { useState as N, useRef as Z, useEffect as M, createContext as nt, useContext as lt } from "react";
4
+ import { useState as N, useRef as Z, useEffect as S, createContext as nt, useContext as lt } from "react";
5
5
  import { Icons as F, Tooltip as H, TooltipV2 as $t } from "@imj_media/tasks-modules";
6
6
  import ct from "react-dom";
7
7
  import Et from "axios";
@@ -78,7 +78,7 @@ const h = {
78
78
  }) => {
79
79
  const { position: n, setElementPosition: a } = bt(), s = Z(null), o = ({ children: i }) => {
80
80
  const [c, l] = N();
81
- return M(() => {
81
+ return S(() => {
82
82
  var p, d;
83
83
  e.current && l(
84
84
  ((n == null ? void 0 : n.x) ?? 0) - (((d = (p = e.current) == null ? void 0 : p.getBoundingClientRect()) == null ? void 0 : d.width) ?? 0)
@@ -132,18 +132,18 @@ const h = {
132
132
  }), e;
133
133
  }, Lt = nt({}), je = ({ children: r }) => {
134
134
  const [e, n] = N({}), [a, s] = N({}), [o, i] = N([]), [c, l] = N(""), p = ({ name: g, value: m }) => {
135
- function x(b) {
136
- return !isNaN(b) && b !== null && b !== "" ? parseFloat(b) : null;
135
+ function x(f) {
136
+ return !isNaN(f) && f !== null && f !== "" ? parseFloat(f) : null;
137
137
  }
138
138
  let y = x(m);
139
- s((b) => {
140
- let v = { ...b }, q = o == null ? void 0 : o.find(
139
+ s((f) => {
140
+ let v = { ...f }, q = o == null ? void 0 : o.find(
141
141
  (P) => P.label.toLowerCase().replace(/ /g, "_") === g
142
142
  );
143
143
  return q ? v[q.id] = y ?? m : v[g] = y ?? m, v;
144
144
  });
145
145
  };
146
- M(() => {
146
+ S(() => {
147
147
  let g = o.map((m) => m.id === "owner.config" ? [m.id, "yo_y_mis_equipos"] : m.id === "dependency" ? [m.id, "ambas"] : [m.id, null]);
148
148
  s((m) => {
149
149
  let x = { search: m == null ? void 0 : m.search, taskName: m == null ? void 0 : m.taskName };
@@ -251,7 +251,7 @@ const G = ({
251
251
  ] });
252
252
  }, Me = ({ error: r, options: e, onSelect: n, initialValue: a }) => {
253
253
  const [s, o] = N(!1), [i, c] = N((a == null ? void 0 : a.name) ?? null);
254
- return M(() => {
254
+ return S(() => {
255
255
  a && c(a);
256
256
  }, [a]), /* @__PURE__ */ w("div", { className: "tw-relative", children: [
257
257
  /* @__PURE__ */ w("div", { onBlur: () => o(!1), onClick: () => o(!s), className: `tw-z-[1] tw-cursor-pointer tw-w-full tw-bg-bg-card ${r ? "tw-shadow-danger-regular tw-border-2 tw-border-danger-regular" : "tw-shadow-input"} tw-h-[30px] tw-rounded-md tw-flex tw-justify-between tw-items-center tw-pl-2 ${r ? "tw-text-danger-regular" : i ? "tw-text-texts-subtext" : "tw-text-texts-placeholder"}`, children: [
@@ -353,11 +353,11 @@ class Ee {
353
353
  name: e.responsable.nombre,
354
354
  image: (c = (i = (o = (s = (a = e.responsable) == null ? void 0 : a.userOBP) == null ? void 0 : s.imagen) == null ? void 0 : o.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : c.url
355
355
  }), (l = e == null ? void 0 : e.equipo) != null && l.miembros && e.equipo.miembros.forEach((x) => {
356
- var y, b, v, q;
356
+ var y, f, v, q;
357
357
  n != null && n.find((P) => P.id === x.idUser.id) || x.idUser && n.push({
358
358
  id: x.idUser.id,
359
359
  name: x.idUser.nombre,
360
- image: (q = (v = (b = (y = x == null ? void 0 : x.userOBP) == null ? void 0 : y.imagen) == null ? void 0 : b.formats) == null ? void 0 : v.thumbnail) == null ? void 0 : q.url
360
+ image: (q = (v = (f = (y = x == null ? void 0 : x.userOBP) == null ? void 0 : y.imagen) == null ? void 0 : f.formats) == null ? void 0 : v.thumbnail) == null ? void 0 : q.url
361
361
  });
362
362
  }), {
363
363
  paused: e == null ? void 0 : e.pausada,
@@ -446,17 +446,17 @@ const De = async ({ filters: r, tasks_api: e, project: n }) => {
446
446
  }
447
447
  );
448
448
  }, U = () => lt(Qt), Ot = nt({}), Ut = ({ children: r, project: e }) => {
449
- var b;
449
+ var f;
450
450
  const [n, a] = N([]), [s, o] = N(!1), [i, c] = N([]), { tasks_api: l } = Q(), { filters: p } = V(), { user: d } = U(), [_, k] = N({
451
451
  owner: {
452
452
  user: d.id,
453
- config: ((b = p == null ? void 0 : p.owner) == null ? void 0 : b.config) ?? "yo_y_mis_equipos"
453
+ config: ((f = p == null ? void 0 : p.owner) == null ? void 0 : f.config) ?? "yo_y_mis_equipos"
454
454
  },
455
455
  project: {
456
456
  id: e
457
457
  }
458
458
  });
459
- M(() => {
459
+ S(() => {
460
460
  var v;
461
461
  if (Object.keys(p).length > 0) {
462
462
  const q = {
@@ -591,7 +591,7 @@ const Ie = async ({
591
591
  return J(P.data).map(Ht.toAtrasoReasons);
592
592
  }, _ = async ({
593
593
  taskId: P,
594
- motivoId: S,
594
+ motivoId: A,
595
595
  projectID: E
596
596
  }) => {
597
597
  try {
@@ -599,7 +599,7 @@ const Ie = async ({
599
599
  data: {
600
600
  inicio: /* @__PURE__ */ new Date(),
601
601
  fin: null,
602
- motivo: S,
602
+ motivo: A,
603
603
  proyecto: E,
604
604
  tarea: P,
605
605
  creada_por: n == null ? void 0 : n.id
@@ -611,8 +611,8 @@ const Ie = async ({
611
611
  }, k = async (P) => {
612
612
  try {
613
613
  return (await e.delete(`/api/atrasos/${P}`)).data;
614
- } catch (S) {
615
- console.log("error", S);
614
+ } catch (A) {
615
+ console.log("error", A);
616
616
  }
617
617
  }, g = async (P) => {
618
618
  try {
@@ -621,20 +621,20 @@ const Ie = async ({
621
621
  fin: /* @__PURE__ */ new Date()
622
622
  }
623
623
  })).data;
624
- } catch (S) {
625
- console.log("error", S);
624
+ } catch (A) {
625
+ console.log("error", A);
626
626
  }
627
627
  }, m = async ({
628
628
  taskId: P,
629
- projectID: S,
629
+ projectID: A,
630
630
  motivo: E
631
631
  }) => {
632
- await b({ taskId: P, motivoId: E, projectID: S });
632
+ await f({ taskId: P, motivoId: E, projectID: A });
633
633
  }, x = async (P) => {
634
634
  await v(P);
635
635
  }, y = async (P) => {
636
636
  await q(P);
637
- }, { mutateAsync: b } = X({
637
+ }, { mutateAsync: f } = X({
638
638
  mutationFn: _,
639
639
  onSuccess: () => {
640
640
  s("Atraso registrado correctamente"), c === "kanban-general" && (a.invalidateQueries({ queryKey: ["to_do_tasks", i] }), a.invalidateQueries({ queryKey: ["working_tasks", i] })), c === "kanban-campania" && a.invalidateQueries({ queryKey: ["tasksProject"] });
@@ -676,98 +676,98 @@ const Ie = async ({
676
676
  finalizarAtraso: y
677
677
  };
678
678
  }, rt = () => {
679
- const { tasks_api: r } = Q(), { user: e } = U(), { filters: n, path: a } = V(), s = st(), { projectID: o } = ot(), { showSuccess: i, showError: c } = yt(), { finalizarAtraso: l } = Vt({ enabled: !1 }), p = async ({ id: f }) => (await r.put(`/api/tareas/${f}`, {
679
+ const { tasks_api: r } = Q(), { user: e } = U(), { filters: n, path: a } = V(), s = st(), { projectID: o } = ot(), { showSuccess: i, showError: c } = yt(), { finalizarAtraso: l } = Vt({ enabled: !1 }), p = async ({ id: b }) => (await r.put(`/api/tareas/${b}`, {
680
680
  data: {
681
681
  estatus: 1,
682
682
  responsable: e == null ? void 0 : e.id,
683
683
  updated_by: e == null ? void 0 : e.id
684
684
  }
685
- })).data, d = async ({ id: f }) => (await r.put(`/api/tareas/${f}`, {
685
+ })).data, d = async ({ id: b }) => (await r.put(`/api/tareas/${b}`, {
686
686
  data: {
687
687
  estatus: 0,
688
688
  responsable: e == null ? void 0 : e.id,
689
689
  updated_by: e == null ? void 0 : e.id
690
690
  }
691
- })).data, _ = async ({ id: f, idAtraso: C }) => {
692
- const j = await r.post("/api/terminarTarea", {
693
- id_task: f,
691
+ })).data, _ = async ({ id: b, idAtraso: C }) => {
692
+ const $ = await r.post("/api/terminarTarea", {
693
+ id_task: b,
694
694
  ended_at: (/* @__PURE__ */ new Date()).toISOString(),
695
695
  id_user: e == null ? void 0 : e.id
696
696
  });
697
- return await l(C), j.data;
698
- }, k = async ({ id: f, repeats: C }) => (await r.put(`/api/tareas/${f}`, {
697
+ return await l(C), $.data;
698
+ }, k = async ({ id: b, repeats: C }) => (await r.put(`/api/tareas/${b}`, {
699
699
  data: {
700
700
  repeticiones_realizadas: C,
701
701
  updated_by: e == null ? void 0 : e.id
702
702
  }
703
- })).data, g = async ({ id: f, motiveId: C }) => {
703
+ })).data, g = async ({ id: b, motiveId: C }) => {
704
704
  try {
705
- const j = await r.post("/api/pausarTarea", {
706
- taskId: f,
705
+ const $ = await r.post("/api/pausarTarea", {
706
+ taskId: b,
707
707
  userId: e == null ? void 0 : e.id,
708
708
  motivoId: C
709
709
  });
710
- return i("Tarea pausada correctamente"), j.data;
711
- } catch (j) {
712
- c("Error al pausar la tarea: " + j);
710
+ return i("Tarea pausada correctamente"), $.data;
711
+ } catch ($) {
712
+ c("Error al pausar la tarea: " + $);
713
713
  }
714
- }, m = async ({ id: f }) => {
714
+ }, m = async ({ id: b }) => {
715
715
  try {
716
716
  const C = await r.post("/api/reanudarTarea", {
717
- taskId: f
717
+ taskId: b
718
718
  });
719
719
  return i("Tarea reanudada correctamente"), C.data;
720
720
  } catch (C) {
721
721
  c("Error al reanudar la tarea: " + C);
722
722
  }
723
723
  }, x = async ({
724
- id: f,
724
+ id: b,
725
725
  idNewResponsible: C,
726
- typeOfSelect: j
726
+ typeOfSelect: $
727
727
  }) => {
728
728
  let z = {
729
729
  updated_by: e == null ? void 0 : e.id
730
730
  };
731
- return j === "responsible" && (z = { ...z, responsable: C }), j === "team" && (z = {
731
+ return $ === "responsible" && (z = { ...z, responsable: C }), $ === "team" && (z = {
732
732
  ...z,
733
733
  responsable: null,
734
734
  equipo: C
735
- }), (await r.put(`/api/tareas/${f}`, {
735
+ }), (await r.put(`/api/tareas/${b}`, {
736
736
  data: z
737
737
  })).data;
738
- }, y = async ({ id: f, data: C, user: j }) => {
738
+ }, y = async ({ id: b, data: C, user: $ }) => {
739
739
  try {
740
- return (await r.put(`/api/tareas/${f}`, {
740
+ return (await r.put(`/api/tareas/${b}`, {
741
741
  data: {
742
742
  ...C,
743
- updated_by: j == null ? void 0 : j.id
743
+ updated_by: $ == null ? void 0 : $.id
744
744
  }
745
745
  })).data;
746
746
  } catch (z) {
747
747
  console.error("Error updating the element:", z);
748
748
  }
749
- }, b = async ({ id: f }) => {
750
- await P({ id: f });
751
- }, v = async ({ id: f, data: C, user: j }) => {
752
- await q({ id: f, data: C, user: j });
749
+ }, f = async ({ id: b }) => {
750
+ await P({ id: b });
751
+ }, v = async ({ id: b, data: C, user: $ }) => {
752
+ await q({ id: b, data: C, user: $ });
753
753
  }, { mutateAsync: q } = X({
754
754
  mutationFn: y,
755
755
  onSuccess: () => {
756
756
  i("Tarea actualizada correctamente");
757
- const f = {
757
+ const b = {
758
758
  "kanban-general": "to_do_tasks",
759
759
  "kanban-campania": "tasksProject"
760
760
  };
761
761
  try {
762
- a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
762
+ a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
763
763
  queryKey: ["tasksProject", n, o]
764
764
  }));
765
765
  } catch (C) {
766
766
  console.error("Error invalidating queries:", C);
767
767
  }
768
768
  },
769
- onError: (f) => {
770
- console.error("Failed to update the task.", f);
769
+ onError: (b) => {
770
+ console.error("Failed to update the task.", b);
771
771
  },
772
772
  onMutate: async () => {
773
773
  await s.cancelQueries({ queryKey: ["working_tasks"] });
@@ -775,43 +775,43 @@ const Ie = async ({
775
775
  }), { mutateAsync: P } = X({
776
776
  mutationFn: p,
777
777
  onSuccess: () => {
778
- const f = {
778
+ const b = {
779
779
  "kanban-general": "to_do_tasks",
780
780
  "kanban-campania": "tasksProject"
781
781
  };
782
782
  try {
783
- a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
783
+ a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
784
784
  queryKey: ["tasksProject", n, o]
785
785
  }));
786
786
  } catch (C) {
787
787
  console.error("Error updating the element:", C);
788
788
  }
789
789
  },
790
- onError: (f) => {
791
- console.error("Failed to update the task.", f);
790
+ onError: (b) => {
791
+ console.error("Failed to update the task.", b);
792
792
  },
793
793
  onMutate: async () => {
794
794
  await s.cancelQueries({ queryKey: ["working_tasks"] }), await s.cancelQueries({ queryKey: ["to_do_tasks"] });
795
795
  }
796
- }), { mutateAsync: S } = X({
796
+ }), { mutateAsync: A } = X({
797
797
  mutationFn: _,
798
798
  onSuccess: () => {
799
- const f = {
799
+ const b = {
800
800
  "kanban-general": "to_do_tasks",
801
801
  "kanban-campania": "tasksProject"
802
802
  };
803
803
  try {
804
- s.setQueryData([f[a], n], (C) => {
804
+ s.setQueryData([b[a], n], (C) => {
805
805
  console.log({ oldData: C });
806
- }), a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
806
+ }), a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
807
807
  queryKey: ["tasksProject", n, o]
808
808
  }));
809
809
  } catch (C) {
810
810
  console.error("Error invalidating queries:", C);
811
811
  }
812
812
  },
813
- onError: (f) => {
814
- console.error("Failed to update the task.", f);
813
+ onError: (b) => {
814
+ console.error("Failed to update the task.", b);
815
815
  },
816
816
  onMutate: async () => {
817
817
  await s.cancelQueries({ queryKey: ["working_tasks"] }), await s.cancelQueries({ queryKey: ["done_tasks"] }), await s.cancelQueries({ queryKey: ["to_do_tasks"] });
@@ -819,20 +819,20 @@ const Ie = async ({
819
819
  }), { mutateAsync: E } = X({
820
820
  mutationFn: k,
821
821
  onSuccess: () => {
822
- const f = {
822
+ const b = {
823
823
  "kanban-general": "to_do_tasks",
824
824
  "kanban-campania": "tasksProject"
825
825
  };
826
826
  try {
827
- a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
827
+ a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
828
828
  queryKey: ["tasksProject", n, o]
829
829
  }));
830
830
  } catch (C) {
831
831
  console.error("Error invalidating queries:", C);
832
832
  }
833
833
  },
834
- onError: (f) => {
835
- console.error("Failed to update the task.", f);
834
+ onError: (b) => {
835
+ console.error("Failed to update the task.", b);
836
836
  },
837
837
  onMutate: async () => {
838
838
  await s.cancelQueries({ queryKey: ["working_tasks"] }), await s.cancelQueries({ queryKey: ["done_tasks"] }), await s.cancelQueries({ queryKey: ["to_do_tasks"] });
@@ -840,41 +840,41 @@ const Ie = async ({
840
840
  }), { mutateAsync: T } = X({
841
841
  mutationFn: x,
842
842
  onSuccess: () => {
843
- const f = {
843
+ const b = {
844
844
  "kanban-general": "to_do_tasks",
845
845
  "kanban-campania": "tasksProject"
846
846
  };
847
847
  try {
848
- a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
848
+ a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["done_tasks", n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
849
849
  queryKey: ["tasksProject", n, o]
850
850
  }));
851
851
  } catch (C) {
852
852
  console.error("Error invalidating queries:", C);
853
853
  }
854
854
  },
855
- onError: (f) => {
856
- console.error("Failed to reassign the task.", f);
855
+ onError: (b) => {
856
+ console.error("Failed to reassign the task.", b);
857
857
  },
858
858
  onMutate: async () => {
859
859
  await s.cancelQueries({ queryKey: ["working_tasks"] }), await s.cancelQueries({ queryKey: ["done_tasks"] }), await s.cancelQueries({ queryKey: ["to_do_tasks"] });
860
860
  }
861
- }), { mutateAsync: $ } = X({
861
+ }), { mutateAsync: M } = X({
862
862
  mutationFn: d,
863
863
  onSuccess: () => {
864
- const f = {
864
+ const b = {
865
865
  "kanban-general": "to_do_tasks",
866
866
  "kanban-campania": "tasksProject"
867
867
  };
868
868
  try {
869
- a === "kanban-general" && (s.invalidateQueries({ queryKey: [f[a], n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
869
+ a === "kanban-general" && (s.invalidateQueries({ queryKey: [b[a], n] }), s.invalidateQueries({ queryKey: ["working_tasks", n] })), a === "kanban-campania" && (s.invalidateQueries({ queryKey: ["tasksProject"] }), s.invalidateQueries({
870
870
  queryKey: ["tasksProject", n, o]
871
871
  }));
872
872
  } catch (C) {
873
873
  console.error("Error updating the element:", C);
874
874
  }
875
875
  },
876
- onError: (f) => {
877
- console.error("Failed to update the task.", f);
876
+ onError: (b) => {
877
+ console.error("Failed to update the task.", b);
878
878
  },
879
879
  onMutate: async () => {
880
880
  await s.cancelQueries({ queryKey: ["working_tasks"] }), await s.cancelQueries({ queryKey: ["to_do_tasks"] });
@@ -884,21 +884,21 @@ const Ie = async ({
884
884
  //* Methods
885
885
  updatingTask: v,
886
886
  updateTask: y,
887
- startTask: async ({ id: f }) => {
888
- await $({ id: f });
887
+ startTask: async ({ id: b }) => {
888
+ await M({ id: b });
889
889
  },
890
- startWorking: b,
891
- completeTask: async ({ id: f, idAtraso: C }) => {
892
- await S({ id: f, idAtraso: C });
890
+ startWorking: f,
891
+ completeTask: async ({ id: b, idAtraso: C }) => {
892
+ await A({ id: b, idAtraso: C });
893
893
  },
894
- reasignResponsible: async ({ id: f, idNewResponsible: C, typeOfSelect: j }) => {
895
- await T({ id: f, idNewResponsible: C, typeOfSelect: j });
894
+ reasignResponsible: async ({ id: b, idNewResponsible: C, typeOfSelect: $ }) => {
895
+ await T({ id: b, idNewResponsible: C, typeOfSelect: $ });
896
896
  },
897
- updateUnitys: async ({ repeats: f, id: C }) => {
898
- await E({ repeats: f, id: C });
897
+ updateUnitys: async ({ repeats: b, id: C }) => {
898
+ await E({ repeats: b, id: C });
899
899
  },
900
- pauseTask: async ({ id: f, motiveId: C }) => {
901
- console.log({ taksId: f, motivoId: C, user: e == null ? void 0 : e.id });
900
+ pauseTask: async ({ id: b, motiveId: C }) => {
901
+ console.log({ taksId: b, motivoId: C, user: e == null ? void 0 : e.id });
902
902
  },
903
903
  postPauseTask: g,
904
904
  postReanudeTask: m
@@ -1096,22 +1096,22 @@ const jt = (r) => {
1096
1096
  return /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(F, { icon: "user", size: "xs", strokeWidth: 3 }) });
1097
1097
  const m = () => {
1098
1098
  var E;
1099
- const [x, y] = N(), [b, v] = N("responsible"), { teams: q } = Oe(), { users: P } = He();
1100
- M(() => {
1101
- var T, $;
1102
- p.current && y(((c == null ? void 0 : c.x) ?? 0) - ((($ = (T = p.current) == null ? void 0 : T.getBoundingClientRect()) == null ? void 0 : $.width) ?? 0));
1099
+ const [x, y] = N(), [f, v] = N("responsible"), { teams: q } = Oe(), { users: P } = He();
1100
+ S(() => {
1101
+ var T, M;
1102
+ p.current && y(((c == null ? void 0 : c.x) ?? 0) - (((M = (T = p.current) == null ? void 0 : T.getBoundingClientRect()) == null ? void 0 : M.width) ?? 0));
1103
1103
  }, [p == null ? void 0 : p.current, c == null ? void 0 : c.x]);
1104
- const S = () => {
1104
+ const A = () => {
1105
1105
  const T = [
1106
1106
  // { id: 'team', label: 'Equipo' },
1107
1107
  { id: "responsible", label: "Responsable" }
1108
1108
  ];
1109
- return /* @__PURE__ */ t("div", { className: "tw-w-full tw-flex tw-justify-center tw-gap-l tw-text-texts-placeholder tw-font-bold", children: T.map(($, B) => /* @__PURE__ */ t(
1109
+ return /* @__PURE__ */ t("div", { className: "tw-w-full tw-flex tw-justify-center tw-gap-l tw-text-texts-placeholder tw-font-bold", children: T.map((M, B) => /* @__PURE__ */ t(
1110
1110
  "button",
1111
1111
  {
1112
- className: `tw-w-full tw-text-sm tw-border-texts-placeholder tw-text-center ${b === $.id ? "tw-text-primary-pastel" : ""} ${B === T.length - 1 ? "tw-border-r-0" : " tw-border-r-2"}`,
1113
- onClick: () => v($.id),
1114
- children: $.label
1112
+ className: `tw-w-full tw-text-sm tw-border-texts-placeholder tw-text-center ${f === M.id ? "tw-text-primary-pastel" : ""} ${B === T.length - 1 ? "tw-border-r-0" : " tw-border-r-2"}`,
1113
+ onClick: () => v(M.id),
1114
+ children: M.label
1115
1115
  }
1116
1116
  )) });
1117
1117
  };
@@ -1128,18 +1128,18 @@ const jt = (r) => {
1128
1128
  className: "tw-flex tw-flex-col tw-gap-m tw-bg-bg-card tw-border-cards tw-rounded-lg tw-p-2 tw-max-h-[200px] tw-overflow-y-hidden",
1129
1129
  style: { boxShadow: "0px 2px 16px 0px rgba(0, 0, 0, 0.25)" },
1130
1130
  children: [
1131
- /* @__PURE__ */ t(S, {}),
1131
+ /* @__PURE__ */ t(A, {}),
1132
1132
  /* @__PURE__ */ t(
1133
1133
  It,
1134
1134
  {
1135
- options: b === "team" ? q.data.map((T) => ({
1135
+ options: f === "team" ? q.data.map((T) => ({
1136
1136
  id: T.id,
1137
1137
  name: T.name,
1138
1138
  image: ""
1139
1139
  })) : (E = P.data) == null ? void 0 : E.map((T) => Nt(T, s())),
1140
1140
  onselect: (T) => {
1141
- var $;
1142
- l(), e && e(($ = T.tasksUser) == null ? void 0 : $.id, b);
1141
+ var M;
1142
+ l(), e && e((M = T.tasksUser) == null ? void 0 : M.id, f);
1143
1143
  }
1144
1144
  }
1145
1145
  )
@@ -1169,7 +1169,7 @@ const jt = (r) => {
1169
1169
  }, Jt = ({ priority: r, id: e, withLabel: n = !1 }) => {
1170
1170
  var k, g, m, x, y;
1171
1171
  const { updatingTask: a } = rt(), s = Math.random().toString(36), [o, i] = N(null), { user: c } = U(), [l, p] = N(r);
1172
- M(() => {
1172
+ S(() => {
1173
1173
  p(r);
1174
1174
  }, [r]);
1175
1175
  const d = {
@@ -1179,8 +1179,8 @@ const jt = (r) => {
1179
1179
  3: { title: "Alta", color: h.danger.regular }
1180
1180
  }, _ = () => {
1181
1181
  if (!o) return null;
1182
- const b = ({ priorityTask: v, text: q }) => {
1183
- var P, S;
1182
+ const f = ({ priorityTask: v, text: q }) => {
1183
+ var P, A;
1184
1184
  return /* @__PURE__ */ w(
1185
1185
  "button",
1186
1186
  {
@@ -1190,7 +1190,7 @@ const jt = (r) => {
1190
1190
  className: "tw-flex tw-gap-m tw-items-center tw-px-l tw-py-s hover:tw-bg-primary-light",
1191
1191
  children: [
1192
1192
  /* @__PURE__ */ t(F, { icon: "flag", size: "xs", strokeWidth: 4, color: (P = d[v ?? 0]) == null ? void 0 : P.color }),
1193
- /* @__PURE__ */ t("p", { className: "tw-text-sm", style: { color: (S = d[v ?? 0]) == null ? void 0 : S.color }, children: q })
1193
+ /* @__PURE__ */ t("p", { className: "tw-text-sm", style: { color: (A = d[v ?? 0]) == null ? void 0 : A.color }, children: q })
1194
1194
  ]
1195
1195
  }
1196
1196
  );
@@ -1207,7 +1207,7 @@ const jt = (r) => {
1207
1207
  className: `tw-absolute tw-h-fit tw-p-m tw-flex tw-flex-col tw-gap-2 tw-bg-bg-card tw-rounded-xl tw-shadow-lg
1208
1208
  tw-w-max`,
1209
1209
  "data-portal-host": !0,
1210
- children: Object.values(d).map((v, q) => /* @__PURE__ */ t(b, { priorityTask: q, text: v.title }, q))
1210
+ children: Object.values(d).map((v, q) => /* @__PURE__ */ t(f, { priorityTask: q, text: v.title }, q))
1211
1211
  }
1212
1212
  ),
1213
1213
  document.body
@@ -1252,8 +1252,8 @@ const jt = (r) => {
1252
1252
  "button",
1253
1253
  {
1254
1254
  id: s,
1255
- onClick: (b) => {
1256
- i(o ? null : { x: b.clientX, y: b.clientY });
1255
+ onClick: (f) => {
1256
+ i(o ? null : { x: f.clientX, y: f.clientY });
1257
1257
  },
1258
1258
  className: "tw-hidden"
1259
1259
  }
@@ -1306,10 +1306,10 @@ function Ge({ comment: r }) {
1306
1306
  function Je({ currentUser: r, data: e, taskId: n, onNewComment: a }) {
1307
1307
  var g, m, x;
1308
1308
  const { tasks_api: s, getImageOBP: o } = Q(), { register: i, handleSubmit: c, reset: l } = Kt(), [p, d] = N([]), _ = (x = (m = (g = r == null ? void 0 : r.imagen) == null ? void 0 : g.formats) == null ? void 0 : m.thumbnail) == null ? void 0 : x.url;
1309
- return M(() => {
1309
+ return S(() => {
1310
1310
  if (e != null && e.comentarios) {
1311
1311
  const y = [...e.comentarios].sort(
1312
- (b, v) => new Date(v.createdAt).getTime() - new Date(b.createdAt).getTime()
1312
+ (f, v) => new Date(v.createdAt).getTime() - new Date(f.createdAt).getTime()
1313
1313
  );
1314
1314
  d(y);
1315
1315
  }
@@ -1319,7 +1319,7 @@ function Je({ currentUser: r, data: e, taskId: n, onNewComment: a }) {
1319
1319
  {
1320
1320
  onSubmit: c(async (y) => {
1321
1321
  try {
1322
- const b = {
1322
+ const f = {
1323
1323
  autor: {
1324
1324
  id: r == null ? void 0 : r.id,
1325
1325
  email: r == null ? void 0 : r.email,
@@ -1335,9 +1335,9 @@ function Je({ currentUser: r, data: e, taskId: n, onNewComment: a }) {
1335
1335
  comentario: y.comment,
1336
1336
  tarea: n
1337
1337
  }
1338
- }), a(!0), d((v) => [b, ...v]), l();
1339
- } catch (b) {
1340
- console.error("Error al agregar comentario:", b);
1338
+ }), a(!0), d((v) => [f, ...v]), l();
1339
+ } catch (f) {
1340
+ console.error("Error al agregar comentario:", f);
1341
1341
  }
1342
1342
  }),
1343
1343
  className: "tw-flex tw-flex-row tw-items-center tw-gap-3",
@@ -1355,7 +1355,7 @@ function Je({ currentUser: r, data: e, taskId: n, onNewComment: a }) {
1355
1355
  ]
1356
1356
  }
1357
1357
  ),
1358
- p && p.map((y, b) => /* @__PURE__ */ t(Ge, { comment: y }, b))
1358
+ p && p.map((y, f) => /* @__PURE__ */ t(Ge, { comment: y }, f))
1359
1359
  ] });
1360
1360
  }
1361
1361
  function Xe({ data: r }) {
@@ -1413,7 +1413,7 @@ function Ze({ id: r, texto_largo: e, user_id: n }) {
1413
1413
  const [a, s] = N(e), { updatingTask: o } = rt(), i = async () => {
1414
1414
  await o({ id: r, data: { texto_largo: a }, user: n });
1415
1415
  };
1416
- return M(() => {
1416
+ return S(() => {
1417
1417
  s(e);
1418
1418
  }, [e]), /* @__PURE__ */ w("div", { className: "tw-w-full tw-flex tw-flex-col tw-gap-3 tw-mt-8", children: [
1419
1419
  /* @__PURE__ */ t("h6", { className: "tw-text-neutral-900 tw-font-semibold tw-text-2xl", children: "Descripción" }),
@@ -1431,23 +1431,20 @@ function Ze({ id: r, texto_largo: e, user_id: n }) {
1431
1431
  ] });
1432
1432
  }
1433
1433
  function Xt({ isOpen: r, setIsOpen: e, taskId: n }) {
1434
- var b, v, q, P, S, E, T, $, B, W;
1435
- const [a, s] = N(null), [o, i] = N(!1), [c, l] = N(!1), [p, d] = N(null), _ = (P = (q = (v = (b = a == null ? void 0 : a.responsable) == null ? void 0 : b.imagen) == null ? void 0 : v.formats) == null ? void 0 : q.thumbnail) == null ? void 0 : P.url, { tasks_api: k, getImageOBP: g } = Q(), { user: m } = U();
1436
- M(() => {
1434
+ var f, v, q, P, A, E, T, M, B, W;
1435
+ const [a, s] = N(null), [o, i] = N(!1), [c, l] = N(!1), [p, d] = N(null), _ = (P = (q = (v = (f = a == null ? void 0 : a.responsable) == null ? void 0 : f.imagen) == null ? void 0 : v.formats) == null ? void 0 : q.thumbnail) == null ? void 0 : P.url, { tasks_api: k, getImageOBP: g } = Q(), { user: m } = U();
1436
+ S(() => {
1437
1437
  if (r && n || o) {
1438
1438
  const u = async () => {
1439
1439
  const R = await k.get(`/api/detalleTarea/${n}`);
1440
1440
  s(R == null ? void 0 : R.data);
1441
1441
  }, D = async () => {
1442
- var C, j;
1443
- const R = await k.get(`/api/users/${m.id}`), f = await k.post("/api/obtenerUsuarioOBP/", {
1444
- emailList: [(C = R == null ? void 0 : R.data) == null ? void 0 : C.email]
1445
- });
1446
- d((j = f == null ? void 0 : f.data) == null ? void 0 : j.data[0]);
1442
+ const R = await k.get(`/api/users/${m.id}`);
1443
+ d(R == null ? void 0 : R.data);
1447
1444
  };
1448
1445
  u(), D();
1449
1446
  }
1450
- }, [r, n, o]);
1447
+ }, [r, n, o, m.id, k]);
1451
1448
  const x = (u) => u ? Rt(u, "d MMM yyyy, h:mmaaa", {
1452
1449
  locale: xt
1453
1450
  }) : "Fecha no disponible", y = [
@@ -1486,7 +1483,7 @@ function Xt({ isOpen: r, setIsOpen: e, taskId: n }) {
1486
1483
  children: /* @__PURE__ */ w("div", { className: "tw-flex tw-w-full tw-h-full tw-flex-col tw-overflow-y-scroll tw-bg-white tw-border-none tw-shadow-xl tw-px-6 tw-py-10", children: [
1487
1484
  /* @__PURE__ */ w("div", { className: "tw-w-full tw-flex tw-items-center tw-flex-row tw-justify-between tw-pb-4 tw-gap-10 tw-border-none", children: [
1488
1485
  /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-row tw-items-start tw-gap-2 tw-relative", children: [
1489
- ((S = a == null ? void 0 : a.id_t_requerida) == null ? void 0 : S.id) && /* @__PURE__ */ w(I, { children: [
1486
+ ((A = a == null ? void 0 : a.id_t_requerida) == null ? void 0 : A.id) && /* @__PURE__ */ w(I, { children: [
1490
1487
  /* @__PURE__ */ t(
1491
1488
  "div",
1492
1489
  {
@@ -1551,7 +1548,7 @@ function Xt({ isOpen: r, setIsOpen: e, taskId: n }) {
1551
1548
  /* @__PURE__ */ t(xe, { className: "tw-border-none", children: /* @__PURE__ */ w("div", { className: "tw-w-full tw-grid tw-grid-cols-3 tw-gap-xy-details tw-p-4", children: [
1552
1549
  /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
1553
1550
  /* @__PURE__ */ t("span", { className: "tw-font-sans tw-font-semibold tw-text-[1.4rem] tw-leading-[100%] tw-tracking-normal tw-bg-black", children: "Responsable" }),
1554
- ($ = a == null ? void 0 : a.responsable) != null && $.nombre ? /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-center", children: [
1551
+ (M = a == null ? void 0 : a.responsable) != null && M.nombre ? /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-center", children: [
1555
1552
  /* @__PURE__ */ t(
1556
1553
  G,
1557
1554
  {
@@ -1614,7 +1611,7 @@ const tr = ({
1614
1611
  className: a
1615
1612
  }) => {
1616
1613
  const [s, o] = N(), [i, c] = N(!1);
1617
- return M(() => {
1614
+ return S(() => {
1618
1615
  var l, p;
1619
1616
  if (e.current && n) {
1620
1617
  const d = ((n == null ? void 0 : n.x) ?? 0) - (((p = (l = e.current) == null ? void 0 : l.getBoundingClientRect()) == null ? void 0 : p.width) ?? 0);
@@ -1658,16 +1655,16 @@ const tr = ({
1658
1655
  atrasoId: i,
1659
1656
  categoria: c
1660
1657
  }) => {
1661
- const { setElementPosition: l, position: p } = bt(), d = Z(null), { startWorking: _, completeTask: k, startTask: g } = rt(), m = Z(!1), [x, y] = N(!1), [b, v] = N(null), [q, P] = N("first"), S = e !== "" && n === 2, [E, T] = N(null), {
1662
- atrasoReasons: $,
1658
+ const { setElementPosition: l, position: p } = bt(), d = Z(null), { startWorking: _, completeTask: k, startTask: g } = rt(), m = Z(!1), [x, y] = N(!1), [f, v] = N(null), [q, P] = N("first"), A = e !== "" && n === 2, [E, T] = N(null), {
1659
+ atrasoReasons: M,
1663
1660
  isLoading: B,
1664
1661
  createAtraso: W,
1665
1662
  deleteAtraso: u
1666
1663
  } = Vt({ enabled: !0 }), [D, R] = N(null);
1667
- M(() => {
1664
+ S(() => {
1668
1665
  s && P("third");
1669
1666
  }, []);
1670
- const f = (K) => {
1667
+ const b = (K) => {
1671
1668
  P(K), K === "second" && r === 0 && v("Trabajando");
1672
1669
  }, C = () => {
1673
1670
  const K = [];
@@ -1676,7 +1673,7 @@ const tr = ({
1676
1673
  icon: "arrow_right",
1677
1674
  iconReverse: !1,
1678
1675
  onClick: () => {
1679
- f("second");
1676
+ b("second");
1680
1677
  },
1681
1678
  disabled: !1
1682
1679
  }), r === 1 && K.push(
@@ -1684,46 +1681,46 @@ const tr = ({
1684
1681
  name: "Mover a completada",
1685
1682
  icon: "arrow_right",
1686
1683
  iconReverse: !1,
1687
- onClick: () => f("second"),
1684
+ onClick: () => b("second"),
1688
1685
  disabled: !1
1689
1686
  },
1690
1687
  {
1691
1688
  name: "Mover por hacer",
1692
1689
  icon: "arrow_left",
1693
1690
  iconReverse: !0,
1694
- onClick: () => f("fourth"),
1691
+ onClick: () => b("fourth"),
1695
1692
  disabled: !1
1696
1693
  }
1697
1694
  ), i ? K.push({
1698
1695
  name: "Eliminar atraso",
1699
1696
  icon: null,
1700
1697
  iconReverse: !1,
1701
- onClick: () => f("third"),
1698
+ onClick: () => b("third"),
1702
1699
  disabled: !1
1703
1700
  }) : K.push({
1704
1701
  name: "Agregar atraso",
1705
1702
  icon: null,
1706
1703
  iconReverse: !1,
1707
- onClick: () => f("third"),
1704
+ onClick: () => b("third"),
1708
1705
  disabled: !1
1709
- }), m != null && m.current ? /* @__PURE__ */ t("div", { className: "tw-w-max tw-h-fit tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-flex tw-items-center tw-gap-2 tw-hover:bg-primary-light tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: /* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal tw-text-primary-pastel tw-font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ t("div", { className: "tw-w-max tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: K.map(({ name: L, icon: A, onClick: O, disabled: wt, iconReverse: dt }, ut) => /* @__PURE__ */ w(
1706
+ }), m != null && m.current ? /* @__PURE__ */ t("div", { className: "tw-w-max tw-h-fit tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-flex tw-items-center tw-gap-2 tw-hover:bg-primary-light tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: /* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal tw-text-primary-pastel tw-font-regular", children: "Moviendo..." }) }) : /* @__PURE__ */ t("div", { className: "tw-w-max tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: K.map(({ name: L, icon: j, onClick: O, disabled: wt, iconReverse: dt }, ut) => /* @__PURE__ */ w(
1710
1707
  "button",
1711
1708
  {
1712
1709
  onClick: O,
1713
1710
  className: `
1714
- ${A && dt ? "tw-flex-row-reverse" : ""}
1711
+ ${j && dt ? "tw-flex-row-reverse" : ""}
1715
1712
  tw-flex tw-items-center tw-justify-between tw-transition-colors tw-duration-200 tw-pl-3 tw-pr-10 tw-rounded-md
1716
1713
  tw-text-[14px] tw-text-texts-placeholder tw-font-regular tw-text-left tw-border tw-gap-2
1717
1714
  hover:tw-bg-[#e1ebf9] hover:tw-text-primary-dark tw-font-normal tw-font-sans
1718
- ${b === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1715
+ ${f === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1719
1716
  ${wt ? "tw-opacity-50 tw-cursor-not-allowed" : "tw-cursor-pointer"}
1720
1717
  `,
1721
1718
  children: [
1722
1719
  L,
1723
- A && /* @__PURE__ */ t(
1720
+ j && /* @__PURE__ */ t(
1724
1721
  F,
1725
1722
  {
1726
- icon: A,
1723
+ icon: j,
1727
1724
  size: "xs",
1728
1725
  strokeWidth: 4,
1729
1726
  color: h.primary.regular,
@@ -1734,8 +1731,8 @@ const tr = ({
1734
1731
  },
1735
1732
  ut
1736
1733
  )) });
1737
- }, j = () => /* @__PURE__ */ w("div", { className: "tw-w-max tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: [
1738
- (r === 0 ? ["Trabajando"] : ["Completadas"]).map((L, A) => /* @__PURE__ */ t(
1734
+ }, $ = () => /* @__PURE__ */ w("div", { className: "tw-w-max tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: [
1735
+ (r === 0 ? ["Trabajando"] : ["Completadas"]).map((L, j) => /* @__PURE__ */ t(
1739
1736
  "button",
1740
1737
  {
1741
1738
  onClick: () => {
@@ -1752,18 +1749,18 @@ const tr = ({
1752
1749
  tw-font-regular
1753
1750
  tw-text-left
1754
1751
  tw-border
1755
- ${b === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1752
+ ${f === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1756
1753
  `,
1757
1754
  children: L
1758
1755
  },
1759
- A
1756
+ j
1760
1757
  )),
1761
1758
  /* @__PURE__ */ t(
1762
1759
  "button",
1763
1760
  {
1764
1761
  className: "tw-w-full tw-h-fit tw-bg-texts-enfasis tw-rounded-lg tw-p-1",
1765
1762
  onClick: () => {
1766
- m.current = !0, b === "Trabajando" ? _({ id: a }) : b === "Por hacer" ? g({ id: a }) : k({ id: a, idAtraso: i });
1763
+ m.current = !0, f === "Trabajando" ? _({ id: a }) : f === "Por hacer" ? g({ id: a }) : k({ id: a, idAtraso: i });
1767
1764
  },
1768
1765
  children: /* @__PURE__ */ t("p", { className: "tw-text-[12px] tw-font-normal tw-text-white", children: "Mover" })
1769
1766
  }
@@ -1772,14 +1769,14 @@ const tr = ({
1772
1769
  var L;
1773
1770
  if (B)
1774
1771
  return /* @__PURE__ */ t("div", { children: "Cargando motivos..." });
1775
- const K = ($ == null ? void 0 : $.map((A) => {
1772
+ const K = (M == null ? void 0 : M.map((j) => {
1776
1773
  var O;
1777
1774
  return {
1778
- id: A == null ? void 0 : A.id,
1779
- nombre: A == null ? void 0 : A.motivo_imj,
1780
- categoria: (O = A == null ? void 0 : A.categoria) == null ? void 0 : O.nombre
1775
+ id: j == null ? void 0 : j.id,
1776
+ nombre: j == null ? void 0 : j.motivo_imj,
1777
+ categoria: (O = j == null ? void 0 : j.categoria) == null ? void 0 : O.nombre
1781
1778
  };
1782
- }).filter((A) => A.categoria === (c == null ? void 0 : c.nombre))) || [];
1779
+ }).filter((j) => j.categoria === (c == null ? void 0 : c.nombre))) || [];
1783
1780
  return K.length > 0 ? /* @__PURE__ */ w("div", { className: "tw-w-[288px] tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: [
1784
1781
  !E && !i ? /* @__PURE__ */ w(I, { children: [
1785
1782
  /* @__PURE__ */ t("p", { className: "tw-text-[14px] tw-text-black-black_regular tw-font-semibold tw-text-left tw-mb-[11px]", children: "Atraso de tarea" }),
@@ -1788,9 +1785,9 @@ const tr = ({
1788
1785
  {
1789
1786
  isOpen: !0,
1790
1787
  options: K,
1791
- onSelect: (A, O) => R({
1788
+ onSelect: (j, O) => R({
1792
1789
  id: O,
1793
- nombre: A
1790
+ nombre: j
1794
1791
  })
1795
1792
  }
1796
1793
  )
@@ -1824,7 +1821,7 @@ const tr = ({
1824
1821
  ] })
1825
1822
  ] }) : /* @__PURE__ */ t("div", { className: "tw-w-[288px] tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: "No hay motivos de atraso para ésta tarea" });
1826
1823
  }, Y = () => /* @__PURE__ */ w("div", { className: "tw-w-max tw-h-fit tw-flex tw-flex-col tw-bg-bg-card tw-rounded-lg tw-p-l tw-shadow-lg tw-gap-3 tw-transition-all tw-duration-200 tw-ease-in-out tw-translate-x-0", children: [
1827
- ["Por hacer"].map((L, A) => /* @__PURE__ */ t(
1824
+ ["Por hacer"].map((L, j) => /* @__PURE__ */ t(
1828
1825
  "button",
1829
1826
  {
1830
1827
  onClick: () => {
@@ -1841,11 +1838,11 @@ const tr = ({
1841
1838
  tw-font-regular
1842
1839
  tw-text-left
1843
1840
  tw-border
1844
- ${b === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1841
+ ${f === L ? "tw-bg-content tw-text-primary-dark tw-border tw-border-primary-regular" : "tw-border-bg-card"}
1845
1842
  `,
1846
1843
  children: L
1847
1844
  },
1848
- A
1845
+ j
1849
1846
  )),
1850
1847
  /* @__PURE__ */ t(
1851
1848
  "button",
@@ -1861,7 +1858,7 @@ const tr = ({
1861
1858
  if (q === "first")
1862
1859
  return C();
1863
1860
  if (q === "second")
1864
- return j();
1861
+ return $();
1865
1862
  if (q === "third")
1866
1863
  return z();
1867
1864
  if (q === "fourth")
@@ -1879,7 +1876,7 @@ const tr = ({
1879
1876
  }
1880
1877
  };
1881
1878
  return /* @__PURE__ */ w(I, { children: [
1882
- (S && n === 2 || !e) && /* @__PURE__ */ t(
1879
+ (A && n === 2 || !e) && /* @__PURE__ */ t(
1883
1880
  "button",
1884
1881
  {
1885
1882
  ref: d,
@@ -2067,11 +2064,11 @@ class nr {
2067
2064
  name: e.responsable.nombre,
2068
2065
  image: (c = (i = (o = (s = (a = e.responsable) == null ? void 0 : a.userOBP) == null ? void 0 : s.imagen) == null ? void 0 : o.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : c.url
2069
2066
  }), (l = e == null ? void 0 : e.equipo) != null && l.miembros && e.equipo.miembros.forEach((m) => {
2070
- var x, y, b, v;
2067
+ var x, y, f, v;
2071
2068
  n != null && n.find((q) => q.id === m.idUser.id) || m.idUser && n.push({
2072
2069
  id: m.idUser.id,
2073
2070
  name: m.idUser.nombre,
2074
- image: (v = (b = (y = (x = m == null ? void 0 : m.userOBP) == null ? void 0 : x.imagen) == null ? void 0 : y.formats) == null ? void 0 : b.thumbnail) == null ? void 0 : v.url
2071
+ image: (v = (f = (y = (x = m == null ? void 0 : m.userOBP) == null ? void 0 : x.imagen) == null ? void 0 : y.formats) == null ? void 0 : f.thumbnail) == null ? void 0 : v.url
2075
2072
  });
2076
2073
  }), {
2077
2074
  paused: e == null ? void 0 : e.pausada,
@@ -2139,7 +2136,7 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2139
2136
  // mantains the data for 24 hours
2140
2137
  getNextPageParam: (d, _) => _.length + 1
2141
2138
  });
2142
- return M(() => {
2139
+ return S(() => {
2143
2140
  var d;
2144
2141
  Object.keys(a).length > 0 && c({
2145
2142
  ...a,
@@ -2150,11 +2147,11 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2150
2147
  },
2151
2148
  status: "por_hacer"
2152
2149
  });
2153
- }, [a]), M(() => {
2150
+ }, [a]), S(() => {
2154
2151
  r.invalidateQueries({
2155
2152
  queryKey: ["to_do_tasks", i]
2156
2153
  });
2157
- }, [i]), M(() => {
2154
+ }, [i]), S(() => {
2158
2155
  (async () => {
2159
2156
  const _ = await e.get("/api/listado_tareas", {
2160
2157
  params: {
@@ -2181,8 +2178,8 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2181
2178
  }), await a.invalidateQueries({
2182
2179
  queryKey: ["tasksProject"]
2183
2180
  }), s && typeof s.refetch == "function" || d && typeof d.refetch == "function") {
2184
- const y = await s.refetch(), b = await d.refetch();
2185
- return [y, b];
2181
+ const y = await s.refetch(), f = await d.refetch();
2182
+ return [y, f];
2186
2183
  }
2187
2184
  } catch (y) {
2188
2185
  console.error("Error al pausar la tarea:", y);
@@ -2194,8 +2191,8 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2194
2191
  }), await a.invalidateQueries({
2195
2192
  queryKey: ["tasksProject"]
2196
2193
  }), s && typeof s.refetch == "function" || d && typeof d.refetch == "function") {
2197
- const y = await s.refetch(), b = await d.refetch();
2198
- return [y, b];
2194
+ const y = await s.refetch(), f = await d.refetch();
2195
+ return [y, f];
2199
2196
  }
2200
2197
  } catch (y) {
2201
2198
  console.error("Error al reanudar la tarea:", y);
@@ -2216,7 +2213,7 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2216
2213
  control: l,
2217
2214
  rules: { required: !0 },
2218
2215
  render: ({ field: y }) => {
2219
- var b;
2216
+ var f;
2220
2217
  return /* @__PURE__ */ w(
2221
2218
  fe,
2222
2219
  {
@@ -2224,7 +2221,7 @@ const _t = async ({ filters: r, tasks_api: e }) => {
2224
2221
  onValueChange: (v) => y.onChange(v),
2225
2222
  children: [
2226
2223
  /* @__PURE__ */ t(be, { className: "!tw-w-[290px] tw-border-none tw-shadow-input tw-h-[26px] tw-text-lg", children: /* @__PURE__ */ t(ye, { placeholder: "Selecciona una razón" }) }),
2227
- /* @__PURE__ */ t(ve, { className: "tw-bg-white tw-border-none tw-shadow-input", children: /* @__PURE__ */ t(Ne, { children: (b = g == null ? void 0 : g.data) == null ? void 0 : b.map((v) => /* @__PURE__ */ t(
2224
+ /* @__PURE__ */ t(ve, { className: "tw-bg-white tw-border-none tw-shadow-input", children: /* @__PURE__ */ t(Ne, { children: (f = g == null ? void 0 : g.data) == null ? void 0 : f.map((v) => /* @__PURE__ */ t(
2228
2225
  _e,
2229
2226
  {
2230
2227
  value: v.id,
@@ -2301,14 +2298,14 @@ const lr = ({
2301
2298
  repeats: m,
2302
2299
  medioName: x,
2303
2300
  paused: y,
2304
- idProject: b,
2301
+ idProject: f,
2305
2302
  atraso: v,
2306
2303
  categoria: q
2307
2304
  }) => {
2308
2305
  var et, K, L;
2309
- const [P, S] = N(!1), [E, T] = N(!1), { reasignResponsible: $, updateUnitys: B } = rt(), { getOBPUrlApi: W } = Q(), [u, D] = N(m ?? 0), R = !!(g && m === g), f = !g || g === 1, C = k === 0, { user: j } = U(), z = () => /* @__PURE__ */ w("div", { className: "tw-flex tw-justify-between tw-items-center tw-w-full tw-h-fit tw-relative", children: [
2306
+ const [P, A] = N(!1), [E, T] = N(!1), { reasignResponsible: M, updateUnitys: B } = rt(), { getOBPUrlApi: W } = Q(), [u, D] = N(m ?? 0), R = !!(g && m === g), b = !g || g === 1, C = k === 0, { user: $ } = U(), z = () => /* @__PURE__ */ w("div", { className: "tw-flex tw-justify-between tw-items-center tw-w-full tw-h-fit tw-relative", children: [
2310
2307
  /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-row tw-items-start tw-gap-[8px] tw-w-[calc(100%-32px)]", children: [
2311
- k < 2 && (R || f || C) && /* @__PURE__ */ t(
2308
+ k < 2 && (R || b || C) && /* @__PURE__ */ t(
2312
2309
  Yt,
2313
2310
  {
2314
2311
  id: r,
@@ -2322,19 +2319,19 @@ const lr = ({
2322
2319
  "p",
2323
2320
  {
2324
2321
  className: "tw-overflow-hidden tw-text-ellipsis tw-w-full tw-text-nowrap tw-text-[1.6rem] tw-font-medium tw-text-neutral-900",
2325
- onClick: () => S(!0),
2322
+ onClick: () => A(!0),
2326
2323
  children: e
2327
2324
  }
2328
2325
  )
2329
2326
  ] }),
2330
- (R || f || C) && k !== 2 && /* @__PURE__ */ t(
2327
+ (R || b || C) && k !== 2 && /* @__PURE__ */ t(
2331
2328
  Zt,
2332
2329
  {
2333
2330
  id: r,
2334
2331
  nameRequiredTask: d,
2335
2332
  status: k,
2336
2333
  statusRequiredTask: _,
2337
- projectID: b,
2334
+ projectID: f,
2338
2335
  atrasoId: v == null ? void 0 : v.atrasoId,
2339
2336
  categoria: q
2340
2337
  }
@@ -2345,8 +2342,8 @@ const lr = ({
2345
2342
  2: { title: "Media", color: h.warning.regular },
2346
2343
  3: { title: "Difícil", color: h.danger.regular },
2347
2344
  4: { title: "Muy difícil", color: h.danger.dark }
2348
- }, tt = (A) => {
2349
- D((O) => A === "minus" ? Math.max(0, O - 1) : Math.min(g, O + 1));
2345
+ }, tt = (j) => {
2346
+ D((O) => j === "minus" ? Math.max(0, O - 1) : Math.min(g, O + 1));
2350
2347
  };
2351
2348
  return /* @__PURE__ */ w(I, { children: [
2352
2349
  /* @__PURE__ */ w("div", { className: "tw-bg-white tw-border-cards tw-max-w-[350px] tw-rounded-lg tw-relative tw-h-fit tw-p-[12px_12px] hover:tw-border-active hover:tw-bg-primary-light tw-cursor-pointer tw-transition-all tw-duration-300 hover:tw-border hover:tw-border-blue-500", children: [
@@ -2361,11 +2358,11 @@ const lr = ({
2361
2358
  Gt,
2362
2359
  {
2363
2360
  responsible: p,
2364
- role: j == null ? void 0 : j.role,
2365
- users: a.filter((A) => p ? A.id === p : !0).map((A) => Nt(A, W())),
2366
- onClick: async (A, O) => {
2367
- await $({
2368
- idNewResponsible: A,
2361
+ role: $ == null ? void 0 : $.role,
2362
+ users: a.filter((j) => p ? j.id === p : !0).map((j) => Nt(j, W())),
2363
+ onClick: async (j, O) => {
2364
+ await M({
2365
+ idNewResponsible: j,
2369
2366
  id: r,
2370
2367
  typeOfSelect: O
2371
2368
  });
@@ -2505,7 +2502,7 @@ const lr = ({
2505
2502
  i > 0 && /* @__PURE__ */ t("div", { className: "tw-border-t tw-border-gray-200 tw-mt-4 tw-pt-2", children: /* @__PURE__ */ w(
2506
2503
  "button",
2507
2504
  {
2508
- onClick: () => S(!0),
2505
+ onClick: () => A(!0),
2509
2506
  className: "tw-flex tw-items-center tw-gap-2",
2510
2507
  children: [
2511
2508
  /* @__PURE__ */ t(F, { icon: "comment", size: "xs", strokeWidth: 4 }),
@@ -2514,11 +2511,11 @@ const lr = ({
2514
2511
  }
2515
2512
  ) })
2516
2513
  ] }),
2517
- /* @__PURE__ */ t(Xt, { taskId: r, isOpen: P, setIsOpen: S })
2514
+ /* @__PURE__ */ t(Xt, { taskId: r, isOpen: P, setIsOpen: A })
2518
2515
  ] });
2519
2516
  }, mt = ({ title: r, tasks: e, loadNextPage: n, isFetching: a, total: s }) => {
2520
2517
  const o = Z(null), i = Z(null), c = Z(!1);
2521
- M(() => {
2518
+ S(() => {
2522
2519
  var d;
2523
2520
  o != null && o.current && (i != null && i.current) && (i.current.style.minHeight = `${((d = o == null ? void 0 : o.current) == null ? void 0 : d.clientHeight) - 300}px`);
2524
2521
  }, [o == null ? void 0 : o.current]);
@@ -2628,7 +2625,7 @@ const lr = ({
2628
2625
  { id: "todas", name: "Todas las tareas" }
2629
2626
  ]
2630
2627
  }];
2631
- return M(() => {
2628
+ return S(() => {
2632
2629
  const s = [...At];
2633
2630
  a.forEach((c) => {
2634
2631
  if (c.roles.includes(r.role)) {
@@ -2647,7 +2644,7 @@ const lr = ({
2647
2644
  }, ir = () => {
2648
2645
  var o;
2649
2646
  const { defineFields: r } = V(), { tasksProject: e } = ot(), { filters: n } = or();
2650
- M(() => {
2647
+ S(() => {
2651
2648
  (async () => {
2652
2649
  let c = [...n];
2653
2650
  r(c);
@@ -2708,7 +2705,7 @@ const lr = ({
2708
2705
  // mantains the data for 24 hours
2709
2706
  getNextPageParam: (d, _) => _.length + 1
2710
2707
  });
2711
- return M(() => {
2708
+ return S(() => {
2712
2709
  var d;
2713
2710
  Object.keys(a).length > 0 && c({
2714
2711
  ...a,
@@ -2719,11 +2716,11 @@ const lr = ({
2719
2716
  },
2720
2717
  status: "trabajando"
2721
2718
  });
2722
- }, [a]), M(() => {
2719
+ }, [a]), S(() => {
2723
2720
  r.invalidateQueries({
2724
2721
  queryKey: ["working_tasks", i]
2725
2722
  });
2726
- }, [i]), M(() => {
2723
+ }, [i]), S(() => {
2727
2724
  (async () => {
2728
2725
  const _ = await e.get("/api/listado_tareas", {
2729
2726
  params: {
@@ -2778,7 +2775,7 @@ const lr = ({
2778
2775
  // mantains the data for 24 hours
2779
2776
  getNextPageParam: (d, _) => _.length + 1
2780
2777
  });
2781
- return M(() => {
2778
+ return S(() => {
2782
2779
  var d;
2783
2780
  Object.keys(a).length > 0 && c({
2784
2781
  ...a,
@@ -2789,11 +2786,11 @@ const lr = ({
2789
2786
  },
2790
2787
  status: "completadas"
2791
2788
  });
2792
- }, [a]), M(() => {
2789
+ }, [a]), S(() => {
2793
2790
  r.invalidateQueries({
2794
2791
  queryKey: ["done_tasks", i]
2795
2792
  });
2796
- }, [i]), M(() => {
2793
+ }, [i]), S(() => {
2797
2794
  (async () => {
2798
2795
  const _ = await n.get("/api/listado_tareas", {
2799
2796
  params: {
@@ -2968,7 +2965,7 @@ const mr = () => {
2968
2965
  { id: "todas", name: "Todas las tareas" }
2969
2966
  ]
2970
2967
  }];
2971
- return M(() => {
2968
+ return S(() => {
2972
2969
  const s = [...St];
2973
2970
  a.forEach((c) => {
2974
2971
  if (c.roles.includes(r.role)) {
@@ -2986,7 +2983,7 @@ const mr = () => {
2986
2983
  };
2987
2984
  }, hr = () => {
2988
2985
  const { defineFields: r } = V(), { getSalesmanAndProjects: e } = mr(), { filters: n } = gr();
2989
- return M(() => {
2986
+ return S(() => {
2990
2987
  (async () => {
2991
2988
  let s = [...n], { salesmanUsers: o, projects: i } = await e();
2992
2989
  r(
@@ -3299,7 +3296,7 @@ const mr = () => {
3299
3296
  }
3300
3297
  ), yr = ({ id: r }) => {
3301
3298
  var k, g, m, x, y;
3302
- const [e, n] = N(!1), [a, s] = N(!1), { tasksProject: o } = ot(), { reasignResponsible: i } = rt(), { getOBPUrlApi: c } = Q(), l = (k = o == null ? void 0 : o.data) == null ? void 0 : k.find((b) => b.id === r), [p, d] = N(null), { user: _ } = U();
3299
+ const [e, n] = N(!1), [a, s] = N(!1), { tasksProject: o } = ot(), { reasignResponsible: i } = rt(), { getOBPUrlApi: c } = Q(), l = (k = o == null ? void 0 : o.data) == null ? void 0 : k.find((f) => f.id === r), [p, d] = N(null), { user: _ } = U();
3303
3300
  return /* @__PURE__ */ w(I, { children: [
3304
3301
  /* @__PURE__ */ t("div", { className: "tw-border-b tw-border-gray-200 tw-pb-3", children: /* @__PURE__ */ w(
3305
3302
  "div",
@@ -3359,16 +3356,16 @@ const mr = () => {
3359
3356
  Gt,
3360
3357
  {
3361
3358
  role: _ == null ? void 0 : _.role,
3362
- onClick: async (b, v) => {
3359
+ onClick: async (f, v) => {
3363
3360
  var q;
3364
3361
  await i({
3365
- idNewResponsible: (q = b == null ? void 0 : b.tasksUser) == null ? void 0 : q.id,
3362
+ idNewResponsible: (q = f == null ? void 0 : f.tasksUser) == null ? void 0 : q.id,
3366
3363
  id: r,
3367
3364
  typeOfSelect: v
3368
3365
  });
3369
3366
  },
3370
3367
  responsible: l == null ? void 0 : l.responsible,
3371
- users: ((m = l == null ? void 0 : l.users) == null ? void 0 : m.map((b) => Nt(b, c()))) ?? []
3368
+ users: ((m = l == null ? void 0 : l.users) == null ? void 0 : m.map((f) => Nt(f, c()))) ?? []
3372
3369
  }
3373
3370
  ),
3374
3371
  /* @__PURE__ */ t(oe, { task: (l == null ? void 0 : l.task) ?? "" }),
@@ -3391,8 +3388,8 @@ const mr = () => {
3391
3388
  "button",
3392
3389
  {
3393
3390
  className: "tw-z-10 tw-bg-silver-silver_light tw-rounded-[8px] tw-h-[21px] tw-w-[24px] tw-flex tw-justify-center tw-items-center tw-w-fit tw-px-[4px] hover:tw-bg-gray-200 hover:tw-cursor-help",
3394
- onClick: (b) => {
3395
- b.stopPropagation();
3391
+ onClick: (f) => {
3392
+ f.stopPropagation();
3396
3393
  },
3397
3394
  children: /* @__PURE__ */ t(
3398
3395
  F,
@@ -3413,8 +3410,8 @@ const mr = () => {
3413
3410
  (l == null ? void 0 : l.status) !== 2 && /* @__PURE__ */ t(
3414
3411
  "div",
3415
3412
  {
3416
- onClick: (b) => {
3417
- b.stopPropagation();
3413
+ onClick: (f) => {
3414
+ f.stopPropagation();
3418
3415
  },
3419
3416
  children: /* @__PURE__ */ t(
3420
3417
  Zt,
@@ -3442,8 +3439,8 @@ const mr = () => {
3442
3439
  var x;
3443
3440
  const g = e == null ? void 0 : e.data, m = [];
3444
3441
  return (x = s == null ? void 0 : s.tasks) == null || x.forEach((y) => {
3445
- const b = g.find((v) => v.id === (y == null ? void 0 : y.id));
3446
- b && m.push(b);
3442
+ const f = g.find((v) => v.id === (y == null ? void 0 : y.id));
3443
+ f && m.push(f);
3447
3444
  }), m;
3448
3445
  })();
3449
3446
  return s ? /* @__PURE__ */ w("div", { className: "tw-flex tw-flex-col tw-gap-m tw-mb-2 tw-overflow-y-auto", children: [
@@ -3492,11 +3489,11 @@ const mr = () => {
3492
3489
  setPath: r,
3493
3490
  setProject: e
3494
3491
  }) => {
3495
- const [n, a] = N([]), [s, o] = N(!0), [i, c] = N(0), [l, p] = N(10), [d, _] = N(0), [k, g] = N("nombre"), { filters: m, defineFields: x } = V(), { tasks_api: y, getImageOBP: b } = Q(), { user: v } = U(), q = async (u, D) => {
3496
- var R, f, C;
3492
+ const [n, a] = N([]), [s, o] = N(!0), [i, c] = N(0), [l, p] = N(10), [d, _] = N(0), [k, g] = N("nombre"), { filters: m, defineFields: x } = V(), { tasks_api: y, getImageOBP: f } = Q(), { user: v } = U(), q = async (u, D) => {
3493
+ var R, b, C;
3497
3494
  try {
3498
3495
  o(!0);
3499
- const j = {
3496
+ const $ = {
3500
3497
  filters: {
3501
3498
  search: (m == null ? void 0 : m.search) ?? "",
3502
3499
  responsable: {
@@ -3512,36 +3509,36 @@ const mr = () => {
3512
3509
  pageSize: D
3513
3510
  },
3514
3511
  orderBy: k,
3515
- ...j
3512
+ ...$
3516
3513
  }
3517
3514
  }), Y = J(z == null ? void 0 : z.data);
3518
- a(Y), _((C = (f = z == null ? void 0 : z.data) == null ? void 0 : f.meta) == null ? void 0 : C.total);
3519
- } catch (j) {
3520
- console.error("Error fetching data en Lista Campaña:", j);
3515
+ a(Y), _((C = (b = z == null ? void 0 : z.data) == null ? void 0 : b.meta) == null ? void 0 : C.total);
3516
+ } catch ($) {
3517
+ console.error("Error fetching data en Lista Campaña:", $);
3521
3518
  } finally {
3522
3519
  o(!1);
3523
3520
  }
3524
3521
  }, P = async () => {
3525
3522
  try {
3526
3523
  const u = await y.get("/api/obtener-comerciales");
3527
- return [...Mt].map((R) => (R.id === "ejecutivo" && (R.options = u.data.map((f) => ({
3528
- id: f.nombre,
3529
- name: f.nombre
3524
+ return [...Mt].map((R) => (R.id === "ejecutivo" && (R.options = u.data.map((b) => ({
3525
+ id: b.nombre,
3526
+ name: b.nombre
3530
3527
  }))), R));
3531
3528
  } catch (u) {
3532
3529
  return console.error("Error fetching salesman data:", u), [...Mt];
3533
3530
  }
3534
3531
  };
3535
- M(() => {
3532
+ S(() => {
3536
3533
  (async () => {
3537
3534
  const D = await P();
3538
3535
  x(D);
3539
3536
  })();
3540
- }, []), M(() => {
3537
+ }, []), S(() => {
3541
3538
  const u = Math.floor(i / l) + 1;
3542
3539
  q(u, l);
3543
3540
  }, [i, l, k, m]);
3544
- const S = (u) => {
3541
+ const A = (u) => {
3545
3542
  c(u.first), p(u.rows);
3546
3543
  }, E = [
3547
3544
  { label: "5 filas", value: 5 },
@@ -3552,8 +3549,8 @@ const mr = () => {
3552
3549
  { label: "50 filas", value: 50 }
3553
3550
  ], T = (u) => {
3554
3551
  const D = parseInt(u.target.value, 10);
3555
- p(D), S({ first: 0, rows: D });
3556
- }, $ = (u) => {
3552
+ p(D), A({ first: 0, rows: D });
3553
+ }, M = (u) => {
3557
3554
  g((D) => D === u ? `${u}:desc` : u);
3558
3555
  }, B = (u) => k === u ? "↑↓" : k === `${u}:desc` ? "↓↑" : "↑↓", W = (u) => ({
3559
3556
  padding: "auto",
@@ -3602,7 +3599,7 @@ const mr = () => {
3602
3599
  /* @__PURE__ */ t(
3603
3600
  "th",
3604
3601
  {
3605
- onClick: () => $("nombre"),
3602
+ onClick: () => M("nombre"),
3606
3603
  style: {
3607
3604
  color: h.gray.gray_dark,
3608
3605
  textAlign: "left"
@@ -3632,7 +3629,7 @@ const mr = () => {
3632
3629
  /* @__PURE__ */ t(
3633
3630
  "th",
3634
3631
  {
3635
- onClick: () => $("inicia"),
3632
+ onClick: () => M("inicia"),
3636
3633
  className: "tw-whitespace-nowrap",
3637
3634
  style: {
3638
3635
  color: h.gray.gray_dark,
@@ -3664,7 +3661,7 @@ const mr = () => {
3664
3661
  /* @__PURE__ */ t(
3665
3662
  "th",
3666
3663
  {
3667
- onClick: () => $("termina"),
3664
+ onClick: () => M("termina"),
3668
3665
  className: "tw-whitespace-nowrap",
3669
3666
  style: {
3670
3667
  color: h.gray.gray_dark,
@@ -3728,7 +3725,7 @@ const mr = () => {
3728
3725
  }
3729
3726
  ) }),
3730
3727
  /* @__PURE__ */ t("tbody", { children: n == null ? void 0 : n.map((u, D) => {
3731
- var R, f, C, j, z, Y, tt, et, K, L, A, O, wt, dt, ut, Ct, Tt, qt;
3728
+ var R, b, C, $, z, Y, tt, et, K, L, j, O, wt, dt, ut, Ct, Tt, qt;
3732
3729
  return /* @__PURE__ */ w(
3733
3730
  "tr",
3734
3731
  {
@@ -3751,7 +3748,7 @@ const mr = () => {
3751
3748
  },
3752
3749
  children: [
3753
3750
  /* @__PURE__ */ t("td", { className: "tw-text-s", children: (R = u == null ? void 0 : u.campania) == null ? void 0 : R.nombre }),
3754
- /* @__PURE__ */ t("td", { className: "tw-text-s", children: (f = u == null ? void 0 : u.campania) == null ? void 0 : f.inicia }),
3751
+ /* @__PURE__ */ t("td", { className: "tw-text-s", children: (b = u == null ? void 0 : u.campania) == null ? void 0 : b.inicia }),
3755
3752
  /* @__PURE__ */ t("td", { className: "tw-text-s", children: (C = u == null ? void 0 : u.campania) == null ? void 0 : C.termina }),
3756
3753
  /* @__PURE__ */ t("td", { className: "tw-text-s", children: /* @__PURE__ */ w(
3757
3754
  "div",
@@ -3854,8 +3851,8 @@ const mr = () => {
3854
3851
  /* @__PURE__ */ t(
3855
3852
  G,
3856
3853
  {
3857
- imageUrl: (et = (tt = (Y = (z = (j = u == null ? void 0 : u.campania) == null ? void 0 : j.responsable) == null ? void 0 : z.imagen) == null ? void 0 : Y.formats) == null ? void 0 : tt.thumbnail) != null && et.url ? b(
3858
- (wt = (O = (A = (L = (K = u == null ? void 0 : u.campania) == null ? void 0 : K.responsable) == null ? void 0 : L.imagen) == null ? void 0 : A.formats) == null ? void 0 : O.thumbnail) == null ? void 0 : wt.url
3854
+ imageUrl: (et = (tt = (Y = (z = ($ = u == null ? void 0 : u.campania) == null ? void 0 : $.responsable) == null ? void 0 : z.imagen) == null ? void 0 : Y.formats) == null ? void 0 : tt.thumbnail) != null && et.url ? f(
3855
+ (wt = (O = (j = (L = (K = u == null ? void 0 : u.campania) == null ? void 0 : K.responsable) == null ? void 0 : L.imagen) == null ? void 0 : j.formats) == null ? void 0 : O.thumbnail) == null ? void 0 : wt.url
3859
3856
  ) : "",
3860
3857
  alt: (Ct = (ut = (dt = u == null ? void 0 : u.campania) == null ? void 0 : dt.responsable) == null ? void 0 : ut.nombre) == null ? void 0 : Ct.charAt(
3861
3858
  0
@@ -3897,7 +3894,7 @@ const mr = () => {
3897
3894
  rows: l,
3898
3895
  totalRecords: d,
3899
3896
  rowsPerPageOptions: [5, 10, 20, 50],
3900
- onPageChange: S,
3897
+ onPageChange: A,
3901
3898
  className: "tw-flex tw-justify-center tw-items-center tw-w-full tw-p-2 tw-gap-1 tw-rounded-lg",
3902
3899
  style: {
3903
3900
  display: "flex",
@@ -4030,7 +4027,7 @@ const mr = () => {
4030
4027
  }
4031
4028
  ), Cr = ({ tabs: r, renderItem: e, initialTab: n }) => {
4032
4029
  const [a, s] = N(n ?? r[0].toLowerCase());
4033
- M(() => {
4030
+ S(() => {
4034
4031
  n && s(n);
4035
4032
  }, [n]);
4036
4033
  const o = (i) => {
@@ -4097,17 +4094,17 @@ const qr = ({ path: r }) => /* @__PURE__ */ t(je, { children: /* @__PURE__ */ w(
4097
4094
  { path: "kanban-campania", search: (o == null ? void 0 : o.taskName) ?? "" },
4098
4095
  { path: "kanban-general", search: (o == null ? void 0 : o.taskName) ?? "" }
4099
4096
  ]), [m, x] = N(), y = Z(null);
4100
- M(() => {
4097
+ S(() => {
4101
4098
  var T;
4102
- c(l === "lista-campanias" ? "lista" : "kanban"), n(l), x(((T = k.find(($) => $.path === l)) == null ? void 0 : T.search) ?? "");
4103
- }, [r, l]), M(() => {
4099
+ c(l === "lista-campanias" ? "lista" : "kanban"), n(l), x(((T = k.find((M) => M.path === l)) == null ? void 0 : T.search) ?? "");
4100
+ }, [r, l]), S(() => {
4104
4101
  var T;
4105
- ((T = S()) == null ? void 0 : T.trim()) === "" && a({
4102
+ ((T = A()) == null ? void 0 : T.trim()) === "" && a({
4106
4103
  name: l === "lista-campanias" ? "search" : "taskName",
4107
4104
  value: null
4108
4105
  }), s();
4109
4106
  }, [k]);
4110
- const b = (T) => ({
4107
+ const f = (T) => ({
4111
4108
  "kanban-general": "Kanban General",
4112
4109
  "lista-campanias": "Campanias",
4113
4110
  "kanban-campania": `Kanban de ${d.project}`
@@ -4116,15 +4113,15 @@ const qr = ({ path: r }) => /* @__PURE__ */ t(je, { children: /* @__PURE__ */ w(
4116
4113
  }, q = ["lista-campanias", "kanban-campania"], P = {
4117
4114
  "lista-campanias": ["lista", "gantt"],
4118
4115
  "kanban-campania": ["kanban", "lista", "gantt"]
4119
- }, S = () => {
4116
+ }, A = () => {
4120
4117
  var T;
4121
- return ((T = k.find(($) => $.path === l)) == null ? void 0 : T.search) ?? "";
4118
+ return ((T = k.find((M) => M.path === l)) == null ? void 0 : T.search) ?? "";
4122
4119
  }, E = (T) => {
4123
4120
  g(
4124
- ($) => $.map((B) => B.path === l ? { ...B, search: T } : B)
4121
+ (M) => M.map((B) => B.path === l ? { ...B, search: T } : B)
4125
4122
  );
4126
4123
  };
4127
- return M(() => {
4124
+ return S(() => {
4128
4125
  const T = setTimeout(() => {
4129
4126
  a({
4130
4127
  name: l === "lista-campanias" ? "search" : "taskName",
@@ -4154,7 +4151,7 @@ const qr = ({ path: r }) => /* @__PURE__ */ t(je, { children: /* @__PURE__ */ w(
4154
4151
  )
4155
4152
  }
4156
4153
  ),
4157
- /* @__PURE__ */ t("h2", { className: "tw-text-texts tw-font-sans tw-text-[1.6rem] tw-font-semibold ", children: b(l) }),
4154
+ /* @__PURE__ */ t("h2", { className: "tw-text-texts tw-font-sans tw-text-[1.6rem] tw-font-semibold ", children: f(l) }),
4158
4155
  q.includes(l) && /* @__PURE__ */ t(
4159
4156
  Cr,
4160
4157
  {