@isettingkit/business-rules 1.0.3 → 1.0.5

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,18 @@
1
- import { jsx as h, jsxs as E, Fragment as q } from "react/jsx-runtime";
2
- import { MdOutlineDelete as $t, MdClear as st, MdAdd as at, MdOutlineFilterAltOff as qt, MdOutlineFilterAlt as Mt } from "react-icons/md";
3
- import { inube as U, Stack as T, Divider as $, Icon as ue, Text as k, SkeletonLine as G, useMediaQuery as Y, Blanket as lt, Button as z, Grid as ct, Box as Ht, Tag as zt, Checkpicker as Vt, Toggle as dt, Checkbox as Jt, Date as je } from "@inubekit/inubekit";
4
- import D, { keyframes as Wt } from "styled-components";
5
- import { ValueDataType as J, ValueHowToSetUp as re, DecisionConditionRender as Ie } from "@isettingkit/input";
6
- import { DecisionViewConditionRenderer as we } from "@isettingkit/view";
7
- import { createPortal as ut } from "react-dom";
8
- import { useFormik as Kt } from "formik";
9
- import { string as Fe, mixed as ft, object as oe, number as Ce, lazy as $e, date as qe } from "yup";
10
- import { useState as ie, useEffect as Gt } from "react";
11
- const Xt = D.div`
1
+ import { jsx as i, jsxs as p, Fragment as E } from "react/jsx-runtime";
2
+ import { MdOutlineDelete as ge, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
3
+ import { inube as v, Stack as u, Divider as D, Icon as z, Text as x, SkeletonLine as F, useMediaQuery as R, Blanket as ie, Button as N, Grid as oe, Box as Te, Tag as fe, Checkpicker as ye, Toggle as re, Checkbox as xe, Date as Q } from "@inubekit/inubekit";
4
+ import f, { keyframes as ve } from "styled-components";
5
+ import { ValueDataType as k, ValueHowToSetUp as L, DecisionConditionRender as Y } from "@isettingkit/input";
6
+ import { DecisionViewConditionRenderer as _ } from "@isettingkit/view";
7
+ import { createPortal as le } from "react-dom";
8
+ import { useFormik as we } from "formik";
9
+ import { string as H, mixed as se, object as O, number as q, lazy as Z, date as K } from "yup";
10
+ import { useState as V, useEffect as Ce } from "react";
11
+ import Se from "axios";
12
+ import { franc as De } from "franc-min";
13
+ const Ee = f.div`
12
14
  border-radius: 8px;
13
- border: 1px solid ${U.palette.neutral.N30};
15
+ border: 1px solid ${v.palette.neutral.N30};
14
16
  box-sizing: border-box;
15
17
  display: flex;
16
18
  flex-direction: column;
@@ -20,7 +22,7 @@ const Xt = D.div`
20
22
  height: 100%;
21
23
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
22
24
  `;
23
- D.div`
25
+ f.div`
24
26
  width: 100%;
25
27
  height: 100%;
26
28
  overflow-y: auto;
@@ -39,36 +41,36 @@ D.div`
39
41
  border-radius: 8px;
40
42
  }
41
43
  `;
