@isettingkit/business-rules 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,16 +1,16 @@
1
- import { jsx as i, jsxs as h, Fragment as D } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as h, Fragment as D } from "react/jsx-runtime";
2
2
  import { MdOutlineDelete as fe, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as ie, MdOutlineFilterAlt as oe } from "react-icons/md";
3
- import { inube as w, Stack as u, Divider as S, Icon as M, Text as x, SkeletonLine as $, useMediaQuery as A, Blanket as re, Button as N, Grid as le, Box as ye, Tag as se, Checkpicker as xe, Toggle as de, Checkbox as we, Date as Q } from "@inubekit/inubekit";
4
- import f, { keyframes as ve } from "styled-components";
3
+ import { inube as w, Stack as p, Divider as S, Icon as M, Text as f, SkeletonLine as $, useMediaQuery as A, Blanket as re, Button as N, Grid as le, Box as ye, Tag as se, Checkpicker as xe, Toggle as de, Checkbox as we, Date as Q } from "@inubekit/inubekit";
4
+ import y, { keyframes as ve } from "styled-components";
5
5
  import { ValueDataType as k, ValueHowToSetUp as O, DecisionConditionRender as Y } from "@isettingkit/input";
6
- import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
6
+ import { DecisionViewConditionRenderer as U } from "@isettingkit/view";
7
7
  import { createPortal as ce } from "react-dom";
8
8
  import { useFormik as Ce } from "formik";
9
9
  import { string as H, mixed as he, object as V, number as q, lazy as K, date as W } from "yup";
10
- import { useState as _, useEffect as Se } from "react";
10
+ import { useState as z, useEffect as Se } from "react";
11
11
  import De from "axios";
12
12
  import { franc as Ee } from "franc-min";
13
- const Ne = f.div`
13
+ const Ne = y.div`
14
14
  border-radius: 8px;
15
15
  border: 1px solid ${w.palette.neutral.N30};
16
16
  box-sizing: border-box;
@@ -22,7 +22,7 @@ const Ne = f.div`
22
22
  height: 100%;
23
23
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
24
24
  `;
25
- f.div`
25
+ y.div`
26
26
  width: 100%;
27
27
  height: 100%;
28
28
  overflow-y: auto;
@@ -42,26 +42,26 @@ f.div`
42
42
  }
43
43
  `;
44
44
  const P = (e) => {
45
- const { children: t, controls: n = !0, handleDelete: a, id: r } = e;
46
- return /* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "16px", padding: "12px 16px", children: [
45
+ const { children: t, controls: n = !0, handleDelete: i, id: o } = e;
46
+ return /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "16px", padding: "12px 16px", children: [
47
47
  t,
48
48
  n && /* @__PURE__ */ h(D, { children: [
49
- /* @__PURE__ */ i(S, {}),
50
- /* @__PURE__ */ i(u, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ i(
49
+ /* @__PURE__ */ a(S, {}),
50
+ /* @__PURE__ */ a(p, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
51
51
  M,
52
52
  {
53
53
  cursorHover: !0,
54
54
  appearance: "danger",
55
55
  size: "24px",
56
- icon: /* @__PURE__ */ i(fe, {}),
56
+ icon: /* @__PURE__ */ a(fe, {}),
57
57
  onClick: () => {
58
- a(r);
58
+ i(o);
59
59
  }
60
60
  }
61
61
  ) })
62
62
  ] })
63
63
  ] }) });
64
- }, J = f.div`
64
+ }, J = y.div`
65
65
  & > div {
66
66
  border-radius: 8px;
67
67
  border: 1px solid
@@ -70,7 +70,7 @@ const P = (e) => {
70
70
  return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
71
71
  }};
72
72
  }
73
- `, X = f.div`
73
+ `, X = y.div`
74
74
  width: 100%;
75
75
  height: 100%;
76
76
  overflow-y: auto;
@@ -92,51 +92,51 @@ const P = (e) => {
92
92
  from: e.from ?? "",
93
93
  to: e.to ?? ""
94
94
  }), Ie = (e) => e.value, Re = (e) => e.value, Me = (e) => e.value;
95
- var y = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(y || {});
95
+ var x = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(x || {});
96
96
  const Le = {
97
- [y.LIST_OF_VALUES]: Ae,
98
- [y.LIST_OF_VALUES_MULTI]: Fe,
99
- [y.RANGE]: $e,
100
- [y.GREATER_THAN]: Ie,
101
- [y.LESS_THAN]: Re,
102
- [y.EQUAL]: Me
97
+ [x.LIST_OF_VALUES]: Ae,
98
+ [x.LIST_OF_VALUES_MULTI]: Fe,
99
+ [x.RANGE]: $e,
100
+ [x.GREATER_THAN]: Ie,
101
+ [x.LESS_THAN]: Re,
102
+ [x.EQUAL]: Me
103
103
  }, R = (e) => {
104
- const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Le[e == null ? void 0 : e.howToSetTheDecision] || ke;
105
- return n && a(t) || t || void 0;
104
+ const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i = Le[e == null ? void 0 : e.howToSetTheDecision] || ke;
105
+ return n && i(t) || t || void 0;
106
106
  }, Oe = (e) => {
107
107
  const {
108
108
  conditionsAlignment: t,
109
109
  decision: n,
110
- decisionDateElement: a,
111
- decisionMapper: r,
112
- loading: o,
113
- skeleton: p,
114
- terms: c,
110
+ decisionDateElement: i,
111
+ decisionMapper: o,
112
+ loading: r,
113
+ skeleton: u,
114
+ terms: l,
115
115
  textValues: s,
116
116
  visibleConditions: g
117
117
  } = e;
118
- return o ? /* @__PURE__ */ h(u, { direction: "column", gap: "12px", children: [
119
- /* @__PURE__ */ i(u, { direction: "column", alignItems: "center", children: /* @__PURE__ */ i(
120
- z,
118
+ return r ? /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
119
+ /* @__PURE__ */ a(p, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
120
+ U,
121
121
  {
122
- element: r,
122
+ element: o,
123
123
  valueData: R(
124
- r
124
+ o
125
125
  ),
126
126
  type: "decision"
127
127
  }
128
128
  ) }, n.ruleName),
129
- /* @__PURE__ */ i(S, { dashed: !0 }),
130
- /* @__PURE__ */ i(X, { children: /* @__PURE__ */ h(
131
- u,
129
+ /* @__PURE__ */ a(S, { dashed: !0 }),
130
+ /* @__PURE__ */ a(X, { children: /* @__PURE__ */ h(
131
+ p,
132
132
  {
133
133
  direction: "column",
134
134
  gap: "12px",
135
135
  justifyContent: t,
136
136
  height: "203px",
137
137
  children: [
138
- /* @__PURE__ */ i(
139
- x,
138
+ /* @__PURE__ */ a(
139
+ f,
140
140
  {
141
141
  type: "label",
142
142
  size: "large",
@@ -146,22 +146,22 @@ const Le = {
146
146
  children: s.factsThatConditionIt
147
147
  }
148
148
  ),
149
- g.map((d) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(u, { direction: "column", padding: "8px", children: /* @__PURE__ */ i(
150
- z,
149
+ g.map((c) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ a(p, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
150
+ U,
151
151
  {
152
- element: { ...d, value: d.value },
152
+ element: { ...c, value: c.value },
153
153
  valueData: R(
154
- d
154
+ c
155
155
  )
156
156
  }
157
- ) }) }, d.conditionName)),
158
- c && /* @__PURE__ */ h(D, { children: [
159
- /* @__PURE__ */ i(S, { dashed: !0 }),
160
- a && /* @__PURE__ */ i(
161
- z,
157
+ ) }) }, c.conditionName)),
158
+ l && /* @__PURE__ */ h(D, { children: [
159
+ /* @__PURE__ */ a(S, { dashed: !0 }),
160
+ i && /* @__PURE__ */ a(
161
+ U,
162
162
  {
163
- element: a.element,
164
- valueData: a.valueData,
163
+ element: i.element,
164
+ valueData: i.valueData,
165
165
  type: "decision"
166
166
  },
167
167
  s.terms
@@ -170,49 +170,49 @@ const Le = {
170
170
  ]
171
171
  }
172
172
  ) })
173
- ] }) : /* @__PURE__ */ h(u, { direction: "column", gap: "12px", children: [
174
- /* @__PURE__ */ h(u, { direction: "column", alignItems: "center", gap: "4px", children: [
175
- /* @__PURE__ */ i($, { animated: !0, width: "180px" }),
176
- /* @__PURE__ */ i($, { animated: !0, width: "85px" })
173
+ ] }) : /* @__PURE__ */ h(p, { direction: "column", gap: "12px", children: [
174
+ /* @__PURE__ */ h(p, { direction: "column", alignItems: "center", gap: "4px", children: [
175
+ /* @__PURE__ */ a($, { animated: !0, width: "180px" }),
176
+ /* @__PURE__ */ a($, { animated: !0, width: "85px" })
177
177
  ] }, "loading"),
178
- /* @__PURE__ */ h(u, { direction: "column", gap: "12px", alignItems: "center", children: [
179
- /* @__PURE__ */ i(S, { dashed: !0 }),
180
- /* @__PURE__ */ i($, { animated: !0, width: "150px" })
178
+ /* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
179
+ /* @__PURE__ */ a(S, { dashed: !0 }),
180
+ /* @__PURE__ */ a($, { animated: !0, width: "150px" })
181
181
  ] }),
182
- /* @__PURE__ */ i(X, { children: /* @__PURE__ */ i(
183
- u,
182
+ /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(
183
+ p,
184
184
  {
185
185
  direction: "column",
186
186
  gap: "12px",
187
187
  justifyContent: "space-between",
188
188
  height: "203px",
189
- children: p.map((d, l) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ h(
190
- u,
189
+ children: u.map((c, d) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ h(
190
+ p,
191
191
  {
192
192
  direction: "column",
193
193
  gap: "12px",
194
194
  alignItems: "start",
195
195
  padding: "8px",
196
196
  children: [
197
- /* @__PURE__ */ i($, { animated: !0, width: "180px" }),
198
- /* @__PURE__ */ i($, { animated: !0, width: "85px" })
197
+ /* @__PURE__ */ a($, { animated: !0, width: "180px" }),
198
+ /* @__PURE__ */ a($, { animated: !0, width: "85px" })
199
199
  ]
200
200
  }
201
- ) }, `condition-${l}`))
201
+ ) }, `condition-${d}`))
202
202
  }
203
203
  ) })
204
204
  ] });
205
205
  }, ue = (e) => {
206
206
  var b;
207
- const { decision: t, loading: n = !1, textValues: a } = e, r = !!(t != null && t.effectiveFrom), o = !!(t != null && t.validUntil), p = r && o ? {
207
+ const { decision: t, loading: n = !1, textValues: i } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), u = o && r ? {
208
208
  element: {
209
- labelName: a == null ? void 0 : a.terms,
209
+ labelName: i == null ? void 0 : i.terms,
210
210
  value: String(t.effectiveFrom),
211
211
  howToSetTheDecision: O.RANGE,
212
212
  decisionDataType: k.DATE
213
213
  },
214
214
  valueData: R({
215
- labelName: a == null ? void 0 : a.terms,
215
+ labelName: i == null ? void 0 : i.terms,
216
216
  value: {
217
217
  from: String(t.effectiveFrom),
218
218
  to: String(t.validUntil)
@@ -220,47 +220,47 @@ const Le = {
220
220
  howToSetTheDecision: O.RANGE,
221
221
  decisionDataType: k.DATE
222
222
  })
223
- } : r && !o ? {
223
+ } : o && !r ? {
224
224
  element: {
225
- labelName: a == null ? void 0 : a.terms,
225
+ labelName: i == null ? void 0 : i.terms,
226
226
  value: String(t.effectiveFrom),
227
227
  howToSetTheDecision: O.EQUAL,
228
228
  decisionDataType: k.DATE
229
229
  },
230
230
  valueData: R({
231
- labelName: a == null ? void 0 : a.terms,
231
+ labelName: i == null ? void 0 : i.terms,
232
232
  value: String(t.effectiveFrom),
233
233
  howToSetTheDecision: O.EQUAL,
234
234
  decisionDataType: k.DATE
235
235
  })
236
- } : null, c = t ? {
236
+ } : null, l = t ? {
237
237
  labelName: t.labelName || "",
238
238
  decisionDataType: t.decisionDataType || "alphabetical",
239
239
  value: R(t),
240
240
  howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
241
241
  } : null, s = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
242
242
  (T) => !T.hidden
243
- )) || [], g = Array.from({ length: 5 }), d = !!(!n && t && a && c), l = s.length < 2 ? "start" : "space-between";
244
- return /* @__PURE__ */ i(
243
+ )) || [], g = Array.from({ length: 5 }), c = !!(!n && t && i && l), d = s.length < 2 ? "start" : "space-between";
244
+ return /* @__PURE__ */ a(
245
245
  Oe,
246
246
  {
247
- conditionsAlignment: l,
247
+ conditionsAlignment: d,
248
248
  decision: t,
249
- decisionDateElement: p,
250
- decisionMapper: c,
251
- loading: d,
249
+ decisionDateElement: u,
250
+ decisionMapper: l,
251
+ loading: c,
252
252
  skeleton: g,
253
- terms: !!(a != null && a.terms),
254
- textValues: a,
253
+ terms: !!(i != null && i.terms),
254
+ textValues: i,
255
255
  visibleConditions: s
256
256
  }
257
257
  );
258
- }, Ve = f.div`
258
+ }, Ve = y.div`
259
259
  position: relative;
260
260
  & > div {
261
261
  padding: 24px 16px;
262
262
  }
263
- `, _e = f.div`
263
+ `, ze = y.div`
264
264
  background-color: ${({ theme: e }) => {
265
265
  var t, n;
266
266
  return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
@@ -291,24 +291,24 @@ const Le = {
291
291
  background-color: #ebecf0;
292
292
  border-radius: 8px;
293
293
  }
294
- `, Ue = (e) => {
295
- const { children: t, portalId: n, onCloseModal: a, title: r } = e, o = document.getElementById(n);
296
- if (!o)
294
+ `, _e = (e) => {
295
+ const { children: t, portalId: n, onCloseModal: i, title: o } = e, r = document.getElementById(n);
296
+ if (!r)
297
297
  throw new Error(
298
298
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
299
299
  );
300
- const p = A("(max-width: 400px)");
300
+ const u = A("(max-width: 400px)");
301
301
  return ce(
302
- /* @__PURE__ */ i(Ve, { smallScreen: p, children: /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i(_e, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "24px", children: [
303
- /* @__PURE__ */ i(u, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(u, { alignItems: "center", justifyContent: "space-between", children: [
304
- /* @__PURE__ */ i(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
305
- /* @__PURE__ */ i(ne, { size: "24px", cursor: "pointer", onClick: a })
302
+ /* @__PURE__ */ a(Ve, { smallScreen: u, children: /* @__PURE__ */ a(re, { children: /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
303
+ /* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(p, { alignItems: "center", justifyContent: "space-between", children: [
304
+ /* @__PURE__ */ a(f, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
305
+ /* @__PURE__ */ a(ne, { size: "24px", cursor: "pointer", onClick: i })
306
306
  ] }) }),
307
307
  t
308
308
  ] }) }) }) }),
309
- o
309
+ r
310
310
  );
311
- }, ze = ve`
311
+ }, Ue = ve`
312
312
  from {
313
313
  opacity: 0;
314
314
  transform: translateY(20px);
@@ -318,7 +318,7 @@ const Le = {
318
318
  transform: translateY(0);
319
319
  }
320
320
  `;
321
- f.div`
321
+ y.div`
322
322
  border-radius: 8px;
323
323
  border: 1px solid
324
324
  ${({ theme: e }) => {
@@ -332,7 +332,7 @@ f.div`
332
332
  height: 100%;
333
333
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
334
334
  `;
335
- f.div`
335
+ y.div`
336
336
  & > div {
337
337
  border-radius: 8px;
338
338
  border: 1px solid
@@ -342,7 +342,7 @@ f.div`
342
342
  }};
343
343
  }
344
344
  `;
345
- const je = f.div`
345
+ const je = y.div`
346
346
  & > div {
347
347
  background-color: ${({ theme: e }) => {
348
348
  var t, n;
@@ -354,18 +354,18 @@ const je = f.div`
354
354
  width: 100%;
355
355
  height: 100%;
356
356
  padding-bottom: 12px;
357
- `, pe = f.div`
357
+ `, pe = y.div`
358
358
  width: 100%;
359
359
  height: 100%;
360
360
  & > div {
361
- animation: ${ze} 600ms ease-out;
361
+ animation: ${Ue} 600ms ease-out;
362
362
  }
363
- `, qe = f.div`
363
+ `, qe = y.div`
364
364
  & > div > div {
365
365
  border-radius: 8px;
366
366
  box-sizing: border-box;
367
367
  }
368
- `, Be = f.div`
368
+ `, Be = y.div`
369
369
  & > div {
370
370
  width: 100%;
371
371
  height: 100%;
@@ -388,7 +388,7 @@ const je = f.div`
388
388
  `;
389
389
  function He(e) {
390
390
  const { index: t, handleOpenModal: n } = e;
391
- return /* @__PURE__ */ i(
391
+ return /* @__PURE__ */ a(
392
392
  P,
393
393
  {
394
394
  id: `loading-card-${t}`,
@@ -396,23 +396,23 @@ function He(e) {
396
396
  },
397
397
  handleView: () => n ? n() : null,
398
398
  controls: !1,
399
- children: /* @__PURE__ */ i(ue, { loading: !0 })
399
+ children: /* @__PURE__ */ a(ue, { loading: !0 })
400
400
  },
401
401
  `loading-card-${t}`
402
402
  );
403
403
  }
404
404
  function Pe(e) {
405
- const { decision: t, controls: n, handleOpenModal: a, handleDelete: r, textValues: o } = e;
406
- return t ? /* @__PURE__ */ i(pe, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
407
- /* @__PURE__ */ i(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
408
- /* @__PURE__ */ i(
405
+ const { decision: t, controls: n, handleOpenModal: i, handleDelete: o, textValues: r } = e;
406
+ return t ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
407
+ /* @__PURE__ */ a(f, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
408
+ /* @__PURE__ */ a(
409
409
  P,
410
410
  {
411
411
  id: t.decisionId,
412
- handleDelete: () => r ? r(t.decisionId) : null,
413
- handleView: () => a ? a(t) : null,
412
+ handleDelete: () => o ? o(t.decisionId) : null,
413
+ handleView: () => i ? i(t) : null,
414
414
  controls: n,
415
- children: /* @__PURE__ */ i(ue, { decision: t, textValues: o })
415
+ children: /* @__PURE__ */ a(ue, { decision: t, textValues: r })
416
416
  }
417
417
  )
418
418
  ] }) }, t.decisionId) : null;
@@ -421,26 +421,26 @@ function Ge(e) {
421
421
  const {
422
422
  customTitleContentAddCard: t,
423
423
  index: n,
424
- handleOpenModal: a,
425
- shouldRenderEmptyMessage: r
426
- } = e, o = t || "Agregar decisión";
427
- return /* @__PURE__ */ i(pe, { children: r ? null : /* @__PURE__ */ h(u, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
428
- /* @__PURE__ */ i(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
429
- /* @__PURE__ */ i(
424
+ handleOpenModal: i,
425
+ shouldRenderEmptyMessage: o
426
+ } = e, r = t || "Agregar decisión";
427
+ return /* @__PURE__ */ a(pe, { children: o ? null : /* @__PURE__ */ h(p, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
428
+ /* @__PURE__ */ a(f, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
429
+ /* @__PURE__ */ a(
430
430
  je,
431
431
  {
432
- onClick: () => a ? a() : null,
433
- children: /* @__PURE__ */ i(
432
+ onClick: () => i ? i() : null,
433
+ children: /* @__PURE__ */ a(
434
434
  P,
435
435
  {
436
436
  id: `add-decision-${n}`,
437
437
  handleDelete: () => {
438
438
  },
439
- handleView: () => a ? a() : null,
439
+ handleView: () => i ? i() : null,
440
440
  controls: !1,
441
- children: /* @__PURE__ */ h(u, { direction: "column", gap: "12px", alignItems: "center", children: [
442
- /* @__PURE__ */ i(M, { appearance: "gray", icon: /* @__PURE__ */ i(ae, {}), size: "35px" }),
443
- /* @__PURE__ */ i(x, { appearance: "gray", type: "body", size: "large", children: o })
441
+ children: /* @__PURE__ */ h(p, { direction: "column", gap: "12px", alignItems: "center", children: [
442
+ /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(ae, {}), size: "35px" }),
443
+ /* @__PURE__ */ a(f, { appearance: "gray", type: "body", size: "large", children: r })
444
444
  ] })
445
445
  }
446
446
  )
@@ -459,63 +459,63 @@ const Qe = {
459
459
  const {
460
460
  controls: t,
461
461
  customTitleContentAddCard: n,
462
- decisions: a,
463
- loading: r,
464
- handleOpenModal: o,
465
- handleDelete: p,
466
- textValues: c
467
- } = e, s = r ? Array.from({ length: 3 }).map(
468
- (d, l) => B({
462
+ decisions: i,
463
+ loading: o,
464
+ handleOpenModal: r,
465
+ handleDelete: u,
466
+ textValues: l
467
+ } = e, s = o ? Array.from({ length: 3 }).map(
468
+ (c, d) => B({
469
469
  type: "loading",
470
- index: l,
470
+ index: d,
471
471
  controls: t,
472
472
  customTitleContentAddCard: n,
473
- loading: r,
474
- handleOpenModal: o,
475
- handleDelete: p,
476
- textValues: c
473
+ loading: o,
474
+ handleOpenModal: r,
475
+ handleDelete: u,
476
+ textValues: l
477
477
  })
478
- ) : a == null ? void 0 : a.map(
479
- (d) => B({
478
+ ) : i == null ? void 0 : i.map(
479
+ (c) => B({
480
480
  type: "decision",
481
- decision: d,
481
+ decision: c,
482
482
  controls: t,
483
483
  customTitleContentAddCard: n,
484
- loading: r,
485
- handleOpenModal: o,
486
- handleDelete: p,
487
- textValues: c
484
+ loading: o,
485
+ handleOpenModal: r,
486
+ handleDelete: u,
487
+ textValues: l
488
488
  })
489
- ), g = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !r && t;
489
+ ), g = ((i == null ? void 0 : i.length) === 0 || i.length < Math.floor(window.innerWidth / 300)) && !o && t;
490
490
  return { renderedCards: s, shouldRenderAddCard: g };
491
491
  }, kt = (e) => {
492
492
  const {
493
493
  controls: t = !0,
494
494
  customTitleContentAddCard: n,
495
- customMessageEmptyDecisions: a,
496
- decisions: r,
497
- textValues: o,
498
- decisionTemplate: p,
499
- isModalOpen: c,
495
+ customMessageEmptyDecisions: i,
496
+ decisions: o,
497
+ textValues: r,
498
+ decisionTemplate: u,
499
+ isModalOpen: l,
500
500
  selectedDecision: s,
501
501
  loading: g,
502
- handleOpenModal: d,
503
- handleCloseModal: l,
502
+ handleOpenModal: c,
503
+ handleCloseModal: d,
504
504
  handleSubmitForm: b,
505
505
  handleDelete: T,
506
506
  terms: m = !0
507
- } = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard: U } = Ye({
507
+ } = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard: _ } = Ye({
508
508
  controls: t,
509
509
  customTitleContentAddCard: n,
510
- decisions: r,
510
+ decisions: o,
511
511
  loading: g,
512
- handleOpenModal: d,
512
+ handleOpenModal: c,
513
513
  handleDelete: T,
514
- textValues: o
515
- }), L = (r == null ? void 0 : r.length) === 0 && !g;
514
+ textValues: r
515
+ }), L = (o == null ? void 0 : o.length) === 0 && !g;
516
516
  return /* @__PURE__ */ h(D, { children: [
517
- /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(Be, { children: /* @__PURE__ */ i(u, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ h(
518
- u,
517
+ /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(Be, { children: /* @__PURE__ */ a(p, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ h(
518
+ p,
519
519
  {
520
520
  direction: "column",
521
521
  gap: "28px",
@@ -524,10 +524,10 @@ const Qe = {
524
524
  justifyContent: "center",
525
525
  alignItems: "center",
526
526
  children: [
527
- /* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(D, { children: [
527
+ /* @__PURE__ */ a(f, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */ h(D, { children: [
528
528
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
529
529
  /* @__PURE__ */ h(
530
- x,
530
+ f,
531
531
  {
532
532
  as: "span",
533
533
  type: "label",
@@ -543,11 +543,11 @@ const Qe = {
543
543
  ),
544
544
  "para empezar."
545
545
  ] }) }),
546
- /* @__PURE__ */ i(
546
+ /* @__PURE__ */ a(
547
547
  N,
548
548
  {
549
- iconBefore: /* @__PURE__ */ i(ae, {}),
550
- onClick: () => d ? d() : null,
549
+ iconBefore: /* @__PURE__ */ a(ae, {}),
550
+ onClick: () => c ? c() : null,
551
551
  children: n || "Agregar decisión"
552
552
  }
553
553
  )
@@ -567,42 +567,42 @@ const Qe = {
567
567
  height: v ? "auto" : "484px",
568
568
  children: [
569
569
  F,
570
- U && B({
570
+ _ && B({
571
571
  type: "add",
572
- index: r == null ? void 0 : r.length,
572
+ index: o == null ? void 0 : o.length,
573
573
  controls: t,
574
574
  customTitleContentAddCard: n,
575
- customMessageEmptyDecisions: a,
575
+ customMessageEmptyDecisions: i,
576
576
  loading: g,
577
- handleOpenModal: d,
577
+ handleOpenModal: c,
578
578
  handleDelete: T,
579
- textValues: o,
579
+ textValues: r,
580
580
  shouldRenderEmptyMessage: L,
581
581
  terms: m
582
582
  })
583
583
  ]
584
584
  }
585
585
  ) }) }) }),
586
- c && /* @__PURE__ */ i(
587
- Ue,
586
+ l && /* @__PURE__ */ a(
587
+ _e,
588
588
  {
589
589
  portalId: "modal-portal",
590
- onCloseModal: l,
590
+ onCloseModal: d,
591
591
  title: s ? "Editar Decisión" : "Nueva decisión",
592
- children: /* @__PURE__ */ i(
592
+ children: /* @__PURE__ */ a(
593
593
  st,
594
594
  {
595
- decision: s || p,
595
+ decision: s || u,
596
596
  onSubmitEvent: b,
597
- textValues: o,
598
- onCancel: () => l ? l() : () => {
597
+ textValues: r,
598
+ onCancel: () => d ? d() : () => {
599
599
  }
600
600
  }
601
601
  )
602
602
  }
603
603
  )
604
604
  ] });
605
- }, Ke = f.div`
605
+ }, Ke = y.div`
606
606
  display: flex;
607
607
  justify-content: ${({ justifyContent: e }) => e};
608
608
  align-items: ${({ alignItems: e }) => e};
@@ -615,12 +615,12 @@ const Qe = {
615
615
  margin: ${({ margin: e }) => e};
616
616
  padding: ${({ padding: e }) => e};
617
617
  background: ${({ background: e, theme: t }) => {
618
- var n, a, r, o;
619
- return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || w.palette.neutral.N10}` : `${((o = (r = t == null ? void 0 : t.palette) == null ? void 0 : r.neutral) == null ? void 0 : o.N0) || w.palette.neutral.N0}`;
618
+ var n, i, o, r;
619
+ return e ? `${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N10) || w.palette.neutral.N10}` : `${((r = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : r.N0) || w.palette.neutral.N0}`;
620
620
  }};
621
621
  border: ${({ border: e, theme: t }) => {
622
- var n, a;
623
- return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) || w.palette.neutral.N40}` : "none";
622
+ var n, i;
623
+ return e ? `1px solid ${((i = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : i.N40) || w.palette.neutral.N40}` : "none";
624
624
  }};
625
625
  border-radius: ${({ borderRadius: e }) => e};
626
626
  box-sizing: ${({ boxSizing: e }) => e};
@@ -629,46 +629,53 @@ const Qe = {
629
629
  const {
630
630
  children: t,
631
631
  wrap: n,
632
- direction: a = "column",
633
- justifyContent: r,
634
- alignItems: o,
635
- alignContent: p,
636
- height: c,
632
+ direction: i = "column",
633
+ justifyContent: o,
634
+ alignItems: r,
635
+ alignContent: u,
636
+ height: l,
637
637
  width: s,
638
638
  gap: g,
639
- background: d,
640
- borderRadius: l,
639
+ background: c,
640
+ borderRadius: d,
641
641
  border: b,
642
642
  margin: T = "0px",
643
643
  padding: m = "0px",
644
644
  boxSizing: v,
645
645
  scroll: C = !1
646
646
  } = e;
647
- return /* @__PURE__ */ i(
647
+ return /* @__PURE__ */ a(
648
648
  Ke,
649
649
  {
650
- direction: a,
651
- justifyContent: r,
652
- alignItems: o,
653
- alignContent: p,
654
- height: c,
650
+ direction: i,
651
+ justifyContent: o,
652
+ alignItems: r,
653
+ alignContent: u,
654
+ height: l,
655
655
  width: s,
656
656
  wrap: n,
657
657
  gap: g,
658
- background: d,
658
+ background: c,
659
659
  border: b,
660
660
  margin: T,
661
661
  padding: m,
662
- borderRadius: l,
662
+ borderRadius: d,
663
663
  boxSizing: v,
664
664
  scroll: C,
665
665
  children: t
666
666
  }
667
667
  );
668
668
  }, At = (e) => {
669
- const { appliedFilters: t, onClear: n, onClick: a, titleClearFilter: r, titleFilter: o } = e, p = !t || t.length === 0;
670
- return /* @__PURE__ */ i(ye, { borderRadius: "8px", children: /* @__PURE__ */ h(le, { gap: "12px", templateColumns: "1fr auto auto", children: [
671
- /* @__PURE__ */ i(
669
+ const {
670
+ appliedFilters: t,
671
+ onClear: n,
672
+ onClick: i,
673
+ noFiltersLabel: o,
674
+ titleClearFilter: r,
675
+ titleFilter: u
676
+ } = e, l = !t || t.length === 0;
677
+ return /* @__PURE__ */ a(ye, { borderRadius: "8px", width: "100%", children: /* @__PURE__ */ h(le, { gap: "12px", templateColumns: "1fr auto auto", children: [
678
+ /* @__PURE__ */ a(
672
679
  ge,
673
680
  {
674
681
  background: !0,
@@ -678,41 +685,44 @@ const Qe = {
678
685
  gap: "8px",
679
686
  alignItems: "center",
680
687
  padding: "0px 8px",
681
- children: t == null ? void 0 : t.map((c) => /* @__PURE__ */ i(
688
+ border: !0,
689
+ children: l ? /* @__PURE__ */ a(f, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((s) => /* @__PURE__ */ a(
682
690
  se,
683
691
  {
684
692
  appearance: "primary",
685
693
  displayIcon: !0,
686
- icon: c.icon,
687
- label: c.label
694
+ removable: !0,
695
+ icon: s.icon,
696
+ label: s.label,
697
+ onClose: s.onClose
688
698
  },
689
- c.label
699
+ s.label
690
700
  ))
691
701
  }
692
702
  ),
693
- /* @__PURE__ */ i(
703
+ /* @__PURE__ */ a(
694
704
  N,
695
705
  {
696
706
  cursorHover: !0,
697
- disabled: p,
698
- iconBefore: /* @__PURE__ */ i(ie, {}),
707
+ disabled: l,
708
+ iconBefore: /* @__PURE__ */ a(ie, {}),
699
709
  onClick: n,
700
710
  variant: "outlined",
701
711
  children: r
702
712
  }
703
713
  ),
704
- /* @__PURE__ */ i(
714
+ /* @__PURE__ */ a(
705
715
  N,
706
716
  {
707
717
  cursorHover: !0,
708
- iconBefore: /* @__PURE__ */ i(oe, {}),
709
- onClick: a,
718
+ iconBefore: /* @__PURE__ */ a(oe, {}),
719
+ onClick: i,
710
720
  variant: "outlined",
711
- children: o
721
+ children: u
712
722
  }
713
723
  )
714
724
  ] }) });
715
- }, We = f.div`
725
+ }, We = y.div`
716
726
  display: flex;
717
727
  flex-direction: column;
718
728
  background-color: ${({ theme: e }) => {
@@ -729,56 +739,56 @@ const Qe = {
729
739
  const {
730
740
  actionButtonLabel: t,
731
741
  cancelButtonLabel: n,
732
- children: a,
733
- loading: r,
734
- onClick: o,
735
- onCloseModal: p,
736
- portalId: c,
742
+ children: i,
743
+ loading: o,
744
+ onClick: r,
745
+ onCloseModal: u,
746
+ portalId: l,
737
747
  title: s
738
- } = e, g = A("(max-width: 768px)"), d = document.getElementById(c);
739
- if (!d)
748
+ } = e, g = A("(max-width: 768px)"), c = document.getElementById(l);
749
+ if (!c)
740
750
  throw new Error(
741
751
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
742
752
  );
743
753
  return ce(
744
- /* @__PURE__ */ i(re, { children: /* @__PURE__ */ h(We, { $smallScreen: g, children: [
745
- /* @__PURE__ */ h(u, { direction: "column", gap: "16px", children: [
746
- /* @__PURE__ */ h(u, { alignContent: "center", justifyContent: "space-between", children: [
747
- /* @__PURE__ */ i(x, { appearance: "dark", size: "small", type: "headline", children: s }),
748
- /* @__PURE__ */ h(u, { alignItems: "center", children: [
749
- /* @__PURE__ */ i(x, { children: "Cerrar" }),
750
- /* @__PURE__ */ i(
754
+ /* @__PURE__ */ a(re, { children: /* @__PURE__ */ h(We, { $smallScreen: g, children: [
755
+ /* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
756
+ /* @__PURE__ */ h(p, { alignContent: "center", justifyContent: "space-between", children: [
757
+ /* @__PURE__ */ a(f, { appearance: "dark", size: "small", type: "headline", children: s }),
758
+ /* @__PURE__ */ h(p, { alignItems: "center", children: [
759
+ /* @__PURE__ */ a(f, { children: "Cerrar" }),
760
+ /* @__PURE__ */ a(
751
761
  M,
752
762
  {
753
763
  appearance: "dark",
754
- icon: /* @__PURE__ */ i(ne, {}),
755
- onClick: p,
764
+ icon: /* @__PURE__ */ a(ne, {}),
765
+ onClick: u,
756
766
  cursorHover: !0
757
767
  }
758
768
  )
759
769
  ] })
760
770
  ] }),
761
- /* @__PURE__ */ i(S, {})
771
+ /* @__PURE__ */ a(S, {})
762
772
  ] }),
763
- a,
764
- /* @__PURE__ */ h(u, { gap: "20px", justifyContent: "flex-end", children: [
765
- /* @__PURE__ */ i(
773
+ i,
774
+ /* @__PURE__ */ h(p, { gap: "20px", justifyContent: "flex-end", children: [
775
+ /* @__PURE__ */ a(
766
776
  N,
767
777
  {
768
778
  appearance: "gray",
769
- onClick: p,
770
- iconBefore: /* @__PURE__ */ i(ie, {}),
779
+ onClick: u,
780
+ iconBefore: /* @__PURE__ */ a(ie, {}),
771
781
  spacing: "wide",
772
782
  variant: "outlined",
773
783
  children: n
774
784
  }
775
785
  ),
776
- /* @__PURE__ */ i(
786
+ /* @__PURE__ */ a(
777
787
  N,
778
788
  {
779
789
  appearance: "primary",
780
- loading: r,
781
- onClick: o,
790
+ loading: o,
791
+ onClick: r,
782
792
  spacing: "wide",
783
793
  variant: "filled",
784
794
  children: t
@@ -786,63 +796,67 @@ const Qe = {
786
796
  )
787
797
  ] })
788
798
  ] }) }),
789
- d
799
+ c
790
800
  );
791
801
  }, $t = (e) => {
792
- const { appliedFilters: t, fields: n, onChange: a } = e, r = A("(max-width: 768px)");
793
- return /* @__PURE__ */ h(u, { direction: "column", gap: "16px", children: [
794
- r && (t != null && t.length) && t.length > 0 ? /* @__PURE__ */ h(D, { children: [
795
- /* @__PURE__ */ h(u, { gap: "6px", children: [
796
- /* @__PURE__ */ i(M, { appearance: "primary", icon: /* @__PURE__ */ i(oe, {}) }),
797
- /* @__PURE__ */ i(
802
+ const { appliedFilters: t, fields: n, onChange: i, noFiltersLabel: o } = e, r = A("(max-width: 768px)"), u = !t || t.length === 0;
803
+ return /* @__PURE__ */ h(p, { direction: "column", gap: "16px", children: [
804
+ r && /* @__PURE__ */ h(D, { children: [
805
+ /* @__PURE__ */ h(p, { gap: "6px", width: "100%", alignItems: "center", children: [
806
+ /* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(oe, {}) }),
807
+ /* @__PURE__ */ a(
798
808
  ge,
799
809
  {
800
810
  background: !0,
801
811
  borderRadius: "8px",
802
- height: "100%",
803
812
  direction: "row",
804
813
  gap: "8px",
805
814
  alignItems: "center",
806
815
  padding: "0px 8px",
807
- children: t == null ? void 0 : t.map((o) => /* @__PURE__ */ i(
816
+ border: !0,
817
+ width: "100%",
818
+ height: "32px",
819
+ children: u ? /* @__PURE__ */ a(f, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ a(
808
820
  se,
809
821
  {
810
822
  appearance: "primary",
811
823
  displayIcon: !0,
812
- icon: o.icon,
813
- label: o.label
824
+ icon: l.icon,
825
+ label: l.label,
826
+ onClose: l.onClose,
827
+ removable: !0
814
828
  },
815
- o.label
829
+ l.label
816
830
  ))
817
831
  }
818
832
  )
819
833
  ] }),
820
- /* @__PURE__ */ i(S, { dashed: !0 })
821
- ] }) : null,
822
- n.map((o) => /* @__PURE__ */ h(u, { gap: "6px", alignItems: "center", children: [
823
- /* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(M, { appearance: "primary", icon: o.icon }) }),
824
- /* @__PURE__ */ i(
834
+ /* @__PURE__ */ a(S, { dashed: !0 })
835
+ ] }),
836
+ n.map((l) => /* @__PURE__ */ h(p, { gap: "6px", alignItems: "center", children: [
837
+ /* @__PURE__ */ a(p, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(M, { appearance: "primary", icon: l.icon }) }),
838
+ /* @__PURE__ */ a(
825
839
  xe,
826
840
  {
827
- disabled: o.disabled,
828
- invalid: o.invalid,
829
- label: o.label,
830
- message: o.message,
831
- name: o.name,
832
- onChange: a,
833
- options: o.options,
834
- placeholder: o.placeholder,
835
- required: o.required,
836
- values: o.values,
841
+ disabled: l.disabled,
842
+ invalid: l.invalid,
843
+ label: l.label,
844
+ message: l.message,
845
+ name: l.name,
846
+ onChange: i,
847
+ options: l.options,
848
+ placeholder: l.placeholder,
849
+ required: l.required,
850
+ values: l.values,
837
851
  fullwidth: !0
838
852
  },
839
- o.name
853
+ l.name
840
854
  )
841
- ] }, o.name))
855
+ ] }, l.name))
842
856
  ] });
843
857
  }, It = (e) => {
844
858
  console.log(e);
845
- const { dataDecision: t, originalDecision: n } = e, a = {
859
+ const { dataDecision: t, originalDecision: n } = e, i = {
846
860
  conditionName: t.ruleName || "",
847
861
  labelName: t.labelName || "",
848
862
  conditionDataType: t.decisionDataType || "alphabetical",
@@ -854,17 +868,17 @@ const Qe = {
854
868
  return {
855
869
  ...n,
856
870
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
857
- (r) => r.hidden ? { ...a } : r
871
+ (o) => o.hidden ? { ...i } : o
858
872
  )
859
873
  };
860
874
  }, Rt = (e) => {
861
875
  const { decisions: t } = e;
862
876
  return t == null ? void 0 : t.map((n) => {
863
- var r;
864
- const a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
865
- (o) => o.hidden
877
+ var o;
878
+ const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
879
+ (r) => r.hidden
866
880
  );
867
- return a ? {
881
+ return i ? {
868
882
  ...n,
869
883
  ruleName: n.ruleName,
870
884
  labelName: n.labelName,
@@ -872,7 +886,7 @@ const Qe = {
872
886
  value: n.value,
873
887
  howToSetTheDecision: n.howToSetTheDecision,
874
888
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
875
- (o) => o.hidden ? { ...a, hidden: !1 } : o
889
+ (r) => r.hidden ? { ...i, hidden: !1 } : r
876
890
  )
877
891
  } : n;
878
892
  });
@@ -909,9 +923,9 @@ const Qe = {
909
923
  to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
910
924
  "is-greater",
911
925
  "To value must be greater than From value",
912
- function(a) {
913
- const { from: r } = this.parent;
914
- return a > r;
926
+ function(i) {
927
+ const { from: o } = this.parent;
928
+ return i > o;
915
929
  }
916
930
  )
917
931
  }),
@@ -924,19 +938,19 @@ const Qe = {
924
938
  schema: H().required("Required"),
925
939
  value: e
926
940
  }, tt = {
927
- [y.LIST_OF_VALUES]: Xe,
928
- [y.LIST_OF_VALUES_MULTI]: Ze,
929
- [y.RANGE]: et,
930
- [y.GREATER_THAN]: j,
931
- [y.LESS_THAN]: j,
932
- [y.EQUAL]: j
941
+ [x.LIST_OF_VALUES]: Xe,
942
+ [x.LIST_OF_VALUES_MULTI]: Ze,
943
+ [x.RANGE]: et,
944
+ [x.GREATER_THAN]: j,
945
+ [x.LESS_THAN]: j,
946
+ [x.EQUAL]: j
933
947
  }, Z = (e) => tt[e] || Je;
934
948
  function nt({
935
949
  decision: e,
936
950
  onSubmitEvent: t,
937
951
  textValues: n
938
952
  }) {
939
- const a = {
953
+ const i = {
940
954
  ruleName: e.ruleName || "",
941
955
  decisionDataType: e.decisionDataType || k.ALPHABETICAL,
942
956
  howToSetTheDecision: e.howToSetTheDecision || "",
@@ -948,21 +962,21 @@ function nt({
948
962
  checkClosed: !1,
949
963
  terms: !0
950
964
  };
951
- let r;
952
- const o = {
965
+ let o;
966
+ const r = {
953
967
  ruleName: H().required("Name is required"),
954
968
  value: K(() => Z(
955
- r.values.howToSetTheDecision
969
+ o.values.howToSetTheDecision
956
970
  )(
957
- r.values.value,
958
- r.values.decisionDataType
971
+ o.values.value,
972
+ o.values.decisionDataType
959
973
  ).schema),
960
974
  conditionsThatEstablishesTheDecision: K((s, { parent: g }) => {
961
975
  var b;
962
976
  if ((g == null ? void 0 : g.toggleNone) && Object.keys(g.conditionsThatEstablishesTheDecision || {}).length > 0) return V().shape({});
963
- const l = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
977
+ const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
964
978
  (T, m) => {
965
- if (r.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
979
+ if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
966
980
  const C = Z(
967
981
  m.howToSetTheCondition
968
982
  );
@@ -975,7 +989,7 @@ function nt({
975
989
  },
976
990
  {}
977
991
  );
978
- return V(l).test(
992
+ return V(d).test(
979
993
  "at-least-one-condition",
980
994
  "It must be at least one condition in order for the decision to be validated correctly.",
981
995
  (T) => T ? Object.values(T).some(
@@ -984,11 +998,11 @@ function nt({
984
998
  );
985
999
  })
986
1000
  };
987
- n.terms && (o.effectiveFrom = W().required(
1001
+ n.terms && (r.effectiveFrom = W().required(
988
1002
  "effective From date is required"
989
- ), o.validUntil = W().when(
1003
+ ), r.validUntil = W().when(
990
1004
  "checkClosed",
991
- (s, g, { parent: d }) => (d == null ? void 0 : d.checkClosed) ? g.required("valid Until date is required").test(
1005
+ (s, g, { parent: c }) => (c == null ? void 0 : c.checkClosed) ? g.required("valid Until date is required").test(
992
1006
  "is-after-startDate",
993
1007
  "valid Until date must be greater than or equal to Start date",
994
1008
  function(b) {
@@ -997,13 +1011,13 @@ function nt({
997
1011
  }
998
1012
  ) : g.notRequired()
999
1013
  ));
1000
- const p = V(o);
1001
- return r = Ce({
1002
- initialValues: a,
1003
- validationSchema: p,
1014
+ const u = V(r);
1015
+ return o = Ce({
1016
+ initialValues: i,
1017
+ validationSchema: u,
1004
1018
  validateOnBlur: !0,
1005
1019
  onSubmit: (s) => {
1006
- var d;
1020
+ var c;
1007
1021
  const g = {
1008
1022
  ...e,
1009
1023
  ruleName: s.ruleName,
@@ -1012,35 +1026,35 @@ function nt({
1012
1026
  value: s.value,
1013
1027
  effectiveFrom: s.effectiveFrom,
1014
1028
  validUntil: s.validUntil,
1015
- conditionsThatEstablishesTheDecision: (d = e.conditionsThatEstablishesTheDecision) == null ? void 0 : d.filter((l) => {
1016
- const b = s.conditionsThatEstablishesTheDecision[l.conditionName];
1029
+ conditionsThatEstablishesTheDecision: (c = e.conditionsThatEstablishesTheDecision) == null ? void 0 : c.filter((d) => {
1030
+ const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
1017
1031
  return b != null && b !== "";
1018
- }).map((l) => ({
1019
- ...l,
1020
- value: s.conditionsThatEstablishesTheDecision[l.conditionName]
1032
+ }).map((d) => ({
1033
+ ...d,
1034
+ value: s.conditionsThatEstablishesTheDecision[d.conditionName]
1021
1035
  }))
1022
1036
  };
1023
1037
  t(g);
1024
1038
  }
1025
- }), { formik: r, handleToggleNoneChange: (s) => {
1039
+ }), { formik: o, handleToggleNoneChange: (s) => {
1026
1040
  var g;
1027
- r.setFieldValue("toggleNone", s), (g = e.conditionsThatEstablishesTheDecision) == null || g.forEach((d) => {
1041
+ o.setFieldValue("toggleNone", s), (g = e.conditionsThatEstablishesTheDecision) == null || g.forEach((c) => {
1028
1042
  if (s)
1029
- r.setFieldValue(
1030
- `conditionsThatEstablishesTheDecision.${d.conditionName}`,
1043
+ o.setFieldValue(
1044
+ `conditionsThatEstablishesTheDecision.${c.conditionName}`,
1031
1045
  void 0
1032
1046
  );
1033
1047
  else {
1034
- const l = d.howToSetTheCondition === y.LIST_OF_VALUES_MULTI ? [] : "";
1035
- r.setFieldValue(
1036
- `conditionsThatEstablishesTheDecision.${d.conditionName}`,
1037
- l
1048
+ const d = c.howToSetTheCondition === x.LIST_OF_VALUES_MULTI ? [] : "";
1049
+ o.setFieldValue(
1050
+ `conditionsThatEstablishesTheDecision.${c.conditionName}`,
1051
+ d
1038
1052
  );
1039
1053
  }
1040
1054
  });
1041
1055
  } };
1042
1056
  }
1043
- const at = f.div`
1057
+ const at = y.div`
1044
1058
  & > div {
1045
1059
  border-radius: 8px;
1046
1060
  border: 1px solid
@@ -1049,7 +1063,7 @@ const at = f.div`
1049
1063
  return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
1050
1064
  }};
1051
1065
  }
1052
- `, it = f.div`
1066
+ `, it = y.div`
1053
1067
  width: 100%;
1054
1068
  height: 100%;
1055
1069
  overflow-y: auto;
@@ -1070,57 +1084,57 @@ const at = f.div`
1070
1084
  const {
1071
1085
  checked: t,
1072
1086
  children: n,
1073
- handleToggleChange: a,
1074
- id: r,
1075
- labelToggle: o,
1076
- name: p,
1077
- valueToggle: c = ""
1078
- } = e, [s, g] = _(t), d = (l) => {
1079
- g(l.target.checked), a(l);
1087
+ handleToggleChange: i,
1088
+ id: o,
1089
+ labelToggle: r,
1090
+ name: u,
1091
+ valueToggle: l = ""
1092
+ } = e, [s, g] = z(t), c = (d) => {
1093
+ g(d.target.checked), i(d);
1080
1094
  };
1081
1095
  return Se(() => {
1082
1096
  g(t);
1083
1097
  }, [t]), /* @__PURE__ */ h(D, { children: [
1084
- /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
1098
+ /* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(
1085
1099
  de,
1086
1100
  {
1087
1101
  checked: s,
1088
- id: r,
1089
- name: p,
1090
- onChange: d,
1102
+ id: o,
1103
+ name: u,
1104
+ onChange: c,
1091
1105
  size: "small",
1092
- value: c,
1093
- children: /* @__PURE__ */ i(x, { size: "medium", type: "label", weight: "bold", children: o })
1106
+ value: l,
1107
+ children: /* @__PURE__ */ a(f, { size: "medium", type: "label", weight: "bold", children: r })
1094
1108
  }
1095
1109
  ) }),
1096
- s && /* @__PURE__ */ i(D, { children: n })
1110
+ s && /* @__PURE__ */ a(D, { children: n })
1097
1111
  ] });
1098
1112
  }, rt = (e) => {
1099
1113
  const {
1100
1114
  onHandleStartChange: t,
1101
1115
  onHandleEndChange: n,
1102
- onCheckClosedChange: a,
1103
- labelStart: r,
1104
- labelEnd: o,
1105
- checkedClosed: p = !1,
1106
- required: c = !1,
1116
+ onCheckClosedChange: i,
1117
+ labelStart: o,
1118
+ labelEnd: r,
1119
+ checkedClosed: u = !1,
1120
+ required: l = !1,
1107
1121
  valueStart: s = "",
1108
1122
  valueEnd: g = "",
1109
- messageStart: d = "",
1110
- messageEnd: l = "",
1123
+ messageStart: c = "",
1124
+ messageEnd: d = "",
1111
1125
  statusStart: b = "pending",
1112
1126
  statusEnd: T = "pending"
1113
- } = e, [m, v] = _(p), [C, F] = _(s), [U, L] = _(g), G = ({ target: E }) => {
1114
- v(E.checked), a && a(E.checked);
1127
+ } = e, [m, v] = z(u), [C, F] = z(s), [_, L] = z(g), G = ({ target: E }) => {
1128
+ v(E.checked), i && i(E.checked);
1115
1129
  }, me = (E) => {
1116
1130
  F(E.target.value), t(E);
1117
1131
  }, be = (E) => {
1118
1132
  L(E.target.value), n(E);
1119
1133
  }, Te = A("(max-width: 400px)");
1120
1134
  return /* @__PURE__ */ h(D, { children: [
1121
- /* @__PURE__ */ h(u, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1122
- /* @__PURE__ */ i(
1123
- x,
1135
+ /* @__PURE__ */ h(p, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1136
+ /* @__PURE__ */ a(
1137
+ f,
1124
1138
  {
1125
1139
  appearance: "gray",
1126
1140
  margin: "10px 0",
@@ -1130,14 +1144,14 @@ const at = f.div`
1130
1144
  children: "Vigencia"
1131
1145
  }
1132
1146
  ),
1133
- /* @__PURE__ */ i(
1134
- u,
1147
+ /* @__PURE__ */ a(
1148
+ p,
1135
1149
  {
1136
1150
  alignContent: "center",
1137
1151
  justifyContent: "center",
1138
1152
  wrap: "wrap",
1139
1153
  gap: "4px",
1140
- children: /* @__PURE__ */ i(
1154
+ children: /* @__PURE__ */ a(
1141
1155
  we,
1142
1156
  {
1143
1157
  label: "Cerrada",
@@ -1150,36 +1164,36 @@ const at = f.div`
1150
1164
  )
1151
1165
  ] }),
1152
1166
  /* @__PURE__ */ h(
1153
- u,
1167
+ p,
1154
1168
  {
1155
1169
  direction: Te ? "column" : "row",
1156
1170
  justifyContent: "space-between",
1157
1171
  gap: "24px",
1158
1172
  children: [
1159
- /* @__PURE__ */ i(
1173
+ /* @__PURE__ */ a(
1160
1174
  Q,
1161
1175
  {
1162
1176
  id: "dateStart",
1163
- label: r,
1177
+ label: o,
1164
1178
  onChange: me,
1165
1179
  value: C,
1166
- required: c,
1180
+ required: l,
1167
1181
  size: "compact",
1168
1182
  status: b,
1169
- message: d
1183
+ message: c
1170
1184
  }
1171
1185
  ),
1172
- m && /* @__PURE__ */ i(
1186
+ m && /* @__PURE__ */ a(
1173
1187
  Q,
1174
1188
  {
1175
1189
  id: "dateEnd",
1176
- label: o,
1190
+ label: r,
1177
1191
  onChange: be,
1178
- value: U,
1179
- required: c,
1192
+ value: _,
1193
+ required: l,
1180
1194
  size: "compact",
1181
1195
  status: T,
1182
- message: l
1196
+ message: d
1183
1197
  }
1184
1198
  )
1185
1199
  ]
@@ -1190,24 +1204,24 @@ const at = f.div`
1190
1204
  const {
1191
1205
  formik: t,
1192
1206
  textValues: n,
1193
- onCancel: a,
1194
- visibleConditions: r,
1195
- normalizedDecision: o,
1196
- handleToggleNoneChange: p,
1197
- handleConditionToggleChange: c,
1207
+ onCancel: i,
1208
+ visibleConditions: o,
1209
+ normalizedDecision: r,
1210
+ handleToggleNoneChange: u,
1211
+ handleConditionToggleChange: l,
1198
1212
  showConditionsError: s,
1199
1213
  termStartStatus: g,
1200
- termEndStatus: d
1214
+ termEndStatus: c
1201
1215
  } = e;
1202
- return /* @__PURE__ */ i("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ h(u, { direction: "column", gap: "24px", children: [
1216
+ return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ h(p, { direction: "column", gap: "24px", children: [
1203
1217
  Y({
1204
- condition: o,
1218
+ condition: r,
1205
1219
  formik: t,
1206
1220
  isDecision: !0
1207
1221
  }),
1208
- /* @__PURE__ */ i(S, { dashed: !0 }),
1209
- /* @__PURE__ */ i(at, { children: /* @__PURE__ */ i(it, { children: /* @__PURE__ */ h(
1210
- u,
1222
+ /* @__PURE__ */ a(S, { dashed: !0 }),
1223
+ /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(it, { children: /* @__PURE__ */ h(
1224
+ p,
1211
1225
  {
1212
1226
  direction: "column",
1213
1227
  padding: "6px 12px",
@@ -1215,47 +1229,47 @@ const at = f.div`
1215
1229
  height: "272px",
1216
1230
  children: [
1217
1231
  /* @__PURE__ */ h(
1218
- u,
1232
+ p,
1219
1233
  {
1220
1234
  justifyContent: "space-between",
1221
1235
  alignItems: "center",
1222
1236
  gap: "64px",
1223
1237
  children: [
1224
- /* @__PURE__ */ i(x, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1225
- /* @__PURE__ */ i(
1238
+ /* @__PURE__ */ a(f, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1239
+ /* @__PURE__ */ a(
1226
1240
  de,
1227
1241
  {
1228
1242
  id: "toggleNone",
1229
- onChange: () => p(!t.values.toggleNone),
1243
+ onChange: () => u(!t.values.toggleNone),
1230
1244
  checked: t.values.toggleNone,
1231
1245
  size: "small",
1232
- children: /* @__PURE__ */ i(x, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1246
+ children: /* @__PURE__ */ a(f, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1233
1247
  }
1234
1248
  )
1235
1249
  ]
1236
1250
  }
1237
1251
  ),
1238
- /* @__PURE__ */ i(u, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((l) => /* @__PURE__ */ i(
1252
+ /* @__PURE__ */ a(p, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((d) => /* @__PURE__ */ a(
1239
1253
  ot,
1240
1254
  {
1241
- id: `toggle-${l.conditionName}`,
1242
- name: `toggle.${l.conditionName}`,
1243
- labelToggle: l.labelName,
1244
- checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[l.conditionName] !== void 0,
1245
- handleToggleChange: (b) => c(
1246
- l.conditionName,
1247
- l.howToSetTheCondition === y.LIST_OF_VALUES_MULTI
1255
+ id: `toggle-${d.conditionName}`,
1256
+ name: `toggle.${d.conditionName}`,
1257
+ labelToggle: d.labelName,
1258
+ checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
1259
+ handleToggleChange: (b) => l(
1260
+ d.conditionName,
1261
+ d.howToSetTheCondition === x.LIST_OF_VALUES_MULTI
1248
1262
  )(b.target.checked),
1249
- children: Y({ condition: l, formik: t })
1263
+ children: Y({ condition: d, formik: t })
1250
1264
  },
1251
- l.conditionName
1265
+ d.conditionName
1252
1266
  )) })
1253
1267
  ]
1254
1268
  }
1255
1269
  ) }) }),
1256
1270
  n.terms && /* @__PURE__ */ h(D, { children: [
1257
- /* @__PURE__ */ i(S, { dashed: !0 }),
1258
- /* @__PURE__ */ i(
1271
+ /* @__PURE__ */ a(S, { dashed: !0 }),
1272
+ /* @__PURE__ */ a(
1259
1273
  rt,
1260
1274
  {
1261
1275
  labelStart: n.termStart,
@@ -1265,30 +1279,30 @@ const at = f.div`
1265
1279
  messageStart: t.errors.effectiveFrom,
1266
1280
  messageEnd: t.errors.validUntil,
1267
1281
  statusStart: g,
1268
- statusEnd: d,
1269
- onHandleStartChange: (l) => t.setFieldValue("effectiveFrom", l.target.value),
1270
- onHandleEndChange: (l) => t.setFieldValue("validUntil", l.target.value),
1271
- onCheckClosedChange: (l) => {
1272
- t.setFieldValue("checkClosed", l), l && t.setFieldValue("validUntil", "");
1282
+ statusEnd: c,
1283
+ onHandleStartChange: (d) => t.setFieldValue("effectiveFrom", d.target.value),
1284
+ onHandleEndChange: (d) => t.setFieldValue("validUntil", d.target.value),
1285
+ onCheckClosedChange: (d) => {
1286
+ t.setFieldValue("checkClosed", d), d && t.setFieldValue("validUntil", "");
1273
1287
  },
1274
1288
  checkedClosed: t.values.checkClosed
1275
1289
  }
1276
1290
  )
1277
1291
  ] }),
1278
- /* @__PURE__ */ i(S, {}),
1279
- s && /* @__PURE__ */ i(x, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1280
- /* @__PURE__ */ h(u, { direction: "row", justifyContent: "end", gap: "16px", children: [
1281
- /* @__PURE__ */ i(N, { appearance: "gray", onClick: a, children: n.cancel }),
1282
- /* @__PURE__ */ i(N, { type: "submit", children: n.confirm })
1292
+ /* @__PURE__ */ a(S, {}),
1293
+ s && /* @__PURE__ */ a(f, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1294
+ /* @__PURE__ */ h(p, { direction: "row", justifyContent: "end", gap: "16px", children: [
1295
+ /* @__PURE__ */ a(N, { appearance: "gray", onClick: i, children: n.cancel }),
1296
+ /* @__PURE__ */ a(N, { type: "submit", children: n.confirm })
1283
1297
  ] })
1284
1298
  ] }) });
1285
1299
  }, st = (e) => {
1286
1300
  var T;
1287
- const { decision: t, onSubmitEvent: n, textValues: a, onCancel: r } = e, { formik: o, handleToggleNoneChange: p } = nt({
1301
+ const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange: u } = nt({
1288
1302
  decision: t,
1289
1303
  onSubmitEvent: n,
1290
- textValues: a
1291
- }), c = {
1304
+ textValues: i
1305
+ }), l = {
1292
1306
  ruleName: t.ruleName,
1293
1307
  labelName: t.labelName,
1294
1308
  howToSetTheCondition: t.howToSetTheDecision,
@@ -1296,80 +1310,80 @@ const at = f.div`
1296
1310
  listOfPossibleValues: t.listOfPossibleValues
1297
1311
  }, s = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
1298
1312
  (m) => !m.hidden
1299
- )) || [], g = !!o.errors.conditionsThatEstablishesTheDecision && o.submitCount > 0, d = o.touched.effectiveFrom ? o.errors.effectiveFrom ? "invalid" : "valid" : void 0, l = o.touched.validUntil ? o.errors.validUntil ? "invalid" : "valid" : void 0;
1300
- return /* @__PURE__ */ i(
1313
+ )) || [], g = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, c = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
1314
+ return /* @__PURE__ */ a(
1301
1315
  lt,
1302
1316
  {
1303
- formik: o,
1304
- onCancel: r,
1305
- textValues: a,
1317
+ formik: r,
1318
+ onCancel: o,
1319
+ textValues: i,
1306
1320
  decision: t,
1307
1321
  visibleConditions: s,
1308
- normalizedDecision: c,
1309
- handleToggleNoneChange: p,
1322
+ normalizedDecision: l,
1323
+ handleToggleNoneChange: u,
1310
1324
  handleConditionToggleChange: (m, v) => (C) => {
1311
1325
  if (!C)
1312
- o.setFieldValue(
1326
+ r.setFieldValue(
1313
1327
  `conditionsThatEstablishesTheDecision.${m}`,
1314
1328
  void 0
1315
- ), o.setFieldTouched(
1329
+ ), r.setFieldTouched(
1316
1330
  `conditionsThatEstablishesTheDecision.${m}`,
1317
1331
  !1,
1318
1332
  !1
1319
1333
  );
1320
1334
  else {
1321
1335
  const F = v ? [] : "";
1322
- o.setFieldValue(
1336
+ r.setFieldValue(
1323
1337
  `conditionsThatEstablishesTheDecision.${m}`,
1324
1338
  F
1325
1339
  );
1326
1340
  }
1327
1341
  },
1328
1342
  showConditionsError: g,
1329
- termStartStatus: d,
1330
- termEndStatus: l
1343
+ termStartStatus: c,
1344
+ termEndStatus: d
1331
1345
  }
1332
1346
  );
1333
1347
  }, Mt = (e) => {
1334
- var r;
1335
- const { decisionTemplate: t } = e, n = { ...t }, a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1336
- (o) => o.switchPlaces
1348
+ var o;
1349
+ const { decisionTemplate: t } = e, n = { ...t }, i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1350
+ (r) => r.switchPlaces
1337
1351
  );
1338
- return a ? {
1352
+ return i ? {
1339
1353
  ...n,
1340
- ruleName: a.conditionName,
1341
- labelName: a.labelName,
1342
- decisionDataType: a.conditionDataType,
1343
- value: a.value,
1344
- howToSetTheDecision: a.howToSetTheCondition,
1354
+ ruleName: i.conditionName,
1355
+ labelName: i.labelName,
1356
+ decisionDataType: i.conditionDataType,
1357
+ value: i.value,
1358
+ howToSetTheDecision: i.howToSetTheCondition,
1345
1359
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1346
- (o) => o.conditionName === a.conditionName ? { ...o, hidden: !0 } : o
1360
+ (r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
1347
1361
  )
1348
1362
  } : n;
1349
1363
  }, Lt = (e) => {
1350
1364
  const { decisions: t } = e;
1351
1365
  return t == null ? void 0 : t.map((n) => {
1352
- var r;
1353
- const a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1354
- (o) => o.switchPlaces
1366
+ var o;
1367
+ const i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1368
+ (r) => r.switchPlaces
1355
1369
  );
1356
- return a ? {
1370
+ return i ? {
1357
1371
  ...n,
1358
- ruleName: a.conditionName,
1359
- labelName: a.labelName,
1360
- decisionDataType: a.conditionDataType,
1361
- value: a.value,
1362
- howToSetTheDecision: a.howToSetTheCondition,
1372
+ ruleName: i.conditionName,
1373
+ labelName: i.labelName,
1374
+ decisionDataType: i.conditionDataType,
1375
+ value: i.value,
1376
+ howToSetTheDecision: i.howToSetTheCondition,
1363
1377
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1364
- (o) => o.conditionName === a.conditionName ? { ...o, hidden: !0 } : o
1378
+ (r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
1365
1379
  )
1366
1380
  } : n;
1367
1381
  });
1368
1382
  }, I = /* @__PURE__ */ new Map(), dt = (e, t) => I.get(`${t}:${e}`), ct = (e, t, n) => {
1369
- const a = `${t}:${e}`;
1370
- if (I.set(a, n), I.size > 1e3) {
1371
- const r = I.keys().next().value;
1372
- r !== void 0 && I.delete(r);
1383
+ const i = `${t}:${e}`;
1384
+ if (I.set(i, n), I.size > 1e3) {
1385
+ const o = I.keys().next().value;
1386
+ o !== void 0 && I.delete(o);
1373
1387
  }
1374
1388
  }, ee = /* @__PURE__ */ new Map(), ht = 1e3, ut = (e) => {
1375
1389
  const t = Date.now(), n = ee.get(e) || 0;
@@ -1384,52 +1398,52 @@ const at = f.div`
1384
1398
  ita: "it",
1385
1399
  por: "pt"
1386
1400
  }[t] || "en";
1387
- }, gt = async (e, t, { url: n, apiKey: a }) => {
1388
- const r = `${t}:${e}`, o = dt(e, t);
1389
- if (o) return o;
1390
- if (ut(r))
1401
+ }, gt = async (e, t, { url: n, apiKey: i }) => {
1402
+ const o = `${t}:${e}`, r = dt(e, t);
1403
+ if (r) return r;
1404
+ if (ut(o))
1391
1405
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
1392
- const p = pt(e);
1406
+ const u = pt(e);
1393
1407
  try {
1394
- const { data: c } = await De.post(
1408
+ const { data: l } = await De.post(
1395
1409
  n,
1396
1410
  {
1397
1411
  q: e,
1398
- source: p,
1412
+ source: u,
1399
1413
  target: t,
1400
- api_key: a
1414
+ api_key: i
1401
1415
  },
1402
1416
  {
1403
1417
  headers: {
1404
1418
  "Content-Type": "application/json"
1405
1419
  }
1406
1420
  }
1407
- ), s = (c == null ? void 0 : c.translatedText) || e;
1421
+ ), s = (l == null ? void 0 : l.translatedText) || e;
1408
1422
  return ct(e, t, s), s;
1409
- } catch (c) {
1410
- return console.warn(`[Translation] Failed for: "${e}"`, c), e;
1423
+ } catch (l) {
1424
+ return console.warn(`[Translation] Failed for: "${e}"`, l), e;
1411
1425
  }
1412
1426
  }, mt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
1413
- const a = await Promise.all(
1414
- Object.entries(e).map(async ([r, o]) => {
1415
- if (mt(o)) {
1416
- const p = await gt(o, t, n);
1417
- return [r, p];
1418
- } else if (Array.isArray(o)) {
1419
- const p = await Promise.all(
1420
- o.map(
1421
- async (c) => typeof c == "object" && c !== null ? await te(c, t, n) : c
1427
+ const i = await Promise.all(
1428
+ Object.entries(e).map(async ([o, r]) => {
1429
+ if (mt(r)) {
1430
+ const u = await gt(r, t, n);
1431
+ return [o, u];
1432
+ } else if (Array.isArray(r)) {
1433
+ const u = await Promise.all(
1434
+ r.map(
1435
+ async (l) => typeof l == "object" && l !== null ? await te(l, t, n) : l
1422
1436
  )
1423
1437
  );
1424
- return [r, p];
1425
- } else if (typeof o == "object" && o !== null) {
1426
- const p = await te(o, t, n);
1427
- return [r, p];
1438
+ return [o, u];
1439
+ } else if (typeof r == "object" && r !== null) {
1440
+ const u = await te(r, t, n);
1441
+ return [o, u];
1428
1442
  } else
1429
- return [r, o];
1443
+ return [o, r];
1430
1444
  })
1431
1445
  );
1432
- return Object.fromEntries(a);
1446
+ return Object.fromEntries(i);
1433
1447
  };
1434
1448
  export {
1435
1449
  P as BusinessRuleCard,
@@ -1438,7 +1452,7 @@ export {
1438
1452
  At as Filter,
1439
1453
  Ft as FilterModal,
1440
1454
  $t as FormFilter,
1441
- Ue as ModalRules,
1455
+ _e as ModalRules,
1442
1456
  st as RulesForm,
1443
1457
  It as revertSortedDataSampleSwitchPlaces,
1444
1458
  Rt as revertSortedDataSwitchPlaces,