@isettingkit/business-rules 0.1.26 → 0.1.28

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.
@@ -4,7 +4,7 @@ import { ReactPortal } from 'react';
4
4
 
5
5
  export declare const BusinessRuleCard: (props: IBusinessRuleCard) => JSX_2.Element;
6
6
 
7
- export declare const BusinessRules: ({ controls, decisions, textValues, decisionTemplate, isModalOpen, selectedDecision, loading, handleOpenModal, handleCloseModal, handleSubmitForm, handleDelete, }: IBusinessRules) => JSX_2.Element;
7
+ export declare const BusinessRules: (props: IBusinessRules) => JSX_2.Element;
8
8
 
9
9
  export declare const BusinessRuleView: (props: IBusinessRuleView) => JSX_2.Element;
10
10
 
@@ -45,9 +45,9 @@ declare interface IModalRules {
45
45
 
46
46
  export declare interface IRulesForm {
47
47
  decision: IRuleDecision;
48
+ onCancel: () => void;
48
49
  onSubmitEvent: (dataDecision: IRuleDecision) => void;
49
50
  textValues: IRulesFormTextValues;
50
- onCancel: () => void;
51
51
  }
52
52
 
53
53
  declare interface IRulesFormTextValues {
package/dist/index.es.js CHANGED
@@ -1,44 +1,44 @@
1
- import { jsxs as c, Fragment as A, jsx as t } from "react/jsx-runtime";
2
- import { ValueDataType as V, ValueHowToSetUp as m, InputRange as ee, MultipleChoices as te, DynamicField as ae } from "@isettingkit/input";
3
- import { Stack as d } from "@inubekit/stack";
4
- import { Divider as S } from "@inubekit/divider";
5
- import { Button as B } from "@inubekit/button";
6
- import { useState as _, useEffect as re } from "react";
1
+ import { jsxs as c, Fragment as F, jsx as t } from "react/jsx-runtime";
2
+ import { ValueDataType as V, ValueHowToSetUp as g, InputRange as te, MultipleChoices as re, DynamicField as ae } from "@isettingkit/input";
3
+ import { Stack as s } from "@inubekit/stack";
4
+ import { Divider as k } from "@inubekit/divider";
5
+ import { Button as G } from "@inubekit/button";
6
+ import { useState as _, useEffect as ne } from "react";
7
7
  import { Text as y } from "@inubekit/text";
8
- import { Date as G } from "@inubekit/date";
9
- import { Checkbox as ne } from "@inubekit/checkbox";
10
- import { Toggle as K } from "@inubekit/toggle";
11
- import { inube as k } from "@inubekit/foundations";
12
- import b, { keyframes as oe } from "styled-components";
13
- import { useFormik as le } from "formik";
14
- import { mixed as X, object as F, number as N, string as H, date as P, lazy as ie } from "yup";
8
+ import { Date as P } from "@inubekit/date";
9
+ import { Checkbox as oe } from "@inubekit/checkbox";
10
+ import { Toggle as J } from "@inubekit/toggle";
11
+ import { inube as S } from "@inubekit/foundations";
12
+ import f, { keyframes as le } from "styled-components";
13
+ import { useFormik as ie } from "formik";
14
+ import { mixed as K, object as A, number as R, string as B, date as Q, lazy as de } from "yup";
15
15
  import { DecisionViewConditionRenderer as q } from "@isettingkit/view";
16
- import { SkeletonLine as E } from "@inubekit/skeleton";
17
- import { MdOutlineDelete as de, MdClear as se, MdAdd as ce } from "react-icons/md";
18
- import { Icon as Z } from "@inubekit/icon";
19
- import { createPortal as ue } from "react-dom";
20
- import { Blanket as he } from "@inubekit/blanket";
21
- import { Grid as pe } from "@inubekit/grid";
16
+ import { SkeletonLine as D } from "@inubekit/skeleton";
17
+ import { MdOutlineDelete as se, MdClear as ce, MdAdd as ue } from "react-icons/md";
18
+ import { Icon as X } from "@inubekit/icon";
19
+ import { createPortal as he } from "react-dom";
20
+ import { Blanket as pe } from "@inubekit/blanket";
21
+ import { Grid as ge } from "@inubekit/grid";
22
22
  import { useMediaQuery as me } from "@inubekit/hooks";
23
- const ge = (r) => {
23
+ const be = (r) => {
24
24
  const {
25
25
  onHandleStartChange: e,
26
- onHandleEndChange: s,
26
+ onHandleEndChange: o,
27
27
  onCheckClosedChange: i,
28
28
  labelStart: h,
29
29
  labelEnd: a,
30
- checkedClosed: l = !1,
31
- required: o = !1,
30
+ checkedClosed: d = !1,
31
+ required: l = !1,
32
32
  valueStart: u = "",
33
- valueEnd: g = "",
34
- messageStart: v = "",
35
- messageEnd: f = "",
36
- statusStart: p = "pending",
33
+ valueEnd: p = "",
34
+ messageStart: b = "",
35
+ messageEnd: m = "",
36
+ statusStart: x = "pending",
37
37
  statusEnd: w = "pending"
38
- } = r, [n, U] = _(l), [I, R] = _(u), [$, L] = _(g);
39
- return /* @__PURE__ */ c(A, { children: [
40
- /* @__PURE__ */ c(d, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
41
- /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
38
+ } = r, [n, N] = _(d), [U, I] = _(u), [L, $] = _(p);
39
+ return /* @__PURE__ */ c(F, { children: [
40
+ /* @__PURE__ */ c(s, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
41
+ /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
42
42
  y,
43
43
  {
44
44
  appearance: "gray",
@@ -50,18 +50,18 @@ const ge = (r) => {
50
50
  }
51
51
  ) }),
52
52
  /* @__PURE__ */ t(
53
- d,
53
+ s,
54
54
  {
55
55
  alignContent: "center",
56
56
  justifyContent: "center",
57
57
  wrap: "wrap",
58
58
  gap: "4px",
59
59
  children: /* @__PURE__ */ t(
60
- ne,
60
+ oe,
61
61
  {
62
62
  label: "Cerrada",
63
- onChange: ({ target: x }) => {
64
- U(x.checked), i && i(x.checked);
63
+ onChange: ({ target: v }) => {
64
+ N(v.checked), i && i(v.checked);
65
65
  },
66
66
  checked: n,
67
67
  value: ""
@@ -70,45 +70,45 @@ const ge = (r) => {
70
70
  }
71
71
  )
72
72
  ] }),
73
- /* @__PURE__ */ c(d, { justifyContent: "space-between", gap: "24px", children: [
74
- /* @__PURE__ */ t(d, { width: "189px", children: /* @__PURE__ */ t(
75
- G,
73
+ /* @__PURE__ */ c(s, { justifyContent: "space-between", gap: "24px", children: [
74
+ /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
75
+ P,
76
76
  {
77
77
  id: "dateStart",
78
78
  label: h,
79
- onChange: (x) => {
80
- R(x.target.value), e(x);
79
+ onChange: (v) => {
80
+ I(v.target.value), e(v);
81
81
  },
82
- value: I,
83
- required: o,
82
+ value: U,
83
+ required: l,
84
84
  size: "compact",
85
- status: p,
86
- message: v
85
+ status: x,
86
+ message: b
87
87
  }
88
88
  ) }),
89
- n && /* @__PURE__ */ t(d, { width: "189px", children: /* @__PURE__ */ t(
90
- G,
89
+ n && /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
90
+ P,
91
91
  {
92
92
  id: "dateEnd",
93
93
  label: a,
94
- onChange: (x) => {
95
- L(x.target.value), s(x);
94
+ onChange: (v) => {
95
+ $(v.target.value), o(v);
96
96
  },
97
- value: $,
98
- required: o,
97
+ value: L,
98
+ required: l,
99
99
  size: "compact",
100
100
  status: w,
101
- message: f
101
+ message: m
102
102
  }
103
103
  ) })
104
104
  ] })
105
105
  ] });
106
- }, be = b.div`
106
+ }, fe = f.div`
107
107
  & > div {
108
108
  border-radius: 8px;
109
- border: 1px solid ${k.palette.neutral.N30};
109
+ border: 1px solid ${S.palette.neutral.N30};
110
110
  }
111
- `, fe = b.div`
111
+ `, xe = f.div`
112
112
  width: 100%;
113
113
  height: 100%;
114
114
  overflow-y: auto;
@@ -128,82 +128,82 @@ const ge = (r) => {
128
128
  `, ve = (r) => {
129
129
  const {
130
130
  checked: e,
131
- children: s,
131
+ children: o,
132
132
  handleToggleChange: i,
133
133
  id: h,
134
134
  labelToggle: a,
135
- name: l,
136
- valueToggle: o = ""
137
- } = r, [u, g] = _(e), v = (f) => {
138
- g(f.target.checked), i(f);
135
+ name: d,
136
+ valueToggle: l = ""
137
+ } = r, [u, p] = _(e), b = (m) => {
138
+ p(m.target.checked), i(m);
139
139
  };
140
- return re(() => {
141
- g(e);
142
- }, [e]), /* @__PURE__ */ c(A, { children: [
143
- /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
144
- K,
140
+ return ne(() => {
141
+ p(e);
142
+ }, [e]), /* @__PURE__ */ c(F, { children: [
143
+ /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
144
+ J,
145
145
  {
146
146
  checked: u,
147
147
  id: h,
148
- name: l,
149
- onChange: v,
148
+ name: d,
149
+ onChange: b,
150
150
  size: "small",
151
- value: o,
151
+ value: l,
152
152
  children: /* @__PURE__ */ t(y, { size: "medium", type: "label", weight: "bold", children: a })
153
153
  }
154
154
  ) }),
155
- u && /* @__PURE__ */ t(A, { children: s })
155
+ u && /* @__PURE__ */ t(F, { children: o })
156
156
  ] });
157
- }, xe = (r) => ({
158
- schema: X().test(
157
+ }, ye = (r) => ({
158
+ schema: K().test(
159
159
  "isArrayOrString",
160
160
  "Must be an array of strings/numbers or a single string",
161
161
  (e) => Array.isArray(e) ? e.every(
162
- (s) => typeof s == "string" || typeof s == "number"
162
+ (o) => typeof o == "string" || typeof o == "number"
163
163
  ) : typeof e == "string"
164
164
  ),
165
165
  value: r
166
- }), ye = (r) => ({
167
- schema: X().test(
166
+ }), Ce = (r) => ({
167
+ schema: K().test(
168
168
  "isArrayOrString",
169
169
  "Must be an array of strings/numbers or a single string",
170
170
  (e) => Array.isArray(e) ? e.every(
171
- (s) => typeof s == "string" || typeof s == "number"
171
+ (o) => typeof o == "string" || typeof o == "number"
172
172
  ) : typeof e == "string"
173
173
  ),
174
174
  value: r
175
- }), Ce = (r) => {
176
- const e = (r == null ? void 0 : r.from) ?? 0, s = (r == null ? void 0 : r.to) ?? 0;
175
+ }), we = (r) => {
176
+ const e = (r == null ? void 0 : r.from) ?? 0, o = (r == null ? void 0 : r.to) ?? 0;
177
177
  return {
178
- schema: F({
179
- from: N().required("Range From is required").max(s, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
- to: N().required("Range To is required").min(e, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
178
+ schema: A({
179
+ from: R().required("Range From is required").max(o, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
+ to: R().required("Range To is required").min(e, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
181
181
  }),
182
- value: { from: e, to: s }
182
+ value: { from: e, to: o }
183
183
  };
184
- }, O = (r, e) => e === V.PERCENTAGE ? {
185
- schema: N().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
184
+ }, M = (r, e) => e === V.PERCENTAGE ? {
185
+ schema: R().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
186
186
  value: r
187
187
  } : {
188
- schema: H().required("Required"),
188
+ schema: B().required("Required"),
189
189
  value: r
190
- }, we = (r) => ({
191
- schema: H().required("Required").test(
190
+ }, Se = (r) => ({
191
+ schema: B().required("Required").test(
192
192
  "non-empty",
193
193
  "Value cannot be empty",
194
194
  (e) => e != null && e.trim() !== ""
195
195
  ),
196
196
  value: r
197
197
  }), ke = {
198
- [m.LIST_OF_VALUES]: xe,
199
- [m.LIST_OF_VALUES_MULTI]: ye,
200
- [m.RANGE]: Ce,
201
- [m.GREATER_THAN]: O,
202
- [m.LESS_THAN]: O,
203
- [m.EQUAL]: O
204
- }, Se = (r) => ke[r] || we;
205
- function Te({ decision: r, onSubmitEvent: e }) {
206
- const s = {
198
+ [g.LIST_OF_VALUES]: ye,
199
+ [g.LIST_OF_VALUES_MULTI]: Ce,
200
+ [g.RANGE]: we,
201
+ [g.GREATER_THAN]: M,
202
+ [g.LESS_THAN]: M,
203
+ [g.EQUAL]: M
204
+ }, Te = (r) => ke[r] || Se;
205
+ function De({ decision: r, onSubmitEvent: e }) {
206
+ const o = {
207
207
  name: r.name || "",
208
208
  dataType: r.dataType || "",
209
209
  valueUse: r.valueUse || "",
@@ -213,82 +213,89 @@ function Te({ decision: r, onSubmitEvent: e }) {
213
213
  toggleNone: !0,
214
214
  conditions: {},
215
215
  checkClosed: !1
216
- }, i = F({
217
- name: H().required("Name is required"),
218
- startDate: P().required("Start date is required"),
219
- endDate: P().when("checkClosed", (l, o, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? o.required("End date is required") : o.notRequired()),
220
- value: F({
221
- from: N().min(0, "From value must be greater than or equal to 0").required("From value is required"),
222
- to: N().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
216
+ }, i = A({
217
+ name: B().required("Name is required"),
218
+ startDate: Q().required("Start date is required"),
219
+ endDate: Q().when("checkClosed", (d, l, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? l.required("End date is required").test(
220
+ "is-after-startDate",
221
+ "End date must be greater than or equal to Start date",
222
+ function(b) {
223
+ const m = this.parent.startDate;
224
+ return !m || !b ? !0 : new Date(b) >= new Date(m);
225
+ }
226
+ ) : l.notRequired()),
227
+ value: A({
228
+ from: R().min(0, "From value must be greater than or equal to 0").required("From value is required"),
229
+ to: R().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
223
230
  "is-greater",
224
231
  "To value must be greater than From value",
225
- function(l) {
226
- const { from: o } = this.parent;
227
- return l > o;
232
+ function(d) {
233
+ const { from: l } = this.parent;
234
+ return d > l;
228
235
  }
229
236
  )
230
237
  }).required("Range value is required"),
231
- conditions: ie((l, { parent: o }) => {
232
- var g, v;
233
- return (o == null ? void 0 : o.toggleNone) && ((g = o == null ? void 0 : o.conditions) == null ? void 0 : g.length) > 0 ? F().shape({}) : F(
234
- (v = r.conditions) == null ? void 0 : v.reduce(
235
- (f, p) => {
236
- if (h.values.conditions[p.name] !== void 0) {
237
- const w = Se(p.valueUse);
238
- f[p.name] = w(
239
- p.value,
240
- p.dataType
238
+ conditions: de((d, { parent: l }) => {
239
+ var p, b;
240
+ return (l == null ? void 0 : l.toggleNone) && ((p = l == null ? void 0 : l.conditions) == null ? void 0 : p.length) > 0 ? A().shape({}) : A(
241
+ (b = r.conditions) == null ? void 0 : b.reduce(
242
+ (m, x) => {
243
+ if (h.values.conditions[x.name] !== void 0) {
244
+ const w = Te(x.valueUse);
245
+ m[x.name] = w(
246
+ x.value,
247
+ x.dataType
241
248
  ).schema;
242
249
  }
243
- return f;
250
+ return m;
244
251
  },
245
252
  {}
246
253
  )
247
254
  );
248
255
  })
249
- }), h = le({
250
- initialValues: s,
256
+ }), h = ie({
257
+ initialValues: o,
251
258
  validationSchema: i,
252
259
  validateOnBlur: !0,
253
- onSubmit: (l) => {
260
+ onSubmit: (d) => {
254
261
  var u;
255
- const o = {
262
+ const l = {
256
263
  ...r,
257
- name: l.name,
258
- dataType: l.dataType,
259
- valueUse: l.valueUse,
260
- value: l.value,
261
- startDate: l.startDate,
262
- endDate: l.endDate,
263
- conditions: (u = r.conditions) == null ? void 0 : u.map((g) => ({
264
- ...g,
265
- value: l.conditions[g.name]
264
+ name: d.name,
265
+ dataType: d.dataType,
266
+ valueUse: d.valueUse,
267
+ value: d.value,
268
+ startDate: d.startDate,
269
+ endDate: d.endDate,
270
+ conditions: (u = r.conditions) == null ? void 0 : u.map((p) => ({
271
+ ...p,
272
+ value: d.conditions[p.name]
266
273
  }))
267
274
  };
268
- e(o);
275
+ e(l);
269
276
  }
270
277
  });
271
- return { formik: h, handleToggleNoneChange: (l) => {
272
- var o;
273
- h.setFieldValue("toggleNone", l), (o = r.conditions) == null || o.forEach((u) => {
274
- if (l)
278
+ return { formik: h, handleToggleNoneChange: (d) => {
279
+ var l;
280
+ h.setFieldValue("toggleNone", d), (l = r.conditions) == null || l.forEach((u) => {
281
+ if (d)
275
282
  h.setFieldValue(`conditions.${u.name}`, void 0);
276
283
  else {
277
- const g = u.valueUse === m.LIST_OF_VALUES_MULTI ? [] : "";
278
- h.setFieldValue(`conditions.${u.name}`, g);
284
+ const p = u.valueUse === g.LIST_OF_VALUES_MULTI ? [] : "";
285
+ h.setFieldValue(`conditions.${u.name}`, p);
279
286
  }
280
287
  });
281
288
  } };
282
289
  }
283
290
  const Ee = (r) => {
284
- var o, u, g, v, f, p, w;
285
- const { decision: e, onSubmitEvent: s, textValues: i, onCancel: h } = r, { formik: a, handleToggleNoneChange: l } = Te({
291
+ var l, u, p, b, m, x, w;
292
+ const { decision: e, onSubmitEvent: o, textValues: i, onCancel: h } = r, { formik: a, handleToggleNoneChange: d } = De({
286
293
  decision: e,
287
- onSubmitEvent: s
294
+ onSubmitEvent: o
288
295
  });
289
- return /* @__PURE__ */ t("form", { onSubmit: a.handleSubmit, children: /* @__PURE__ */ c(d, { direction: "column", gap: "24px", children: [
296
+ return /* @__PURE__ */ t("form", { onSubmit: a.handleSubmit, children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
290
297
  /* @__PURE__ */ t(
291
- ee,
298
+ te,
292
299
  {
293
300
  id: "valueRange",
294
301
  typeInput: e.dataType.toLowerCase(),
@@ -297,37 +304,37 @@ const Ee = (r) => {
297
304
  valueTo: a.values.value.to,
298
305
  handleInputChangeFrom: (n) => a.setFieldValue("value.from", n),
299
306
  handleInputChangeTo: (n) => a.setFieldValue("value.to", n),
300
- messageFrom: (o = a.errors.value) == null ? void 0 : o.from,
307
+ messageFrom: (l = a.errors.value) == null ? void 0 : l.from,
301
308
  messageTo: (u = a.errors.value) == null ? void 0 : u.to,
302
- statusFrom: (g = a.touched.value) != null && g.from ? (v = a.errors.value) != null && v.from ? "invalid" : "valid" : "pending",
303
- statusTo: (f = a.touched.value) != null && f.to ? (p = a.errors.value) != null && p.to ? "invalid" : "valid" : "pending",
309
+ statusFrom: (p = a.touched.value) != null && p.from ? (b = a.errors.value) != null && b.from ? "invalid" : "valid" : "pending",
310
+ statusTo: (m = a.touched.value) != null && m.to ? (x = a.errors.value) != null && x.to ? "invalid" : "valid" : "pending",
304
311
  onBlur: a.handleBlur
305
312
  }
306
313
  ),
307
- /* @__PURE__ */ t(S, { dashed: !0 }),
308
- /* @__PURE__ */ t(be, { children: /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ c(
309
- d,
314
+ /* @__PURE__ */ t(k, { dashed: !0 }),
315
+ /* @__PURE__ */ t(fe, { children: /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ c(
316
+ s,
310
317
  {
311
318
  direction: "column",
312
319
  padding: "6px 12px",
313
320
  gap: "16px",
314
321
  height: "272px",
315
322
  children: [
316
- /* @__PURE__ */ c(d, { direction: "row", justifyContent: "space-between", children: [
323
+ /* @__PURE__ */ c(s, { direction: "row", justifyContent: "space-between", children: [
317
324
  /* @__PURE__ */ t(y, { children: i.factsThatConditionIt }),
318
325
  /* @__PURE__ */ t(
319
- K,
326
+ J,
320
327
  {
321
328
  id: "toggleNone",
322
- onChange: () => l(!a.values.toggleNone),
329
+ onChange: () => d(!a.values.toggleNone),
323
330
  checked: a.values.toggleNone,
324
331
  size: "small",
325
332
  children: /* @__PURE__ */ t(y, { size: "medium", type: "label", weight: "bold", children: i.none })
326
333
  }
327
334
  )
328
335
  ] }),
329
- /* @__PURE__ */ t(d, { direction: "column", gap: "20px", children: (w = e.conditions) == null ? void 0 : w.map((n) => {
330
- var U, I, R, $, L, z, j;
336
+ /* @__PURE__ */ t(s, { direction: "column", gap: "20px", children: (w = e.conditions) == null ? void 0 : w.map((n) => {
337
+ var N, U, I, L, $, z, j;
331
338
  return /* @__PURE__ */ t(
332
339
  ve,
333
340
  {
@@ -346,29 +353,29 @@ const Ee = (r) => {
346
353
  !1
347
354
  );
348
355
  else {
349
- const T = n.valueUse === m.LIST_OF_VALUES_MULTI ? [] : "";
356
+ const T = n.valueUse === g.LIST_OF_VALUES_MULTI ? [] : "";
350
357
  a.setFieldValue(
351
358
  `conditions.${n.name}`,
352
359
  T
353
360
  );
354
361
  }
355
362
  },
356
- children: n.valueUse === m.LIST_OF_VALUES_MULTI ? /* @__PURE__ */ t(
357
- te,
363
+ children: n.valueUse === g.LIST_OF_VALUES_MULTI ? /* @__PURE__ */ t(
364
+ re,
358
365
  {
359
366
  id: n.name,
360
367
  labelSelect: n.name,
361
368
  labelSelected: `Selected ${n.name}`,
362
- options: (I = (U = n.possibleValue) == null ? void 0 : U.list) == null ? void 0 : I.map((C) => ({
369
+ options: (U = (N = n.possibleValue) == null ? void 0 : N.list) == null ? void 0 : U.map((C) => ({
363
370
  id: C,
364
371
  label: C,
365
372
  checked: (a.values.conditions[n.name] || []).includes(C)
366
373
  })),
367
374
  onHandleSelectCheckChange: (C) => {
368
- const x = C.filter((T) => T.checked).map((T) => T.id);
375
+ const v = C.filter((T) => T.checked).map((T) => T.id);
369
376
  a.setFieldValue(
370
377
  `conditions.${n.name}`,
371
- x
378
+ v
372
379
  ), a.setFieldTouched(
373
380
  `conditions.${n.name}`,
374
381
  !0,
@@ -376,7 +383,7 @@ const Ee = (r) => {
376
383
  );
377
384
  },
378
385
  placeholderSelect: `Select ${n.name}`,
379
- message: (R = a.touched.conditions) != null && R[n.name] && (($ = a.errors.conditions) != null && $[n.name]) ? a.errors.conditions[n.name] : void 0,
386
+ message: (I = a.touched.conditions) != null && I[n.name] && ((L = a.errors.conditions) != null && L[n.name]) ? a.errors.conditions[n.name] : void 0,
380
387
  onBlur: () => a.setFieldTouched(
381
388
  `conditions.${n.name}`,
382
389
  !0,
@@ -395,7 +402,7 @@ const Ee = (r) => {
395
402
  C
396
403
  ),
397
404
  messageValidate: String(
398
- (L = a.errors.conditions) == null ? void 0 : L[n.name]
405
+ ($ = a.errors.conditions) == null ? void 0 : $[n.name]
399
406
  ),
400
407
  statusValidate: (z = a.touched.conditions) != null && z[n.name] ? (j = a.errors.conditions) != null && j[n.name] ? "invalid" : "valid" : void 0,
401
408
  onBlur: a.handleBlur
@@ -408,9 +415,9 @@ const Ee = (r) => {
408
415
  ]
409
416
  }
410
417
  ) }) }),
411
- /* @__PURE__ */ t(S, { dashed: !0 }),
418
+ /* @__PURE__ */ t(k, { dashed: !0 }),
412
419
  /* @__PURE__ */ t(
413
- ge,
420
+ be,
414
421
  {
415
422
  labelStart: i.termStart,
416
423
  labelEnd: i.termEnd,
@@ -428,13 +435,13 @@ const Ee = (r) => {
428
435
  checkedClosed: a.values.checkClosed
429
436
  }
430
437
  ),
431
- /* @__PURE__ */ t(S, {}),
432
- /* @__PURE__ */ c(d, { direction: "row", justifyContent: "end", gap: "16px", children: [
433
- /* @__PURE__ */ t(B, { appearance: "gray", onClick: h, children: i.cancel }),
434
- /* @__PURE__ */ t(B, { type: "submit", children: i.confirm })
438
+ /* @__PURE__ */ t(k, {}),
439
+ /* @__PURE__ */ c(s, { direction: "row", justifyContent: "end", gap: "16px", children: [
440
+ /* @__PURE__ */ t(G, { appearance: "gray", onClick: h, children: i.cancel }),
441
+ /* @__PURE__ */ t(G, { type: "submit", children: i.confirm })
435
442
  ] })
436
443
  ] }) });
437
- }, D = (r) => {
444
+ }, E = (r) => {
438
445
  if (!r)
439
446
  return;
440
447
  const e = r.value;
@@ -442,29 +449,29 @@ const Ee = (r) => {
442
449
  return;
443
450
  if (((i) => typeof i == "object" && i !== null)(e))
444
451
  switch (r.valueUse) {
445
- case m.LIST_OF_VALUES_MULTI:
452
+ case g.LIST_OF_VALUES_MULTI:
446
453
  return e;
447
- case m.LIST_OF_VALUES:
454
+ case g.LIST_OF_VALUES:
448
455
  return e;
449
- case m.RANGE:
456
+ case g.RANGE:
450
457
  return {
451
458
  from: e.from,
452
459
  to: e.to
453
460
  };
454
- case m.GREATER_THAN:
455
- case m.LESS_THAN:
456
- case m.EQUAL:
461
+ case g.GREATER_THAN:
462
+ case g.LESS_THAN:
463
+ case g.EQUAL:
457
464
  return e.value;
458
465
  default:
459
466
  return e.value;
460
467
  }
461
468
  return e;
462
- }, Q = b.div`
469
+ }, Y = f.div`
463
470
  & > div {
464
471
  border-radius: 8px;
465
- border: 1px solid ${k.palette.neutral.N30};
472
+ border: 1px solid ${S.palette.neutral.N30};
466
473
  }
467
- `, Y = b.div`
474
+ `, W = f.div`
468
475
  width: 100%;
469
476
  height: 100%;
470
477
  overflow-y: auto;
@@ -482,25 +489,25 @@ const Ee = (r) => {
482
489
  background-color: #ebecf0;
483
490
  border-radius: 8px;
484
491
  }
485
- `, W = (r) => {
486
- const { decision: e, loading: s = !1, textValues: i } = r, h = (l) => l && Object.keys(l).length > 0, a = {
492
+ `, Z = (r) => {
493
+ const { decision: e, loading: o = !1, textValues: i } = r, h = (d) => d && Object.keys(d).length > 0, a = {
487
494
  name: (e == null ? void 0 : e.name) || "",
488
495
  dataType: (e == null ? void 0 : e.dataType) || "alphabetical",
489
- value: D(e),
496
+ value: E(e),
490
497
  valueUse: (e == null ? void 0 : e.valueUse) || "equal"
491
498
  };
492
- return !s && e && i ? /* @__PURE__ */ c(d, { direction: "column", gap: "12px", children: [
493
- e && /* @__PURE__ */ t(d, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
499
+ return !o && e && i ? /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
500
+ e && /* @__PURE__ */ t(s, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
494
501
  q,
495
502
  {
496
503
  element: a,
497
- valueData: D(a),
504
+ valueData: E(a),
498
505
  type: "decision"
499
506
  }
500
507
  ) }, e.name),
501
- /* @__PURE__ */ t(S, { dashed: !0 }),
502
- /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ c(
503
- d,
508
+ /* @__PURE__ */ t(k, { dashed: !0 }),
509
+ /* @__PURE__ */ t(W, { children: /* @__PURE__ */ c(
510
+ s,
504
511
  {
505
512
  direction: "column",
506
513
  gap: "12px",
@@ -518,38 +525,38 @@ const Ee = (r) => {
518
525
  children: i.factsThatConditionIt
519
526
  }
520
527
  ),
521
- e.conditions && e.conditions.map((l) => {
522
- if (l.hidden) return null;
523
- const o = l.value;
524
- return (typeof o == "object" && h(o) || o !== void 0 && typeof o == "string" && o.length > 0) && /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(d, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
528
+ e.conditions && e.conditions.map((d) => {
529
+ if (d.hidden) return null;
530
+ const l = d.value;
531
+ return (typeof l == "object" && h(l) || l !== void 0 && typeof l == "string" && l.length > 0) && /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(s, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
525
532
  q,
526
533
  {
527
534
  element: {
528
- ...l,
529
- value: o
535
+ ...d,
536
+ value: l
530
537
  },
531
- valueData: D(l)
538
+ valueData: E(d)
532
539
  }
533
- ) }) }, l.name);
540
+ ) }) }, d.name);
534
541
  }),
535
- /* @__PURE__ */ t(S, { dashed: !0 }),
536
- /* @__PURE__ */ c(d, { direction: "column", gap: "12px", children: [
542
+ /* @__PURE__ */ t(k, { dashed: !0 }),
543
+ /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
537
544
  (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ t(
538
545
  q,
539
546
  {
540
547
  element: {
541
548
  name: i.terms,
542
549
  value: String(e.startDate),
543
- valueUse: m.RANGE,
550
+ valueUse: g.RANGE,
544
551
  dataType: V.DATE
545
552
  },
546
- valueData: D({
553
+ valueData: E({
547
554
  name: i.terms,
548
555
  value: {
549
556
  from: String(e.startDate),
550
557
  to: String(e.endDate)
551
558
  },
552
- valueUse: m.RANGE,
559
+ valueUse: g.RANGE,
553
560
  dataType: V.DATE
554
561
  }),
555
562
  type: "decision"
@@ -562,13 +569,13 @@ const Ee = (r) => {
562
569
  element: {
563
570
  name: i.terms,
564
571
  value: String(e.startDate),
565
- valueUse: m.EQUAL,
572
+ valueUse: g.EQUAL,
566
573
  dataType: V.DATE
567
574
  },
568
- valueData: D({
575
+ valueData: E({
569
576
  name: i.terms,
570
577
  value: String(e.startDate),
571
- valueUse: m.EQUAL,
578
+ valueUse: g.EQUAL,
572
579
  dataType: V.DATE
573
580
  }),
574
581
  type: "decision"
@@ -579,41 +586,41 @@ const Ee = (r) => {
579
586
  ]
580
587
  }
581
588
  ) })
582
- ] }) : /* @__PURE__ */ c(d, { direction: "column", gap: "12px", children: [
583
- /* @__PURE__ */ c(d, { direction: "column", alignItems: "center", gap: "4px", children: [
584
- /* @__PURE__ */ t(E, { animated: !0, width: "180px" }),
585
- /* @__PURE__ */ t(E, { animated: !0, width: "85px" })
589
+ ] }) : /* @__PURE__ */ c(s, { direction: "column", gap: "12px", children: [
590
+ /* @__PURE__ */ c(s, { direction: "column", alignItems: "center", gap: "4px", children: [
591
+ /* @__PURE__ */ t(D, { animated: !0, width: "180px" }),
592
+ /* @__PURE__ */ t(D, { animated: !0, width: "85px" })
586
593
  ] }, "loading"),
587
- /* @__PURE__ */ c(d, { direction: "column", gap: "12px", alignItems: "center", children: [
588
- /* @__PURE__ */ t(S, { dashed: !0 }),
589
- /* @__PURE__ */ t(E, { animated: !0, width: "150px" })
594
+ /* @__PURE__ */ c(s, { direction: "column", gap: "12px", alignItems: "center", children: [
595
+ /* @__PURE__ */ t(k, { dashed: !0 }),
596
+ /* @__PURE__ */ t(D, { animated: !0, width: "150px" })
590
597
  ] }),
591
- /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
592
- d,
598
+ /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
599
+ s,
593
600
  {
594
601
  direction: "column",
595
602
  gap: "12px",
596
603
  justifyContent: "space-between",
597
604
  height: "203px",
598
- children: Array.from({ length: 5 }).map((l, o) => /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ c(
599
- d,
605
+ children: Array.from({ length: 5 }).map((d, l) => /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ c(
606
+ s,
600
607
  {
601
608
  direction: "column",
602
609
  gap: "12px",
603
610
  alignItems: "start",
604
611
  padding: "8px",
605
612
  children: [
606
- /* @__PURE__ */ t(E, { animated: !0, width: "180px" }),
607
- /* @__PURE__ */ t(E, { animated: !0, width: "85px" })
613
+ /* @__PURE__ */ t(D, { animated: !0, width: "180px" }),
614
+ /* @__PURE__ */ t(D, { animated: !0, width: "85px" })
608
615
  ]
609
616
  }
610
- ) }, `condition-${o}`))
617
+ ) }, `condition-${l}`))
611
618
  }
612
619
  ) })
613
620
  ] });
614
- }, De = b.div`
621
+ }, Ve = f.div`
615
622
  border-radius: 8px;
616
- border: 1px solid ${k.palette.neutral.N30};
623
+ border: 1px solid ${S.palette.neutral.N30};
617
624
  box-sizing: border-box;
618
625
  display: flex;
619
626
  flex-direction: column;
@@ -623,7 +630,7 @@ const Ee = (r) => {
623
630
  height: 100%;
624
631
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
625
632
  `;
626
- b.div`
633
+ f.div`
627
634
  width: 100%;
628
635
  height: 100%;
629
636
  overflow-y: auto;
@@ -642,19 +649,19 @@ b.div`
642
649
  border-radius: 8px;
643
650
  }
644
651
  `;
645
- const M = (r) => {
646
- const { children: e, controls: s = !0, handleDelete: i, id: h } = r;
647
- return /* @__PURE__ */ t(De, { children: /* @__PURE__ */ c(d, { direction: "column", gap: "16px", padding: "12px 16px", children: [
652
+ const H = (r) => {
653
+ const { children: e, controls: o = !0, handleDelete: i, id: h } = r;
654
+ return /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "12px 16px", children: [
648
655
  e,
649
- s && /* @__PURE__ */ c(A, { children: [
650
- /* @__PURE__ */ t(S, {}),
651
- /* @__PURE__ */ t(d, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ t(
652
- Z,
656
+ o && /* @__PURE__ */ c(F, { children: [
657
+ /* @__PURE__ */ t(k, {}),
658
+ /* @__PURE__ */ t(s, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ t(
659
+ X,
653
660
  {
654
661
  cursorHover: !0,
655
662
  appearance: "dark",
656
663
  size: "24px",
657
- icon: /* @__PURE__ */ t(de, {}),
664
+ icon: /* @__PURE__ */ t(se, {}),
658
665
  onClick: () => {
659
666
  i(h);
660
667
  }
@@ -662,15 +669,15 @@ const M = (r) => {
662
669
  ) })
663
670
  ] })
664
671
  ] }) });
665
- }, Ve = b.div`
672
+ }, Ae = f.div`
666
673
  position: relative;
667
674
  & > div {
668
675
  padding: 24px 16px;
669
676
  }
670
- `, Fe = b.div`
677
+ `, Fe = f.div`
671
678
  background-color: ${({ theme: r }) => {
672
- var e, s;
673
- return ((s = (e = r == null ? void 0 : r.palette) == null ? void 0 : e.neutral) == null ? void 0 : s.N0) || k.palette.neutral.N0;
679
+ var e, o;
680
+ return ((o = (e = r == null ? void 0 : r.palette) == null ? void 0 : e.neutral) == null ? void 0 : o.N0) || S.palette.neutral.N0;
674
681
  }};
675
682
  max-width: 450px;
676
683
  max-height: 90vh;
@@ -698,23 +705,23 @@ const M = (r) => {
698
705
  background-color: #ebecf0;
699
706
  border-radius: 8px;
700
707
  }
701
- `, Ae = (r) => {
702
- const { children: e, portalId: s, onCloseModal: i, title: h } = r, a = document.getElementById(s);
708
+ `, Re = (r) => {
709
+ const { children: e, portalId: o, onCloseModal: i, title: h } = r, a = document.getElementById(o);
703
710
  if (!a)
704
711
  throw new Error(
705
712
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
706
713
  );
707
- return ue(
708
- /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ c(d, { direction: "column", gap: "24px", children: [
709
- /* @__PURE__ */ t(d, { direction: "column", gap: "24px", children: /* @__PURE__ */ c(d, { alignItems: "center", justifyContent: "space-between", children: [
714
+ return he(
715
+ /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(pe, { children: /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "24px", children: [
716
+ /* @__PURE__ */ t(s, { direction: "column", gap: "24px", children: /* @__PURE__ */ c(s, { alignItems: "center", justifyContent: "space-between", children: [
710
717
  /* @__PURE__ */ t(y, { type: "title", size: "large", appearance: "dark", weight: "bold", children: h }),
711
- /* @__PURE__ */ t(se, { size: "24px", cursor: "pointer", onClick: i })
718
+ /* @__PURE__ */ t(ce, { size: "24px", cursor: "pointer", onClick: i })
712
719
  ] }) }),
713
720
  e
714
721
  ] }) }) }) }),
715
722
  a
716
723
  );
717
- }, Ne = oe`
724
+ }, Ne = le`
718
725
  from {
719
726
  opacity: 0;
720
727
  transform: translateY(20px);
@@ -723,16 +730,16 @@ const M = (r) => {
723
730
  opacity: 1;
724
731
  transform: translateY(0);
725
732
  }
726
- `, J = b.div`
733
+ `, ee = f.div`
727
734
  width: 100%;
728
735
  height: 100%;
729
736
  & > div {
730
737
  animation: ${Ne} 600ms ease-out;
731
738
  }
732
739
  `;
733
- b.div`
740
+ f.div`
734
741
  border-radius: 8px;
735
- border: 1px solid ${k.palette.neutral.N30};
742
+ border: 1px solid ${S.palette.neutral.N30};
736
743
  box-sizing: border-box;
737
744
  display: flex;
738
745
  flex-direction: column;
@@ -742,7 +749,7 @@ b.div`
742
749
  height: 100%;
743
750
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
744
751
  `;
745
- const Ue = b.div`
752
+ const Ue = f.div`
746
753
  & > div {
747
754
  width: 100%;
748
755
  height: 100%;
@@ -762,16 +769,16 @@ const Ue = b.div`
762
769
  border-radius: 8px;
763
770
  }
764
771
  }
765
- `, Ie = b.div`
772
+ `, Ie = f.div`
766
773
  & > div > div {
767
774
  border-radius: 8px;
768
- border: 1px solid ${k.palette.neutral.N30};
775
+ border: 1px solid ${S.palette.neutral.N30};
769
776
  box-sizing: border-box;
770
777
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
771
778
  }
772
- `, Re = b.div`
779
+ `, Le = f.div`
773
780
  & > div {
774
- background-color: ${k.palette.neutral.N30};
781
+ background-color: ${S.palette.neutral.N30};
775
782
  justify-content: center;
776
783
  }
777
784
  min-height: 300px;
@@ -779,31 +786,137 @@ const Ue = b.div`
779
786
  height: 100%;
780
787
  padding-bottom: 12px;
781
788
  `;
782
- b.div`
789
+ f.div`
783
790
  & > div {
784
791
  border-radius: 8px;
785
- border: 1px solid ${k.palette.neutral.N30};
792
+ border: 1px solid ${S.palette.neutral.N30};
786
793
  }
787
794
  `;
788
- const rt = ({
789
- controls: r = !0,
790
- decisions: e,
791
- textValues: s,
792
- decisionTemplate: i,
793
- isModalOpen: h,
794
- selectedDecision: a,
795
- loading: l,
795
+ function $e({
796
+ index: r,
797
+ handleOpenModal: e
798
+ }) {
799
+ return /* @__PURE__ */ t(
800
+ H,
801
+ {
802
+ id: `loading-card-${r}`,
803
+ handleDelete: () => {
804
+ },
805
+ handleView: () => e(),
806
+ controls: !1,
807
+ children: /* @__PURE__ */ t(Z, { loading: !0 })
808
+ },
809
+ `loading-card-${r}`
810
+ );
811
+ }
812
+ function qe({
813
+ decision: r,
814
+ controls: e,
796
815
  handleOpenModal: o,
797
- handleCloseModal: u,
798
- handleSubmitForm: g,
799
- handleDelete: v
800
- }) => {
801
- const f = me("(max-width: 681px)");
802
- return /* @__PURE__ */ c(A, { children: [
803
- /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ c(d, { direction: "column", gap: "16px", padding: "6px", children: [
804
- e.length === 0 && !l && /* @__PURE__ */ c(y, { as: "span", type: "label", size: "large", appearance: "gray", children: [
816
+ handleDelete: i,
817
+ textValues: h
818
+ }) {
819
+ return r ? /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
820
+ /* @__PURE__ */ t(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: r.id }),
821
+ /* @__PURE__ */ t(
822
+ H,
823
+ {
824
+ id: r.id,
825
+ handleDelete: () => i(r.id),
826
+ handleView: () => o(r),
827
+ controls: e,
828
+ children: /* @__PURE__ */ t(Z, { decision: r, textValues: h })
829
+ }
830
+ )
831
+ ] }) }, r.id) : null;
832
+ }
833
+ function _e({
834
+ index: r,
835
+ handleOpenModal: e
836
+ }) {
837
+ return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
838
+ /* @__PURE__ */ t(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
839
+ /* @__PURE__ */ t(Le, { onClick: () => e(), children: /* @__PURE__ */ t(
840
+ H,
841
+ {
842
+ id: `add-decision-${r}`,
843
+ handleDelete: () => {
844
+ },
845
+ handleView: () => e(),
846
+ controls: !1,
847
+ children: /* @__PURE__ */ c(s, { direction: "column", gap: "12px", alignItems: "center", children: [
848
+ /* @__PURE__ */ t(X, { appearance: "gray", icon: /* @__PURE__ */ t(ue, {}), size: "35px" }),
849
+ /* @__PURE__ */ t(y, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
850
+ ] })
851
+ }
852
+ ) })
853
+ ] }) }, `add-decision-${r}`);
854
+ }
855
+ const ze = {
856
+ loading: $e,
857
+ decision: qe,
858
+ add: _e
859
+ };
860
+ function O(r) {
861
+ const { type: e } = r, o = ze[e];
862
+ return o ? o(r) : null;
863
+ }
864
+ function je({
865
+ controls: r,
866
+ decisions: e,
867
+ loading: o,
868
+ handleOpenModal: i,
869
+ handleDelete: h,
870
+ textValues: a
871
+ }) {
872
+ const d = o ? Array.from({ length: 3 }).map(
873
+ (u, p) => O({
874
+ type: "loading",
875
+ index: p,
876
+ controls: r,
877
+ loading: o,
878
+ handleOpenModal: i,
879
+ handleDelete: h,
880
+ textValues: a
881
+ })
882
+ ) : e.map(
883
+ (u) => O({
884
+ type: "decision",
885
+ decision: u,
886
+ controls: r,
887
+ loading: o,
888
+ handleOpenModal: i,
889
+ handleDelete: h,
890
+ textValues: a
891
+ })
892
+ ), l = (e.length === 0 || e.length < Math.floor(window.innerWidth / 300)) && !o && r;
893
+ return { renderedCards: d, shouldRenderAddCard: l };
894
+ }
895
+ const st = (r) => {
896
+ const {
897
+ controls: e = !0,
898
+ decisions: o,
899
+ textValues: i,
900
+ decisionTemplate: h,
901
+ isModalOpen: a,
902
+ selectedDecision: d,
903
+ loading: l,
904
+ handleOpenModal: u,
905
+ handleCloseModal: p,
906
+ handleSubmitForm: b,
907
+ handleDelete: m
908
+ } = r, x = me("(max-width: 681px)"), { renderedCards: w, shouldRenderAddCard: n } = je({
909
+ controls: e,
910
+ decisions: o,
911
+ loading: l,
912
+ handleOpenModal: u,
913
+ handleDelete: m,
914
+ textValues: i
915
+ });
916
+ return /* @__PURE__ */ c(F, { children: [
917
+ /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ c(s, { direction: "column", gap: "16px", padding: "6px", children: [
918
+ o.length === 0 && !l && /* @__PURE__ */ c(y, { as: "span", type: "label", size: "large", appearance: "gray", children: [
805
919
  "Aún no tienes definidas tasas de interés efectivas. Presiona",
806
- " ",
807
920
  /* @__PURE__ */ t(
808
921
  y,
809
922
  {
@@ -815,11 +928,10 @@ const rt = ({
815
928
  children: "“+ Agregar decisión”"
816
929
  }
817
930
  ),
818
- " ",
819
931
  "para empezar."
820
932
  ] }),
821
933
  /* @__PURE__ */ c(
822
- pe,
934
+ ge,
823
935
  {
824
936
  templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
825
937
  autoFlow: "row dense",
@@ -829,131 +941,35 @@ const rt = ({
829
941
  autoRows: "1fr",
830
942
  justifyItems: "center",
831
943
  padding: "6px",
832
- height: f ? "auto" : "484px",
944
+ height: x ? "auto" : "484px",
833
945
  children: [
834
- l ? Array.from({ length: 3 }).map((p, w) => /* @__PURE__ */ t(
835
- M,
836
- {
837
- id: `loading-card-${w}`,
838
- handleDelete: () => {
839
- },
840
- handleView: () => o(),
841
- controls: !1,
842
- children: /* @__PURE__ */ t(W, { loading: !0 })
843
- },
844
- `loading-card-${w}`
845
- )) : e.map((p) => /* @__PURE__ */ t(J, { children: /* @__PURE__ */ c(
846
- d,
847
- {
848
- direction: "column",
849
- gap: "4px",
850
- width: "100%",
851
- padding: "0 0 12px 0",
852
- children: [
853
- /* @__PURE__ */ t(
854
- y,
855
- {
856
- type: "title",
857
- size: "medium",
858
- appearance: "gray",
859
- weight: "bold",
860
- children: p.id
861
- }
862
- ),
863
- /* @__PURE__ */ t(
864
- M,
865
- {
866
- id: p.id,
867
- handleDelete: () => v(p.id),
868
- handleView: () => o(p),
869
- controls: r,
870
- children: /* @__PURE__ */ t(
871
- W,
872
- {
873
- decision: p,
874
- textValues: s
875
- }
876
- )
877
- }
878
- )
879
- ]
880
- },
881
- p.id
882
- ) }, p.id)),
883
- (e.length === 0 || e.length < Math.floor(window.innerWidth / 300)) && !l && r && /* @__PURE__ */ t(J, { children: /* @__PURE__ */ c(
884
- d,
885
- {
886
- direction: "column",
887
- gap: "4px",
888
- width: "100%",
889
- height: "100%",
890
- children: [
891
- /* @__PURE__ */ t(
892
- y,
893
- {
894
- type: "title",
895
- size: "medium",
896
- appearance: "gray",
897
- weight: "bold",
898
- children: "Nueva decisión"
899
- }
900
- ),
901
- /* @__PURE__ */ t(
902
- Re,
903
- {
904
- onClick: () => o(),
905
- children: /* @__PURE__ */ t(
906
- M,
907
- {
908
- id: `add-decision-${e.length}`,
909
- handleDelete: () => {
910
- },
911
- handleView: () => o(),
912
- controls: !1,
913
- children: /* @__PURE__ */ c(
914
- d,
915
- {
916
- direction: "column",
917
- gap: "12px",
918
- alignItems: "center",
919
- children: [
920
- /* @__PURE__ */ t(
921
- Z,
922
- {
923
- appearance: "gray",
924
- icon: /* @__PURE__ */ t(ce, {}),
925
- size: "35px"
926
- }
927
- ),
928
- /* @__PURE__ */ t(y, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
929
- ]
930
- }
931
- )
932
- }
933
- )
934
- }
935
- )
936
- ]
937
- },
938
- `add-decision-${e.length}`
939
- ) }, `add-decision-${e.length}`)
946
+ w,
947
+ n && O({
948
+ type: "add",
949
+ index: o.length,
950
+ controls: e,
951
+ loading: l,
952
+ handleOpenModal: u,
953
+ handleDelete: m,
954
+ textValues: i
955
+ })
940
956
  ]
941
957
  }
942
958
  )
943
959
  ] }) }) }),
944
- h && /* @__PURE__ */ t(
945
- Ae,
960
+ a && /* @__PURE__ */ t(
961
+ Re,
946
962
  {
947
963
  portalId: "modal-portal",
948
- onCloseModal: u,
949
- title: a ? "Editar Decisión" : "Nueva decisión",
964
+ onCloseModal: p,
965
+ title: d ? "Editar Decisión" : "Nueva decisión",
950
966
  children: /* @__PURE__ */ t(
951
967
  Ee,
952
968
  {
953
- decision: a || i,
954
- onSubmitEvent: g,
955
- textValues: s,
956
- onCancel: () => u()
969
+ decision: d || h,
970
+ onSubmitEvent: b,
971
+ textValues: i,
972
+ onCancel: () => p()
957
973
  }
958
974
  )
959
975
  }
@@ -961,9 +977,9 @@ const rt = ({
961
977
  ] });
962
978
  };
963
979
  export {
964
- M as BusinessRuleCard,
965
- W as BusinessRuleView,
966
- rt as BusinessRules,
967
- Ae as ModalRules,
980
+ H as BusinessRuleCard,
981
+ Z as BusinessRuleView,
982
+ st as BusinessRules,
983
+ Re as ModalRules,
968
984
  Ee as RulesForm
969
985
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "0.1.26",
13
+ "version": "0.1.28",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {