@isettingkit/business-rules 2.2.10 → 2.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.es.js +193 -191
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsx as a, jsxs as m, Fragment as _ } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as m, Fragment as V } from "react/jsx-runtime";
2
2
  import { MdOutlineDelete as ft, MdClear as Gt, MdAdd as We, MdOutlineCreate as zn, MdExpandLess as Hn, MdExpandMore as Lt, MdInfo as Gn, MdCached as Bn, MdOutlineInfo as qn, MdClose as Wn, MdOutlineFilterAltOff as Yn, MdOutlineFilterAlt as Tn, MdChevronRight as Kt, MdArrowRight as Xn, MdOutlineArrowCircleLeft as Qn, MdOutlineArrowCircleRight as Jn } from "react-icons/md";
3
- import { inube as I, Stack as y, Divider as Y, Icon as G, Text as F, SkeletonLine as re, useMediaQuery as ue, Blanket as Bt, Button as Q, Grid as Ye, Toggle as mt, Checkbox as qt, Date as ke, Box as Zn, Tag as Ve, Tabs as xn, SkeletonIcon as Kn, Fieldset as _e, OptionList as eo, Checkpicker as to } from "@inubekit/inubekit";
3
+ import { inube as I, Stack as y, Divider as Y, Icon as G, Text as F, SkeletonLine as re, useMediaQuery as ue, Blanket as Bt, Button as Q, Grid as Ye, Toggle as mt, Checkbox as qt, Date as ke, Box as Zn, Tag as Pe, Tabs as xn, SkeletonIcon as Kn, Fieldset as Ve, OptionList as eo, Checkpicker as to } from "@inubekit/inubekit";
4
4
  import E, { keyframes as Wt, ThemeContext as no } from "styled-components";
5
- import { ValueDataType as z, ValueHowToSetUp as H, DecisionConditionRender as ut, DecisionConditionRenderNew as en } from "@isettingkit/input";
5
+ import { ValueDataType as H, ValueHowToSetUp as j, DecisionConditionRender as ut, DecisionConditionRenderNew as en } from "@isettingkit/input";
6
6
  import { DecisionViewConditionRenderer as Ee, DecisionViewConditionRendererNew as it } from "@isettingkit/view";
7
7
  import { createPortal as Yt } from "react-dom";
8
8
  import { useFormik as Xt } from "formik";
9
9
  import { string as pe, mixed as $e, object as te, number as he, lazy as Ge, date as Ae } from "yup";
10
- import V, { useState as B, useRef as je, useEffect as Be, useContext as oo } from "react";
10
+ import P, { useState as B, useRef as je, useEffect as Be, useContext as oo } from "react";
11
11
  import { Link as Dn, useLocation as ro } from "react-router-dom";
12
12
  import io from "axios";
13
13
  import { franc as ao } from "franc-min";