42
- const _e = (e) => {
43
- const { children: t, controls: n = !0, handleDelete: r, id: o } = e;
44
- return /* @__PURE__ */ h(Xt, { children: /* @__PURE__ */ E(T, { direction: "column", gap: "16px", padding: "12px 16px", children: [
44
+ const P = (e) => {
45
+ const { children: t, controls: n = !0, handleDelete: a, id: o } = e;
46
+ return /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ p(u, { direction: "column", gap: "16px", padding: "12px 16px", children: [
45
47
  t,
46
- n && /* @__PURE__ */ E(q, { children: [
47
- /* @__PURE__ */ h($, {}),
48
- /* @__PURE__ */ h(T, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ h(
49
- ue,
48
+ n && /* @__PURE__ */ p(E, { children: [
49
+ /* @__PURE__ */ i(D, {}),
50
+ /* @__PURE__ */ i(u, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ i(
51
+ z,
50
52
  {
51
53
  cursorHover: !0,
52
54
  appearance: "danger",
53
55
  size: "24px",
54
- icon: /* @__PURE__ */ h($t, {}),
56
+ icon: /* @__PURE__ */ i(ge, {}),
55
57
  onClick: () => {
56
- r(o);
58
+ a(o);
57
59
  }
58
60
  }
59
61
  ) })
60
62
  ] })
61
63
  ] }) });
62
- }, Me = D.div`
64
+ }, W = f.div`
63
65
  & > div {
64
66
  border-radius: 8px;
65
67
  border: 1px solid
66
68
  ${({ theme: e }) => {
67
69
  var t, n;
68
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || U.palette.neutral.N30;
70
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
69
71
  }};
70
72
  }
71
- `, He = D.div`
73
+ `, J = f.div`
72
74
  width: 100%;
73
75
  height: 100%;
74
76
  overflow-y: auto;
@@ -86,182 +88,182 @@ const _e = (e) => {
86
88
  background-color: #ebecf0;
87
89
  border-radius: 8px;
88
90
  }
89
- `, Qt = (e) => e.value, Zt = (e) => e.value, Yt = (e) => e.value, en = (e) => ({
91
+ `, Ne = (e) => e.value, ke = (e) => e.value, Ae = (e) => e.value, Fe = (e) => ({
90
92
  from: e.from ?? "",
91
93
  to: e.to ?? ""
92
- }), tn = (e) => e.value, nn = (e) => e.value, rn = (e) => e.value;
93
- var O = /* @__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))(O || {});
94
- const on = {
95
- [O.LIST_OF_VALUES]: Zt,
96
- [O.LIST_OF_VALUES_MULTI]: Yt,
97
- [O.RANGE]: en,
98
- [O.GREATER_THAN]: tn,
99
- [O.LESS_THAN]: nn,
100
- [O.EQUAL]: rn
101
- }, Z = (e) => {
102
- const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), r = on[e == null ? void 0 : e.howToSetTheDecision] || Qt;
103
- return n && r(t) || t || void 0;
104
- }, sn = (e) => {
94
+ }), $e = (e) => e.value, Ie = (e) => e.value, Re = (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 || {});
96
+ const Me = {
97
+ [y.LIST_OF_VALUES]: ke,
98
+ [y.LIST_OF_VALUES_MULTI]: Ae,
99
+ [y.RANGE]: Fe,
100
+ [y.GREATER_THAN]: $e,
101
+ [y.LESS_THAN]: Ie,
102
+ [y.EQUAL]: Re
103
+ }, I = (e) => {
104
+ const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Me[e == null ? void 0 : e.howToSetTheDecision] || Ne;
105
+ return n && a(t) || t || void 0;
106
+ }, Le = (e) => {
105
107
  const {
106
108
  conditionsAlignment: t,
107
109
  decision: n,
108
- decisionDateElement: r,
110
+ decisionDateElement: a,
109
111
  decisionMapper: o,
110
- loading: i,
111
- skeleton: s,
112
- terms: l,
113
- textValues: u,
114
- visibleConditions: d
112
+ loading: r,
113
+ skeleton: c,
114
+ terms: g,
115
+ textValues: d,
116
+ visibleConditions: h
115
117
  } = e;
116
- return i ? /* @__PURE__ */ E(T, { direction: "column", gap: "12px", children: [
117
- /* @__PURE__ */ h(T, { direction: "column", alignItems: "center", children: /* @__PURE__ */ h(
118
- we,
118
+ return r ? /* @__PURE__ */ p(u, { direction: "column", gap: "12px", children: [
119
+ /* @__PURE__ */ i(u, { direction: "column", alignItems: "center", children: /* @__PURE__ */ i(
120
+ _,
119
121
  {
120
122
  element: o,
121
- valueData: Z(
123
+ valueData: I(
122
124
  o
123
125
  ),
124
126
  type: "decision"
125
127
  }
126
128
  ) }, n.ruleName),
127
- /* @__PURE__ */ h($, { dashed: !0 }),
128
- /* @__PURE__ */ h(He, { children: /* @__PURE__ */ E(
129
- T,
129
+ /* @__PURE__ */ i(D, { dashed: !0 }),
130
+ /* @__PURE__ */ i(J, { children: /* @__PURE__ */ p(
131
+ u,
130
132
  {
131
133
  direction: "column",
132
134
  gap: "12px",
133
135
  justifyContent: t,
134
136
  height: "203px",
135
137
  children: [
136
- /* @__PURE__ */ h(
137
- k,
138
+ /* @__PURE__ */ i(
139
+ x,
138
140
  {
139
141
  type: "label",
140
142
  size: "large",
141
143
  appearance: "dark",
142
144
  weight: "bold",
143
145
  textAlign: "center",
144
- children: u.factsThatConditionIt
146
+ children: d.factsThatConditionIt
145
147
  }
146
148
  ),
147
- d.map((c) => /* @__PURE__ */ h(Me, { children: /* @__PURE__ */ h(T, { direction: "column", padding: "8px", children: /* @__PURE__ */ h(
148
- we,
149
+ h.map((s) => /* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(u, { direction: "column", padding: "8px", children: /* @__PURE__ */ i(
150
+ _,
149
151
  {
150
- element: { ...c, value: c.value },
151
- valueData: Z(
152
- c
152
+ element: { ...s, value: s.value },
153
+ valueData: I(
154
+ s
153
155
  )
154
156
  }
155
- ) }) }, c.conditionName)),
156
- l && /* @__PURE__ */ E(q, { children: [
157
- /* @__PURE__ */ h($, { dashed: !0 }),
158
- r && /* @__PURE__ */ h(
159
- we,
157
+ ) }) }, s.conditionName)),
158
+ g && /* @__PURE__ */ p(E, { children: [
159
+ /* @__PURE__ */ i(D, { dashed: !0 }),
160
+ a && /* @__PURE__ */ i(
161
+ _,
160
162
  {
161
- element: r.element,
162
- valueData: r.valueData,
163
+ element: a.element,
164
+ valueData: a.valueData,
163
165
  type: "decision"
164
166
  },
165
- u.terms
167
+ d.terms
166
168
  )
167
169
  ] })
168
170
  ]
169
171
  }
170
172
  ) })
171
- ] }) : /* @__PURE__ */ E(T, { direction: "column", gap: "12px", children: [
172
- /* @__PURE__ */ E(T, { direction: "column", alignItems: "center", gap: "4px", children: [
173
- /* @__PURE__ */ h(G, { animated: !0, width: "180px" }),
174
- /* @__PURE__ */ h(G, { animated: !0, width: "85px" })
173
+ ] }) : /* @__PURE__ */ p(u, { direction: "column", gap: "12px", children: [
174
+ /* @__PURE__ */ p(u, { direction: "column", alignItems: "center", gap: "4px", children: [
175
+ /* @__PURE__ */ i(F, { animated: !0, width: "180px" }),
176
+ /* @__PURE__ */ i(F, { animated: !0, width: "85px" })
175
177
  ] }, "loading"),
176
- /* @__PURE__ */ E(T, { direction: "column", gap: "12px", alignItems: "center", children: [
177
- /* @__PURE__ */ h($, { dashed: !0 }),
178
- /* @__PURE__ */ h(G, { animated: !0, width: "150px" })
178
+ /* @__PURE__ */ p(u, { direction: "column", gap: "12px", alignItems: "center", children: [
179
+ /* @__PURE__ */ i(D, { dashed: !0 }),
180
+ /* @__PURE__ */ i(F, { animated: !0, width: "150px" })
179
181
  ] }),
180
- /* @__PURE__ */ h(He, { children: /* @__PURE__ */ h(
181
- T,
182
+ /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(
183
+ u,
182
184
  {
183
185
  direction: "column",
184
186
  gap: "12px",
185
187
  justifyContent: "space-between",
186
188
  height: "203px",
187
- children: s.map((c, f) => /* @__PURE__ */ h(Me, { children: /* @__PURE__ */ E(
188
- T,
189
+ children: c.map((s, l) => /* @__PURE__ */ i(W, { children: /* @__PURE__ */ p(
190
+ u,
189
191
  {
190
192
  direction: "column",
191
193
  gap: "12px",
192
194
  alignItems: "start",
193
195
  padding: "8px",
194
196
  children: [
195
- /* @__PURE__ */ h(G, { animated: !0, width: "180px" }),
196
- /* @__PURE__ */ h(G, { animated: !0, width: "85px" })
197
+ /* @__PURE__ */ i(F, { animated: !0, width: "180px" }),
198
+ /* @__PURE__ */ i(F, { animated: !0, width: "85px" })
197
199
  ]
198
200
  }
199
- ) }, `condition-${f}`))
201
+ ) }, `condition-${l}`))
200
202
  }
201
203
  ) })
202
204
  ] });
203
- }, ht = (e) => {
205
+ }, de = (e) => {
204
206
  var b;
205
- const { decision: t, loading: n = !1, textValues: r } = e, o = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), s = o && i ? {
207
+ const { decision: t, loading: n = !1, textValues: a } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), c = o && r ? {
206
208
  element: {
207
- labelName: r == null ? void 0 : r.terms,
209
+ labelName: a == null ? void 0 : a.terms,
208
210
  value: String(t.effectiveFrom),
209
- howToSetTheDecision: re.RANGE,
210
- decisionDataType: J.DATE
211
+ howToSetTheDecision: L.RANGE,
212
+ decisionDataType: k.DATE
211
213
  },
212
- valueData: Z({
213
- labelName: r == null ? void 0 : r.terms,
214
+ valueData: I({
215
+ labelName: a == null ? void 0 : a.terms,
214
216
  value: {
215
217
  from: String(t.effectiveFrom),
216
218
  to: String(t.validUntil)
217
219
  },
218
- howToSetTheDecision: re.RANGE,
219
- decisionDataType: J.DATE
220
+ howToSetTheDecision: L.RANGE,
221
+ decisionDataType: k.DATE
220
222
  })
221
- } : o && !i ? {
223
+ } : o && !r ? {
222
224
  element: {
223
- labelName: r == null ? void 0 : r.terms,
225
+ labelName: a == null ? void 0 : a.terms,
224
226
  value: String(t.effectiveFrom),
225
- howToSetTheDecision: re.EQUAL,
226
- decisionDataType: J.DATE
227
+ howToSetTheDecision: L.EQUAL,
228
+ decisionDataType: k.DATE
227
229
  },
228
- valueData: Z({
229
- labelName: r == null ? void 0 : r.terms,
230
+ valueData: I({
231
+ labelName: a == null ? void 0 : a.terms,
230
232
  value: String(t.effectiveFrom),
231
- howToSetTheDecision: re.EQUAL,
232
- decisionDataType: J.DATE
233
+ howToSetTheDecision: L.EQUAL,
234
+ decisionDataType: k.DATE
233
235
  })
234
- } : null, l = t ? {
236
+ } : null, g = t ? {
235
237
  labelName: t.labelName || "",
236
238
  decisionDataType: t.decisionDataType || "alphabetical",
237
- value: Z(t),
239
+ value: I(t),
238
240
  howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
239
- } : null, u = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
240
- (w) => !w.hidden
241
- )) || [], d = Array.from({ length: 5 }), c = !!(!n && t && r && l), f = u.length < 2 ? "start" : "space-between";
242
- return /* @__PURE__ */ h(
243
- sn,
241
+ } : null, d = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
242
+ (T) => !T.hidden
243
+ )) || [], h = Array.from({ length: 5 }), s = !!(!n && t && a && g), l = d.length < 2 ? "start" : "space-between";
244
+ return /* @__PURE__ */ i(
245
+ Le,
244
246
  {
245
- conditionsAlignment: f,
247
+ conditionsAlignment: l,
246
248
  decision: t,
247
- decisionDateElement: s,
248
- decisionMapper: l,
249
- loading: c,
250
- skeleton: d,
251
- terms: !!(r != null && r.terms),
252
- textValues: r,
253
- visibleConditions: u
249
+ decisionDateElement: c,
250
+ decisionMapper: g,
251
+ loading: s,
252
+ skeleton: h,
253
+ terms: !!(a != null && a.terms),
254
+ textValues: a,
255
+ visibleConditions: d
254
256
  }
255
257
  );
256
- }, an = D.div`
258
+ }, Oe = f.div`
257
259
  position: relative;
258
260
  & > div {
259
261
  padding: 24px 16px;
260
262
  }
261
- `, ln = D.div`
263
+ `, Ve = f.div`
262
264
  background-color: ${({ theme: e }) => {
263
265
  var t, n;
264
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || U.palette.neutral.N0;
266
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || v.palette.neutral.N0;
265
267
  }};
266
268
  max-width: 450px;
267
269
  max-height: 90vh;
@@ -289,24 +291,24 @@ const on = {
289
291
  background-color: #ebecf0;
290
292
  border-radius: 8px;
291
293
  }
292
- `, cn = (e) => {
293
- const { children: t, portalId: n, onCloseModal: r, title: o } = e, i = document.getElementById(n);
294
- if (!i)
294
+ `, ze = (e) => {
295
+ const { children: t, portalId: n, onCloseModal: a, title: o } = e, r = document.getElementById(n);
296
+ if (!r)
295
297
  throw new Error(
296
298
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
297
299
  );
298
- const s = Y("(max-width: 400px)");
299
- return ut(
300
- /* @__PURE__ */ h(an, { smallScreen: s, children: /* @__PURE__ */ h(lt, { children: /* @__PURE__ */ h(ln, { children: /* @__PURE__ */ E(T, { direction: "column", gap: "24px", children: [
301
- /* @__PURE__ */ h(T, { direction: "column", gap: "24px", children: /* @__PURE__ */ E(T, { alignItems: "center", justifyContent: "space-between", children: [
302
- /* @__PURE__ */ h(k, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
303
- /* @__PURE__ */ h(st, { size: "24px", cursor: "pointer", onClick: r })
300
+ const c = R("(max-width: 400px)");
301
+ return le(
302
+ /* @__PURE__ */ i(Oe, { smallScreen: c, children: /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i(Ve, { children: /* @__PURE__ */ p(u, { direction: "column", gap: "24px", children: [
303
+ /* @__PURE__ */ i(u, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(u, { alignItems: "center", justifyContent: "space-between", children: [
304
+ /* @__PURE__ */ i(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
305
+ /* @__PURE__ */ i(ne, { size: "24px", cursor: "pointer", onClick: a })
304
306
  ] }) }),
305
307
  t
306
308
  ] }) }) }) }),
307
- i
309
+ r
308
310
  );
309
- }, dn = Wt`
311
+ }, Ue = ve`
310
312
  from {
311
313
  opacity: 0;
312
314
  transform: translateY(20px);
@@ -316,12 +318,12 @@ const on = {
316
318
  transform: translateY(0);
317
319
  }
318
320
  `;
319
- D.div`
321
+ f.div`
320
322
  border-radius: 8px;
321
323
  border: 1px solid
322
324
  ${({ theme: e }) => {
323
325
  var t, n;
324
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || U.palette.neutral.N30;
326
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
325
327
  }};
326
328
  box-sizing: border-box;
327
329
  display: flex;
@@ -330,21 +332,21 @@ D.div`
330
332
  height: 100%;
331
333
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
332
334
  `;
333
- D.div`
335
+ f.div`
334
336
  & > div {
335
337
  border-radius: 8px;
336
338
  border: 1px solid
337
339
  ${({ theme: e }) => {
338
340
  var t, n;
339
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || U.palette.neutral.N30;
341
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
340
342
  }};
341
343
  }
342
344
  `;
343
- const un = D.div`
345
+ const _e = f.div`
344
346
  & > div {
345
347
  background-color: ${({ theme: e }) => {
346
348
  var t, n;
347
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || U.palette.neutral.N10;
349
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || v.palette.neutral.N10;
348
350
  }};
349
351
  justify-content: center;
350
352
  }
@@ -352,18 +354,18 @@ const un = D.div`
352
354
  width: 100%;
353
355
  height: 100%;
354
356
  padding-bottom: 12px;
355
- `, pt = D.div`
357
+ `, ce = f.div`
356
358
  width: 100%;
357
359
  height: 100%;
358
360
  & > div {
359
- animation: ${dn} 600ms ease-out;
361
+ animation: ${Ue} 600ms ease-out;
360
362
  }
361
- `, fn = D.div`
363
+ `, je = f.div`
362
364
  & > div > div {
363
365
  border-radius: 8px;
364
366
  box-sizing: border-box;
365
367
  }
366
- `, hn = D.div`
368
+ `, qe = f.div`
367
369
  & > div {
368
370
  width: 100%;
369
371
  height: 100%;
@@ -384,61 +386,61 @@ const un = D.div`
384
386
  }
385
387
  }
386
388
  `;
387
- function pn(e) {
389
+ function Be(e) {
388
390
  const { index: t, handleOpenModal: n } = e;
389
- return /* @__PURE__ */ h(
390
- _e,
391
+ return /* @__PURE__ */ i(
392
+ P,
391
393
  {
392
394
  id: `loading-card-${t}`,
393
395
  handleDelete: () => {
394
396
  },
395
397
  handleView: () => n ? n() : null,
396
398
  controls: !1,
397
- children: /* @__PURE__ */ h(ht, { loading: !0 })
399
+ children: /* @__PURE__ */ i(de, { loading: !0 })
398
400
  },
399
401
  `loading-card-${t}`
400
402
  );
401
403
  }
402
- function mn(e) {
403
- const { decision: t, controls: n, handleOpenModal: r, handleDelete: o, textValues: i } = e;
404
- return t ? /* @__PURE__ */ h(pt, { children: /* @__PURE__ */ E(T, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
405
- /* @__PURE__ */ h(k, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
406
- /* @__PURE__ */ h(
407
- _e,
404
+ function He(e) {
405
+ const { decision: t, controls: n, handleOpenModal: a, handleDelete: o, textValues: r } = e;
406
+ return t ? /* @__PURE__ */ i(ce, { children: /* @__PURE__ */ p(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(
409
+ P,
408
410
  {
409
411
  id: t.decisionId,
410
412
  handleDelete: () => o ? o(t.decisionId) : null,
411
- handleView: () => r ? r(t) : null,
413
+ handleView: () => a ? a(t) : null,
412
414
  controls: n,
413
- children: /* @__PURE__ */ h(ht, { decision: t, textValues: i })
415
+ children: /* @__PURE__ */ i(de, { decision: t, textValues: r })
414
416
  }
415
417
  )
416
418
  ] }) }, t.decisionId) : null;
417
419
  }
418
- function gn(e) {
420
+ function Pe(e) {
419
421
  const {
420
422
  customTitleContentAddCard: t,
421
423
  index: n,
422
- handleOpenModal: r,
424
+ handleOpenModal: a,
423
425
  shouldRenderEmptyMessage: o
424
- } = e, i = t || "Agregar decisión";
425
- return /* @__PURE__ */ h(pt, { children: o ? null : /* @__PURE__ */ E(T, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
426
- /* @__PURE__ */ h(k, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
427
- /* @__PURE__ */ h(
428
- un,
426
+ } = e, r = t || "Agregar decisión";
427
+ return /* @__PURE__ */ i(ce, { children: o ? null : /* @__PURE__ */ p(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(
430
+ _e,
429
431
  {
430
- onClick: () => r ? r() : null,
431
- children: /* @__PURE__ */ h(
432
- _e,
432
+ onClick: () => a ? a() : null,
433
+ children: /* @__PURE__ */ i(
434
+ P,
433
435
  {
434
436
  id: `add-decision-${n}`,
435
437
  handleDelete: () => {
436
438
  },
437
- handleView: () => r ? r() : null,
439
+ handleView: () => a ? a() : null,
438
440
  controls: !1,
439
- children: /* @__PURE__ */ E(T, { direction: "column", gap: "12px", alignItems: "center", children: [
440
- /* @__PURE__ */ h(ue, { appearance: "gray", icon: /* @__PURE__ */ h(at, {}), size: "35px" }),
441
- /* @__PURE__ */ h(k, { appearance: "gray", type: "body", size: "large", children: i })
441
+ children: /* @__PURE__ */ p(u, { direction: "column", gap: "12px", alignItems: "center", children: [
442
+ /* @__PURE__ */ i(z, { appearance: "gray", icon: /* @__PURE__ */ i(ae, {}), size: "35px" }),
443
+ /* @__PURE__ */ i(x, { appearance: "gray", type: "body", size: "large", children: r })
442
444
  ] })
443
445
  }
444
446
  )
@@ -446,86 +448,86 @@ function gn(e) {
446
448
  )
447
449
  ] }) }, `add-decision-${n}`);
448
450
  }
449
- const bn = {
450
- loading: pn,
451
- decision: mn,
452
- add: gn
453
- }, Re = (e) => {
454
- const { type: t } = e, n = bn[t];
451
+ const Ge = {
452
+ loading: Be,
453
+ decision: He,
454
+ add: Pe
455
+ }, B = (e) => {
456
+ const { type: t } = e, n = Ge[t];
455
457
  return n ? n(e) : null;
456
- }, yn = (e) => {
458
+ }, Qe = (e) => {
457
459
  const {
458
460
  controls: t,
459
461
  customTitleContentAddCard: n,
460
- decisions: r,
462
+ decisions: a,
461
463
  loading: o,
462
- handleOpenModal: i,
463
- handleDelete: s,
464
- textValues: l
465
- } = e, u = o ? Array.from({ length: 3 }).map(
466
- (c, f) => Re({
464
+ handleOpenModal: r,
465
+ handleDelete: c,
466
+ textValues: g
467
+ } = e, d = o ? Array.from({ length: 3 }).map(
468
+ (s, l) => B({
467
469
  type: "loading",
468
- index: f,
470
+ index: l,
469
471
  controls: t,
470
472
  customTitleContentAddCard: n,
471
473
  loading: o,
472
- handleOpenModal: i,
473
- handleDelete: s,
474
- textValues: l
474
+ handleOpenModal: r,
475
+ handleDelete: c,
476
+ textValues: g
475
477
  })
476
- ) : r == null ? void 0 : r.map(
477
- (c) => Re({
478
+ ) : a == null ? void 0 : a.map(
479
+ (s) => B({
478
480
  type: "decision",
479
- decision: c,
481
+ decision: s,
480
482
  controls: t,
481
483
  customTitleContentAddCard: n,
482
484
  loading: o,
483
- handleOpenModal: i,
484
- handleDelete: s,
485
- textValues: l
485
+ handleOpenModal: r,
486
+ handleDelete: c,
487
+ textValues: g
486
488
  })
487
- ), d = ((r == null ? void 0 : r.length) === 0 || r.length < Math.floor(window.innerWidth / 300)) && !o && t;
488
- return { renderedCards: u, shouldRenderAddCard: d };
489
- }, Oo = (e) => {
489
+ ), h = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !o && t;
490
+ return { renderedCards: d, shouldRenderAddCard: h };
491
+ }, Ft = (e) => {
490
492
  const {
491
493
  controls: t = !0,
492
494
  customTitleContentAddCard: n,
493
- customMessageEmptyDecisions: r,
495
+ customMessageEmptyDecisions: a,
494
496
  decisions: o,
495
- textValues: i,
496
- decisionTemplate: s,
497
- isModalOpen: l,
498
- selectedDecision: u,
499
- loading: d,
500
- handleOpenModal: c,
501
- handleCloseModal: f,
497
+ textValues: r,
498
+ decisionTemplate: c,
499
+ isModalOpen: g,
500
+ selectedDecision: d,
501
+ loading: h,
502
+ handleOpenModal: s,
503
+ handleCloseModal: l,
502
504
  handleSubmitForm: b,
503
- handleDelete: w,
504
- terms: p = !0
505
- } = e, g = Y("(max-width: 681px)"), m = Y("(max-width: 400px)"), { renderedCards: S, shouldRenderAddCard: x } = yn({
505
+ handleDelete: T,
506
+ terms: m = !0
507
+ } = e, w = R("(max-width: 681px)"), C = R("(max-width: 400px)"), { renderedCards: A, shouldRenderAddCard: U } = Qe({
506
508
  controls: t,
507
509
  customTitleContentAddCard: n,
508
510
  decisions: o,
509
- loading: d,
510
- handleOpenModal: c,
511
- handleDelete: w,
512
- textValues: i
513
- }), C = (o == null ? void 0 : o.length) === 0 && !d;
514
- return /* @__PURE__ */ E(q, { children: [
515
- /* @__PURE__ */ h(fn, { children: /* @__PURE__ */ h(hn, { children: /* @__PURE__ */ h(T, { direction: "column", gap: "16px", padding: "6px", children: C ? /* @__PURE__ */ E(
516
- T,
511
+ loading: h,
512
+ handleOpenModal: s,
513
+ handleDelete: T,
514
+ textValues: r
515
+ }), M = (o == null ? void 0 : o.length) === 0 && !h;
516
+ return /* @__PURE__ */ p(E, { children: [
517
+ /* @__PURE__ */ i(je, { children: /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(u, { direction: "column", gap: "16px", padding: "6px", children: M ? /* @__PURE__ */ p(
518
+ u,
517
519
  {
518
520
  direction: "column",
519
521
  gap: "28px",
520
522
  width: "100%",
521
- height: g ? "auto" : "435px",
523
+ height: w ? "auto" : "435px",
522
524
  justifyContent: "center",
523
525
  alignItems: "center",
524
526
  children: [
525
- /* @__PURE__ */ h(k, { as: "span", type: "label", size: "large", appearance: "gray", children: r || /* @__PURE__ */ E(q, { children: [
527
+ /* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(E, { children: [
526
528
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
527
- /* @__PURE__ */ E(
528
- k,
529
+ /* @__PURE__ */ p(
530
+ x,
529
531
  {
530
532
  as: "span",
531
533
  type: "label",
@@ -541,20 +543,20 @@ const bn = {
541
543
  ),
542
544
  "para empezar."
543
545
  ] }) }),
544
- /* @__PURE__ */ h(
545
- z,
546
+ /* @__PURE__ */ i(
547
+ N,
546
548
  {
547
- iconBefore: /* @__PURE__ */ h(at, {}),
548
- onClick: () => c ? c() : null,
549
+ iconBefore: /* @__PURE__ */ i(ae, {}),
550
+ onClick: () => s ? s() : null,
549
551
  children: n || "Agregar decisión"
550
552
  }
551
553
  )
552
554
  ]
553
555
  }
554
- ) : /* @__PURE__ */ E(
555
- ct,
556
+ ) : /* @__PURE__ */ p(
557
+ oe,
556
558
  {
557
- templateColumns: m ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
559
+ templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
558
560
  autoFlow: "row dense",
559
561
  gap: "24px",
560
562
  alignItems: "start",
@@ -562,45 +564,45 @@ const bn = {
562
564
  autoRows: "1fr",
563
565
  justifyItems: "center",
564
566
  padding: "6px",
565
- height: g ? "auto" : "484px",
567
+ height: w ? "auto" : "484px",
566
568
  children: [
567
- S,
568
- x && Re({
569
+ A,
570
+ U && B({
569
571
  type: "add",
570
572
  index: o == null ? void 0 : o.length,
571
573
  controls: t,
572
574
  customTitleContentAddCard: n,
573
- customMessageEmptyDecisions: r,
574
- loading: d,
575
- handleOpenModal: c,
576
- handleDelete: w,
577
- textValues: i,
578
- shouldRenderEmptyMessage: C,
579
- terms: p
575
+ customMessageEmptyDecisions: a,
576
+ loading: h,
577
+ handleOpenModal: s,
578
+ handleDelete: T,
579
+ textValues: r,
580
+ shouldRenderEmptyMessage: M,
581
+ terms: m
580
582
  })
581
583
  ]
582
584
  }
583
585
  ) }) }) }),
584
- l && /* @__PURE__ */ h(
585
- cn,
586
+ g && /* @__PURE__ */ i(
587
+ ze,
586
588
  {
587
589
  portalId: "modal-portal",
588
- onCloseModal: f,
589
- title: u ? "Editar Decisión" : "Nueva decisión",
590
- children: /* @__PURE__ */ h(
591
- _n,
590
+ onCloseModal: l,
591
+ title: d ? "Editar Decisión" : "Nueva decisión",
592
+ children: /* @__PURE__ */ i(
593
+ st,
592
594
  {
593
- decision: u || s,
595
+ decision: d || c,
594
596
  onSubmitEvent: b,
595
- textValues: i,
596
- onCancel: () => f ? f() : () => {
597
+ textValues: r,
598
+ onCancel: () => l ? l() : () => {
597
599
  }
598
600
  }
599
601
  )
600
602
  }
601
603
  )
602
604
  ] });
603
- }, wn = D.div`
605
+ }, Ye = f.div`
604
606
  display: flex;
605
607
  justify-content: ${({ justifyContent: e }) => e};
606
608
  align-items: ${({ alignItems: e }) => e};
@@ -613,61 +615,61 @@ const bn = {
613
615
  margin: ${({ margin: e }) => e};
614
616
  padding: ${({ padding: e }) => e};
615
617
  background: ${({ background: e, theme: t }) => {
616
- var n, r, o, i;
617
- return e ? `${((r = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : r.N10) || U.palette.neutral.N10}` : `${((i = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : i.N0) || U.palette.neutral.N0}`;
618
+ var n, a, o, r;
619
+ return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || v.palette.neutral.N10}` : `${((r = (o = t == null ? void 0 : t.palette) == null ? void 0 : o.neutral) == null ? void 0 : r.N0) || v.palette.neutral.N0}`;
618
620
  }};
619
621
  border: ${({ border: e, theme: t }) => {
620
- var n, r;
621
- return e ? `1px solid ${((r = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : r.N40) || U.palette.neutral.N40}` : "none";
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) || v.palette.neutral.N40}` : "none";
622
624
  }};
623
625
  border-radius: ${({ borderRadius: e }) => e};
624
626
  box-sizing: ${({ boxSizing: e }) => e};
625
627
  overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
626
- `, Tn = (e) => {
628
+ `, Ze = (e) => {
627
629
  const {
628
630
  children: t,
629
631
  wrap: n,
630
- direction: r = "column",
632
+ direction: a = "column",
631
633
  justifyContent: o,
632
- alignItems: i,
633
- alignContent: s,
634
- height: l,
635
- width: u,
636
- gap: d,
637
- background: c,
638
- borderRadius: f,
634
+ alignItems: r,
635
+ alignContent: c,
636
+ height: g,
637
+ width: d,
638
+ gap: h,
639
+ background: s,
640
+ borderRadius: l,
639
641
  border: b,
640
- margin: w = "0px",
641
- padding: p = "0px",
642
- boxSizing: g,
643
- scroll: m = !1
642
+ margin: T = "0px",
643
+ padding: m = "0px",
644
+ boxSizing: w,
645
+ scroll: C = !1
644
646
  } = e;
645
- return /* @__PURE__ */ h(
646
- wn,
647
+ return /* @__PURE__ */ i(
648
+ Ye,
647
649
  {
648
- direction: r,
650
+ direction: a,
649
651
  justifyContent: o,
650
- alignItems: i,
651
- alignContent: s,
652
- height: l,
653
- width: u,
652
+ alignItems: r,
653
+ alignContent: c,
654
+ height: g,
655
+ width: d,
654
656
  wrap: n,
655
- gap: d,
656
- background: c,
657
+ gap: h,
658
+ background: s,
657
659
  border: b,
658
- margin: w,
659
- padding: p,
660
- borderRadius: f,
661
- boxSizing: g,
662
- scroll: m,
660
+ margin: T,
661
+ padding: m,
662
+ borderRadius: l,
663
+ boxSizing: w,
664
+ scroll: C,
663
665
  children: t
664
666
  }
665
667
  );
666
- }, ko = (e) => {
667
- const { appliedFilters: t, onClear: n, onClick: r, titleClearFilter: o, titleFilter: i } = e, s = !t || t.length === 0;
668
- return /* @__PURE__ */ h(Ht, { borderRadius: "8px", children: /* @__PURE__ */ E(ct, { gap: "12px", templateColumns: "1fr auto auto", children: [
669
- /* @__PURE__ */ h(
670
- Tn,
668
+ }, $t = (e) => {
669
+ const { appliedFilters: t, onClear: n, onClick: a, titleClearFilter: o, titleFilter: r } = e, c = !t || t.length === 0;
670
+ return /* @__PURE__ */ i(Te, { borderRadius: "8px", children: /* @__PURE__ */ p(oe, { gap: "12px", templateColumns: "1fr auto auto", children: [
671
+ /* @__PURE__ */ i(
672
+ Ze,
671
673
  {
672
674
  background: !0,
673
675
  borderRadius: "8px",
@@ -676,46 +678,46 @@ const bn = {
676
678
  gap: "8px",
677
679
  alignItems: "center",
678
680
  padding: "0px 8px",
679
- children: t == null ? void 0 : t.map((l) => /* @__PURE__ */ h(
680
- zt,
681
+ children: t == null ? void 0 : t.map((g) => /* @__PURE__ */ i(
682
+ fe,
681
683
  {
682
684
  appearance: "primary",
683
685
  displayIcon: !0,
684
- icon: l.icon,
685
- label: l.label
686
+ icon: g.icon,
687
+ label: g.label
686
688
  },
687
- l.label
689
+ g.label
688
690
  ))
689
691
  }
690
692
  ),
691
- /* @__PURE__ */ h(
692
- z,
693
+ /* @__PURE__ */ i(
694
+ N,
693
695
  {
694
696
  cursorHover: !0,
695
- disabled: s,
696
- iconBefore: /* @__PURE__ */ h(qt, {}),
697
+ disabled: c,
698
+ iconBefore: /* @__PURE__ */ i(me, {}),
697
699
  onClick: n,
698
700
  variant: "outlined",
699
701
  children: o
700
702
  }
701
703
  ),
702
- /* @__PURE__ */ h(
703
- z,
704
+ /* @__PURE__ */ i(
705
+ N,
704
706
  {
705
707
  cursorHover: !0,
706
- iconBefore: /* @__PURE__ */ h(Mt, {}),
707
- onClick: r,
708
+ iconBefore: /* @__PURE__ */ i(be, {}),
709
+ onClick: a,
708
710
  variant: "outlined",
709
- children: i
711
+ children: r
710
712
  }
711
713
  )
712
714
  ] }) });
713
- }, En = D.div`
715
+ }, Ke = f.div`
714
716
  display: flex;
715
717
  flex-direction: column;
716
718
  background-color: ${({ theme: e }) => {
717
719
  var t, n;
718
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || U.palette.neutral.N0;
720
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || v.palette.neutral.N0;
719
721
  }};
720
722
  width: ${({ smallScreen: e }) => e ? "335px" : "450px"};
721
723
  height: auto;
@@ -723,59 +725,59 @@ const bn = {
723
725
  padding: 24px;
724
726
  gap: 24px;
725
727
  box-sizing: border-box;
726
- `, vo = (e) => {
728
+ `, It = (e) => {
727
729
  const {
728
730
  actionButtonLabel: t,
729
731
  cancelButtonLabel: n,
730
- children: r,
732
+ children: a,
731
733
  loading: o,
732
- onClick: i,
733
- onCloseModal: s,
734
- portalId: l,
735
- title: u
736
- } = e, d = Y("(max-width: 768px)"), c = document.getElementById(l);
737
- if (!c)
734
+ onClick: r,
735
+ onCloseModal: c,
736
+ portalId: g,
737
+ title: d
738
+ } = e, h = R("(max-width: 768px)"), s = document.getElementById(g);
739
+ if (!s)
738
740
  throw new Error(
739
741
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
740
742
  );
741
- return ut(
742
- /* @__PURE__ */ h(lt, { children: /* @__PURE__ */ E(En, { $smallScreen: d, children: [
743
- /* @__PURE__ */ E(T, { direction: "column", gap: "16px", children: [
744
- /* @__PURE__ */ E(T, { alignContent: "center", justifyContent: "space-between", children: [
745
- /* @__PURE__ */ h(k, { appearance: "dark", size: "small", type: "headline", children: u }),
746
- /* @__PURE__ */ E(T, { alignItems: "center", children: [
747
- /* @__PURE__ */ h(k, { children: "Cerrar" }),
748
- /* @__PURE__ */ h(
749
- ue,
743
+ return le(
744
+ /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ p(Ke, { $smallScreen: h, children: [
745
+ /* @__PURE__ */ p(u, { direction: "column", gap: "16px", children: [
746
+ /* @__PURE__ */ p(u, { alignContent: "center", justifyContent: "space-between", children: [
747
+ /* @__PURE__ */ i(x, { appearance: "dark", size: "small", type: "headline", children: d }),
748
+ /* @__PURE__ */ p(u, { alignItems: "center", children: [
749
+ /* @__PURE__ */ i(x, { children: "Cerrar" }),
750
+ /* @__PURE__ */ i(
751
+ z,
750
752
  {
751
753
  appearance: "dark",
752
- icon: /* @__PURE__ */ h(st, {}),
753
- onClick: s,
754
+ icon: /* @__PURE__ */ i(ne, {}),
755
+ onClick: c,
754
756
  cursorHover: !0
755
757
  }
756
758
  )
757
759
  ] })
758
760
  ] }),
759
- /* @__PURE__ */ h($, {})
761
+ /* @__PURE__ */ i(D, {})
760
762
  ] }),
761
- r,
762
- /* @__PURE__ */ E(T, { gap: "20px", justifyContent: "flex-end", children: [
763
- /* @__PURE__ */ h(
764
- z,
763
+ a,
764
+ /* @__PURE__ */ p(u, { gap: "20px", justifyContent: "flex-end", children: [
765
+ /* @__PURE__ */ i(
766
+ N,
765
767
  {
766
768
  appearance: "gray",
767
- onClick: s,
769
+ onClick: c,
768
770
  spacing: "wide",
769
771
  variant: "outlined",
770
772
  children: n
771
773
  }
772
774
  ),
773
- /* @__PURE__ */ h(
774
- z,
775
+ /* @__PURE__ */ i(
776
+ N,
775
777
  {
776
778
  appearance: "primary",
777
779
  loading: o,
778
- onClick: i,
780
+ onClick: r,
779
781
  spacing: "wide",
780
782
  variant: "filled",
781
783
  children: t
@@ -783,33 +785,33 @@ const bn = {
783
785
  )
784
786
  ] })
785
787
  ] }) }),
786
- c
788
+ s
787
789
  );
788
- }, Fo = (e) => {
790
+ }, Rt = (e) => {
789
791
  const { fields: t, onChange: n } = e;
790
- return /* @__PURE__ */ h(T, { direction: "column", gap: "16px", children: t.map((r) => /* @__PURE__ */ E(T, { gap: "6px", alignItems: "center", children: [
791
- /* @__PURE__ */ h(T, { padding: "22px 0 0 0", children: /* @__PURE__ */ h(ue, { appearance: "primary", icon: r.icon }) }),
792
- /* @__PURE__ */ h(
793
- Vt,
792
+ return /* @__PURE__ */ i(u, { direction: "column", gap: "16px", children: t.map((a) => /* @__PURE__ */ p(u, { gap: "6px", alignItems: "center", children: [
793
+ /* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(z, { appearance: "primary", icon: a.icon }) }),
794
+ /* @__PURE__ */ i(
795
+ ye,
794
796
  {
795
- disabled: r.disabled,
796
- invalid: r.invalid,
797
- label: r.label,
798
- message: r.message,
799
- name: r.name,
797
+ disabled: a.disabled,
798
+ invalid: a.invalid,
799
+ label: a.label,
800
+ message: a.message,
801
+ name: a.name,
800
802
  onChange: n,
801
- options: r.options,
802
- placeholder: r.placeholder,
803
- required: r.required,
804
- values: r.values,
803
+ options: a.options,
804
+ placeholder: a.placeholder,
805
+ required: a.required,
806
+ values: a.values,
805
807
  fullwidth: !0
806
808
  },
807
- r.name
809
+ a.name
808
810
  )
809
- ] }, r.name)) });
810
- }, _o = (e) => {
811
+ ] }, a.name)) });
812
+ }, Mt = (e) => {
811
813
  console.log(e);
812
- const { dataDecision: t, originalDecision: n } = e, r = {
814
+ const { dataDecision: t, originalDecision: n } = e, a = {
813
815
  conditionName: t.ruleName || "",
814
816
  labelName: t.labelName || "",
815
817
  conditionDataType: t.decisionDataType || "alphabetical",
@@ -821,17 +823,17 @@ const bn = {
821
823
  return {
822
824
  ...n,
823
825
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
824
- (o) => o.hidden ? { ...r } : o
826
+ (o) => o.hidden ? { ...a } : o
825
827
  )
826
828
  };
827
- }, Lo = (e) => {
829
+ }, Lt = (e) => {
828
830
  const { decisions: t } = e;
829
831
  return t == null ? void 0 : t.map((n) => {
830
832
  var o;
831
- const r = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
832
- (i) => i.hidden
833
+ const a = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
834
+ (r) => r.hidden
833
835
  );
834
- return r ? {
836
+ return a ? {
835
837
  ...n,
836
838
  ruleName: n.ruleName,
837
839
  labelName: n.labelName,
@@ -839,19 +841,19 @@ const bn = {
839
841
  value: n.value,
840
842
  howToSetTheDecision: n.howToSetTheDecision,
841
843
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
842
- (i) => i.hidden ? { ...r, hidden: !1 } : i
844
+ (r) => r.hidden ? { ...a, hidden: !1 } : r
843
845
  )
844
846
  } : n;
845
847
  });
846
- }, Sn = (e) => ({
847
- schema: Fe().required("Required").test(
848
+ }, We = (e) => ({
849
+ schema: H().required("Required").test(
848
850
  "non-empty",
849
851
  "Value cannot be empty",
850
852
  (t) => t != null && t.trim() !== ""
851
853
  ),
852
854
  value: e
853
- }), xn = (e) => ({
854
- schema: ft().test(
855
+ }), Je = (e) => ({
856
+ schema: se().test(
855
857
  "isArrayOrString",
856
858
  "Must be an array of strings/numbers or a single string",
857
859
  (t) => Array.isArray(t) ? t.every(
@@ -859,8 +861,8 @@ const bn = {
859
861
  ) : typeof t == "string"
860
862
  ),
861
863
  value: e
862
- }), Cn = (e) => ({
863
- schema: ft().test(
864
+ }), Xe = (e) => ({
865
+ schema: se().test(
864
866
  "isArrayOrString",
865
867
  "Must be an array of strings/numbers or a single string",
866
868
  (t) => Array.isArray(t) ? t.every(
@@ -868,44 +870,44 @@ const bn = {
868
870
  ) : typeof t == "string"
869
871
  ),
870
872
  value: e
871
- }), Rn = (e) => {
873
+ }), et = (e) => {
872
874
  const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
873
875
  return {
874
- schema: oe({
875
- from: Ce().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
876
- to: Ce().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
876
+ schema: O({
877
+ from: q().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
878
+ to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
877
879
  "is-greater",
878
880
  "To value must be greater than From value",
879
- function(r) {
881
+ function(a) {
880
882
  const { from: o } = this.parent;
881
- return r > o;
883
+ return a > o;
882
884
  }
883
885
  )
884
886
  }),
885
887
  value: { from: t, to: n }
886
888
  };
887
- }, Te = (e, t) => t === J.PERCENTAGE ? {
888
- schema: Ce().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
889
+ }, j = (e, t) => t === k.PERCENTAGE ? {
890
+ schema: q().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
889
891
  value: e
890
892
  } : {
891
- schema: Fe().required("Required"),
893
+ schema: H().required("Required"),
892
894
  value: e
893
- }, An = {
894
- [O.LIST_OF_VALUES]: xn,
895
- [O.LIST_OF_VALUES_MULTI]: Cn,
896
- [O.RANGE]: Rn,
897
- [O.GREATER_THAN]: Te,
898
- [O.LESS_THAN]: Te,
899
- [O.EQUAL]: Te
900
- }, ze = (e) => An[e] || Sn;
901
- function Nn({
895
+ }, tt = {
896
+ [y.LIST_OF_VALUES]: Je,
897
+ [y.LIST_OF_VALUES_MULTI]: Xe,
898
+ [y.RANGE]: et,
899
+ [y.GREATER_THAN]: j,
900
+ [y.LESS_THAN]: j,
901
+ [y.EQUAL]: j
902
+ }, X = (e) => tt[e] || We;
903
+ function nt({
902
904
  decision: e,
903
905
  onSubmitEvent: t,
904
906
  textValues: n
905
907
  }) {
906
- const r = {
908
+ const a = {
907
909
  ruleName: e.ruleName || "",
908
- decisionDataType: e.decisionDataType || J.ALPHABETICAL,
910
+ decisionDataType: e.decisionDataType || k.ALPHABETICAL,
909
911
  howToSetTheDecision: e.howToSetTheDecision || "",
910
912
  value: e.value || "",
911
913
  effectiveFrom: e.effectiveFrom || "",
@@ -916,107 +918,107 @@ function Nn({
916
918
  terms: !0
917
919
  };
918
920
  let o;
919
- const i = {
920
- ruleName: Fe().required("Name is required"),
921
- value: $e(() => ze(
921
+ const r = {
922
+ ruleName: H().required("Name is required"),
923
+ value: Z(() => X(
922
924
  o.values.howToSetTheDecision
923
925
  )(
924
926
  o.values.value,
925
927
  o.values.decisionDataType
926
928
  ).schema),
927
- conditionsThatEstablishesTheDecision: $e((u, { parent: d }) => {
929
+ conditionsThatEstablishesTheDecision: Z((d, { parent: h }) => {
928
930
  var b;
929
- if ((d == null ? void 0 : d.toggleNone) && Object.keys(d.conditionsThatEstablishesTheDecision || {}).length > 0) return oe().shape({});
930
- const f = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
931
- (w, p) => {
932
- if (o.values.conditionsThatEstablishesTheDecision[p.conditionName] !== void 0) {
933
- const m = ze(
934
- p.howToSetTheCondition
931
+ if ((h == null ? void 0 : h.toggleNone) && Object.keys(h.conditionsThatEstablishesTheDecision || {}).length > 0) return O().shape({});
932
+ const l = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
933
+ (T, m) => {
934
+ if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
935
+ const C = X(
936
+ m.howToSetTheCondition
935
937
  );
936
- w[p.conditionName] = m(
937
- p.value,
938
- p.conditionDataType
938
+ T[m.conditionName] = C(
939
+ m.value,
940
+ m.conditionDataType
939
941
  ).schema;
940
942
  }
941
- return w;
943
+ return T;
942
944
  },
943
945
  {}
944
946
  );
945
- return oe(f).test(
947
+ return O(l).test(
946
948
  "at-least-one-condition",
947
949
  "It must be at least one condition in order for the decision to be validated correctly.",
948
- (w) => w ? Object.values(w).some(
949
- (p) => p != null && p !== ""
950
+ (T) => T ? Object.values(T).some(
951
+ (m) => m != null && m !== ""
950
952
  ) : !1
951
953
  );
952
954
  })
953
955
  };
954
- n.terms && (i.effectiveFrom = qe().required(
956
+ n.terms && (r.effectiveFrom = K().required(
955
957
  "effective From date is required"
956
- ), i.validUntil = qe().when(
958
+ ), r.validUntil = K().when(
957
959
  "checkClosed",
958
- (u, d, { parent: c }) => (c == null ? void 0 : c.checkClosed) ? d.required("valid Until date is required").test(
960
+ (d, h, { parent: s }) => (s == null ? void 0 : s.checkClosed) ? h.required("valid Until date is required").test(
959
961
  "is-after-startDate",
960
962
  "valid Until date must be greater than or equal to Start date",
961
963
  function(b) {
962
- const w = this.parent.effectiveFrom;
963
- return !w || !b ? !0 : new Date(b) >= new Date(w);
964
+ const T = this.parent.effectiveFrom;
965
+ return !T || !b ? !0 : new Date(b) >= new Date(T);
964
966
  }
965
- ) : d.notRequired()
967
+ ) : h.notRequired()
966
968
  ));
967
- const s = oe(i);
968
- return o = Kt({
969
- initialValues: r,
970
- validationSchema: s,
969
+ const c = O(r);
970
+ return o = we({
971
+ initialValues: a,
972
+ validationSchema: c,
971
973
  validateOnBlur: !0,
972
- onSubmit: (u) => {
973
- var c;
974
- const d = {
974
+ onSubmit: (d) => {
975
+ var s;
976
+ const h = {
975
977
  ...e,
976
- ruleName: u.ruleName,
977
- decisionDataType: u.decisionDataType,
978
- howToSetTheDecision: u.howToSetTheDecision,
979
- value: u.value,
980
- effectiveFrom: u.effectiveFrom,
981
- validUntil: u.validUntil,
982
- conditionsThatEstablishesTheDecision: (c = e.conditionsThatEstablishesTheDecision) == null ? void 0 : c.filter((f) => {
983
- const b = u.conditionsThatEstablishesTheDecision[f.conditionName];
978
+ ruleName: d.ruleName,
979
+ decisionDataType: d.decisionDataType,
980
+ howToSetTheDecision: d.howToSetTheDecision,
981
+ value: d.value,
982
+ effectiveFrom: d.effectiveFrom,
983
+ validUntil: d.validUntil,
984
+ conditionsThatEstablishesTheDecision: (s = e.conditionsThatEstablishesTheDecision) == null ? void 0 : s.filter((l) => {
985
+ const b = d.conditionsThatEstablishesTheDecision[l.conditionName];
984
986
  return b != null && b !== "";
985
- }).map((f) => ({
986
- ...f,
987
- value: u.conditionsThatEstablishesTheDecision[f.conditionName]
987
+ }).map((l) => ({
988
+ ...l,
989
+ value: d.conditionsThatEstablishesTheDecision[l.conditionName]
988
990
  }))
989
991
  };
990
- t(d);
992
+ t(h);
991
993
  }
992
- }), { formik: o, handleToggleNoneChange: (u) => {
993
- var d;
994
- o.setFieldValue("toggleNone", u), (d = e.conditionsThatEstablishesTheDecision) == null || d.forEach((c) => {
995
- if (u)
994
+ }), { formik: o, handleToggleNoneChange: (d) => {
995
+ var h;
996
+ o.setFieldValue("toggleNone", d), (h = e.conditionsThatEstablishesTheDecision) == null || h.forEach((s) => {
997
+ if (d)
996
998
  o.setFieldValue(
997
- `conditionsThatEstablishesTheDecision.${c.conditionName}`,
999
+ `conditionsThatEstablishesTheDecision.${s.conditionName}`,
998
1000
  void 0
999
1001
  );
1000
1002
  else {
1001
- const f = c.howToSetTheCondition === O.LIST_OF_VALUES_MULTI ? [] : "";
1003
+ const l = s.howToSetTheCondition === y.LIST_OF_VALUES_MULTI ? [] : "";
1002
1004
  o.setFieldValue(
1003
- `conditionsThatEstablishesTheDecision.${c.conditionName}`,
1004
- f
1005
+ `conditionsThatEstablishesTheDecision.${s.conditionName}`,
1006
+ l
1005
1007
  );
1006
1008
  }
1007
1009
  });
1008
1010
  } };
1009
1011
  }
1010
- const Dn = D.div`
1012
+ const at = f.div`
1011
1013
  & > div {
1012
1014
  border-radius: 8px;
1013
1015
  border: 1px solid
1014
1016
  ${({ theme: e }) => {
1015
1017
  var t, n;
1016
- return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || U.palette.neutral.N30;
1018
+ return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
1017
1019
  }};
1018
1020
  }
1019
- `, On = D.div`
1021
+ `, it = f.div`
1020
1022
  width: 100%;
1021
1023
  height: 100%;
1022
1024
  overflow-y: auto;
@@ -1033,61 +1035,61 @@ const Dn = D.div`
1033
1035
  background-color: #ebecf0;
1034
1036
  border-radius: 8px;
1035
1037
  }
1036
- `, kn = (e) => {
1038
+ `, ot = (e) => {
1037
1039
  const {
1038
1040
  checked: t,
1039
1041
  children: n,
1040
- handleToggleChange: r,
1042
+ handleToggleChange: a,
1041
1043
  id: o,
1042
- labelToggle: i,
1043
- name: s,
1044
- valueToggle: l = ""
1045
- } = e, [u, d] = ie(t), c = (f) => {
1046
- d(f.target.checked), r(f);
1044
+ labelToggle: r,
1045
+ name: c,
1046
+ valueToggle: g = ""
1047
+ } = e, [d, h] = V(t), s = (l) => {
1048
+ h(l.target.checked), a(l);
1047
1049
  };
1048
- return Gt(() => {
1049
- d(t);
1050
- }, [t]), /* @__PURE__ */ E(q, { children: [
1051
- /* @__PURE__ */ h(T, { children: /* @__PURE__ */ h(
1052
- dt,
1050
+ return Ce(() => {
1051
+ h(t);
1052
+ }, [t]), /* @__PURE__ */ p(E, { children: [
1053
+ /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
1054
+ re,
1053
1055
  {
1054
- checked: u,
1056
+ checked: d,
1055
1057
  id: o,
1056
- name: s,
1057
- onChange: c,
1058
+ name: c,
1059
+ onChange: s,
1058
1060
  size: "small",
1059
- value: l,
1060
- children: /* @__PURE__ */ h(k, { size: "medium", type: "label", weight: "bold", children: i })
1061
+ value: g,
1062
+ children: /* @__PURE__ */ i(x, { size: "medium", type: "label", weight: "bold", children: r })
1061
1063
  }
1062
1064
  ) }),
1063
- u && /* @__PURE__ */ h(q, { children: n })
1065
+ d && /* @__PURE__ */ i(E, { children: n })
1064
1066
  ] });
1065
- }, vn = (e) => {
1067
+ }, rt = (e) => {
1066
1068
  const {
1067
1069
  onHandleStartChange: t,
1068
1070
  onHandleEndChange: n,
1069
- onCheckClosedChange: r,
1071
+ onCheckClosedChange: a,
1070
1072
  labelStart: o,
1071
- labelEnd: i,
1072
- checkedClosed: s = !1,
1073
- required: l = !1,
1074
- valueStart: u = "",
1075
- valueEnd: d = "",
1076
- messageStart: c = "",
1077
- messageEnd: f = "",
1073
+ labelEnd: r,
1074
+ checkedClosed: c = !1,
1075
+ required: g = !1,
1076
+ valueStart: d = "",
1077
+ valueEnd: h = "",
1078
+ messageStart: s = "",
1079
+ messageEnd: l = "",
1078
1080
  statusStart: b = "pending",
1079
- statusEnd: w = "pending"
1080
- } = e, [p, g] = ie(s), [m, S] = ie(u), [x, C] = ie(d), L = ({ target: _ }) => {
1081
- g(_.checked), r && r(_.checked);
1082
- }, A = (_) => {
1083
- S(_.target.value), t(_);
1084
- }, B = (_) => {
1085
- C(_.target.value), n(_);
1086
- }, I = Y("(max-width: 400px)");
1087
- return /* @__PURE__ */ E(q, { children: [
1088
- /* @__PURE__ */ E(T, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1089
- /* @__PURE__ */ h(
1090
- k,
1081
+ statusEnd: T = "pending"
1082
+ } = e, [m, w] = V(c), [C, A] = V(d), [U, M] = V(h), G = ({ target: S }) => {
1083
+ w(S.checked), a && a(S.checked);
1084
+ }, he = (S) => {
1085
+ A(S.target.value), t(S);
1086
+ }, ue = (S) => {
1087
+ M(S.target.value), n(S);
1088
+ }, pe = R("(max-width: 400px)");
1089
+ return /* @__PURE__ */ p(E, { children: [
1090
+ /* @__PURE__ */ p(u, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1091
+ /* @__PURE__ */ i(
1092
+ x,
1091
1093
  {
1092
1094
  appearance: "gray",
1093
1095
  margin: "10px 0",
@@ -1097,133 +1099,133 @@ const Dn = D.div`
1097
1099
  children: "Vigencia"
1098
1100
  }
1099
1101
  ),
1100
- /* @__PURE__ */ h(
1101
- T,
1102
+ /* @__PURE__ */ i(
1103
+ u,
1102
1104
  {
1103
1105
  alignContent: "center",
1104
1106
  justifyContent: "center",
1105
1107
  wrap: "wrap",
1106
1108
  gap: "4px",
1107
- children: /* @__PURE__ */ h(
1108
- Jt,
1109
+ children: /* @__PURE__ */ i(
1110
+ xe,
1109
1111
  {
1110
1112
  label: "Cerrada",
1111
- onChange: L,
1112
- checked: p,
1113
+ onChange: G,
1114
+ checked: m,
1113
1115
  value: ""
1114
1116
  }
1115
1117
  )
1116
1118
  }
1117
1119
  )
1118
1120
  ] }),
1119
- /* @__PURE__ */ E(
1120
- T,
1121
+ /* @__PURE__ */ p(
1122
+ u,
1121
1123
  {
1122
- direction: I ? "column" : "row",
1124
+ direction: pe ? "column" : "row",
1123
1125
  justifyContent: "space-between",
1124
1126
  gap: "24px",
1125
1127
  children: [
1126
- /* @__PURE__ */ h(
1127
- je,
1128
+ /* @__PURE__ */ i(
1129
+ Q,
1128
1130
  {
1129
1131
  id: "dateStart",
1130
1132
  label: o,
1131
- onChange: A,
1132
- value: m,
1133
- required: l,
1133
+ onChange: he,
1134
+ value: C,
1135
+ required: g,
1134
1136
  size: "compact",
1135
1137
  status: b,
1136
- message: c
1138
+ message: s
1137
1139
  }
1138
1140
  ),
1139
- p && /* @__PURE__ */ h(
1140
- je,
1141
+ m && /* @__PURE__ */ i(
1142
+ Q,
1141
1143
  {
1142
1144
  id: "dateEnd",
1143
- label: i,
1144
- onChange: B,
1145
- value: x,
1146
- required: l,
1145
+ label: r,
1146
+ onChange: ue,
1147
+ value: U,
1148
+ required: g,
1147
1149
  size: "compact",
1148
- status: w,
1149
- message: f
1150
+ status: T,
1151
+ message: l
1150
1152
  }
1151
1153
  )
1152
1154
  ]
1153
1155
  }
1154
1156
  )
1155
1157
  ] });
1156
- }, Fn = (e) => {
1158
+ }, lt = (e) => {
1157
1159
  const {
1158
1160
  formik: t,
1159
1161
  textValues: n,
1160
- onCancel: r,
1162
+ onCancel: a,
1161
1163
  visibleConditions: o,
1162
- normalizedDecision: i,
1163
- handleToggleNoneChange: s,
1164
- handleConditionToggleChange: l,
1165
- showConditionsError: u,
1166
- termStartStatus: d,
1167
- termEndStatus: c
1164
+ normalizedDecision: r,
1165
+ handleToggleNoneChange: c,
1166
+ handleConditionToggleChange: g,
1167
+ showConditionsError: d,
1168
+ termStartStatus: h,
1169
+ termEndStatus: s
1168
1170
  } = e;
1169
- return /* @__PURE__ */ h("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ E(T, { direction: "column", gap: "24px", children: [
1170
- Ie({
1171
- condition: i,
1171
+ return /* @__PURE__ */ i("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(u, { direction: "column", gap: "24px", children: [
1172
+ Y({
1173
+ condition: r,
1172
1174
  formik: t,
1173
1175
  isDecision: !0
1174
1176
  }),
1175
- /* @__PURE__ */ h($, { dashed: !0 }),
1176
- /* @__PURE__ */ h(Dn, { children: /* @__PURE__ */ h(On, { children: /* @__PURE__ */ E(
1177
- T,
1177
+ /* @__PURE__ */ i(D, { dashed: !0 }),
1178
+ /* @__PURE__ */ i(at, { children: /* @__PURE__ */ i(it, { children: /* @__PURE__ */ p(
1179
+ u,
1178
1180
  {
1179
1181
  direction: "column",
1180
1182
  padding: "6px 12px",
1181
1183
  gap: "16px",
1182
1184
  height: "272px",
1183
1185
  children: [
1184
- /* @__PURE__ */ E(
1185
- T,
1186
+ /* @__PURE__ */ p(
1187
+ u,
1186
1188
  {
1187
1189
  justifyContent: "space-between",
1188
1190
  alignItems: "center",
1189
1191
  gap: "64px",
1190
1192
  children: [
1191
- /* @__PURE__ */ h(k, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1192
- /* @__PURE__ */ h(
1193
- dt,
1193
+ /* @__PURE__ */ i(x, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
1194
+ /* @__PURE__ */ i(
1195
+ re,
1194
1196
  {
1195
1197
  id: "toggleNone",
1196
- onChange: () => s(!t.values.toggleNone),
1198
+ onChange: () => c(!t.values.toggleNone),
1197
1199
  checked: t.values.toggleNone,
1198
1200
  size: "small",
1199
- children: /* @__PURE__ */ h(k, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1201
+ children: /* @__PURE__ */ i(x, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
1200
1202
  }
1201
1203
  )
1202
1204
  ]
1203
1205
  }
1204
1206
  ),
1205
- /* @__PURE__ */ h(T, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((f) => /* @__PURE__ */ h(
1206
- kn,
1207
+ /* @__PURE__ */ i(u, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((l) => /* @__PURE__ */ i(
1208
+ ot,
1207
1209
  {
1208
- id: `toggle-${f.conditionName}`,
1209
- name: `toggle.${f.conditionName}`,
1210
- labelToggle: f.labelName,
1211
- checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0,
1212
- handleToggleChange: (b) => l(
1213
- f.conditionName,
1214
- f.howToSetTheCondition === O.LIST_OF_VALUES_MULTI
1210
+ id: `toggle-${l.conditionName}`,
1211
+ name: `toggle.${l.conditionName}`,
1212
+ labelToggle: l.labelName,
1213
+ checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[l.conditionName] !== void 0,
1214
+ handleToggleChange: (b) => g(
1215
+ l.conditionName,
1216
+ l.howToSetTheCondition === y.LIST_OF_VALUES_MULTI
1215
1217
  )(b.target.checked),
1216
- children: Ie({ condition: f, formik: t })
1218
+ children: Y({ condition: l, formik: t })
1217
1219
  },
1218
- f.conditionName
1220
+ l.conditionName
1219
1221
  )) })
1220
1222
  ]
1221
1223
  }
1222
1224
  ) }) }),
1223
- n.terms && /* @__PURE__ */ E(q, { children: [
1224
- /* @__PURE__ */ h($, { dashed: !0 }),
1225
- /* @__PURE__ */ h(
1226
- vn,
1225
+ n.terms && /* @__PURE__ */ p(E, { children: [
1226
+ /* @__PURE__ */ i(D, { dashed: !0 }),
1227
+ /* @__PURE__ */ i(
1228
+ rt,
1227
1229
  {
1228
1230
  labelStart: n.termStart,
1229
1231
  labelEnd: n.termEnd,
@@ -1231,1870 +1233,181 @@ const Dn = D.div`
1231
1233
  valueEnd: t.values.validUntil,
1232
1234
  messageStart: t.errors.effectiveFrom,
1233
1235
  messageEnd: t.errors.validUntil,
1234
- statusStart: d,
1235
- statusEnd: c,
1236
- onHandleStartChange: (f) => t.setFieldValue("effectiveFrom", f.target.value),
1237
- onHandleEndChange: (f) => t.setFieldValue("validUntil", f.target.value),
1238
- onCheckClosedChange: (f) => {
1239
- t.setFieldValue("checkClosed", f), f && t.setFieldValue("validUntil", "");
1236
+ statusStart: h,
1237
+ statusEnd: s,
1238
+ onHandleStartChange: (l) => t.setFieldValue("effectiveFrom", l.target.value),
1239
+ onHandleEndChange: (l) => t.setFieldValue("validUntil", l.target.value),
1240
+ onCheckClosedChange: (l) => {
1241
+ t.setFieldValue("checkClosed", l), l && t.setFieldValue("validUntil", "");
1240
1242
  },
1241
1243
  checkedClosed: t.values.checkClosed
1242
1244
  }
1243
1245
  )
1244
1246
  ] }),
1245
- /* @__PURE__ */ h($, {}),
1246
- u && /* @__PURE__ */ h(k, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1247
- /* @__PURE__ */ E(T, { direction: "row", justifyContent: "end", gap: "16px", children: [
1248
- /* @__PURE__ */ h(z, { appearance: "gray", onClick: r, children: n.cancel }),
1249
- /* @__PURE__ */ h(z, { type: "submit", children: n.confirm })
1247
+ /* @__PURE__ */ i(D, {}),
1248
+ d && /* @__PURE__ */ i(x, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
1249
+ /* @__PURE__ */ p(u, { direction: "row", justifyContent: "end", gap: "16px", children: [
1250
+ /* @__PURE__ */ i(N, { appearance: "gray", onClick: a, children: n.cancel }),
1251
+ /* @__PURE__ */ i(N, { type: "submit", children: n.confirm })
1250
1252
  ] })
1251
1253
  ] }) });
1252
- }, _n = (e) => {
1253
- var w;
1254
- const { decision: t, onSubmitEvent: n, textValues: r, onCancel: o } = e, { formik: i, handleToggleNoneChange: s } = Nn({
1254
+ }, st = (e) => {
1255
+ var T;
1256
+ const { decision: t, onSubmitEvent: n, textValues: a, onCancel: o } = e, { formik: r, handleToggleNoneChange: c } = nt({
1255
1257
  decision: t,
1256
1258
  onSubmitEvent: n,
1257
- textValues: r
1258
- }), l = {
1259
+ textValues: a
1260
+ }), g = {
1259
1261
  ruleName: t.ruleName,
1260
1262
  labelName: t.labelName,
1261
1263
  howToSetTheCondition: t.howToSetTheDecision,
1262
1264
  decisionDataType: t.decisionDataType,
1263
1265
  listOfPossibleValues: t.listOfPossibleValues
1264
- }, u = ((w = t.conditionsThatEstablishesTheDecision) == null ? void 0 : w.filter(
1265
- (p) => !p.hidden
1266
- )) || [], d = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, c = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, f = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
1267
- return /* @__PURE__ */ h(
1268
- Fn,
1266
+ }, d = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
1267
+ (m) => !m.hidden
1268
+ )) || [], h = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, s = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, l = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
1269
+ return /* @__PURE__ */ i(
1270
+ lt,
1269
1271
  {
1270
- formik: i,
1272
+ formik: r,
1271
1273
  onCancel: o,
1272
- textValues: r,
1274
+ textValues: a,
1273
1275
  decision: t,
1274
- visibleConditions: u,
1275
- normalizedDecision: l,
1276
- handleToggleNoneChange: s,
1277
- handleConditionToggleChange: (p, g) => (m) => {
1278
- if (!m)
1279
- i.setFieldValue(
1280
- `conditionsThatEstablishesTheDecision.${p}`,
1276
+ visibleConditions: d,
1277
+ normalizedDecision: g,
1278
+ handleToggleNoneChange: c,
1279
+ handleConditionToggleChange: (m, w) => (C) => {
1280
+ if (!C)
1281
+ r.setFieldValue(
1282
+ `conditionsThatEstablishesTheDecision.${m}`,
1281
1283
  void 0
1282
- ), i.setFieldTouched(
1283
- `conditionsThatEstablishesTheDecision.${p}`,
1284
+ ), r.setFieldTouched(
1285
+ `conditionsThatEstablishesTheDecision.${m}`,
1284
1286
  !1,
1285
1287
  !1
1286
1288
  );
1287
1289
  else {
1288
- const S = g ? [] : "";
1289
- i.setFieldValue(
1290
- `conditionsThatEstablishesTheDecision.${p}`,
1291
- S
1290
+ const A = w ? [] : "";
1291
+ r.setFieldValue(
1292
+ `conditionsThatEstablishesTheDecision.${m}`,
1293
+ A
1292
1294
  );
1293
1295
  }
1294
1296
  },
1295
- showConditionsError: d,
1296
- termStartStatus: c,
1297
- termEndStatus: f
1297
+ showConditionsError: h,
1298
+ termStartStatus: s,
1299
+ termEndStatus: l
1298
1300
  }
1299
1301
  );
1300
- }, Uo = (e) => {
1302
+ }, Ot = (e) => {
1301
1303
  var o;
1302
- const { decisionTemplate: t } = e, n = { ...t }, r = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1303
- (i) => i.switchPlaces
1304
+ const { decisionTemplate: t } = e, n = { ...t }, a = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1305
+ (r) => r.switchPlaces
1304
1306
  );
1305
- return r ? {
1307
+ return a ? {
1306
1308
  ...n,
1307
- ruleName: r.conditionName,
1308
- labelName: r.labelName,
1309
- decisionDataType: r.conditionDataType,
1310
- value: r.value,
1311
- howToSetTheDecision: r.howToSetTheCondition,
1309
+ ruleName: a.conditionName,
1310
+ labelName: a.labelName,
1311
+ decisionDataType: a.conditionDataType,
1312
+ value: a.value,
1313
+ howToSetTheDecision: a.howToSetTheCondition,
1312
1314
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1313
- (i) => i.conditionName === r.conditionName ? { ...i, hidden: !0 } : i
1315
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1314
1316
  )
1315
1317
  } : n;
1316
- }, Po = (e) => {
1318
+ }, Vt = (e) => {
1317
1319
  const { decisions: t } = e;
1318
1320
  return t == null ? void 0 : t.map((n) => {
1319
1321
  var o;
1320
- const r = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1321
- (i) => i.switchPlaces
1322
+ const a = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
1323
+ (r) => r.switchPlaces
1322
1324
  );
1323
- return r ? {
1325
+ return a ? {
1324
1326
  ...n,
1325
- ruleName: r.conditionName,
1326
- labelName: r.labelName,
1327
- decisionDataType: r.conditionDataType,
1328
- value: r.value,
1329
- howToSetTheDecision: r.howToSetTheCondition,
1327
+ ruleName: a.conditionName,
1328
+ labelName: a.labelName,
1329
+ decisionDataType: a.conditionDataType,
1330
+ value: a.value,
1331
+ howToSetTheDecision: a.howToSetTheCondition,
1330
1332
  conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
1331
- (i) => i.conditionName === r.conditionName ? { ...i, hidden: !0 } : i
1333
+ (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
1332
1334
  )
1333
1335
  } : n;
1334
1336
  });
1335
- };
1336
- function mt(e, t) {
1337
- return function() {
1338
- return e.apply(t, arguments);
1339
- };
1340
- }
1341
- const { toString: Ln } = Object.prototype, { getPrototypeOf: Le } = Object, { iterator: fe, toStringTag: gt } = Symbol, he = /* @__PURE__ */ ((e) => (t) => {
1342
- const n = Ln.call(t);
1343
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
1344
- })(/* @__PURE__ */ Object.create(null)), P = (e) => (e = e.toLowerCase(), (t) => he(t) === e), pe = (e) => (t) => typeof t === e, { isArray: W } = Array, ee = pe("undefined");
1345
- function Un(e) {
1346
- return e !== null && !ee(e) && e.constructor !== null && !ee(e.constructor) && v(e.constructor.isBuffer) && e.constructor.isBuffer(e);
1347
- }
1348
- const bt = P("ArrayBuffer");
1349
- function Pn(e) {
1350
- let t;
1351
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && bt(e.buffer), t;
1352
- }
1353
- const Bn = pe("string"), v = pe("function"), yt = pe("number"), me = (e) => e !== null && typeof e == "object", jn = (e) => e === !0 || e === !1, se = (e) => {
1354
- if (he(e) !== "object")
1355
- return !1;
1356
- const t = Le(e);
1357
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(gt in e) && !(fe in e);
1358
- }, In = P("Date"), $n = P("File"), qn = P("Blob"), Mn = P("FileList"), Hn = (e) => me(e) && v(e.pipe), zn = (e) => {
1359
- let t;
1360
- return e && (typeof FormData == "function" && e instanceof FormData || v(e.append) && ((t = he(e)) === "formdata" || // detect form-data instance
1361
- t === "object" && v(e.toString) && e.toString() === "[object FormData]"));
1362
- }, Vn = P("URLSearchParams"), [Jn, Wn, Kn, Gn] = ["ReadableStream", "Request", "Response", "Headers"].map(P), Xn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1363
- function te(e, t, { allOwnKeys: n = !1 } = {}) {
1364
- if (e === null || typeof e > "u")
1365
- return;
1366
- let r, o;
1367
- if (typeof e != "object" && (e = [e]), W(e))
1368
- for (r = 0, o = e.length; r < o; r++)
1369
- t.call(null, e[r], r, e);
1370
- else {
1371
- const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length;
1372
- let l;
1373
- for (r = 0; r < s; r++)
1374
- l = i[r], t.call(null, e[l], l, e);
1375
- }
1376
- }
1377
- function wt(e, t) {
1378
- t = t.toLowerCase();
1379
- const n = Object.keys(e);
1380
- let r = n.length, o;
1381
- for (; r-- > 0; )
1382
- if (o = n[r], t === o.toLowerCase())
1383
- return o;
1384
- return null;
1385
- }
1386
- const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tt = (e) => !ee(e) && e !== M;
1387
- function Ae() {
1388
- const { caseless: e } = Tt(this) && this || {}, t = {}, n = (r, o) => {
1389
- const i = e && wt(t, o) || o;
1390
- se(t[i]) && se(r) ? t[i] = Ae(t[i], r) : se(r) ? t[i] = Ae({}, r) : W(r) ? t[i] = r.slice() : t[i] = r;
1391
- };
1392
- for (let r = 0, o = arguments.length; r < o; r++)
1393
- arguments[r] && te(arguments[r], n);
1394
- return t;
1395
- }
1396
- const Qn = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
1397
- n && v(o) ? e[i] = mt(o, n) : e[i] = o;
1398
- }, { allOwnKeys: r }), e), Zn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Yn = (e, t, n, r) => {
1399
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
1400
- value: t.prototype
1401
- }), n && Object.assign(e.prototype, n);
1402
- }, er = (e, t, n, r) => {
1403
- let o, i, s;
1404
- const l = {};
1405
- if (t = t || {}, e == null) return t;
1406
- do {
1407
- for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
1408
- s = o[i], (!r || r(s, e, t)) && !l[s] && (t[s] = e[s], l[s] = !0);
1409
- e = n !== !1 && Le(e);
1410
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
1411
- return t;
1412
- }, tr = (e, t, n) => {
1413
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
1414
- const r = e.indexOf(t, n);
1415
- return r !== -1 && r === n;
1416
- }, nr = (e) => {
1417
- if (!e) return null;
1418
- if (W(e)) return e;
1419
- let t = e.length;
1420
- if (!yt(t)) return null;
1421
- const n = new Array(t);
1422
- for (; t-- > 0; )
1423
- n[t] = e[t];
1424
- return n;
1425
- }, rr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Le(Uint8Array)), or = (e, t) => {
1426
- const r = (e && e[fe]).call(e);
1427
- let o;
1428
- for (; (o = r.next()) && !o.done; ) {
1429
- const i = o.value;
1430
- t.call(e, i[0], i[1]);
1431
- }
1432
- }, ir = (e, t) => {
1433
- let n;
1434
- const r = [];
1435
- for (; (n = e.exec(t)) !== null; )
1436
- r.push(n);
1437
- return r;
1438
- }, sr = P("HTMLFormElement"), ar = (e) => e.toLowerCase().replace(
1439
- /[-_\s]([a-z\d])(\w*)/g,
1440
- function(n, r, o) {
1441
- return r.toUpperCase() + o;
1442
- }
1443
- ), Ve = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), lr = P("RegExp"), Et = (e, t) => {
1444
- const n = Object.getOwnPropertyDescriptors(e), r = {};
1445
- te(n, (o, i) => {
1446
- let s;
1447
- (s = t(o, i, e)) !== !1 && (r[i] = s || o);
1448
- }), Object.defineProperties(e, r);
1449
- }, cr = (e) => {
1450
- Et(e, (t, n) => {
1451
- if (v(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
1452
- return !1;
1453
- const r = e[n];
1454
- if (v(r)) {
1455
- if (t.enumerable = !1, "writable" in t) {
1456
- t.writable = !1;
1457
- return;
1458
- }
1459
- t.set || (t.set = () => {
1460
- throw Error("Can not rewrite read-only method '" + n + "'");
1461
- });
1462
- }
1463
- });
1464
- }, dr = (e, t) => {
1465
- const n = {}, r = (o) => {
1466
- o.forEach((i) => {
1467
- n[i] = !0;
1468
- });
1469
- };
1470
- return W(e) ? r(e) : r(String(e).split(t)), n;
1471
- }, ur = () => {
1472
- }, fr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
1473
- function hr(e) {
1474
- return !!(e && v(e.append) && e[gt] === "FormData" && e[fe]);
1475
- }
1476
- const pr = (e) => {
1477
- const t = new Array(10), n = (r, o) => {
1478
- if (me(r)) {
1479
- if (t.indexOf(r) >= 0)
1480
- return;
1481
- if (!("toJSON" in r)) {
1482
- t[o] = r;
1483
- const i = W(r) ? [] : {};
1484
- return te(r, (s, l) => {
1485
- const u = n(s, o + 1);
1486
- !ee(u) && (i[l] = u);
1487
- }), t[o] = void 0, i;
1488
- }
1489
- }
1490
- return r;
1491
- };
1492
- return n(e, 0);
1493
- }, mr = P("AsyncFunction"), gr = (e) => e && (me(e) || v(e)) && v(e.then) && v(e.catch), St = ((e, t) => e ? setImmediate : t ? ((n, r) => (M.addEventListener("message", ({ source: o, data: i }) => {
1494
- o === M && i === n && r.length && r.shift()();
1495
- }, !1), (o) => {
1496
- r.push(o), M.postMessage(n, "*");
1497
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
1498
- typeof setImmediate == "function",
1499
- v(M.postMessage)
1500
- ), br = typeof queueMicrotask < "u" ? queueMicrotask.bind(M) : typeof process < "u" && process.nextTick || St, yr = (e) => e != null && v(e[fe]), a = {
1501
- isArray: W,
1502
- isArrayBuffer: bt,
1503
- isBuffer: Un,
1504
- isFormData: zn,
1505
- isArrayBufferView: Pn,
1506
- isString: Bn,
1507
- isNumber: yt,
1508
- isBoolean: jn,
1509
- isObject: me,
1510
- isPlainObject: se,
1511
- isReadableStream: Jn,
1512
- isRequest: Wn,
1513
- isResponse: Kn,
1514
- isHeaders: Gn,
1515
- isUndefined: ee,
1516
- isDate: In,
1517
- isFile: $n,
1518
- isBlob: qn,
1519
- isRegExp: lr,
1520
- isFunction: v,
1521
- isStream: Hn,
1522
- isURLSearchParams: Vn,
1523
- isTypedArray: rr,
1524
- isFileList: Mn,
1525
- forEach: te,
1526
- merge: Ae,
1527
- extend: Qn,
1528
- trim: Xn,
1529
- stripBOM: Zn,
1530
- inherits: Yn,
1531
- toFlatObject: er,
1532
- kindOf: he,
1533
- kindOfTest: P,
1534
- endsWith: tr,
1535
- toArray: nr,
1536
- forEachEntry: or,
1537
- matchAll: ir,
1538
- isHTMLForm: sr,
1539
- hasOwnProperty: Ve,
1540
- hasOwnProp: Ve,
1541
- // an alias to avoid ESLint no-prototype-builtins detection
1542
- reduceDescriptors: Et,
1543
- freezeMethods: cr,
1544
- toObjectSet: dr,
1545
- toCamelCase: ar,
1546
- noop: ur,
1547
- toFiniteNumber: fr,
1548
- findKey: wt,
1549
- global: M,
1550
- isContextDefined: Tt,
1551
- isSpecCompliantForm: hr,
1552
- toJSONObject: pr,
1553
- isAsyncFn: mr,
1554
- isThenable: gr,
1555
- setImmediate: St,
1556
- asap: br,
1557
- isIterable: yr
1558
- };
1559
- function y(e, t, n, r, o) {
1560
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
1561
- }
1562
- a.inherits(y, Error, {
1563
- toJSON: function() {
1564
- return {
1565
- // Standard
1566
- message: this.message,
1567
- name: this.name,
1568
- // Microsoft
1569
- description: this.description,
1570
- number: this.number,
1571
- // Mozilla
1572
- fileName: this.fileName,
1573
- lineNumber: this.lineNumber,
1574
- columnNumber: this.columnNumber,
1575
- stack: this.stack,
1576
- // Axios
1577
- config: a.toJSONObject(this.config),
1578
- code: this.code,
1579
- status: this.status
1580
- };
1581
- }
1582
- });
1583
- const xt = y.prototype, Ct = {};
1584
- [
1585
- "ERR_BAD_OPTION_VALUE",
1586
- "ERR_BAD_OPTION",
1587
- "ECONNABORTED",
1588
- "ETIMEDOUT",
1589
- "ERR_NETWORK",
1590
- "ERR_FR_TOO_MANY_REDIRECTS",
1591
- "ERR_DEPRECATED",
1592
- "ERR_BAD_RESPONSE",
1593
- "ERR_BAD_REQUEST",
1594
- "ERR_CANCELED",
1595
- "ERR_NOT_SUPPORT",
1596
- "ERR_INVALID_URL"
1597
- // eslint-disable-next-line func-names
1598
- ].forEach((e) => {
1599
- Ct[e] = { value: e };
1600
- });
1601
- Object.defineProperties(y, Ct);
1602
- Object.defineProperty(xt, "isAxiosError", { value: !0 });
1603
- y.from = (e, t, n, r, o, i) => {
1604
- const s = Object.create(xt);
1605
- return a.toFlatObject(e, s, function(u) {
1606
- return u !== Error.prototype;
1607
- }, (l) => l !== "isAxiosError"), y.call(s, e.message, t, n, r, o), s.cause = e, s.name = e.name, i && Object.assign(s, i), s;
1608
- };
1609
- const wr = null;
1610
- function Ne(e) {
1611
- return a.isPlainObject(e) || a.isArray(e);
1612
- }
1613
- function Rt(e) {
1614
- return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
1615
- }
1616
- function Je(e, t, n) {
1617
- return e ? e.concat(t).map(function(o, i) {
1618
- return o = Rt(o), !n && i ? "[" + o + "]" : o;
1619
- }).join(n ? "." : "") : t;
1620
- }
1621
- function Tr(e) {
1622
- return a.isArray(e) && !e.some(Ne);
1623
- }
1624
- const Er = a.toFlatObject(a, {}, null, function(t) {
1625
- return /^is[A-Z]/.test(t);
1626
- });
1627
- function ge(e, t, n) {
1628
- if (!a.isObject(e))
1629
- throw new TypeError("target must be an object");
1630
- t = t || new FormData(), n = a.toFlatObject(n, {
1631
- metaTokens: !0,
1632
- dots: !1,
1633
- indexes: !1
1634
- }, !1, function(g, m) {
1635
- return !a.isUndefined(m[g]);
1636
- });
1637
- const r = n.metaTokens, o = n.visitor || c, i = n.dots, s = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
1638
- if (!a.isFunction(o))
1639
- throw new TypeError("visitor must be a function");
1640
- function d(p) {
1641
- if (p === null) return "";
1642
- if (a.isDate(p))
1643
- return p.toISOString();
1644
- if (!u && a.isBlob(p))
1645
- throw new y("Blob is not supported. Use a Buffer instead.");
1646
- return a.isArrayBuffer(p) || a.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
1647
- }
1648
- function c(p, g, m) {
1649
- let S = p;
1650
- if (p && !m && typeof p == "object") {
1651
- if (a.endsWith(g, "{}"))
1652
- g = r ? g : g.slice(0, -2), p = JSON.stringify(p);
1653
- else if (a.isArray(p) && Tr(p) || (a.isFileList(p) || a.endsWith(g, "[]")) && (S = a.toArray(p)))
1654
- return g = Rt(g), S.forEach(function(C, L) {
1655
- !(a.isUndefined(C) || C === null) && t.append(
1656
- // eslint-disable-next-line no-nested-ternary
1657
- s === !0 ? Je([g], L, i) : s === null ? g : g + "[]",
1658
- d(C)
1659
- );
1660
- }), !1;
1661
- }
1662
- return Ne(p) ? !0 : (t.append(Je(m, g, i), d(p)), !1);
1663
- }
1664
- const f = [], b = Object.assign(Er, {
1665
- defaultVisitor: c,
1666
- convertValue: d,
1667
- isVisitable: Ne
1668
- });
1669
- function w(p, g) {
1670
- if (!a.isUndefined(p)) {
1671
- if (f.indexOf(p) !== -1)
1672
- throw Error("Circular reference detected in " + g.join("."));
1673
- f.push(p), a.forEach(p, function(S, x) {
1674
- (!(a.isUndefined(S) || S === null) && o.call(
1675
- t,
1676
- S,
1677
- a.isString(x) ? x.trim() : x,
1678
- g,
1679
- b
1680
- )) === !0 && w(S, g ? g.concat(x) : [x]);
1681
- }), f.pop();
1682
- }
1683
- }
1684
- if (!a.isObject(e))
1685
- throw new TypeError("data must be an object");
1686
- return w(e), t;
1687
- }
1688
- function We(e) {
1689
- const t = {
1690
- "!": "%21",
1691
- "'": "%27",
1692
- "(": "%28",
1693
- ")": "%29",
1694
- "~": "%7E",
1695
- "%20": "+",
1696
- "%00": "\0"
1697
- };
1698
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
1699
- return t[r];
1700
- });
1701
- }
1702
- function Ue(e, t) {
1703
- this._pairs = [], e && ge(e, this, t);
1704
- }
1705
- const At = Ue.prototype;
1706
- At.append = function(t, n) {
1707
- this._pairs.push([t, n]);
1708
- };
1709
- At.toString = function(t) {
1710
- const n = t ? function(r) {
1711
- return t.call(this, r, We);
1712
- } : We;
1713
- return this._pairs.map(function(o) {
1714
- return n(o[0]) + "=" + n(o[1]);
1715
- }, "").join("&");
1716
- };
1717
- function Sr(e) {
1718
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1719
- }
1720
- function Nt(e, t, n) {
1721
- if (!t)
1722
- return e;
1723
- const r = n && n.encode || Sr;
1724
- a.isFunction(n) && (n = {
1725
- serialize: n
1726
- });
1727
- const o = n && n.serialize;
1728
- let i;
1729
- if (o ? i = o(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new Ue(t, n).toString(r), i) {
1730
- const s = e.indexOf("#");
1731
- s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
1732
- }
1733
- return e;
1734
- }
1735
- class Ke {
1736
- constructor() {
1737
- this.handlers = [];
1738
- }
1739
- /**
1740
- * Add a new interceptor to the stack
1741
- *
1742
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1743
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1744
- *
1745
- * @return {Number} An ID used to remove interceptor later
1746
- */
1747
- use(t, n, r) {
1748
- return this.handlers.push({
1749
- fulfilled: t,
1750
- rejected: n,
1751
- synchronous: r ? r.synchronous : !1,
1752
- runWhen: r ? r.runWhen : null
1753
- }), this.handlers.length - 1;
1754
- }
1755
- /**
1756
- * Remove an interceptor from the stack
1757
- *
1758
- * @param {Number} id The ID that was returned by `use`
1759
- *
1760
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1761
- */
1762
- eject(t) {
1763
- this.handlers[t] && (this.handlers[t] = null);
1764
- }
1765
- /**
1766
- * Clear all interceptors from the stack
1767
- *
1768
- * @returns {void}
1769
- */
1770
- clear() {
1771
- this.handlers && (this.handlers = []);
1772
- }
1773
- /**
1774
- * Iterate over all the registered interceptors
1775
- *
1776
- * This method is particularly useful for skipping over any
1777
- * interceptors that may have become `null` calling `eject`.
1778
- *
1779
- * @param {Function} fn The function to call for each interceptor
1780
- *
1781
- * @returns {void}
1782
- */
1783
- forEach(t) {
1784
- a.forEach(this.handlers, function(r) {
1785
- r !== null && t(r);
1786
- });
1787
- }
1788
- }
1789
- const Dt = {
1790
- silentJSONParsing: !0,
1791
- forcedJSONParsing: !0,
1792
- clarifyTimeoutError: !1
1793
- }, xr = typeof URLSearchParams < "u" ? URLSearchParams : Ue, Cr = typeof FormData < "u" ? FormData : null, Rr = typeof Blob < "u" ? Blob : null, Ar = {
1794
- isBrowser: !0,
1795
- classes: {
1796
- URLSearchParams: xr,
1797
- FormData: Cr,
1798
- Blob: Rr
1799
- },
1800
- protocols: ["http", "https", "file", "blob", "url", "data"]
1801
- }, Pe = typeof window < "u" && typeof document < "u", De = typeof navigator == "object" && navigator || void 0, Nr = Pe && (!De || ["ReactNative", "NativeScript", "NS"].indexOf(De.product) < 0), Dr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
1802
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Or = Pe && window.location.href || "http://localhost", kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1803
- __proto__: null,
1804
- hasBrowserEnv: Pe,
1805
- hasStandardBrowserEnv: Nr,
1806
- hasStandardBrowserWebWorkerEnv: Dr,
1807
- navigator: De,
1808
- origin: Or
1809
- }, Symbol.toStringTag, { value: "Module" })), N = {
1810
- ...kr,
1811
- ...Ar
1812
- };
1813
- function vr(e, t) {
1814
- return ge(e, new N.classes.URLSearchParams(), Object.assign({
1815
- visitor: function(n, r, o, i) {
1816
- return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
1817
- }
1818
- }, t));
1819
- }
1820
- function Fr(e) {
1821
- return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1822
- }
1823
- function _r(e) {
1824
- const t = {}, n = Object.keys(e);
1825
- let r;
1826
- const o = n.length;
1827
- let i;
1828
- for (r = 0; r < o; r++)
1829
- i = n[r], t[i] = e[i];
1830
- return t;
1831
- }
1832
- function Ot(e) {
1833
- function t(n, r, o, i) {
1834
- let s = n[i++];
1835
- if (s === "__proto__") return !0;
1836
- const l = Number.isFinite(+s), u = i >= n.length;
1837
- return s = !s && a.isArray(o) ? o.length : s, u ? (a.hasOwnProp(o, s) ? o[s] = [o[s], r] : o[s] = r, !l) : ((!o[s] || !a.isObject(o[s])) && (o[s] = []), t(n, r, o[s], i) && a.isArray(o[s]) && (o[s] = _r(o[s])), !l);
1838
- }
1839
- if (a.isFormData(e) && a.isFunction(e.entries)) {
1840
- const n = {};
1841
- return a.forEachEntry(e, (r, o) => {
1842
- t(Fr(r), o, n, 0);
1843
- }), n;
1844
- }
1845
- return null;
1846
- }
1847
- function Lr(e, t, n) {
1848
- if (a.isString(e))
1849
- try {
1850
- return (t || JSON.parse)(e), a.trim(e);
1851
- } catch (r) {
1852
- if (r.name !== "SyntaxError")
1853
- throw r;
1854
- }
1855
- return (n || JSON.stringify)(e);
1856
- }
1857
- const ne = {
1858
- transitional: Dt,
1859
- adapter: ["xhr", "http", "fetch"],
1860
- transformRequest: [function(t, n) {
1861
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, i = a.isObject(t);
1862
- if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
1863
- return o ? JSON.stringify(Ot(t)) : t;
1864
- if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
1865
- return t;
1866
- if (a.isArrayBufferView(t))
1867
- return t.buffer;
1868
- if (a.isURLSearchParams(t))
1869
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1870
- let l;
1871
- if (i) {
1872
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
1873
- return vr(t, this.formSerializer).toString();
1874
- if ((l = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1875
- const u = this.env && this.env.FormData;
1876
- return ge(
1877
- l ? { "files[]": t } : t,
1878
- u && new u(),
1879
- this.formSerializer
1880
- );
1881
- }
1882
- }
1883
- return i || o ? (n.setContentType("application/json", !1), Lr(t)) : t;
1884
- }],
1885
- transformResponse: [function(t) {
1886
- const n = this.transitional || ne.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
1887
- if (a.isResponse(t) || a.isReadableStream(t))
1888
- return t;
1889
- if (t && a.isString(t) && (r && !this.responseType || o)) {
1890
- const s = !(n && n.silentJSONParsing) && o;
1891
- try {
1892
- return JSON.parse(t);
1893
- } catch (l) {
1894
- if (s)
1895
- throw l.name === "SyntaxError" ? y.from(l, y.ERR_BAD_RESPONSE, this, null, this.response) : l;
1896
- }
1897
- }
1898
- return t;
1899
- }],
1900
- /**
1901
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1902
- * timeout is not created.
1903
- */
1904
- timeout: 0,
1905
- xsrfCookieName: "XSRF-TOKEN",
1906
- xsrfHeaderName: "X-XSRF-TOKEN",
1907
- maxContentLength: -1,
1908
- maxBodyLength: -1,
1909
- env: {
1910
- FormData: N.classes.FormData,
1911
- Blob: N.classes.Blob
1912
- },
1913
- validateStatus: function(t) {
1914
- return t >= 200 && t < 300;
1915
- },
1916
- headers: {
1917
- common: {
1918
- Accept: "application/json, text/plain, */*",
1919
- "Content-Type": void 0
1920
- }
1921
- }
1922
- };
1923
- a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1924
- ne.headers[e] = {};
1925
- });
1926
- const Ur = a.toObjectSet([
1927
- "age",
1928
- "authorization",
1929
- "content-length",
1930
- "content-type",
1931
- "etag",
1932
- "expires",
1933
- "from",
1934
- "host",
1935
- "if-modified-since",
1936
- "if-unmodified-since",
1937
- "last-modified",
1938
- "location",
1939
- "max-forwards",
1940
- "proxy-authorization",
1941
- "referer",
1942
- "retry-after",
1943
- "user-agent"
1944
- ]), Pr = (e) => {
1945
- const t = {};
1946
- let n, r, o;
1947
- return e && e.split(`
1948
- `).forEach(function(s) {
1949
- o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && Ur[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
1950
- }), t;
1951
- }, Ge = Symbol("internals");
1952
- function X(e) {
1953
- return e && String(e).trim().toLowerCase();
1954
- }
1955
- function ae(e) {
1956
- return e === !1 || e == null ? e : a.isArray(e) ? e.map(ae) : String(e);
1957
- }
1958
- function Br(e) {
1959
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1960
- let r;
1961
- for (; r = n.exec(e); )
1962
- t[r[1]] = r[2];
1963
- return t;
1964
- }
1965
- const jr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1966
- function Ee(e, t, n, r, o) {
1967
- if (a.isFunction(r))
1968
- return r.call(this, t, n);
1969
- if (o && (t = n), !!a.isString(t)) {
1970
- if (a.isString(r))
1971
- return t.indexOf(r) !== -1;
1972
- if (a.isRegExp(r))
1973
- return r.test(t);
1974
- }
1975
- }
1976
- function Ir(e) {
1977
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
1978
- }
1979
- function $r(e, t) {
1980
- const n = a.toCamelCase(" " + t);
1981
- ["get", "set", "has"].forEach((r) => {
1982
- Object.defineProperty(e, r + n, {
1983
- value: function(o, i, s) {
1984
- return this[r].call(this, t, o, i, s);
1985
- },
1986
- configurable: !0
1987
- });
1988
- });
1989
- }
1990
- let F = class {
1991
- constructor(t) {
1992
- t && this.set(t);
1993
- }
1994
- set(t, n, r) {
1995
- const o = this;
1996
- function i(l, u, d) {
1997
- const c = X(u);
1998
- if (!c)
1999
- throw new Error("header name must be a non-empty string");
2000
- const f = a.findKey(o, c);
2001
- (!f || o[f] === void 0 || d === !0 || d === void 0 && o[f] !== !1) && (o[f || u] = ae(l));
2002
- }
2003
- const s = (l, u) => a.forEach(l, (d, c) => i(d, c, u));
2004
- if (a.isPlainObject(t) || t instanceof this.constructor)
2005
- s(t, n);
2006
- else if (a.isString(t) && (t = t.trim()) && !jr(t))
2007
- s(Pr(t), n);
2008
- else if (a.isObject(t) && a.isIterable(t)) {
2009
- let l = {}, u, d;
2010
- for (const c of t) {
2011
- if (!a.isArray(c))
2012
- throw TypeError("Object iterator must return a key-value pair");
2013
- l[d = c[0]] = (u = l[d]) ? a.isArray(u) ? [...u, c[1]] : [u, c[1]] : c[1];
2014
- }
2015
- s(l, n);
2016
- } else
2017
- t != null && i(n, t, r);
2018
- return this;
2019
- }
2020
- get(t, n) {
2021
- if (t = X(t), t) {
2022
- const r = a.findKey(this, t);
2023
- if (r) {
2024
- const o = this[r];
2025
- if (!n)
2026
- return o;
2027
- if (n === !0)
2028
- return Br(o);
2029
- if (a.isFunction(n))
2030
- return n.call(this, o, r);
2031
- if (a.isRegExp(n))
2032
- return n.exec(o);
2033
- throw new TypeError("parser must be boolean|regexp|function");
2034
- }
2035
- }
2036
- }
2037
- has(t, n) {
2038
- if (t = X(t), t) {
2039
- const r = a.findKey(this, t);
2040
- return !!(r && this[r] !== void 0 && (!n || Ee(this, this[r], r, n)));
2041
- }
2042
- return !1;
2043
- }
2044
- delete(t, n) {
2045
- const r = this;
2046
- let o = !1;
2047
- function i(s) {
2048
- if (s = X(s), s) {
2049
- const l = a.findKey(r, s);
2050
- l && (!n || Ee(r, r[l], l, n)) && (delete r[l], o = !0);
2051
- }
2052
- }
2053
- return a.isArray(t) ? t.forEach(i) : i(t), o;
2054
- }
2055
- clear(t) {
2056
- const n = Object.keys(this);
2057
- let r = n.length, o = !1;
2058
- for (; r--; ) {
2059
- const i = n[r];
2060
- (!t || Ee(this, this[i], i, t, !0)) && (delete this[i], o = !0);
2061
- }
2062
- return o;
2063
- }
2064
- normalize(t) {
2065
- const n = this, r = {};
2066
- return a.forEach(this, (o, i) => {
2067
- const s = a.findKey(r, i);
2068
- if (s) {
2069
- n[s] = ae(o), delete n[i];
2070
- return;
2071
- }
2072
- const l = t ? Ir(i) : String(i).trim();
2073
- l !== i && delete n[i], n[l] = ae(o), r[l] = !0;
2074
- }), this;
2075
- }
2076
- concat(...t) {
2077
- return this.constructor.concat(this, ...t);
2078
- }
2079
- toJSON(t) {
2080
- const n = /* @__PURE__ */ Object.create(null);
2081
- return a.forEach(this, (r, o) => {
2082
- r != null && r !== !1 && (n[o] = t && a.isArray(r) ? r.join(", ") : r);
2083
- }), n;
2084
- }
2085
- [Symbol.iterator]() {
2086
- return Object.entries(this.toJSON())[Symbol.iterator]();
2087
- }
2088
- toString() {
2089
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
2090
- `);
2091
- }
2092
- getSetCookie() {
2093
- return this.get("set-cookie") || [];
2094
- }
2095
- get [Symbol.toStringTag]() {
2096
- return "AxiosHeaders";
2097
- }
2098
- static from(t) {
2099
- return t instanceof this ? t : new this(t);
2100
- }
2101
- static concat(t, ...n) {
2102
- const r = new this(t);
2103
- return n.forEach((o) => r.set(o)), r;
2104
- }
2105
- static accessor(t) {
2106
- const r = (this[Ge] = this[Ge] = {
2107
- accessors: {}
2108
- }).accessors, o = this.prototype;
2109
- function i(s) {
2110
- const l = X(s);
2111
- r[l] || ($r(o, s), r[l] = !0);
2112
- }
2113
- return a.isArray(t) ? t.forEach(i) : i(t), this;
2114
- }
2115
- };
2116
- F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2117
- a.reduceDescriptors(F.prototype, ({ value: e }, t) => {
2118
- let n = t[0].toUpperCase() + t.slice(1);
1337
+ }, $ = /* @__PURE__ */ new Map(), dt = (e, t) => $.get(`${t}:${e}`), ct = (e, t, n) => {
1338
+ const a = `${t}:${e}`;
1339
+ if ($.set(a, n), $.size > 1e3) {
1340
+ const o = $.keys().next().value;
1341
+ o !== void 0 && $.delete(o);
1342
+ }
1343
+ }, ht = (e) => /^[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+)*$/.test(e.trim()), ee = /* @__PURE__ */ new Map(), ut = 1e3, pt = (e) => {
1344
+ const t = Date.now(), n = ee.get(e) || 0;
1345
+ return t - n < ut ? !0 : (ee.set(e, t), !1);
1346
+ }, gt = (e) => {
1347
+ const t = De(e);
2119
1348
  return {
2120
- get: () => e,
2121
- set(r) {
2122
- this[n] = r;
2123
- }
2124
- };
2125
- });
2126
- a.freezeMethods(F);
2127
- function Se(e, t) {
2128
- const n = this || ne, r = t || n, o = F.from(r.headers);
2129
- let i = r.data;
2130
- return a.forEach(e, function(l) {
2131
- i = l.call(n, i, o.normalize(), t ? t.status : void 0);
2132
- }), o.normalize(), i;
2133
- }
2134
- function kt(e) {
2135
- return !!(e && e.__CANCEL__);
2136
- }
2137
- function K(e, t, n) {
2138
- y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
2139
- }
2140
- a.inherits(K, y, {
2141
- __CANCEL__: !0
2142
- });
2143
- function vt(e, t, n) {
2144
- const r = n.config.validateStatus;
2145
- !n.status || !r || r(n.status) ? e(n) : t(new y(
2146
- "Request failed with status code " + n.status,
2147
- [y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
2148
- n.config,
2149
- n.request,
2150
- n
2151
- ));
2152
- }
2153
- function qr(e) {
2154
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
2155
- return t && t[1] || "";
2156
- }
2157
- function Mr(e, t) {
2158
- e = e || 10;
2159
- const n = new Array(e), r = new Array(e);
2160
- let o = 0, i = 0, s;
2161
- return t = t !== void 0 ? t : 1e3, function(u) {
2162
- const d = Date.now(), c = r[i];
2163
- s || (s = d), n[o] = u, r[o] = d;
2164
- let f = i, b = 0;
2165
- for (; f !== o; )
2166
- b += n[f++], f = f % e;
2167
- if (o = (o + 1) % e, o === i && (i = (i + 1) % e), d - s < t)
2168
- return;
2169
- const w = c && d - c;
2170
- return w ? Math.round(b * 1e3 / w) : void 0;
2171
- };
2172
- }
2173
- function Hr(e, t) {
2174
- let n = 0, r = 1e3 / t, o, i;
2175
- const s = (d, c = Date.now()) => {
2176
- n = c, o = null, i && (clearTimeout(i), i = null), e.apply(null, d);
2177
- };
2178
- return [(...d) => {
2179
- const c = Date.now(), f = c - n;
2180
- f >= r ? s(d, c) : (o = d, i || (i = setTimeout(() => {
2181
- i = null, s(o);
2182
- }, r - f)));
2183
- }, () => o && s(o)];
2184
- }
2185
- const ce = (e, t, n = 3) => {
2186
- let r = 0;
2187
- const o = Mr(50, 250);
2188
- return Hr((i) => {
2189
- const s = i.loaded, l = i.lengthComputable ? i.total : void 0, u = s - r, d = o(u), c = s <= l;
2190
- r = s;
2191
- const f = {
2192
- loaded: s,
2193
- total: l,
2194
- progress: l ? s / l : void 0,
2195
- bytes: u,
2196
- rate: d || void 0,
2197
- estimated: d && l && c ? (l - s) / d : void 0,
2198
- event: i,
2199
- lengthComputable: l != null,
2200
- [t ? "download" : "upload"]: !0
2201
- };
2202
- e(f);
2203
- }, n);
2204
- }, Xe = (e, t) => {
2205
- const n = e != null;
2206
- return [(r) => t[0]({
2207
- lengthComputable: n,
2208
- total: e,
2209
- loaded: r
2210
- }), t[1]];
2211
- }, Qe = (e) => (...t) => a.asap(() => e(...t)), zr = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, N.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
2212
- new URL(N.origin),
2213
- N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
2214
- ) : () => !0, Vr = N.hasStandardBrowserEnv ? (
2215
- // Standard browser envs support document.cookie
2216
- {
2217
- write(e, t, n, r, o, i) {
2218
- const s = [e + "=" + encodeURIComponent(t)];
2219
- a.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), a.isString(r) && s.push("path=" + r), a.isString(o) && s.push("domain=" + o), i === !0 && s.push("secure"), document.cookie = s.join("; ");
2220
- },
2221
- read(e) {
2222
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
2223
- return t ? decodeURIComponent(t[3]) : null;
2224
- },
2225
- remove(e) {
2226
- this.write(e, "", Date.now() - 864e5);
2227
- }
2228
- }
2229
- ) : (
2230
- // Non-standard browser env (web workers, react-native) lack needed support.
2231
- {
2232
- write() {
2233
- },
2234
- read() {
2235
- return null;
2236
- },
2237
- remove() {
2238
- }
2239
- }
2240
- );
2241
- function Jr(e) {
2242
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
2243
- }
2244
- function Wr(e, t) {
2245
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
2246
- }
2247
- function Ft(e, t, n) {
2248
- let r = !Jr(t);
2249
- return e && (r || n == !1) ? Wr(e, t) : t;
2250
- }
2251
- const Ze = (e) => e instanceof F ? { ...e } : e;
2252
- function V(e, t) {
2253
- t = t || {};
2254
- const n = {};
2255
- function r(d, c, f, b) {
2256
- return a.isPlainObject(d) && a.isPlainObject(c) ? a.merge.call({ caseless: b }, d, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
2257
- }
2258
- function o(d, c, f, b) {
2259
- if (a.isUndefined(c)) {
2260
- if (!a.isUndefined(d))
2261
- return r(void 0, d, f, b);
2262
- } else return r(d, c, f, b);
2263
- }
2264
- function i(d, c) {
2265
- if (!a.isUndefined(c))
2266
- return r(void 0, c);
2267
- }
2268
- function s(d, c) {
2269
- if (a.isUndefined(c)) {
2270
- if (!a.isUndefined(d))
2271
- return r(void 0, d);
2272
- } else return r(void 0, c);
2273
- }
2274
- function l(d, c, f) {
2275
- if (f in t)
2276
- return r(d, c);
2277
- if (f in e)
2278
- return r(void 0, d);
2279
- }
2280
- const u = {
2281
- url: i,
2282
- method: i,
2283
- data: i,
2284
- baseURL: s,
2285
- transformRequest: s,
2286
- transformResponse: s,
2287
- paramsSerializer: s,
2288
- timeout: s,
2289
- timeoutMessage: s,
2290
- withCredentials: s,
2291
- withXSRFToken: s,
2292
- adapter: s,
2293
- responseType: s,
2294
- xsrfCookieName: s,
2295
- xsrfHeaderName: s,
2296
- onUploadProgress: s,
2297
- onDownloadProgress: s,
2298
- decompress: s,
2299
- maxContentLength: s,
2300
- maxBodyLength: s,
2301
- beforeRedirect: s,
2302
- transport: s,
2303
- httpAgent: s,
2304
- httpsAgent: s,
2305
- cancelToken: s,
2306
- socketPath: s,
2307
- responseEncoding: s,
2308
- validateStatus: l,
2309
- headers: (d, c, f) => o(Ze(d), Ze(c), f, !0)
2310
- };
2311
- return a.forEach(Object.keys(Object.assign({}, e, t)), function(c) {
2312
- const f = u[c] || o, b = f(e[c], t[c], c);
2313
- a.isUndefined(b) && f !== l || (n[c] = b);
2314
- }), n;
2315
- }
2316
- const _t = (e) => {
2317
- const t = V({}, e);
2318
- let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: l } = t;
2319
- t.headers = s = F.from(s), t.url = Nt(Ft(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && s.set(
2320
- "Authorization",
2321
- "Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
2322
- );
2323
- let u;
2324
- if (a.isFormData(n)) {
2325
- if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
2326
- s.setContentType(void 0);
2327
- else if ((u = s.getContentType()) !== !1) {
2328
- const [d, ...c] = u ? u.split(";").map((f) => f.trim()).filter(Boolean) : [];
2329
- s.setContentType([d || "multipart/form-data", ...c].join("; "));
2330
- }
2331
- }
2332
- if (N.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && zr(t.url))) {
2333
- const d = o && i && Vr.read(i);
2334
- d && s.set(o, d);
2335
- }
2336
- return t;
2337
- }, Kr = typeof XMLHttpRequest < "u", Gr = Kr && function(e) {
2338
- return new Promise(function(n, r) {
2339
- const o = _t(e);
2340
- let i = o.data;
2341
- const s = F.from(o.headers).normalize();
2342
- let { responseType: l, onUploadProgress: u, onDownloadProgress: d } = o, c, f, b, w, p;
2343
- function g() {
2344
- w && w(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
2345
- }
2346
- let m = new XMLHttpRequest();
2347
- m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
2348
- function S() {
2349
- if (!m)
2350
- return;
2351
- const C = F.from(
2352
- "getAllResponseHeaders" in m && m.getAllResponseHeaders()
2353
- ), A = {
2354
- data: !l || l === "text" || l === "json" ? m.responseText : m.response,
2355
- status: m.status,
2356
- statusText: m.statusText,
2357
- headers: C,
2358
- config: e,
2359
- request: m
2360
- };
2361
- vt(function(I) {
2362
- n(I), g();
2363
- }, function(I) {
2364
- r(I), g();
2365
- }, A), m = null;
2366
- }
2367
- "onloadend" in m ? m.onloadend = S : m.onreadystatechange = function() {
2368
- !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(S);
2369
- }, m.onabort = function() {
2370
- m && (r(new y("Request aborted", y.ECONNABORTED, e, m)), m = null);
2371
- }, m.onerror = function() {
2372
- r(new y("Network Error", y.ERR_NETWORK, e, m)), m = null;
2373
- }, m.ontimeout = function() {
2374
- let L = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
2375
- const A = o.transitional || Dt;
2376
- o.timeoutErrorMessage && (L = o.timeoutErrorMessage), r(new y(
2377
- L,
2378
- A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
2379
- e,
2380
- m
2381
- )), m = null;
2382
- }, i === void 0 && s.setContentType(null), "setRequestHeader" in m && a.forEach(s.toJSON(), function(L, A) {
2383
- m.setRequestHeader(A, L);
2384
- }), a.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), l && l !== "json" && (m.responseType = o.responseType), d && ([b, p] = ce(d, !0), m.addEventListener("progress", b)), u && m.upload && ([f, w] = ce(u), m.upload.addEventListener("progress", f), m.upload.addEventListener("loadend", w)), (o.cancelToken || o.signal) && (c = (C) => {
2385
- m && (r(!C || C.type ? new K(null, e, m) : C), m.abort(), m = null);
2386
- }, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
2387
- const x = qr(o.url);
2388
- if (x && N.protocols.indexOf(x) === -1) {
2389
- r(new y("Unsupported protocol " + x + ":", y.ERR_BAD_REQUEST, e));
2390
- return;
2391
- }
2392
- m.send(i || null);
2393
- });
2394
- }, Xr = (e, t) => {
2395
- const { length: n } = e = e ? e.filter(Boolean) : [];
2396
- if (t || n) {
2397
- let r = new AbortController(), o;
2398
- const i = function(d) {
2399
- if (!o) {
2400
- o = !0, l();
2401
- const c = d instanceof Error ? d : this.reason;
2402
- r.abort(c instanceof y ? c : new K(c instanceof Error ? c.message : c));
2403
- }
2404
- };
2405
- let s = t && setTimeout(() => {
2406
- s = null, i(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
2407
- }, t);
2408
- const l = () => {
2409
- e && (s && clearTimeout(s), s = null, e.forEach((d) => {
2410
- d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
2411
- }), e = null);
2412
- };
2413
- e.forEach((d) => d.addEventListener("abort", i));
2414
- const { signal: u } = r;
2415
- return u.unsubscribe = () => a.asap(l), u;
2416
- }
2417
- }, Qr = function* (e, t) {
2418
- let n = e.byteLength;
2419
- if (n < t) {
2420
- yield e;
2421
- return;
2422
- }
2423
- let r = 0, o;
2424
- for (; r < n; )
2425
- o = r + t, yield e.slice(r, o), r = o;
2426
- }, Zr = async function* (e, t) {
2427
- for await (const n of Yr(e))
2428
- yield* Qr(n, t);
2429
- }, Yr = async function* (e) {
2430
- if (e[Symbol.asyncIterator]) {
2431
- yield* e;
2432
- return;
2433
- }
2434
- const t = e.getReader();
2435
- try {
2436
- for (; ; ) {
2437
- const { done: n, value: r } = await t.read();
2438
- if (n)
2439
- break;
2440
- yield r;
2441
- }
2442
- } finally {
2443
- await t.cancel();
2444
- }
2445
- }, Ye = (e, t, n, r) => {
2446
- const o = Zr(e, t);
2447
- let i = 0, s, l = (u) => {
2448
- s || (s = !0, r && r(u));
2449
- };
2450
- return new ReadableStream({
2451
- async pull(u) {
2452
- try {
2453
- const { done: d, value: c } = await o.next();
2454
- if (d) {
2455
- l(), u.close();
2456
- return;
2457
- }
2458
- let f = c.byteLength;
2459
- if (n) {
2460
- let b = i += f;
2461
- n(b);
2462
- }
2463
- u.enqueue(new Uint8Array(c));
2464
- } catch (d) {
2465
- throw l(d), d;
2466
- }
2467
- },
2468
- cancel(u) {
2469
- return l(u), o.return();
2470
- }
2471
- }, {
2472
- highWaterMark: 2
2473
- });
2474
- }, be = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Lt = be && typeof ReadableStream == "function", eo = be && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Ut = (e, ...t) => {
2475
- try {
2476
- return !!e(...t);
2477
- } catch {
2478
- return !1;
2479
- }
2480
- }, to = Lt && Ut(() => {
2481
- let e = !1;
2482
- const t = new Request(N.origin, {
2483
- body: new ReadableStream(),
2484
- method: "POST",
2485
- get duplex() {
2486
- return e = !0, "half";
2487
- }
2488
- }).headers.has("Content-Type");
2489
- return e && !t;
2490
- }), et = 64 * 1024, Oe = Lt && Ut(() => a.isReadableStream(new Response("").body)), de = {
2491
- stream: Oe && ((e) => e.body)
2492
- };
2493
- be && ((e) => {
2494
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
2495
- !de[t] && (de[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
2496
- throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
2497
- });
2498
- });
2499
- })(new Response());
2500
- const no = async (e) => {
2501
- if (e == null)
2502
- return 0;
2503
- if (a.isBlob(e))
2504
- return e.size;
2505
- if (a.isSpecCompliantForm(e))
2506
- return (await new Request(N.origin, {
2507
- method: "POST",
2508
- body: e
2509
- }).arrayBuffer()).byteLength;
2510
- if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
2511
- return e.byteLength;
2512
- if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
2513
- return (await eo(e)).byteLength;
2514
- }, ro = async (e, t) => {
2515
- const n = a.toFiniteNumber(e.getContentLength());
2516
- return n ?? no(t);
2517
- }, oo = be && (async (e) => {
2518
- let {
2519
- url: t,
2520
- method: n,
2521
- data: r,
2522
- signal: o,
2523
- cancelToken: i,
2524
- timeout: s,
2525
- onDownloadProgress: l,
2526
- onUploadProgress: u,
2527
- responseType: d,
2528
- headers: c,
2529
- withCredentials: f = "same-origin",
2530
- fetchOptions: b
2531
- } = _t(e);
2532
- d = d ? (d + "").toLowerCase() : "text";
2533
- let w = Xr([o, i && i.toAbortSignal()], s), p;
2534
- const g = w && w.unsubscribe && (() => {
2535
- w.unsubscribe();
2536
- });
2537
- let m;
2538
- try {
2539
- if (u && to && n !== "get" && n !== "head" && (m = await ro(c, r)) !== 0) {
2540
- let A = new Request(t, {
2541
- method: "POST",
2542
- body: r,
2543
- duplex: "half"
2544
- }), B;
2545
- if (a.isFormData(r) && (B = A.headers.get("content-type")) && c.setContentType(B), A.body) {
2546
- const [I, _] = Xe(
2547
- m,
2548
- ce(Qe(u))
2549
- );
2550
- r = Ye(A.body, et, I, _);
2551
- }
2552
- }
2553
- a.isString(f) || (f = f ? "include" : "omit");
2554
- const S = "credentials" in Request.prototype;
2555
- p = new Request(t, {
2556
- ...b,
2557
- signal: w,
2558
- method: n.toUpperCase(),
2559
- headers: c.normalize().toJSON(),
2560
- body: r,
2561
- duplex: "half",
2562
- credentials: S ? f : void 0
2563
- });
2564
- let x = await fetch(p);
2565
- const C = Oe && (d === "stream" || d === "response");
2566
- if (Oe && (l || C && g)) {
2567
- const A = {};
2568
- ["status", "statusText", "headers"].forEach((Be) => {
2569
- A[Be] = x[Be];
2570
- });
2571
- const B = a.toFiniteNumber(x.headers.get("content-length")), [I, _] = l && Xe(
2572
- B,
2573
- ce(Qe(l), !0)
2574
- ) || [];
2575
- x = new Response(
2576
- Ye(x.body, et, I, () => {
2577
- _ && _(), g && g();
2578
- }),
2579
- A
2580
- );
2581
- }
2582
- d = d || "text";
2583
- let L = await de[a.findKey(de, d) || "text"](x, e);
2584
- return !C && g && g(), await new Promise((A, B) => {
2585
- vt(A, B, {
2586
- data: L,
2587
- headers: F.from(x.headers),
2588
- status: x.status,
2589
- statusText: x.statusText,
2590
- config: e,
2591
- request: p
2592
- });
2593
- });
2594
- } catch (S) {
2595
- throw g && g(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
2596
- new y("Network Error", y.ERR_NETWORK, e, p),
2597
- {
2598
- cause: S.cause || S
2599
- }
2600
- ) : y.from(S, S && S.code, e, p);
2601
- }
2602
- }), ke = {
2603
- http: wr,
2604
- xhr: Gr,
2605
- fetch: oo
2606
- };
2607
- a.forEach(ke, (e, t) => {
2608
- if (e) {
2609
- try {
2610
- Object.defineProperty(e, "name", { value: t });
2611
- } catch {
2612
- }
2613
- Object.defineProperty(e, "adapterName", { value: t });
2614
- }
2615
- });
2616
- const tt = (e) => `- ${e}`, io = (e) => a.isFunction(e) || e === null || e === !1, Pt = {
2617
- getAdapter: (e) => {
2618
- e = a.isArray(e) ? e : [e];
2619
- const { length: t } = e;
2620
- let n, r;
2621
- const o = {};
2622
- for (let i = 0; i < t; i++) {
2623
- n = e[i];
2624
- let s;
2625
- if (r = n, !io(n) && (r = ke[(s = String(n)).toLowerCase()], r === void 0))
2626
- throw new y(`Unknown adapter '${s}'`);
2627
- if (r)
2628
- break;
2629
- o[s || "#" + i] = r;
2630
- }
2631
- if (!r) {
2632
- const i = Object.entries(o).map(
2633
- ([l, u]) => `adapter ${l} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
2634
- );
2635
- let s = t ? i.length > 1 ? `since :
2636
- ` + i.map(tt).join(`
2637
- `) : " " + tt(i[0]) : "as no adapter specified";
2638
- throw new y(
2639
- "There is no suitable adapter to dispatch the request " + s,
2640
- "ERR_NOT_SUPPORT"
2641
- );
2642
- }
2643
- return r;
2644
- },
2645
- adapters: ke
2646
- };
2647
- function xe(e) {
2648
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
2649
- throw new K(null, e);
2650
- }
2651
- function nt(e) {
2652
- return xe(e), e.headers = F.from(e.headers), e.data = Se.call(
2653
- e,
2654
- e.transformRequest
2655
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Pt.getAdapter(e.adapter || ne.adapter)(e).then(function(r) {
2656
- return xe(e), r.data = Se.call(
2657
- e,
2658
- e.transformResponse,
2659
- r
2660
- ), r.headers = F.from(r.headers), r;
2661
- }, function(r) {
2662
- return kt(r) || (xe(e), r && r.response && (r.response.data = Se.call(
2663
- e,
2664
- e.transformResponse,
2665
- r.response
2666
- ), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
2667
- });
2668
- }
2669
- const Bt = "1.9.0", ye = {};
2670
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
2671
- ye[e] = function(r) {
2672
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
2673
- };
2674
- });
2675
- const rt = {};
2676
- ye.transitional = function(t, n, r) {
2677
- function o(i, s) {
2678
- return "[Axios v" + Bt + "] Transitional option '" + i + "'" + s + (r ? ". " + r : "");
2679
- }
2680
- return (i, s, l) => {
2681
- if (t === !1)
2682
- throw new y(
2683
- o(s, " has been removed" + (n ? " in " + n : "")),
2684
- y.ERR_DEPRECATED
2685
- );
2686
- return n && !rt[s] && (rt[s] = !0, console.warn(
2687
- o(
2688
- s,
2689
- " has been deprecated since v" + n + " and will be removed in the near future"
2690
- )
2691
- )), t ? t(i, s, l) : !0;
2692
- };
2693
- };
2694
- ye.spelling = function(t) {
2695
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
2696
- };
2697
- function so(e, t, n) {
2698
- if (typeof e != "object")
2699
- throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
2700
- const r = Object.keys(e);
2701
- let o = r.length;
2702
- for (; o-- > 0; ) {
2703
- const i = r[o], s = t[i];
2704
- if (s) {
2705
- const l = e[i], u = l === void 0 || s(l, i, e);
2706
- if (u !== !0)
2707
- throw new y("option " + i + " must be " + u, y.ERR_BAD_OPTION_VALUE);
2708
- continue;
2709
- }
2710
- if (n !== !0)
2711
- throw new y("Unknown option " + i, y.ERR_BAD_OPTION);
2712
- }
2713
- }
2714
- const le = {
2715
- assertOptions: so,
2716
- validators: ye
2717
- }, j = le.validators;
2718
- let H = class {
2719
- constructor(t) {
2720
- this.defaults = t || {}, this.interceptors = {
2721
- request: new Ke(),
2722
- response: new Ke()
2723
- };
2724
- }
2725
- /**
2726
- * Dispatch a request
2727
- *
2728
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2729
- * @param {?Object} config
2730
- *
2731
- * @returns {Promise} The Promise to be fulfilled
2732
- */
2733
- async request(t, n) {
2734
- try {
2735
- return await this._request(t, n);
2736
- } catch (r) {
2737
- if (r instanceof Error) {
2738
- let o = {};
2739
- Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
2740
- const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
2741
- try {
2742
- r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
2743
- ` + i) : r.stack = i;
2744
- } catch {
2745
- }
2746
- }
2747
- throw r;
2748
- }
2749
- }
2750
- _request(t, n) {
2751
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = V(this.defaults, n);
2752
- const { transitional: r, paramsSerializer: o, headers: i } = n;
2753
- r !== void 0 && le.assertOptions(r, {
2754
- silentJSONParsing: j.transitional(j.boolean),
2755
- forcedJSONParsing: j.transitional(j.boolean),
2756
- clarifyTimeoutError: j.transitional(j.boolean)
2757
- }, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
2758
- serialize: o
2759
- } : le.assertOptions(o, {
2760
- encode: j.function,
2761
- serialize: j.function
2762
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), le.assertOptions(n, {
2763
- baseUrl: j.spelling("baseURL"),
2764
- withXsrfToken: j.spelling("withXSRFToken")
2765
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2766
- let s = i && a.merge(
2767
- i.common,
2768
- i[n.method]
2769
- );
2770
- i && a.forEach(
2771
- ["delete", "get", "head", "post", "put", "patch", "common"],
2772
- (p) => {
2773
- delete i[p];
2774
- }
2775
- ), n.headers = F.concat(s, i);
2776
- const l = [];
2777
- let u = !0;
2778
- this.interceptors.request.forEach(function(g) {
2779
- typeof g.runWhen == "function" && g.runWhen(n) === !1 || (u = u && g.synchronous, l.unshift(g.fulfilled, g.rejected));
2780
- });
2781
- const d = [];
2782
- this.interceptors.response.forEach(function(g) {
2783
- d.push(g.fulfilled, g.rejected);
2784
- });
2785
- let c, f = 0, b;
2786
- if (!u) {
2787
- const p = [nt.bind(this), void 0];
2788
- for (p.unshift.apply(p, l), p.push.apply(p, d), b = p.length, c = Promise.resolve(n); f < b; )
2789
- c = c.then(p[f++], p[f++]);
2790
- return c;
2791
- }
2792
- b = l.length;
2793
- let w = n;
2794
- for (f = 0; f < b; ) {
2795
- const p = l[f++], g = l[f++];
2796
- try {
2797
- w = p(w);
2798
- } catch (m) {
2799
- g.call(this, m);
2800
- break;
2801
- }
2802
- }
2803
- try {
2804
- c = nt.call(this, w);
2805
- } catch (p) {
2806
- return Promise.reject(p);
2807
- }
2808
- for (f = 0, b = d.length; f < b; )
2809
- c = c.then(d[f++], d[f++]);
2810
- return c;
2811
- }
2812
- getUri(t) {
2813
- t = V(this.defaults, t);
2814
- const n = Ft(t.baseURL, t.url, t.allowAbsoluteUrls);
2815
- return Nt(n, t.params, t.paramsSerializer);
2816
- }
2817
- };
2818
- a.forEach(["delete", "get", "head", "options"], function(t) {
2819
- H.prototype[t] = function(n, r) {
2820
- return this.request(V(r || {}, {
2821
- method: t,
2822
- url: n,
2823
- data: (r || {}).data
2824
- }));
2825
- };
2826
- });
2827
- a.forEach(["post", "put", "patch"], function(t) {
2828
- function n(r) {
2829
- return function(i, s, l) {
2830
- return this.request(V(l || {}, {
2831
- method: t,
2832
- headers: r ? {
2833
- "Content-Type": "multipart/form-data"
2834
- } : {},
2835
- url: i,
2836
- data: s
2837
- }));
2838
- };
2839
- }
2840
- H.prototype[t] = n(), H.prototype[t + "Form"] = n(!0);
2841
- });
2842
- let ao = class jt {
2843
- constructor(t) {
2844
- if (typeof t != "function")
2845
- throw new TypeError("executor must be a function.");
2846
- let n;
2847
- this.promise = new Promise(function(i) {
2848
- n = i;
2849
- });
2850
- const r = this;
2851
- this.promise.then((o) => {
2852
- if (!r._listeners) return;
2853
- let i = r._listeners.length;
2854
- for (; i-- > 0; )
2855
- r._listeners[i](o);
2856
- r._listeners = null;
2857
- }), this.promise.then = (o) => {
2858
- let i;
2859
- const s = new Promise((l) => {
2860
- r.subscribe(l), i = l;
2861
- }).then(o);
2862
- return s.cancel = function() {
2863
- r.unsubscribe(i);
2864
- }, s;
2865
- }, t(function(i, s, l) {
2866
- r.reason || (r.reason = new K(i, s, l), n(r.reason));
2867
- });
2868
- }
2869
- /**
2870
- * Throws a `CanceledError` if cancellation has been requested.
2871
- */
2872
- throwIfRequested() {
2873
- if (this.reason)
2874
- throw this.reason;
2875
- }
2876
- /**
2877
- * Subscribe to the cancel signal
2878
- */
2879
- subscribe(t) {
2880
- if (this.reason) {
2881
- t(this.reason);
2882
- return;
2883
- }
2884
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
2885
- }
2886
- /**
2887
- * Unsubscribe from the cancel signal
2888
- */
2889
- unsubscribe(t) {
2890
- if (!this._listeners)
2891
- return;
2892
- const n = this._listeners.indexOf(t);
2893
- n !== -1 && this._listeners.splice(n, 1);
2894
- }
2895
- toAbortSignal() {
2896
- const t = new AbortController(), n = (r) => {
2897
- t.abort(r);
2898
- };
2899
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
2900
- }
2901
- /**
2902
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2903
- * cancels the `CancelToken`.
2904
- */
2905
- static source() {
2906
- let t;
2907
- return {
2908
- token: new jt(function(o) {
2909
- t = o;
2910
- }),
2911
- cancel: t
2912
- };
2913
- }
2914
- };
2915
- function lo(e) {
2916
- return function(n) {
2917
- return e.apply(null, n);
2918
- };
2919
- }
2920
- function co(e) {
2921
- return a.isObject(e) && e.isAxiosError === !0;
2922
- }
2923
- const ve = {
2924
- Continue: 100,
2925
- SwitchingProtocols: 101,
2926
- Processing: 102,
2927
- EarlyHints: 103,
2928
- Ok: 200,
2929
- Created: 201,
2930
- Accepted: 202,
2931
- NonAuthoritativeInformation: 203,
2932
- NoContent: 204,
2933
- ResetContent: 205,
2934
- PartialContent: 206,
2935
- MultiStatus: 207,
2936
- AlreadyReported: 208,
2937
- ImUsed: 226,
2938
- MultipleChoices: 300,
2939
- MovedPermanently: 301,
2940
- Found: 302,
2941
- SeeOther: 303,
2942
- NotModified: 304,
2943
- UseProxy: 305,
2944
- Unused: 306,
2945
- TemporaryRedirect: 307,
2946
- PermanentRedirect: 308,
2947
- BadRequest: 400,
2948
- Unauthorized: 401,
2949
- PaymentRequired: 402,
2950
- Forbidden: 403,
2951
- NotFound: 404,
2952
- MethodNotAllowed: 405,
2953
- NotAcceptable: 406,
2954
- ProxyAuthenticationRequired: 407,
2955
- RequestTimeout: 408,
2956
- Conflict: 409,
2957
- Gone: 410,
2958
- LengthRequired: 411,
2959
- PreconditionFailed: 412,
2960
- PayloadTooLarge: 413,
2961
- UriTooLong: 414,
2962
- UnsupportedMediaType: 415,
2963
- RangeNotSatisfiable: 416,
2964
- ExpectationFailed: 417,
2965
- ImATeapot: 418,
2966
- MisdirectedRequest: 421,
2967
- UnprocessableEntity: 422,
2968
- Locked: 423,
2969
- FailedDependency: 424,
2970
- TooEarly: 425,
2971
- UpgradeRequired: 426,
2972
- PreconditionRequired: 428,
2973
- TooManyRequests: 429,
2974
- RequestHeaderFieldsTooLarge: 431,
2975
- UnavailableForLegalReasons: 451,
2976
- InternalServerError: 500,
2977
- NotImplemented: 501,
2978
- BadGateway: 502,
2979
- ServiceUnavailable: 503,
2980
- GatewayTimeout: 504,
2981
- HttpVersionNotSupported: 505,
2982
- VariantAlsoNegotiates: 506,
2983
- InsufficientStorage: 507,
2984
- LoopDetected: 508,
2985
- NotExtended: 510,
2986
- NetworkAuthenticationRequired: 511
2987
- };
2988
- Object.entries(ve).forEach(([e, t]) => {
2989
- ve[t] = e;
2990
- });
2991
- function It(e) {
2992
- const t = new H(e), n = mt(H.prototype.request, t);
2993
- return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2994
- return It(V(e, o));
2995
- }, n;
2996
- }
2997
- const R = It(ne);
2998
- R.Axios = H;
2999
- R.CanceledError = K;
3000
- R.CancelToken = ao;
3001
- R.isCancel = kt;
3002
- R.VERSION = Bt;
3003
- R.toFormData = ge;
3004
- R.AxiosError = y;
3005
- R.Cancel = R.CanceledError;
3006
- R.all = function(t) {
3007
- return Promise.all(t);
3008
- };
3009
- R.spread = lo;
3010
- R.isAxiosError = co;
3011
- R.mergeConfig = V;
3012
- R.AxiosHeaders = F;
3013
- R.formToJSON = (e) => Ot(a.isHTMLForm(e) ? new FormData(e) : e);
3014
- R.getAdapter = Pt.getAdapter;
3015
- R.HttpStatusCode = ve;
3016
- R.default = R;
3017
- const {
3018
- Axios: Io,
3019
- AxiosError: $o,
3020
- CanceledError: qo,
3021
- isCancel: Mo,
3022
- CancelToken: Ho,
3023
- VERSION: zo,
3024
- all: Vo,
3025
- Cancel: Jo,
3026
- isAxiosError: Wo,
3027
- spread: Ko,
3028
- toFormData: Go,
3029
- AxiosHeaders: Xo,
3030
- HttpStatusCode: Qo,
3031
- formToJSON: Zo,
3032
- getAdapter: Yo,
3033
- mergeConfig: ei
3034
- } = R, Q = /* @__PURE__ */ new Map(), uo = (e, t) => Q.get(`${t}:${e}`), fo = (e, t, n) => {
3035
- const r = `${t}:${e}`;
3036
- if (Q.set(r, n), Q.size > 1e3) {
3037
- const o = Q.keys().next().value;
3038
- o !== void 0 && Q.delete(o);
3039
- }
3040
- }, ho = (e) => /^[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+)*$/.test(e.trim()), ot = /* @__PURE__ */ new Map(), po = 1e3, mo = (e) => {
3041
- const t = Date.now(), n = ot.get(e) || 0;
3042
- return t - n < po ? !0 : (ot.set(e, t), !1);
3043
- }, go = "https://api.mymemory.translated.net/get", bo = async (e, t, n = "es") => {
3044
- var i;
3045
- const r = `${t}:${e}`;
3046
- if (ho(e))
3047
- return e;
3048
- const o = uo(e, t);
3049
- if (o) return o;
3050
- if (mo(r))
1349
+ spa: "es",
1350
+ eng: "en",
1351
+ deu: "de",
1352
+ fra: "fr",
1353
+ ita: "it",
1354
+ por: "pt"
1355
+ }[t] || "en";
1356
+ }, mt = "https://api.mymemory.translated.net/get", bt = async (e, t) => {
1357
+ var r;
1358
+ if (ht(e)) return e;
1359
+ const n = `${t}:${e}`, a = dt(e, t);
1360
+ if (a) return a;
1361
+ if (pt(n))
3051
1362
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
1363
+ const o = gt(e);
1364
+ console.log(`[Detected] ${e} => ${o}`);
3052
1365
  try {
3053
- const { data: s } = await R.get(go, {
1366
+ const { data: c } = await Se.get(mt, {
3054
1367
  params: {
3055
1368
  q: e,
3056
- langpair: `${n}|${t}`
1369
+ langpair: `${o}|${t}`
3057
1370
  }
3058
- }), l = ((i = s == null ? void 0 : s.responseData) == null ? void 0 : i.translatedText) || e;
3059
- return fo(e, t, l), l;
3060
- } catch (s) {
3061
- return console.warn(`[Translation] Failed for: "${e}"`, s), e;
1371
+ }), g = ((r = c == null ? void 0 : c.responseData) == null ? void 0 : r.translatedText) || e;
1372
+ return ct(e, t, g), g;
1373
+ } catch (c) {
1374
+ return console.warn(`[Translation] Failed for: "${e}"`, c), e;
3062
1375
  }
3063
- }, yo = (e) => typeof e == "string" && e.trim().length > 0, it = async (e, t) => {
1376
+ }, Tt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t) => {
3064
1377
  const n = await Promise.all(
3065
- Object.entries(e).map(async ([r, o]) => {
3066
- if (yo(o)) {
3067
- const i = await bo(o, t);
3068
- return [r, i];
1378
+ Object.entries(e).map(async ([a, o]) => {
1379
+ if (Tt(o)) {
1380
+ const r = await bt(o, t);
1381
+ return [a, r];
3069
1382
  } else if (Array.isArray(o)) {
3070
- const i = await Promise.all(
1383
+ const r = await Promise.all(
3071
1384
  o.map(
3072
- async (s) => typeof s == "object" && s !== null ? await it(s, t) : s
1385
+ async (c) => typeof c == "object" && c !== null ? await te(c, t) : c
3073
1386
  )
3074
1387
  );
3075
- return [r, i];
1388
+ return [a, r];
3076
1389
  } else if (typeof o == "object" && o !== null) {
3077
- const i = await it(o, t);
3078
- return [r, i];
1390
+ const r = await te(o, t);
1391
+ return [a, r];
3079
1392
  } else
3080
- return [r, o];
1393
+ return [a, o];
3081
1394
  })
3082
1395
  );
3083
1396
  return Object.fromEntries(n);
3084
1397
  };
3085
1398
  export {
3086
- _e as BusinessRuleCard,
3087
- ht as BusinessRuleView,
3088
- Oo as BusinessRules,
3089
- ko as Filter,
3090
- vo as FilterModal,
3091
- Fo as FormFilter,
3092
- cn as ModalRules,
3093
- _n as RulesForm,
3094
- _o as revertSortedDataSampleSwitchPlaces,
3095
- Lo as revertSortedDataSwitchPlaces,
3096
- Uo as sortDisplayDataSampleSwitchPlaces,
3097
- Po as sortDisplayDataSwitchPlaces,
3098
- it as translateObject,
3099
- bo as translateText
1399
+ P as BusinessRuleCard,
1400
+ de as BusinessRuleView,
1401
+ Ft as BusinessRules,
1402
+ $t as Filter,
1403
+ It as FilterModal,
1404
+ Rt as FormFilter,
1405
+ ze as ModalRules,
1406
+ st as RulesForm,
1407
+ Mt as revertSortedDataSampleSwitchPlaces,
1408
+ Lt as revertSortedDataSwitchPlaces,
1409
+ Ot as sortDisplayDataSampleSwitchPlaces,
1410
+ Vt as sortDisplayDataSwitchPlaces,
1411
+ te as translateObject,
1412
+ bt as translateText
3100
1413
  };