@@ -50,7 +50,7 @@ const Xe = (e) => {
50
50
  const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
51
51
  return /* @__PURE__ */ a(lo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
52
52
  t,
53
- n && /* @__PURE__ */ m(_, { children: [
53
+ n && /* @__PURE__ */ m(V, { children: [
54
54
  /* @__PURE__ */ a(Y, {}),
55
55
  /* @__PURE__ */ a(y, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
56
56
  G,
@@ -161,7 +161,7 @@ const mo = {
161
161
  }
162
162
  ) }) }, p.conditionName)),
163
163
  u.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
164
- d && /* @__PURE__ */ a(_, { children: o && /* @__PURE__ */ a(
164
+ d && /* @__PURE__ */ a(V, { children: o && /* @__PURE__ */ a(
165
165
  Ee,
166
166
  {
167
167
  element: o.element,
@@ -211,8 +211,8 @@ const mo = {
211
211
  element: {
212
212
  labelName: o == null ? void 0 : o.terms,
213
213
  value: String(t.effectiveFrom),
214
- howToSetTheDecision: H.RANGE,
215
- decisionDataType: z.DATE
214
+ howToSetTheDecision: j.RANGE,
215
+ decisionDataType: H.DATE
216
216
  },
217
217
  valueData: Ue({
218
218
  labelName: o == null ? void 0 : o.terms,
@@ -220,21 +220,21 @@ const mo = {
220
220
  from: String(t.effectiveFrom),
221
221
  to: String(t.validUntil)
222
222
  },
223
- howToSetTheDecision: H.RANGE,
224
- decisionDataType: z.DATE
223
+ howToSetTheDecision: j.RANGE,
224
+ decisionDataType: H.DATE
225
225
  })
226
226
  } : r && !i ? {
227
227
  element: {
228
228
  labelName: o == null ? void 0 : o.terms,
229
229
  value: String(t.effectiveFrom),
230
- howToSetTheDecision: H.EQUAL,
231
- decisionDataType: z.DATE
230
+ howToSetTheDecision: j.EQUAL,
231
+ decisionDataType: H.DATE
232
232
  },
233
233
  valueData: Ue({
234
234
  labelName: o == null ? void 0 : o.terms,
235
235
  value: String(t.effectiveFrom),
236
- howToSetTheDecision: H.EQUAL,
237
- decisionDataType: z.DATE
236
+ howToSetTheDecision: j.EQUAL,
237
+ decisionDataType: H.DATE
238
238
  })
239
239
  } : null, d = t ? {
240
240
  labelName: t.labelName || "",
@@ -513,7 +513,7 @@ const Cn = E.div`
513
513
  handleDelete: g,
514
514
  textValues: i
515
515
  }), S = (r == null ? void 0 : r.length) === 0 && !u;
516
- return /* @__PURE__ */ m(_, { children: [
516
+ return /* @__PURE__ */ m(V, { children: [
517
517
  /* @__PURE__ */ a(xo, { children: /* @__PURE__ */ a(Do, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
518
518
  y,
519
519
  {
@@ -524,7 +524,7 @@ const Cn = E.div`
524
524
  justifyContent: "center",
525
525
  alignItems: "center",
526
526
  children: [
527
- /* @__PURE__ */ a(F, { as: "span", type: "label", size: "large", appearance: "gray", children: o || /* @__PURE__ */ m(_, { children: [
527
+ /* @__PURE__ */ a(F, { as: "span", type: "label", size: "large", appearance: "gray", children: o || /* @__PURE__ */ m(V, { children: [
528
528
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
529
529
  /* @__PURE__ */ m(
530
530
  F,
@@ -749,14 +749,14 @@ const Fo = E.div`
749
749
  },
750
750
  `loading-card-${t}`
751
751
  );
752
- }, Oo = (e) => e.value, Mo = (e) => e.value, Po = (e) => e.value, Vo = (e) => ({
752
+ }, Oo = (e) => e.value, Mo = (e) => e.value, _o = (e) => e.value, Po = (e) => ({
753
753
  from: e.from ?? "",
754
754
  to: e.to ?? ""
755
- }), _o = (e) => e.value, jo = (e) => e.value, Uo = (e) => e.value, zo = {
755
+ }), Vo = (e) => e.value, jo = (e) => e.value, Uo = (e) => e.value, zo = {
756
756
  [k.LIST_OF_VALUES]: Mo,
757
- [k.LIST_OF_VALUES_MULTI]: Po,
758
- [k.RANGE]: Vo,
759
- [k.GREATER_THAN]: _o,
757
+ [k.LIST_OF_VALUES_MULTI]: _o,
758
+ [k.RANGE]: Po,
759
+ [k.GREATER_THAN]: Vo,
760
760
  [k.LESS_THAN]: jo,
761
761
  [k.EQUAL]: Uo
762
762
  }, ze = (e) => {
@@ -842,7 +842,7 @@ const Fo = E.div`
842
842
  }
843
843
  ) }) }, p.conditionName)),
844
844
  u.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
845
- d && /* @__PURE__ */ a(_, { children: o && /* @__PURE__ */ a(
845
+ d && /* @__PURE__ */ a(V, { children: o && /* @__PURE__ */ a(
846
846
  Ee,
847
847
  {
848
848
  element: o.element,
@@ -894,8 +894,8 @@ const Fo = E.div`
894
894
  element: {
895
895
  labelName: o == null ? void 0 : o.terms,
896
896
  value: String(t.effectiveFrom),
897
- howToSetTheDecision: H.RANGE,
898
- decisionDataType: z.DATE
897
+ howToSetTheDecision: j.RANGE,
898
+ decisionDataType: H.DATE
899
899
  },
900
900
  valueData: ze({
901
901
  labelName: o == null ? void 0 : o.terms,
@@ -903,21 +903,21 @@ const Fo = E.div`
903
903
  from: String(t.effectiveFrom),
904
904
  to: String(t.validUntil)
905
905
  },
906
- howToSetTheDecision: H.RANGE,
907
- decisionDataType: z.DATE
906
+ howToSetTheDecision: j.RANGE,
907
+ decisionDataType: H.DATE
908
908
  })
909
909
  } : r && !i ? {
910
910
  element: {
911
911
  labelName: o == null ? void 0 : o.terms,
912
912
  value: String(t.effectiveFrom),
913
- howToSetTheDecision: H.EQUAL,
914
- decisionDataType: z.DATE
913
+ howToSetTheDecision: j.EQUAL,
914
+ decisionDataType: H.DATE
915
915
  },
916
916
  valueData: ze({
917
917
  labelName: o == null ? void 0 : o.terms,
918
918
  value: String(t.effectiveFrom),
919
- howToSetTheDecision: H.EQUAL,
920
- decisionDataType: z.DATE
919
+ howToSetTheDecision: j.EQUAL,
920
+ decisionDataType: H.DATE
921
921
  })
922
922
  } : null, d = t ? {
923
923
  labelName: t.labelName || "",
@@ -978,7 +978,7 @@ const Yo = (e) => {
978
978
  const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
979
979
  return /* @__PURE__ */ a(Wo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "16px", padding: "12px 16px", children: [
980
980
  t,
981
- n && /* @__PURE__ */ m(_, { children: [
981
+ n && /* @__PURE__ */ m(V, { children: [
982
982
  /* @__PURE__ */ a(Y, {}),
983
983
  /* @__PURE__ */ a(y, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
984
984
  G,
@@ -1093,7 +1093,7 @@ const Yo = (e) => {
1093
1093
  }),
1094
1094
  value: { from: t, to: n }
1095
1095
  };
1096
- }, At = (e, t) => t === z.PERCENTAGE ? {
1096
+ }, At = (e, t) => t === H.PERCENTAGE ? {
1097
1097
  schema: he().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
1098
1098
  value: e
1099
1099
  } : {
@@ -1135,7 +1135,7 @@ function ir({
1135
1135
  var c, h;
1136
1136
  const o = ((c = e.conditionGroups[0]) == null ? void 0 : c.conditionsThatEstablishesTheDecision) ?? [], r = o.reduce((g, f) => (dt(f.value) && (g[f.conditionName] = f.value), g), {}), i = Object.keys(r).length > 0, s = {
1137
1137
  ruleName: e.ruleName || "",
1138
- decisionDataType: e.decisionDataType || z.ALPHABETICAL,
1138
+ decisionDataType: e.decisionDataType || H.ALPHABETICAL,
1139
1139
  howToSetTheDecision: e.howToSetTheDecision || "",
1140
1140
  value: e.value ?? "",
1141
1141
  effectiveFrom: e.effectiveFrom || "",
@@ -1246,7 +1246,7 @@ const ar = E.div`
1246
1246
  name: s,
1247
1247
  valueToggle: d = ""
1248
1248
  } = e, [l, u] = B(t);
1249
- return /* @__PURE__ */ m(_, { children: [
1249
+ return /* @__PURE__ */ m(V, { children: [
1250
1250
  /* @__PURE__ */ a(y, { children: /* @__PURE__ */ a(
1251
1251
  mt,
1252
1252
  {
@@ -1261,7 +1261,7 @@ const ar = E.div`
1261
1261
  children: /* @__PURE__ */ a(F, { size: "medium", type: "label", weight: "bold", as: "span", children: i })
1262
1262
  }
1263
1263
  ) }),
1264
- l && /* @__PURE__ */ a(_, { children: n })
1264
+ l && /* @__PURE__ */ a(V, { children: n })
1265
1265
  ] });
1266
1266
  }, dr = (e) => {
1267
1267
  const {
@@ -1285,7 +1285,7 @@ const ar = E.div`
1285
1285
  }, A = ($) => {
1286
1286
  S($.target.value), n($);
1287
1287
  }, R = ue("(max-width: 400px)");
1288
- return /* @__PURE__ */ m(_, { children: [
1288
+ return /* @__PURE__ */ m(V, { children: [
1289
1289
  /* @__PURE__ */ m(y, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1290
1290
  /* @__PURE__ */ a(
1291
1291
  F,
@@ -1424,7 +1424,7 @@ const ar = E.div`
1424
1424
  ]
1425
1425
  }
1426
1426
  ) }) }),
1427
- n.terms && /* @__PURE__ */ m(_, { children: [
1427
+ n.terms && /* @__PURE__ */ m(V, { children: [
1428
1428
  /* @__PURE__ */ a(Y, { dashed: !0 }),
1429
1429
  /* @__PURE__ */ a(
1430
1430
  dr,
@@ -1559,7 +1559,7 @@ const ar = E.div`
1559
1559
  handleDelete: g,
1560
1560
  textValues: i
1561
1561
  }), S = (r == null ? void 0 : r.length) === 0 && !u;
1562
- return /* @__PURE__ */ m(_, { children: [
1562
+ return /* @__PURE__ */ m(V, { children: [
1563
1563
  /* @__PURE__ */ a(Fo, { children: /* @__PURE__ */ a(Ro, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
1564
1564
  y,
1565
1565
  {
@@ -1570,7 +1570,7 @@ const ar = E.div`
1570
1570
  justifyContent: "center",
1571
1571
  alignItems: "center",
1572
1572
  children: [
1573
- /* @__PURE__ */ a(F, { as: "span", type: "label", size: "large", appearance: "gray", children: o || /* @__PURE__ */ m(_, { children: [
1573
+ /* @__PURE__ */ a(F, { as: "span", type: "label", size: "large", appearance: "gray", children: o || /* @__PURE__ */ m(V, { children: [
1574
1574
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
1575
1575
  /* @__PURE__ */ m(
1576
1576
  F,
@@ -1702,7 +1702,7 @@ const ar = E.div`
1702
1702
  border-radius: ${({ $borderRadius: e }) => e};
1703
1703
  box-sizing: ${({ $boxSizing: e }) => e};
1704
1704
  overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
1705
- `, ce = V.forwardRef(
1705
+ `, ce = P.forwardRef(
1706
1706
  (e, t) => {
1707
1707
  const {
1708
1708
  children: n,
@@ -1821,7 +1821,7 @@ const Sr = (e) => {
1821
1821
  children: [
1822
1822
  /* @__PURE__ */ m(y, { gap: "12px", children: [
1823
1823
  /* @__PURE__ */ a(wr, { children: /* @__PURE__ */ a(
1824
- Ve,
1824
+ Pe,
1825
1825
  {
1826
1826
  id: "tag",
1827
1827
  appearance: "gray",
@@ -1841,7 +1841,7 @@ const Sr = (e) => {
1841
1841
  ) })
1842
1842
  ] }),
1843
1843
  /* @__PURE__ */ m(y, { gap: "12px", children: [
1844
- t && /* @__PURE__ */ m(_, { children: [
1844
+ t && /* @__PURE__ */ m(V, { children: [
1845
1845
  /* @__PURE__ */ a(
1846
1846
  G,
1847
1847
  {
@@ -1881,7 +1881,7 @@ const Sr = (e) => {
1881
1881
  },
1882
1882
  o.ruleName
1883
1883
  ) }),
1884
- l && /* @__PURE__ */ m(_, { children: [
1884
+ l && /* @__PURE__ */ m(V, { children: [
1885
1885
  /* @__PURE__ */ a(Y, { dashed: !0 }),
1886
1886
  N ? /* @__PURE__ */ a(
1887
1887
  xn,
@@ -2013,7 +2013,7 @@ const Sr = (e) => {
2013
2013
  Year: { label: "en años", labelView: "años" },
2014
2014
  Month: { label: "en meses", labelView: "meses" },
2015
2015
  Day: { label: "en días", labelView: "días" }
2016
- }, Pt = (e, t, n = !1) => {
2016
+ }, _t = (e, t, n = !1) => {
2017
2017
  const o = Er[t ?? ""];
2018
2018
  return o ? n ? `${e} ${o.labelView}` : `${e} ${o.label}` : e;
2019
2019
  }, Nr = (e, t) => {
@@ -2058,7 +2058,7 @@ const Sr = (e) => {
2058
2058
  if (isNaN(o.getTime())) return "";
2059
2059
  const r = o.getUTCDate(), i = o.getUTCMonth(), s = o.getUTCFullYear(), d = String(r).padStart(2, "0"), l = t[i] ?? "";
2060
2060
  return l ? `${d}/${l}/${s}` : "";
2061
- }, Vt = (e) => {
2061
+ }, Pt = (e) => {
2062
2062
  if (e == null) return !1;
2063
2063
  if (typeof e == "number") return !Number.isNaN(e);
2064
2064
  if (typeof e == "string") return e.trim().length > 0;
@@ -2066,10 +2066,10 @@ const Sr = (e) => {
2066
2066
  if (typeof e == "object") {
2067
2067
  if (Object.keys(e).length === 0) return !1;
2068
2068
  const n = e.from ?? e.min ?? e.start, o = e.to ?? e.max ?? e.end;
2069
- return n !== void 0 || o !== void 0 ? Vt(n) || Vt(o) : !0;
2069
+ return n !== void 0 || o !== void 0 ? Pt(n) || Pt(o) : !0;
2070
2070
  }
2071
2071
  return !1;
2072
- }, kr = (e) => Vt(e == null ? void 0 : e.value), pt = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, Ar = (e) => {
2072
+ }, kr = (e) => Pt(e == null ? void 0 : e.value), pt = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, Ar = (e) => {
2073
2073
  var i, s;
2074
2074
  const t = ((i = e.listOfPossibleValues) == null ? void 0 : i.list) ?? [], n = e.value, o = Array.isArray(n) ? n : [n];
2075
2075
  return { list: ((s = t.filter((d) => o.includes(d.value)).map((d, l) => ({
@@ -2094,38 +2094,40 @@ const Sr = (e) => {
2094
2094
  element: {
2095
2095
  labelName: r == null ? void 0 : r.effectiveFrom,
2096
2096
  value: at(n.effectiveFrom),
2097
- howToSetTheDecision: H.EQUAL,
2098
- decisionDataType: z.DATE
2097
+ howToSetTheDecision: j.EQUAL,
2098
+ decisionDataType: H.DATE
2099
2099
  },
2100
2100
  valueData: He({
2101
2101
  labelName: r == null ? void 0 : r.effectiveFrom,
2102
2102
  value: at(n.effectiveFrom),
2103
- howToSetTheDecision: H.EQUAL,
2104
- decisionDataType: z.DATE
2103
+ howToSetTheDecision: j.EQUAL,
2104
+ decisionDataType: H.DATE
2105
2105
  })
2106
2106
  } : null, f = h ? {
2107
2107
  element: {
2108
2108
  labelName: r == null ? void 0 : r.validUntil,
2109
2109
  value: at(n.validUntil),
2110
- howToSetTheDecision: H.EQUAL,
2111
- decisionDataType: z.DATE
2110
+ howToSetTheDecision: j.EQUAL,
2111
+ decisionDataType: H.DATE
2112
2112
  },
2113
2113
  valueData: He({
2114
2114
  labelName: r == null ? void 0 : r.validUntil,
2115
2115
  value: at(n.validUntil),
2116
- howToSetTheDecision: H.EQUAL,
2117
- decisionDataType: z.DATE
2116
+ howToSetTheDecision: j.EQUAL,
2117
+ decisionDataType: H.DATE
2118
2118
  })
2119
- } : null, v = (n == null ? void 0 : n.howToSetTheDecision) || H.EQUAL, T = n && (v === "ListOfValues" || v === "ListOfValuesMulti") ? Ar(n).list : He(n), w = n ? {
2119
+ } : null, v = (n == null ? void 0 : n.howToSetTheDecision) || j.EQUAL, T = n && (v === j.LIST_OF_VALUES || v === j.LIST_OF_VALUES_MULTI) ? Ar(n).list : He(n), w = n ? {
2120
2120
  labelName: t && n.labelName || "",
2121
- decisionDataType: n.decisionDataType || z.ALPHABETICAL,
2121
+ decisionDataType: n.decisionDataType || H.ALPHABETICAL,
2122
2122
  value: T,
2123
2123
  howToSetTheDecision: v,
2124
2124
  validUntil: n.validUntil
2125
- } : null, D = V.useMemo(
2125
+ } : null;
2126
+ console.log("decisionMapper from library: ", w);
2127
+ const D = P.useMemo(
2126
2128
  () => n ? ye(n) : {},
2127
2129
  [n]
2128
- ), S = ((Et = (St = n == null ? void 0 : n.conditionGroups) == null ? void 0 : St.map((O) => O == null ? void 0 : O.ConditionGroupId)) == null ? void 0 : Et.filter(Boolean)) || Object.keys(D), N = S[0] || "group-primary", C = V.useMemo(() => {
2130
+ ), S = ((Et = (St = n == null ? void 0 : n.conditionGroups) == null ? void 0 : St.map((O) => O == null ? void 0 : O.ConditionGroupId)) == null ? void 0 : Et.filter(Boolean)) || Object.keys(D), N = S[0] || "group-primary", C = P.useMemo(() => {
2129
2131
  const O = {}, q = D[N] || [], ee = D["group-primary"] || [];
2130
2132
  O["group-primary"] = N === "group-primary" ? ee : [...q, ...ee];
2131
2133
  for (const x of S)
@@ -2133,35 +2135,35 @@ const Sr = (e) => {
2133
2135
  for (const x of Object.keys(D))
2134
2136
  x === "group-primary" || x === N || x in O || (O[x] = D[x]);
2135
2137
  return O;
2136
- }, [D, N, S]), A = V.useMemo(() => {
2138
+ }, [D, N, S]), A = P.useMemo(() => {
2137
2139
  const O = {};
2138
2140
  return Object.keys(C).forEach((q) => {
2139
2141
  const ee = C[q];
2140
2142
  ee && Array.isArray(ee) ? O[q] = ee.map((x) => {
2141
2143
  let L = x.labelName;
2142
- x.timeUnit && x.labelName && (L = Pt(x.labelName, x.timeUnit));
2143
- let P = x.value;
2144
- return (x == null ? void 0 : x.howToSetTheCondition) !== void 0 && (x == null ? void 0 : x.howToSetTheCondition) !== null && (x == null ? void 0 : x.value) !== void 0 && (x == null ? void 0 : x.value) !== null && (x == null ? void 0 : x.value) !== "" && (P = Nr(
2144
+ x.timeUnit && x.labelName && (L = _t(x.labelName, x.timeUnit));
2145
+ let _ = x.value;
2146
+ return (x == null ? void 0 : x.howToSetTheCondition) !== void 0 && (x == null ? void 0 : x.howToSetTheCondition) !== null && (x == null ? void 0 : x.value) !== void 0 && (x == null ? void 0 : x.value) !== null && (x == null ? void 0 : x.value) !== "" && (_ = Nr(
2145
2147
  x.value,
2146
2148
  x.howToSetTheCondition
2147
2149
  )), {
2148
2150
  ...x,
2149
2151
  labelName: L,
2150
- value: P
2152
+ value: _
2151
2153
  };
2152
2154
  }) : O[q] = ee;
2153
2155
  }), O;
2154
2156
  }, [C]), R = En(
2155
2157
  A,
2156
2158
  (O) => !O.hidden
2157
- ), $ = V.useMemo(() => {
2159
+ ), $ = P.useMemo(() => {
2158
2160
  const O = Object.entries(R).map(
2159
2161
  ([ee, x]) => [ee, x.filter(kr)]
2160
2162
  ), q = {};
2161
2163
  for (const [ee, x] of O)
2162
2164
  x.length > 0 && (q[ee] = x);
2163
2165
  return q;
2164
- }, [R]), ae = V.useMemo(() => {
2166
+ }, [R]), ae = P.useMemo(() => {
2165
2167
  const O = Object.keys($);
2166
2168
  return O.includes("group-primary") ? ["group-primary", ...O.filter((q) => q !== "group-primary")] : O;
2167
2169
  }, [$]), le = {};
@@ -2173,7 +2175,7 @@ const Sr = (e) => {
2173
2175
  label: O === "group-primary" ? pt(O, 0) : pt(O, Number(q.split("-").at(-1))),
2174
2176
  isDisabled: !1
2175
2177
  };
2176
- }), [Ze, xt] = V.useState(
2178
+ }), [Ze, xt] = P.useState(
2177
2179
  ((Nt = Je[0]) == null ? void 0 : Nt.id) ?? "mainCondition"
2178
2180
  ), Ke = (O) => xt(O), Dt = le[Ze] ?? ae[0] ?? "group-primary", et = $[Dt] ?? [], tt = ae.length > 1, wt = Array.from({ length: 5 }), nt = !!(!o && n && r && w), Ct = et.length < 2 ? "start" : "space-between", Le = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
2179
2181
  return /* @__PURE__ */ a(
@@ -2324,7 +2326,7 @@ const $r = E.div`
2324
2326
  )
2325
2327
  }
2326
2328
  ) }) }, n.decisionId) : null;
2327
- }, Pr = (e) => {
2329
+ }, _r = (e) => {
2328
2330
  const {
2329
2331
  customTitleContentAddCard: t,
2330
2332
  index: n,
@@ -2368,14 +2370,14 @@ const $r = E.div`
2368
2370
  )
2369
2371
  }
2370
2372
  ) }, `add-decision-${n}`);
2371
- }, Vr = {
2373
+ }, Pr = {
2372
2374
  loading: Or,
2373
2375
  decision: Mr,
2374
- add: Pr
2375
- }, _t = (e) => {
2376
- const { type: t } = e, n = Vr[t];
2376
+ add: _r
2377
+ }, Vt = (e) => {
2378
+ const { type: t } = e, n = Pr[t];
2377
2379
  return n ? n(e) : null;
2378
- }, _r = (e) => {
2380
+ }, Vr = (e) => {
2379
2381
  const {
2380
2382
  cardTitle: t,
2381
2383
  controls: n,
@@ -2388,7 +2390,7 @@ const $r = E.div`
2388
2390
  isOpenFor: u,
2389
2391
  toggleAt: p
2390
2392
  } = e, c = i ? Array.from({ length: 3 }).map(
2391
- (g, f) => _t({
2393
+ (g, f) => Vt({
2392
2394
  type: "loading",
2393
2395
  index: f,
2394
2396
  controls: n,
@@ -2399,7 +2401,7 @@ const $r = E.div`
2399
2401
  textValues: l
2400
2402
  })
2401
2403
  ) : r == null ? void 0 : r.map(
2402
- (g, f) => _t({
2404
+ (g, f) => Vt({
2403
2405
  cardTitle: t,
2404
2406
  type: "decision",
2405
2407
  decision: g,
@@ -2529,7 +2531,7 @@ const $r = E.div`
2529
2531
  }, It = (e, t) => {
2530
2532
  if (typeof e == "object" && e !== null && "from" in e && "to" in e) {
2531
2533
  const n = e;
2532
- return t === z.PERCENTAGE ? {
2534
+ return t === H.PERCENTAGE ? {
2533
2535
  schema: te({
2534
2536
  from: he().required("El campo desde es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
2535
2537
  to: he().required("El campo hasta es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100")
@@ -2543,7 +2545,7 @@ const $r = E.div`
2543
2545
  value: n
2544
2546
  };
2545
2547
  }
2546
- return t === z.PERCENTAGE ? {
2548
+ return t === H.PERCENTAGE ? {
2547
2549
  schema: he().required("El campo porcentaje es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
2548
2550
  value: e
2549
2551
  } : {
@@ -2595,7 +2597,7 @@ function Yr({
2595
2597
  }
2596
2598
  ), d = {
2597
2599
  ruleName: e.ruleName || "",
2598
- decisionDataType: e.decisionDataType || z.ALPHABETICAL,
2600
+ decisionDataType: e.decisionDataType || H.ALPHABETICAL,
2599
2601
  howToSetTheDecision: e.howToSetTheDecision || "",
2600
2602
  value: e.value || "",
2601
2603
  effectiveFrom: e.effectiveFrom || "",
@@ -2841,9 +2843,9 @@ const Xr = E.div`
2841
2843
  onCloseRedefineConfirm: w,
2842
2844
  onConfirmRedefine: D
2843
2845
  } = e;
2844
- return /* @__PURE__ */ m(_, { children: [
2846
+ return /* @__PURE__ */ m(V, { children: [
2845
2847
  /* @__PURE__ */ a("form", { onSubmit: r.handleSubmit, children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", width: "100%", children: [
2846
- /* @__PURE__ */ a(_e, { legend: "Decisión N° 01", spacing: "wide", children: /* @__PURE__ */ m(
2848
+ /* @__PURE__ */ a(Ve, { legend: "Decisión N° 01", spacing: "wide", children: /* @__PURE__ */ m(
2847
2849
  y,
2848
2850
  {
2849
2851
  justifyContent: "center",
@@ -2859,7 +2861,7 @@ const Xr = E.div`
2859
2861
  ]
2860
2862
  }
2861
2863
  ) }),
2862
- o && o.length > 0 && /* @__PURE__ */ a(_e, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ m(y, { direction: "column", gap: "20px", width: "100%", children: [
2864
+ o && o.length > 0 && /* @__PURE__ */ a(Ve, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ m(y, { direction: "column", gap: "20px", width: "100%", children: [
2863
2865
  /* @__PURE__ */ a(
2864
2866
  xn,
2865
2867
  {
@@ -2917,7 +2919,7 @@ const Xr = E.div`
2917
2919
  }) }),
2918
2920
  u && /* @__PURE__ */ a(F, { type: "label", size: "medium", appearance: "danger", children: n ?? "Existen errores en el formulario, por favor revísalos." })
2919
2921
  ] }) }),
2920
- /* @__PURE__ */ a(_e, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
2922
+ /* @__PURE__ */ a(Ve, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
2921
2923
  Qr,
2922
2924
  {
2923
2925
  labelStart: g.termStart,
@@ -3035,14 +3037,14 @@ const Oe = (e) => {
3035
3037
  return e ?? de.EQUAL;
3036
3038
  }, Me = (e) => {
3037
3039
  switch (e) {
3038
- case H.LIST_OF_VALUES_MULTI:
3040
+ case j.LIST_OF_VALUES_MULTI:
3039
3041
  return [];
3040
- case H.RANGE:
3042
+ case j.RANGE:
3041
3043
  return "";
3042
- case H.EQUAL:
3043
- case H.GREATER_THAN:
3044
- case H.LESS_THAN:
3045
- case H.LIST_OF_VALUES:
3044
+ case j.EQUAL:
3045
+ case j.GREATER_THAN:
3046
+ case j.LESS_THAN:
3047
+ case j.LIST_OF_VALUES:
3046
3048
  default:
3047
3049
  return "";
3048
3050
  }
@@ -3087,23 +3089,23 @@ const Oe = (e) => {
3087
3089
  label: x === "group-primary" ? pt(x, 0) : pt(x, Number(L.split("-").at(-1))),
3088
3090
  isDisabled: !1
3089
3091
  };
3090
- }), [S, N] = V.useState(
3092
+ }), [S, N] = P.useState(
3091
3093
  ((q = D[0]) == null ? void 0 : q.id) ?? "mainCondition"
3092
3094
  ), C = (x) => N(x), A = T[S] ?? "group-primary";
3093
- V.useEffect(() => {
3095
+ P.useEffect(() => {
3094
3096
  var W;
3095
3097
  const x = (W = l.values) == null ? void 0 : W.conditionsThatEstablishesTheDecision;
3096
3098
  let L = !1;
3097
3099
  if (x && typeof x == "object" && (L = Object.values(x).some(
3098
3100
  (X) => X && typeof X == "object" && Object.keys(X).length > 0
3099
3101
  )), L) return;
3100
- const P = ye(t);
3101
- if (!P || Object.keys(P).length === 0)
3102
+ const _ = ye(t);
3103
+ if (!_ || Object.keys(_).length === 0)
3102
3104
  return;
3103
3105
  const M = Object.fromEntries(
3104
- Object.entries(P).map(([X, j]) => {
3106
+ Object.entries(_).map(([X, U]) => {
3105
3107
  const me = Object.fromEntries(
3106
- j.map((se) => {
3108
+ U.map((se) => {
3107
3109
  const ge = Oe(se.howToSetTheCondition), ve = se.value ?? Me(ge);
3108
3110
  return [se.conditionName, ve];
3109
3111
  })
@@ -3116,21 +3118,21 @@ const Oe = (e) => {
3116
3118
  M,
3117
3119
  !1
3118
3120
  );
3119
- }, [t]), V.useEffect(() => {
3120
- var j;
3121
- const x = (j = l.values) == null ? void 0 : j.conditionsThatEstablishesTheDecision;
3121
+ }, [t]), P.useEffect(() => {
3122
+ var U;
3123
+ const x = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision;
3122
3124
  if (!x || typeof x != "object") return;
3123
- const L = ye(p), P = Object.entries(x).map(
3125
+ const L = ye(p), _ = Object.entries(x).map(
3124
3126
  ([me, se]) => {
3125
3127
  const ge = L[me] || [], ve = Object.keys(se).map((be) => {
3126
- const U = se[be], ne = ge.find((Un) => Un.conditionName === be) || {}, kt = Oe(
3127
- ne.howToSetTheCondition ?? (U == null ? void 0 : U.howToSetTheCondition)
3128
- ), ot = ne.value ?? Me(kt), rt = U && typeof U == "object" && "value" in U ? U.value : U;
3128
+ const z = se[be], ne = ge.find((Un) => Un.conditionName === be) || {}, kt = Oe(
3129
+ ne.howToSetTheCondition ?? (z == null ? void 0 : z.howToSetTheCondition)
3130
+ ), ot = ne.value ?? Me(kt), rt = z && typeof z == "object" && "value" in z ? z.value : z;
3129
3131
  return {
3130
3132
  // meta (labelName, descriptionUse, timeUnit, etc.)
3131
3133
  ...ne,
3132
3134
  // any extra fields that might live in the wrapper
3133
- ...typeof U == "object" && !Array.isArray(U) ? U : {},
3135
+ ...typeof z == "object" && !Array.isArray(z) ? z : {},
3134
3136
  conditionName: be,
3135
3137
  value: rt !== void 0 ? rt : ot
3136
3138
  };
@@ -3140,10 +3142,10 @@ const Oe = (e) => {
3140
3142
  conditionsThatEstablishesTheDecision: ve
3141
3143
  };
3142
3144
  }
3143
- ), M = l.values.conditionGroups, W = JSON.stringify(P), X = JSON.stringify(M ?? []);
3144
- W !== X && l.setFieldValue("conditionGroups", P, !1);
3145
+ ), M = l.values.conditionGroups, W = JSON.stringify(_), X = JSON.stringify(M ?? []);
3146
+ W !== X && l.setFieldValue("conditionGroups", _, !1);
3145
3147
  }, [(ee = l.values) == null ? void 0 : ee.conditionsThatEstablishesTheDecision, p]);
3146
- const R = V.useMemo(() => {
3148
+ const R = P.useMemo(() => {
3147
3149
  const x = [
3148
3150
  ...Object.keys(g).filter(
3149
3151
  (M) => M === "group-primary"
@@ -3153,30 +3155,30 @@ const Oe = (e) => {
3153
3155
  )
3154
3156
  ];
3155
3157
  let L = !1;
3156
- const P = x.map((M) => {
3157
- const X = (g[M] ?? []).map((j, me) => {
3158
+ const _ = x.map((M) => {
3159
+ const X = (g[M] ?? []).map((U, me) => {
3158
3160
  const se = !L && M === "group-primary" && me === 0;
3159
3161
  se && (L = !0);
3160
- const ge = Oe(j.howToSetTheCondition), ve = Zr({
3161
- label: j.labelName || "",
3162
+ const ge = Oe(U.howToSetTheCondition), ve = Zr({
3163
+ label: U.labelName || "",
3162
3164
  howToSet: ge,
3163
3165
  isFirst: se
3164
- }), be = j.timeUnit ? Pt("", j.timeUnit, !0).trim() : "", U = `${M}.${j.conditionName}`, ne = li(
3166
+ }), be = U.timeUnit ? _t("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne = li(
3165
3167
  l.values,
3166
3168
  M,
3167
- j.conditionName
3169
+ U.conditionName
3168
3170
  ), kt = si(
3169
3171
  l.values,
3170
3172
  M,
3171
- j.conditionName
3173
+ U.conditionName
3172
3174
  ), ot = ne !== void 0 ? ne : kt, rt = ot !== void 0 ? ot : Me(ge);
3173
3175
  return {
3174
- ...j,
3175
- __originalConditionName: j.conditionName,
3176
+ ...U,
3177
+ __originalConditionName: U.conditionName,
3176
3178
  __groupKey: M,
3177
3179
  __howToSet: ge,
3178
- __scopedName: U,
3179
- conditionName: j.conditionName,
3180
+ __scopedName: z,
3181
+ conditionName: U.conditionName,
3180
3182
  groupKey: M,
3181
3183
  labelName: ve,
3182
3184
  __unitAfterInput: be,
@@ -3185,28 +3187,28 @@ const Oe = (e) => {
3185
3187
  });
3186
3188
  return [M, X];
3187
3189
  });
3188
- return Object.fromEntries(P);
3190
+ return Object.fromEntries(_);
3189
3191
  }, [g, l.values]), $ = R[A] ?? [], ae = R["group-primary"] ?? [], le = {
3190
3192
  decisionDataType: t.decisionDataType,
3191
3193
  howToSetTheCondition: t.howToSetTheDecision,
3192
3194
  labelName: t.labelName,
3193
3195
  listOfPossibleValues: t.listOfPossibleValues,
3194
3196
  ruleName: t.ruleName,
3195
- timeUnit: t.timeUnit ? Pt("", t.timeUnit, !0).trim() : ""
3196
- }, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Je = l.submitCount > 0 || !!l.touched.validUntil, Ze = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, xt = Je ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke = V.useMemo(() => {
3197
+ timeUnit: t.timeUnit ? _t("", t.timeUnit, !0).trim() : ""
3198
+ }, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Je = l.submitCount > 0 || !!l.touched.validUntil, Ze = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, xt = Je ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke = P.useMemo(() => {
3197
3199
  const x = l.errors.conditionsThatEstablishesTheDecision;
3198
3200
  if (!x) return;
3199
3201
  if (typeof x == "string") return x;
3200
- const L = (P) => {
3201
- if (P) {
3202
- if (typeof P == "string") return P;
3203
- if (Array.isArray(P))
3204
- for (const M of P) {
3202
+ const L = (_) => {
3203
+ if (_) {
3204
+ if (typeof _ == "string") return _;
3205
+ if (Array.isArray(_))
3206
+ for (const M of _) {
3205
3207
  const W = L(M);
3206
3208
  if (W) return W;
3207
3209
  }
3208
- else if (typeof P == "object")
3209
- for (const M of Object.values(P)) {
3210
+ else if (typeof _ == "object")
3211
+ for (const M of Object.values(_)) {
3210
3212
  const W = L(M);
3211
3213
  if (W) return W;
3212
3214
  }
@@ -3216,25 +3218,25 @@ const Oe = (e) => {
3216
3218
  }, [l.errors.conditionsThatEstablishesTheDecision]), Dt = l.submitCount > 0 && !!Ke, et = (x) => {
3217
3219
  const L = (x == null ? void 0 : x.__howToSet) ?? Oe(x == null ? void 0 : x.howToSetTheCondition);
3218
3220
  return Me(L);
3219
- }, tt = (x, L, P) => {
3220
- var j, me, se, ge, ve;
3221
- const M = `conditionsThatEstablishesTheDecision.${x}.${L}`, W = (se = (me = (j = l.values) == null ? void 0 : j.conditionsThatEstablishesTheDecision) == null ? void 0 : me[x]) == null ? void 0 : se[L];
3222
- W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`, P, !1) : l.setFieldValue(M, P, !1);
3221
+ }, tt = (x, L, _) => {
3222
+ var U, me, se, ge, ve;
3223
+ const M = `conditionsThatEstablishesTheDecision.${x}.${L}`, W = (se = (me = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision) == null ? void 0 : me[x]) == null ? void 0 : se[L];
3224
+ W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`, _, !1) : l.setFieldValue(M, _, !1);
3223
3225
  const X = (ge = l.values) == null ? void 0 : ge.conditionGroups;
3224
3226
  if (Array.isArray(X)) {
3225
- const be = X.findIndex((U) => (U == null ? void 0 : U.ConditionGroupId) === x);
3227
+ const be = X.findIndex((z) => (z == null ? void 0 : z.ConditionGroupId) === x);
3226
3228
  if (be >= 0) {
3227
- const U = (ve = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ve.findIndex(
3229
+ const z = (ve = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ve.findIndex(
3228
3230
  (ne) => (ne == null ? void 0 : ne.conditionName) === L
3229
3231
  );
3230
- if (U >= 0) {
3232
+ if (z >= 0) {
3231
3233
  const ne = JSON.parse(JSON.stringify(X));
3232
- ne[be].conditionsThatEstablishesTheDecision[U].value = P, l.setFieldValue("conditionGroups", ne, !1);
3234
+ ne[be].conditionsThatEstablishesTheDecision[z].value = _, l.setFieldValue("conditionGroups", ne, !1);
3233
3235
  }
3234
3236
  }
3235
3237
  }
3236
3238
  }, wt = (x) => {
3237
- const [L, ...P] = x.split("."), M = P.join("."), W = Object.values(c).flat().find((j) => j.conditionName === M), X = et(W || {});
3239
+ const [L, ..._] = x.split("."), M = _.join("."), W = Object.values(c).flat().find((U) => U.conditionName === M), X = et(W || {});
3238
3240
  tt(L, M, X), l.setFieldTouched(
3239
3241
  `conditionsThatEstablishesTheDecision.${L}.${M}`,
3240
3242
  !1,
@@ -3242,10 +3244,10 @@ const Oe = (e) => {
3242
3244
  );
3243
3245
  }, nt = () => {
3244
3246
  (c[A] ?? []).forEach((L) => {
3245
- const P = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(P);
3247
+ const _ = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(_);
3246
3248
  tt(A, L.conditionName, M);
3247
3249
  });
3248
- }, [Ct, Le] = V.useState(!1);
3250
+ }, [Ct, Le] = P.useState(!1);
3249
3251
  return /* @__PURE__ */ a(
3250
3252
  Jr,
3251
3253
  {
@@ -3303,7 +3305,7 @@ const Oe = (e) => {
3303
3305
  onRestoreConditions: w,
3304
3306
  baseDecisionTemplate: D,
3305
3307
  shouldRenderEmptyMessage: S = !0
3306
- } = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } = _r({
3308
+ } = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: $ } = Vr({
3307
3309
  cardTitle: t,
3308
3310
  controls: n,
3309
3311
  customTitleContentAddCard: o,
@@ -3315,8 +3317,8 @@ const Oe = (e) => {
3315
3317
  isOpenFor: (le) => N === le,
3316
3318
  toggleAt: (le) => C((Re) => Re === le ? null : le)
3317
3319
  }), ae = (i == null ? void 0 : i.length) === 0 && !p;
3318
- return /* @__PURE__ */ m(_, { children: [
3319
- /* @__PURE__ */ a(Rr, { children: /* @__PURE__ */ a(Lr, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S && (ae ? /* @__PURE__ */ a(_e, { legend: "Decisiones", children: /* @__PURE__ */ m(
3320
+ return /* @__PURE__ */ m(V, { children: [
3321
+ /* @__PURE__ */ a(Rr, { children: /* @__PURE__ */ a(Lr, { children: /* @__PURE__ */ a(y, { direction: "column", gap: "16px", padding: "6px", children: S && (ae ? /* @__PURE__ */ a(Ve, { legend: "Decisiones", children: /* @__PURE__ */ m(
3320
3322
  y,
3321
3323
  {
3322
3324
  direction: "column",
@@ -3343,7 +3345,7 @@ const Oe = (e) => {
3343
3345
  children: "Sin decisiones"
3344
3346
  }
3345
3347
  ),
3346
- /* @__PURE__ */ a(F, { as: "span", size: "medium", appearance: "gray", children: r || /* @__PURE__ */ m(_, { children: [
3348
+ /* @__PURE__ */ a(F, { as: "span", size: "medium", appearance: "gray", children: r || /* @__PURE__ */ m(V, { children: [
3347
3349
  "Aun no tienes decisiones definidas, para empezar haz clic en",
3348
3350
  o || ' "Agregar decisión"'
3349
3351
  ] }) })
@@ -3363,7 +3365,7 @@ const Oe = (e) => {
3363
3365
  height: A ? "auto" : "484px",
3364
3366
  children: [
3365
3367
  R,
3366
- $ && _t({
3368
+ $ && Vt({
3367
3369
  type: "add",
3368
3370
  index: i == null ? void 0 : i.length,
3369
3371
  controls: n,
@@ -3625,7 +3627,7 @@ const gi = E.div`
3625
3627
  };
3626
3628
  return /* @__PURE__ */ m(pi, { borderRadius: "8px", width: "100%", children: [
3627
3629
  /* @__PURE__ */ a(fi, { ref: g, children: t.map((C) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
3628
- Ve,
3630
+ Pe,
3629
3631
  {
3630
3632
  appearance: "primary",
3631
3633
  displayIcon: !0,
@@ -3648,9 +3650,9 @@ const gi = E.div`
3648
3650
  alignItems: "center",
3649
3651
  padding: "0px 8px",
3650
3652
  border: !0,
3651
- children: w ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ m(_, { children: [
3653
+ children: w ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ m(V, { children: [
3652
3654
  p.map((C) => /* @__PURE__ */ a(
3653
- Ve,
3655
+ Pe,
3654
3656
  {
3655
3657
  "data-filter-tag": "true",
3656
3658
  appearance: "primary",
@@ -3669,7 +3671,7 @@ const gi = E.div`
3669
3671
  style: { position: "relative", display: "inline-block" },
3670
3672
  children: [
3671
3673
  /* @__PURE__ */ a(mi, { onClick: T, children: /* @__PURE__ */ a(
3672
- Ve,
3674
+ Pe,
3673
3675
  {
3674
3676
  appearance: "primary",
3675
3677
  label: `+${c.length}`
@@ -3727,7 +3729,7 @@ const gi = E.div`
3727
3729
  }, bl = (e) => {
3728
3730
  const { appliedFilters: t, fields: n, onChange: o, noFiltersLabel: r } = e, i = ue("(max-width: 768px)"), s = !t || t.length === 0;
3729
3731
  return /* @__PURE__ */ m(y, { direction: "column", gap: "16px", children: [
3730
- i && /* @__PURE__ */ m(_, { children: [
3732
+ i && /* @__PURE__ */ m(V, { children: [
3731
3733
  /* @__PURE__ */ m(y, { gap: "6px", width: "100%", alignItems: "center", children: [
3732
3734
  /* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(Tn, {}) }),
3733
3735
  /* @__PURE__ */ a(
@@ -3743,7 +3745,7 @@ const gi = E.div`
3743
3745
  width: "100%",
3744
3746
  height: "36px",
3745
3747
  children: s ? /* @__PURE__ */ a(F, { size: "small", type: "label", appearance: "gray", children: r }) : t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
3746
- Ve,
3748
+ Pe,
3747
3749
  {
3748
3750
  appearance: "primary",
3749
3751
  displayIcon: !0,
@@ -3889,7 +3891,7 @@ const gi = E.div`
3889
3891
  }),
3890
3892
  value: { from: t, to: n }
3891
3893
  };
3892
- }, $t = (e, t) => t === z.PERCENTAGE ? {
3894
+ }, $t = (e, t) => t === H.PERCENTAGE ? {
3893
3895
  schema: he().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
3894
3896
  value: e
3895
3897
  } : {
@@ -3910,7 +3912,7 @@ function Si({
3910
3912
  }) {
3911
3913
  const o = {
3912
3914
  ruleName: e.ruleName || "",
3913
- decisionDataType: e.decisionDataType || z.ALPHABETICAL,
3915
+ decisionDataType: e.decisionDataType || H.ALPHABETICAL,
3914
3916
  howToSetTheDecision: e.howToSetTheDecision || "",
3915
3917
  value: e.value || "",
3916
3918
  effectiveFrom: e.effectiveFrom || "",
@@ -4083,7 +4085,7 @@ const Ei = E.div`
4083
4085
  };
4084
4086
  return Be(() => {
4085
4087
  u(t);
4086
- }, [t]), /* @__PURE__ */ m(_, { children: [
4088
+ }, [t]), /* @__PURE__ */ m(V, { children: [
4087
4089
  /* @__PURE__ */ a(y, { children: /* @__PURE__ */ a(
4088
4090
  mt,
4089
4091
  {
@@ -4096,7 +4098,7 @@ const Ei = E.div`
4096
4098
  children: /* @__PURE__ */ a(F, { size: "medium", type: "label", weight: "bold", children: i })
4097
4099
  }
4098
4100
  ) }),
4099
- l && /* @__PURE__ */ a(_, { children: n })
4101
+ l && /* @__PURE__ */ a(V, { children: n })
4100
4102
  ] });
4101
4103
  }, Ai = (e) => {
4102
4104
  const {
@@ -4120,7 +4122,7 @@ const Ei = E.div`
4120
4122
  }, A = ($) => {
4121
4123
  S($.target.value), n($);
4122
4124
  }, R = ue("(max-width: 400px)");
4123
- return /* @__PURE__ */ m(_, { children: [
4125
+ return /* @__PURE__ */ m(V, { children: [
4124
4126
  /* @__PURE__ */ m(y, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
4125
4127
  /* @__PURE__ */ a(
4126
4128
  F,
@@ -4256,7 +4258,7 @@ const Ei = E.div`
4256
4258
  ]
4257
4259
  }
4258
4260
  ) }) }),
4259
- n.terms && /* @__PURE__ */ m(_, { children: [
4261
+ n.terms && /* @__PURE__ */ m(V, { children: [
4260
4262
  /* @__PURE__ */ a(Y, { dashed: !0 }),
4261
4263
  /* @__PURE__ */ a(
4262
4264
  Ai,
@@ -4448,21 +4450,21 @@ const Ei = E.div`
4448
4450
  return ((i = (r = (o = t == null ? void 0 : t.menu) == null ? void 0 : o.item) == null ? void 0 : r.background) == null ? void 0 : i.hover) || Te.item.background.hover;
4449
4451
  }};
4450
4452
  }
4451
- `, Pi = E.div`
4453
+ `, _i = E.div`
4452
4454
  display: flex;
4453
4455
  flex-direction: column;
4454
4456
 
4455
4457
  & > a:last-child ${kn} {
4456
4458
  border-radius: 0 0 8px 8px;
4457
4459
  }
4458
- `, Vi = (e) => {
4460
+ `, Pi = (e) => {
4459
4461
  const { isOpen: t, links: n, onClick: o, title: r, activeId: i, headerPath: s, headerActive: d } = e, l = (f) => {
4460
4462
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), o());
4461
4463
  }, u = (f) => {
4462
4464
  f.preventDefault(), f.stopPropagation(), o();
4463
4465
  }, p = (f) => {
4464
4466
  (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), o());
4465
- }, c = t || d ? "primary" : "dark", h = t || d ? "bold" : "normal", g = V.useId();
4467
+ }, c = t || d ? "primary" : "dark", h = t || d ? "bold" : "normal", g = P.useId();
4466
4468
  return /* @__PURE__ */ a(Fi, { $active: t, children: /* @__PURE__ */ m(ce, { border: !0, borderRadius: "8px", width: "100%", children: [
4467
4469
  /* @__PURE__ */ a(
4468
4470
  Mi,
@@ -4545,7 +4547,7 @@ const Ei = E.div`
4545
4547
  )
4546
4548
  }
4547
4549
  ),
4548
- t && n.length > 0 && /* @__PURE__ */ a(Pi, { id: g, children: n.map((f) => {
4550
+ t && n.length > 0 && /* @__PURE__ */ a(_i, { id: g, children: n.map((f) => {
4549
4551
  const v = f.id === i;
4550
4552
  return /* @__PURE__ */ a(Oi, { to: f.path, children: /* @__PURE__ */ a(kn, { $active: v, children: /* @__PURE__ */ m(
4551
4553
  y,
@@ -4571,7 +4573,7 @@ const Ei = E.div`
4571
4573
  ) }) }, f.id);
4572
4574
  }) })
4573
4575
  ] }) });
4574
- }, _i = E.div`
4576
+ }, Vi = E.div`
4575
4577
  & > div {
4576
4578
  background: ${({ $background: e, theme: t }) => {
4577
4579
  var n, o, r, i;
@@ -4585,17 +4587,17 @@ const Ei = E.div`
4585
4587
  if (o.path && (e === o.path || e.startsWith(o.path + "/")) || (n = o.links) != null && n.some((r) => r.path === e)) return o.id;
4586
4588
  return null;
4587
4589
  }, Cl = (e) => {
4588
- const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e, r = ro(), [i, s] = V.useState(n), d = V.useRef(r.pathname), l = V.useCallback(
4590
+ const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e, r = ro(), [i, s] = P.useState(n), d = P.useRef(r.pathname), l = P.useCallback(
4589
4591
  (p) => {
4590
4592
  var c;
4591
4593
  return (c = p.find((h) => h.path === r.pathname)) == null ? void 0 : c.id;
4592
4594
  },
4593
4595
  [r.pathname]
4594
- ), u = V.useCallback(
4596
+ ), u = P.useCallback(
4595
4597
  (p) => !!p && (r.pathname === p || r.pathname.startsWith(p + "/")),
4596
4598
  [r.pathname]
4597
4599
  );
4598
- return V.useEffect(() => {
4600
+ return P.useEffect(() => {
4599
4601
  if (!(d.current !== r.pathname)) return;
4600
4602
  if (d.current = r.pathname, t) {
4601
4603
  s(null);
@@ -4607,8 +4609,8 @@ const Ei = E.div`
4607
4609
  return;
4608
4610
  }
4609
4611
  n && s(n);
4610
- }, [t, n, o, r.pathname]), /* @__PURE__ */ a(_i, { $background: !0, children: /* @__PURE__ */ a(y, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: o.map((p) => /* @__PURE__ */ a(
4611
- Vi,
4612
+ }, [t, n, o, r.pathname]), /* @__PURE__ */ a(Vi, { $background: !0, children: /* @__PURE__ */ a(y, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: o.map((p) => /* @__PURE__ */ a(
4613
+ Pi,
4612
4614
  {
4613
4615
  activeId: l(p.links),
4614
4616
  headerPath: p.path,
@@ -4858,7 +4860,7 @@ function Qi({
4858
4860
  performTransfer: Ki,
4859
4861
  root: o.root ?? document,
4860
4862
  setupNode: na,
4861
- setupNodeRemap: Pn,
4863
+ setupNodeRemap: _n,
4862
4864
  reapplyDragClasses: oa,
4863
4865
  tearDownNode: ia,
4864
4866
  tearDownNodeRemap: ra,
@@ -5110,7 +5112,7 @@ function na(e) {
5110
5112
  (i = (r = o(e.parent.el)) == null ? void 0 : r.setupNode) == null || i.call(r, e);
5111
5113
  });
5112
5114
  }
5113
- function Pn(e) {
5115
+ function _n(e) {
5114
5116
  var t;
5115
5117
  fe.set(e.node.el, e.node.data), (t = e.parent.data.config.plugins) == null || t.forEach((n) => {
5116
5118
  var o, r;
@@ -5212,7 +5214,7 @@ function bt(e, t) {
5212
5214
  el: u,
5213
5215
  data: c
5214
5216
  }
5215
- }), Pn({
5217
+ }), _n({
5216
5218
  parent: {
5217
5219
  el: e,
5218
5220
  data: n
@@ -5254,7 +5256,7 @@ function ca(e) {
5254
5256
  }
5255
5257
  function ua(e, t) {
5256
5258
  const n = e.targetData.parent.data.config;
5257
- if (!n.nativeDrag || !sa(e) || !Vn({
5259
+ if (!n.nativeDrag || !sa(e) || !Pn({
5258
5260
  x: e.e.clientX,
5259
5261
  y: e.e.clientY,
5260
5262
  node: e.targetData.node,
@@ -5290,7 +5292,7 @@ function pa(e, t) {
5290
5292
  parent: e.targetData.parent,
5291
5293
  node: e.targetData.node,
5292
5294
  validated: !1
5293
- }, !Vn({
5295
+ }, !Pn({
5294
5296
  x: e.e.clientX,
5295
5297
  y: e.e.clientY,
5296
5298
  node: e.targetData.node,
@@ -5435,7 +5437,7 @@ function ga(e, t) {
5435
5437
  }
5436
5438
  return n;
5437
5439
  }
5438
- function Vn({
5440
+ function Pn({
5439
5441
  x: e,
5440
5442
  y: t,
5441
5443
  node: n,
@@ -5611,7 +5613,7 @@ function Sa(e, t, n) {
5611
5613
  function Ht(e, t = !0, n = !0) {
5612
5614
  t && (e.frameIdX !== void 0 && (cancelAnimationFrame(e.frameIdX), e.frameIdX = void 0), e.lastScrollDirectionX = void 0), n && (e.frameIdY !== void 0 && (cancelAnimationFrame(e.frameIdY), e.frameIdY = void 0), e.lastScrollDirectionY = void 0), !e.frameIdX && !e.frameIdY && (e.preventEnter = !1);
5613
5615
  }
5614
- function _n(e, t = !1) {
5616
+ function Vn(e, t = !1) {
5615
5617
  var p;
5616
5618
  const { x: n, y: o } = e.coordinates, r = e.startLeft ?? 0, i = e.startTop ?? 0, s = window.scrollX ?? 0, d = window.scrollY ?? 0, l = n - r + s, u = o - i + d;
5617
5619
  e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${u}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", xe(
@@ -5621,7 +5623,7 @@ function _n(e, t = !1) {
5621
5623
  }
5622
5624
  function pn(e, t, n = !1) {
5623
5625
  const o = Fe(e);
5624
- t.coordinates.x = o.x, t.coordinates.y = o.y, _n(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
5626
+ t.coordinates.x = o.x, t.coordinates.y = o.y, Vn(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
5625
5627
  ie(t) && yt(t.coordinates, e, t);
5626
5628
  }, 16);
5627
5629
  const r = Oa(o);
@@ -5887,7 +5889,7 @@ function La(e, t, n, o) {
5887
5889
  n[l] = void 0, n[d] = void 0;
5888
5890
  return;
5889
5891
  }
5890
- e[p] += s * i, ie(n) && _n(n), n[l] = requestAnimationFrame(u);
5892
+ e[p] += s * i, ie(n) && Vn(n), n[l] = requestAnimationFrame(u);
5891
5893
  };
5892
5894
  n[l] = requestAnimationFrame(u);
5893
5895
  }
@@ -5977,28 +5979,28 @@ function Ma(e) {
5977
5979
  return e.current;
5978
5980
  console.warn("Invalid parent element", e);
5979
5981
  }
5980
- function Pa(e, t) {
5982
+ function _a(e, t) {
5981
5983
  const n = Ma(e);
5982
5984
  n && t(n);
5983
5985
  }
5984
5986
  var gt = /* @__PURE__ */ new WeakMap();
5985
- function Va(e) {
5987
+ function Pa(e) {
5986
5988
  const t = gt.get(e);
5987
5989
  return t ? t[0] : (console.warn("No values found for parent element"), []);
5988
5990
  }
5989
- function _a(e, t) {
5991
+ function Va(e, t) {
5990
5992
  const n = gt.get(t);
5991
5993
  n && n[1](e), gt.set(t, [e, n[1]]);
5992
5994
  }
5993
5995
  function ja(e, t) {
5994
5996
  return (n) => {
5995
- gt.set(n, t), Qi({ parent: n, getValues: Va, setValues: _a, config: e });
5997
+ gt.set(n, t), Qi({ parent: n, getValues: Pa, setValues: Va, config: e });
5996
5998
  };
5997
5999
  }
5998
6000
  function fn(e) {
5999
6001
  Zt && (Array.isArray(e) || (e = [e]), e.forEach((t) => {
6000
6002
  const { parent: n, state: o, ...r } = t;
6001
- Pa(n, ja(r, o));
6003
+ _a(n, ja(r, o));
6002
6004
  }));
6003
6005
  }
6004
6006
  function Ua(e, t = {}) {
@@ -6048,10 +6050,10 @@ const mn = {
6048
6050
  highlightFirst: s,
6049
6051
  onMove: d,
6050
6052
  locked: l = !1
6051
- } = e, u = V.useRef(null), p = l ? [u, i] : Ua(i, { group: o }), [c, h] = p, [g, f] = V.useState(
6053
+ } = e, u = P.useRef(null), p = l ? [u, i] : Ua(i, { group: o }), [c, h] = p, [g, f] = P.useState(
6052
6054
  null
6053
- ), v = V.useRef(i);
6054
- V.useEffect(() => {
6055
+ ), v = P.useRef(i);
6056
+ P.useEffect(() => {
6055
6057
  if (l) return;
6056
6058
  const N = (C) => {
6057
6059
  const A = C.detail ?? null;
@@ -6059,7 +6061,7 @@ const mn = {
6059
6061
  };
6060
6062
  return window.addEventListener(Rt, N), () => window.removeEventListener(Rt, N);
6061
6063
  }, [l]);
6062
- const T = V.useCallback((N) => {
6064
+ const T = P.useCallback((N) => {
6063
6065
  l || window.dispatchEvent(
6064
6066
  new CustomEvent(Rt, { detail: N })
6065
6067
  );
@@ -6068,16 +6070,16 @@ const mn = {
6068
6070
  if (l) return;
6069
6071
  const C = N.target, A = ($ = C == null ? void 0 : C.closest) == null ? void 0 : $.call(C, "li.dnd-item"), R = (A == null ? void 0 : A.getAttribute("data-label")) || null;
6070
6072
  R && (f(R), T(R));
6071
- }, D = V.useCallback(() => {
6073
+ }, D = P.useCallback(() => {
6072
6074
  l || (f(null), T(null));
6073
6075
  }, [T, l]);
6074
- V.useEffect(() => {
6076
+ P.useEffect(() => {
6075
6077
  if (l) return;
6076
6078
  const N = () => D();
6077
6079
  return window.addEventListener("pointerup", N), window.addEventListener("blur", N), () => {
6078
6080
  window.removeEventListener("pointerup", N), window.removeEventListener("blur", N);
6079
6081
  };
6080
- }, [D, l]), V.useEffect(() => {
6082
+ }, [D, l]), P.useEffect(() => {
6081
6083
  if (l) return;
6082
6084
  const N = v.current;
6083
6085
  if (h.length !== N.length && h.length === N.length + 1) {
@@ -6091,7 +6093,7 @@ const mn = {
6091
6093
  }, [h, n, d, l]);
6092
6094
  const S = h.length === 0;
6093
6095
  return /* @__PURE__ */ a(
6094
- _e,
6096
+ Ve,
6095
6097
  {
6096
6098
  legend: r,
6097
6099
  width: "100%",
@@ -6277,11 +6279,11 @@ const mn = {
6277
6279
  conditionsThatEstablishesTheDecision: t
6278
6280
  // preserve full structure
6279
6281
  };
6280
- }, Pe = /* @__PURE__ */ new Map(), Wa = (e, t) => Pe.get(`${t}:${e}`), Ya = (e, t, n) => {
6282
+ }, _e = /* @__PURE__ */ new Map(), Wa = (e, t) => _e.get(`${t}:${e}`), Ya = (e, t, n) => {
6281
6283
  const o = `${t}:${e}`;
6282
- if (Pe.set(o, n), Pe.size > 1e3) {
6283
- const r = Pe.keys().next().value;
6284
- r !== void 0 && Pe.delete(r);
6284
+ if (_e.set(o, n), _e.size > 1e3) {
6285
+ const r = _e.keys().next().value;
6286
+ r !== void 0 && _e.delete(r);
6285
6287
  }
6286
6288
  }, vn = /* @__PURE__ */ new Map(), Xa = 1e3, Qa = (e) => {
6287
6289
  const t = Date.now(), n = vn.get(e) || 0;
@@ -6354,7 +6356,7 @@ export {
6354
6356
  gl as BusinessRulesWithGroup,
6355
6357
  Sl as DragAndDropBoxes,
6356
6358
  bn as DraggableList,
6357
- Vi as DropdownMenu,
6359
+ Pi as DropdownMenu,
6358
6360
  Cl as DropdownMenuContainer,
6359
6361
  de as EValueHowToSetUp,
6360
6362
  ml as Filter,
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "2.2.10",
13
+ "version": "2.2.11",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {