@devtable/settings-form 5.4.0 → 5.5.0-alpha

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.
@@ -1,39 +1,45 @@
1
- import { Modal as we, Button as q, Box as N, SegmentedControl as jr, TextInput as F, Divider as Be, Group as L, NumberInput as kr, PasswordInput as ie, Text as be, LoadingOverlay as Ge, Table as He, Stack as Fr, Select as Lr, Switch as qr } from "@mantine/core";
2
- import { showNotification as V, updateNotification as A } from "@mantine/notifications";
3
- import Q, { forwardRef as Je, useMemo as Ir } from "react";
4
- import { useForm as oe, Controller as T } from "react-hook-form";
5
- import { PlaylistAdd as Xe, Trash as Ke, Edit as Ur } from "tabler-icons-react";
1
+ import { Modal as oe, Button as D, Box as L, SegmentedControl as qr, TextInput as I, Divider as er, Group as j, NumberInput as Lr, PasswordInput as se, Text as ye, LoadingOverlay as _e, Table as Pe, Stack as rr, Select as Nr, Switch as Ur } from "@mantine/core";
2
+ import { showNotification as M, updateNotification as A } from "@mantine/notifications";
3
+ import H, { forwardRef as tr, useMemo as nr } from "react";
4
+ import { useForm as ee, Controller as P } from "react-hook-form";
5
+ import { PlaylistAdd as Ee, Trash as Ce, Edit as Mr } from "tabler-icons-react";
6
6
  import $r from "axios";
7
- import { useRequest as ae } from "ahooks";
8
- import { useModals as Qe } from "@mantine/modals";
9
- const y = {
7
+ import { useRequest as G } from "ahooks";
8
+ import { useModals as ce, closeAllModals as Wr } from "@mantine/modals";
9
+ const C = {
10
10
  baseURL: "http://localhost:31200",
11
- getRequest(a) {
12
- return (n, s, c = {}) => {
13
- const d = window.localStorage.getItem("token"), o = {
11
+ apiKey: "",
12
+ getRequest(t) {
13
+ return (a, s, c = {}) => {
14
+ const u = window.localStorage.getItem("token"), i = {
14
15
  "X-Requested-With": "XMLHttpRequest",
15
16
  "Content-Type": c.string ? "application/x-www-form-urlencoded" : "application/json",
16
- authorization: d ? `bearer ${d}` : "",
17
+ authorization: u ? `bearer ${u}` : "",
18
+ "x-api-key": this.apiKey,
17
19
  ...c.headers
18
- }, u = {
20
+ }, l = {
19
21
  baseURL: this.baseURL,
20
- method: a,
21
- url: n,
22
- params: a === "GET" ? s : c.params,
23
- headers: o
22
+ method: t,
23
+ url: a,
24
+ params: t === "GET" ? s : c.params,
25
+ headers: i
24
26
  };
25
- return ["POST", "PUT"].includes(a) && (u.data = c.string ? JSON.stringify(s) : s), $r(u).then((f) => f.data).catch((f) => Promise.reject(f));
27
+ return ["POST", "PUT"].includes(t) && (l.data = c.string ? JSON.stringify(s) : s), $r(l).then((f) => f.data).catch((f) => Promise.reject(f));
26
28
  };
27
29
  }
28
- }, Nr = {
29
- login: async (a, n) => {
30
+ };
31
+ function le(t) {
32
+ C.baseURL !== t.apiBaseURL && (C.baseURL = t.apiBaseURL), t.apiKey && (C.apiKey = t.apiKey);
33
+ }
34
+ const Kr = {
35
+ login: async (t, a) => {
30
36
  const s = {
31
- name: a,
32
- password: n
37
+ name: t,
38
+ password: a
33
39
  };
34
- return await y.getRequest("POST")("/account/login", s);
40
+ return await C.getRequest("POST")("/account/login", s);
35
41
  },
36
- list: async () => await y.getRequest("POST")("/account/list", {
42
+ list: async () => await C.getRequest("POST")("/account/list", {
37
43
  filter: {
38
44
  search: ""
39
45
  },
@@ -46,34 +52,57 @@ const y = {
46
52
  pagesize: 100
47
53
  }
48
54
  }),
49
- get: async () => await y.getRequest("GET")("/account/get", {}),
50
- update: async (a, n) => {
55
+ get: async () => await C.getRequest("GET")("/account/get", {}),
56
+ update: async (t, a) => {
51
57
  const s = {
52
- name: a,
53
- email: n
58
+ name: t,
59
+ email: a
54
60
  };
55
- return await y.getRequest("PUT")("/account/update", s);
61
+ return await C.getRequest("PUT")("/account/update", s);
56
62
  },
57
- changepassword: async (a, n) => {
63
+ changepassword: async (t, a) => {
58
64
  const s = {
59
- old_password: a,
60
- new_password: n
65
+ old_password: t,
66
+ new_password: a
61
67
  };
62
- return await y.getRequest("POST")("/account/changepassword", s);
68
+ return await C.getRequest("POST")("/account/changepassword", s);
63
69
  },
64
- create: async (a, n, s, c) => await y.getRequest("POST")("/account/create", {
65
- name: a,
66
- email: n,
70
+ create: async (t, a, s, c) => await C.getRequest("POST")("/account/create", {
71
+ name: t,
72
+ email: a,
67
73
  password: s,
68
74
  role_id: c
69
75
  }),
70
- edit: async (a) => (a.reset_password || (a.new_password = void 0), await y.getRequest("PUT")("/account/edit", a)),
71
- delete: async (a) => {
72
- if (!!a)
73
- return y.getRequest("POST")("/account/delete", { id: a });
76
+ edit: async (t) => (t.reset_password || (t.new_password = void 0), await C.getRequest("PUT")("/account/edit", t)),
77
+ delete: async (t) => {
78
+ if (!!t)
79
+ return C.getRequest("POST")("/account/delete", { id: t });
80
+ }
81
+ }, Vr = {
82
+ list: async () => await C.getRequest("POST")("/api/key/list", {
83
+ filter: {
84
+ search: ""
85
+ },
86
+ sort: {
87
+ field: "name",
88
+ order: "ASC"
89
+ },
90
+ pagination: {
91
+ page: 1,
92
+ pagesize: 100
93
+ }
94
+ }),
95
+ create: async (t, a, s) => await C.getRequest("POST")("/api/key/create", {
96
+ name: t,
97
+ role_id: a,
98
+ domain: s
99
+ }),
100
+ delete: async (t) => {
101
+ if (!!t)
102
+ return C.getRequest("POST")("/api/key/delete", { id: t });
74
103
  }
75
- }, Wr = {
76
- list: async () => await y.getRequest("POST")("/datasource/list", {
104
+ }, Yr = {
105
+ list: async () => await C.getRequest("POST")("/datasource/list", {
77
106
  filter: {},
78
107
  sort: {
79
108
  field: "create_time",
@@ -84,30 +113,31 @@ const y = {
84
113
  pagesize: 100
85
114
  }
86
115
  }),
87
- create: async (a, n, s) => {
116
+ create: async (t, a, s) => {
88
117
  try {
89
- return await y.getRequest("POST")("/datasource/create", { type: a, key: n, config: s });
118
+ return await C.getRequest("POST")("/datasource/create", { type: t, key: a, config: s });
90
119
  } catch (c) {
91
120
  return console.error(c), !1;
92
121
  }
93
122
  },
94
- delete: async (a) => {
95
- await y.getRequest("POST")("/datasource/delete", { id: a });
123
+ delete: async (t) => {
124
+ await C.getRequest("POST")("/datasource/delete", { id: t });
96
125
  }
97
- }, Mr = {
98
- list: async () => await y.getRequest("GET")("/role/list", {})
99
- }, D = {
100
- datasource: Wr,
101
- account: Nr,
102
- role: Mr
103
- }, se = {
126
+ }, Br = {
127
+ list: async () => await C.getRequest("GET")("/role/list", {})
128
+ }, x = {
129
+ datasource: Yr,
130
+ account: Kr,
131
+ role: Br,
132
+ api_key: Vr
133
+ }, ue = {
104
134
  size: "sm",
105
135
  spacing: "md",
106
136
  button: {
107
137
  size: "xs"
108
138
  }
109
139
  };
110
- var ce = { exports: {} }, X = {};
140
+ var de = { exports: {} }, Q = {};
111
141
  /**
112
142
  * @license React
113
143
  * react-jsx-runtime.production.min.js
@@ -117,25 +147,25 @@ var ce = { exports: {} }, X = {};
117
147
  * This source code is licensed under the MIT license found in the
118
148
  * LICENSE file in the root directory of this source tree.
119
149
  */
120
- var Ye;
121
- function Yr() {
122
- if (Ye)
123
- return X;
124
- Ye = 1;
125
- var a = Q, n = Symbol.for("react.element"), s = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, d = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
126
- function u(f, b, O) {
127
- var S, w = {}, g = null, x = null;
128
- O !== void 0 && (g = "" + O), b.key !== void 0 && (g = "" + b.key), b.ref !== void 0 && (x = b.ref);
129
- for (S in b)
130
- c.call(b, S) && !o.hasOwnProperty(S) && (w[S] = b[S]);
150
+ var Qe;
151
+ function Gr() {
152
+ if (Qe)
153
+ return Q;
154
+ Qe = 1;
155
+ var t = H, a = Symbol.for("react.element"), s = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
156
+ function l(f, v, R) {
157
+ var y, h = {}, d = null, O = null;
158
+ R !== void 0 && (d = "" + R), v.key !== void 0 && (d = "" + v.key), v.ref !== void 0 && (O = v.ref);
159
+ for (y in v)
160
+ c.call(v, y) && !i.hasOwnProperty(y) && (h[y] = v[y]);
131
161
  if (f && f.defaultProps)
132
- for (S in b = f.defaultProps, b)
133
- w[S] === void 0 && (w[S] = b[S]);
134
- return { $$typeof: n, type: f, key: g, ref: x, props: w, _owner: d.current };
162
+ for (y in v = f.defaultProps, v)
163
+ h[y] === void 0 && (h[y] = v[y]);
164
+ return { $$typeof: a, type: f, key: d, ref: O, props: h, _owner: u.current };
135
165
  }
136
- return X.Fragment = s, X.jsx = u, X.jsxs = u, X;
166
+ return Q.Fragment = s, Q.jsx = l, Q.jsxs = l, Q;
137
167
  }
138
- var K = {};
168
+ var Z = {};
139
169
  /**
140
170
  * @license React
141
171
  * react-jsx-runtime.development.js
@@ -145,53 +175,53 @@ var K = {};
145
175
  * This source code is licensed under the MIT license found in the
146
176
  * LICENSE file in the root directory of this source tree.
147
177
  */
148
- var Ve;
149
- function Vr() {
150
- return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
151
- var a = Q, n = Symbol.for("react.element"), s = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), f = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), W = Symbol.iterator, G = "@@iterator";
152
- function le(e) {
178
+ var Ze;
179
+ function Hr() {
180
+ return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
181
+ var t = H, a = Symbol.for("react.element"), s = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), f = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), N = Symbol.iterator, K = "@@iterator";
182
+ function pe(e) {
153
183
  if (e === null || typeof e != "object")
154
184
  return null;
155
- var t = W && e[W] || e[G];
156
- return typeof t == "function" ? t : null;
185
+ var n = N && e[N] || e[K];
186
+ return typeof n == "function" ? n : null;
157
187
  }
158
- var I = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
159
- function P(e) {
188
+ var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
189
+ function T(e) {
160
190
  {
161
- for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), l = 1; l < t; l++)
162
- i[l - 1] = arguments[l];
163
- er("error", e, i);
191
+ for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), p = 1; p < n; p++)
192
+ o[p - 1] = arguments[p];
193
+ ar("error", e, o);
164
194
  }
165
195
  }
166
- function er(e, t, i) {
196
+ function ar(e, n, o) {
167
197
  {
168
- var l = I.ReactDebugCurrentFrame, h = l.getStackAddendum();
169
- h !== "" && (t += "%s", i = i.concat([h]));
170
- var v = i.map(function(m) {
198
+ var p = U.ReactDebugCurrentFrame, b = p.getStackAddendum();
199
+ b !== "" && (n += "%s", o = o.concat([b]));
200
+ var S = o.map(function(m) {
171
201
  return String(m);
172
202
  });
173
- v.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, v);
203
+ S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
174
204
  }
175
205
  }
176
- var rr = !1, tr = !1, nr = !1, ar = !1, ir = !1, Re;
177
- Re = Symbol.for("react.module.reference");
178
- function or(e) {
179
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === o || ir || e === d || e === O || e === S || ar || e === x || rr || tr || nr || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === w || e.$$typeof === u || e.$$typeof === f || e.$$typeof === b || e.$$typeof === Re || e.getModuleId !== void 0));
206
+ var ir = !1, or = !1, sr = !1, cr = !1, lr = !1, ze;
207
+ ze = Symbol.for("react.module.reference");
208
+ function ur(e) {
209
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === i || lr || e === u || e === R || e === y || cr || e === O || ir || or || sr || typeof e == "object" && e !== null && (e.$$typeof === d || e.$$typeof === h || e.$$typeof === l || e.$$typeof === f || e.$$typeof === v || e.$$typeof === ze || e.getModuleId !== void 0));
180
210
  }
181
- function sr(e, t, i) {
182
- var l = e.displayName;
183
- if (l)
184
- return l;
185
- var h = t.displayName || t.name || "";
186
- return h !== "" ? i + "(" + h + ")" : i;
211
+ function dr(e, n, o) {
212
+ var p = e.displayName;
213
+ if (p)
214
+ return p;
215
+ var b = n.displayName || n.name || "";
216
+ return b !== "" ? o + "(" + b + ")" : o;
187
217
  }
188
- function Se(e) {
218
+ function Ae(e) {
189
219
  return e.displayName || "Context";
190
220
  }
191
- function j(e) {
221
+ function F(e) {
192
222
  if (e == null)
193
223
  return null;
194
- if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
224
+ if (typeof e.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
195
225
  return e.displayName || e.name || null;
196
226
  if (typeof e == "string")
197
227
  return e;
@@ -200,32 +230,32 @@ function Vr() {
200
230
  return "Fragment";
201
231
  case s:
202
232
  return "Portal";
203
- case o:
233
+ case i:
204
234
  return "Profiler";
205
- case d:
235
+ case u:
206
236
  return "StrictMode";
207
- case O:
237
+ case R:
208
238
  return "Suspense";
209
- case S:
239
+ case y:
210
240
  return "SuspenseList";
211
241
  }
212
242
  if (typeof e == "object")
213
243
  switch (e.$$typeof) {
214
244
  case f:
215
- var t = e;
216
- return Se(t) + ".Consumer";
217
- case u:
218
- var i = e;
219
- return Se(i._context) + ".Provider";
220
- case b:
221
- return sr(e, e.render, "ForwardRef");
222
- case w:
223
- var l = e.displayName || null;
224
- return l !== null ? l : j(e.type) || "Memo";
225
- case g: {
226
- var h = e, v = h._payload, m = h._init;
245
+ var n = e;
246
+ return Ae(n) + ".Consumer";
247
+ case l:
248
+ var o = e;
249
+ return Ae(o._context) + ".Provider";
250
+ case v:
251
+ return dr(e, e.render, "ForwardRef");
252
+ case h:
253
+ var p = e.displayName || null;
254
+ return p !== null ? p : F(e.type) || "Memo";
255
+ case d: {
256
+ var b = e, S = b._payload, m = b._init;
227
257
  try {
228
- return j(m(v));
258
+ return F(m(S));
229
259
  } catch {
230
260
  return null;
231
261
  }
@@ -233,18 +263,18 @@ function Vr() {
233
263
  }
234
264
  return null;
235
265
  }
236
- var $ = Object.assign, H = 0, _e, Ee, ye, Te, Pe, Ce, Oe;
237
- function ze() {
266
+ var V = Object.assign, J = 0, Oe, xe, De, ke, Ie, je, Fe;
267
+ function qe() {
238
268
  }
239
- ze.__reactDisabledLog = !0;
240
- function cr() {
269
+ qe.__reactDisabledLog = !0;
270
+ function fr() {
241
271
  {
242
- if (H === 0) {
243
- _e = console.log, Ee = console.info, ye = console.warn, Te = console.error, Pe = console.group, Ce = console.groupCollapsed, Oe = console.groupEnd;
272
+ if (J === 0) {
273
+ Oe = console.log, xe = console.info, De = console.warn, ke = console.error, Ie = console.group, je = console.groupCollapsed, Fe = console.groupEnd;
244
274
  var e = {
245
275
  configurable: !0,
246
276
  enumerable: !0,
247
- value: ze,
277
+ value: qe,
248
278
  writable: !0
249
279
  };
250
280
  Object.defineProperties(console, {
@@ -257,79 +287,79 @@ function Vr() {
257
287
  groupEnd: e
258
288
  });
259
289
  }
260
- H++;
290
+ J++;
261
291
  }
262
292
  }
263
- function lr() {
293
+ function pr() {
264
294
  {
265
- if (H--, H === 0) {
295
+ if (J--, J === 0) {
266
296
  var e = {
267
297
  configurable: !0,
268
298
  enumerable: !0,
269
299
  writable: !0
270
300
  };
271
301
  Object.defineProperties(console, {
272
- log: $({}, e, {
273
- value: _e
302
+ log: V({}, e, {
303
+ value: Oe
274
304
  }),
275
- info: $({}, e, {
276
- value: Ee
305
+ info: V({}, e, {
306
+ value: xe
277
307
  }),
278
- warn: $({}, e, {
279
- value: ye
308
+ warn: V({}, e, {
309
+ value: De
280
310
  }),
281
- error: $({}, e, {
282
- value: Te
311
+ error: V({}, e, {
312
+ value: ke
283
313
  }),
284
- group: $({}, e, {
285
- value: Pe
314
+ group: V({}, e, {
315
+ value: Ie
286
316
  }),
287
- groupCollapsed: $({}, e, {
288
- value: Ce
317
+ groupCollapsed: V({}, e, {
318
+ value: je
289
319
  }),
290
- groupEnd: $({}, e, {
291
- value: Oe
320
+ groupEnd: V({}, e, {
321
+ value: Fe
292
322
  })
293
323
  });
294
324
  }
295
- H < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
325
+ J < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
296
326
  }
297
327
  }
298
- var ue = I.ReactCurrentDispatcher, de;
299
- function Z(e, t, i) {
328
+ var ge = U.ReactCurrentDispatcher, me;
329
+ function re(e, n, o) {
300
330
  {
301
- if (de === void 0)
331
+ if (me === void 0)
302
332
  try {
303
333
  throw Error();
304
- } catch (h) {
305
- var l = h.stack.trim().match(/\n( *(at )?)/);
306
- de = l && l[1] || "";
334
+ } catch (b) {
335
+ var p = b.stack.trim().match(/\n( *(at )?)/);
336
+ me = p && p[1] || "";
307
337
  }
308
338
  return `
309
- ` + de + e;
339
+ ` + me + e;
310
340
  }
311
341
  }
312
- var fe = !1, ee;
342
+ var he = !1, te;
313
343
  {
314
- var ur = typeof WeakMap == "function" ? WeakMap : Map;
315
- ee = new ur();
344
+ var gr = typeof WeakMap == "function" ? WeakMap : Map;
345
+ te = new gr();
316
346
  }
317
- function xe(e, t) {
318
- if (!e || fe)
347
+ function Le(e, n) {
348
+ if (!e || he)
319
349
  return "";
320
350
  {
321
- var i = ee.get(e);
322
- if (i !== void 0)
323
- return i;
351
+ var o = te.get(e);
352
+ if (o !== void 0)
353
+ return o;
324
354
  }
325
- var l;
326
- fe = !0;
327
- var h = Error.prepareStackTrace;
355
+ var p;
356
+ he = !0;
357
+ var b = Error.prepareStackTrace;
328
358
  Error.prepareStackTrace = void 0;
329
- var v;
330
- v = ue.current, ue.current = null, cr();
359
+ var S;
360
+ S = ge.current, ge.current = null, fr();
331
361
  try {
332
- if (t) {
362
+ if (n) {
333
363
  var m = function() {
334
364
  throw Error();
335
365
  };
@@ -340,250 +370,250 @@ function Vr() {
340
370
  }), typeof Reflect == "object" && Reflect.construct) {
341
371
  try {
342
372
  Reflect.construct(m, []);
343
- } catch (k) {
344
- l = k;
373
+ } catch (q) {
374
+ p = q;
345
375
  }
346
376
  Reflect.construct(e, [], m);
347
377
  } else {
348
378
  try {
349
379
  m.call();
350
- } catch (k) {
351
- l = k;
380
+ } catch (q) {
381
+ p = q;
352
382
  }
353
383
  e.call(m.prototype);
354
384
  }
355
385
  } else {
356
386
  try {
357
387
  throw Error();
358
- } catch (k) {
359
- l = k;
388
+ } catch (q) {
389
+ p = q;
360
390
  }
361
391
  e();
362
392
  }
363
- } catch (k) {
364
- if (k && l && typeof k.stack == "string") {
365
- for (var p = k.stack.split(`
366
- `), C = l.stack.split(`
367
- `), R = p.length - 1, _ = C.length - 1; R >= 1 && _ >= 0 && p[R] !== C[_]; )
368
- _--;
369
- for (; R >= 1 && _ >= 0; R--, _--)
370
- if (p[R] !== C[_]) {
371
- if (R !== 1 || _ !== 1)
393
+ } catch (q) {
394
+ if (q && p && typeof q.stack == "string") {
395
+ for (var g = q.stack.split(`
396
+ `), z = p.stack.split(`
397
+ `), _ = g.length - 1, E = z.length - 1; _ >= 1 && E >= 0 && g[_] !== z[E]; )
398
+ E--;
399
+ for (; _ >= 1 && E >= 0; _--, E--)
400
+ if (g[_] !== z[E]) {
401
+ if (_ !== 1 || E !== 1)
372
402
  do
373
- if (R--, _--, _ < 0 || p[R] !== C[_]) {
374
- var z = `
375
- ` + p[R].replace(" at new ", " at ");
376
- return e.displayName && z.includes("<anonymous>") && (z = z.replace("<anonymous>", e.displayName)), typeof e == "function" && ee.set(e, z), z;
403
+ if (_--, E--, E < 0 || g[_] !== z[E]) {
404
+ var k = `
405
+ ` + g[_].replace(" at new ", " at ");
406
+ return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, k), k;
377
407
  }
378
- while (R >= 1 && _ >= 0);
408
+ while (_ >= 1 && E >= 0);
379
409
  break;
380
410
  }
381
411
  }
382
412
  } finally {
383
- fe = !1, ue.current = v, lr(), Error.prepareStackTrace = h;
413
+ he = !1, ge.current = S, pr(), Error.prepareStackTrace = b;
384
414
  }
385
- var Y = e ? e.displayName || e.name : "", Me = Y ? Z(Y) : "";
386
- return typeof e == "function" && ee.set(e, Me), Me;
415
+ var B = e ? e.displayName || e.name : "", Xe = B ? re(B) : "";
416
+ return typeof e == "function" && te.set(e, Xe), Xe;
387
417
  }
388
- function dr(e, t, i) {
389
- return xe(e, !1);
418
+ function mr(e, n, o) {
419
+ return Le(e, !1);
390
420
  }
391
- function fr(e) {
392
- var t = e.prototype;
393
- return !!(t && t.isReactComponent);
421
+ function hr(e) {
422
+ var n = e.prototype;
423
+ return !!(n && n.isReactComponent);
394
424
  }
395
- function re(e, t, i) {
425
+ function ne(e, n, o) {
396
426
  if (e == null)
397
427
  return "";
398
428
  if (typeof e == "function")
399
- return xe(e, fr(e));
429
+ return Le(e, hr(e));
400
430
  if (typeof e == "string")
401
- return Z(e);
431
+ return re(e);
402
432
  switch (e) {
403
- case O:
404
- return Z("Suspense");
405
- case S:
406
- return Z("SuspenseList");
433
+ case R:
434
+ return re("Suspense");
435
+ case y:
436
+ return re("SuspenseList");
407
437
  }
408
438
  if (typeof e == "object")
409
439
  switch (e.$$typeof) {
410
- case b:
411
- return dr(e.render);
412
- case w:
413
- return re(e.type, t, i);
414
- case g: {
415
- var l = e, h = l._payload, v = l._init;
440
+ case v:
441
+ return mr(e.render);
442
+ case h:
443
+ return ne(e.type, n, o);
444
+ case d: {
445
+ var p = e, b = p._payload, S = p._init;
416
446
  try {
417
- return re(v(h), t, i);
447
+ return ne(S(b), n, o);
418
448
  } catch {
419
449
  }
420
450
  }
421
451
  }
422
452
  return "";
423
453
  }
424
- var te = Object.prototype.hasOwnProperty, Ae = {}, De = I.ReactDebugCurrentFrame;
425
- function ne(e) {
454
+ var ae = Object.prototype.hasOwnProperty, Ne = {}, Ue = U.ReactDebugCurrentFrame;
455
+ function ie(e) {
426
456
  if (e) {
427
- var t = e._owner, i = re(e.type, e._source, t ? t.type : null);
428
- De.setExtraStackFrame(i);
457
+ var n = e._owner, o = ne(e.type, e._source, n ? n.type : null);
458
+ Ue.setExtraStackFrame(o);
429
459
  } else
430
- De.setExtraStackFrame(null);
460
+ Ue.setExtraStackFrame(null);
431
461
  }
432
- function pr(e, t, i, l, h) {
462
+ function vr(e, n, o, p, b) {
433
463
  {
434
- var v = Function.call.bind(te);
464
+ var S = Function.call.bind(ae);
435
465
  for (var m in e)
436
- if (v(e, m)) {
437
- var p = void 0;
466
+ if (S(e, m)) {
467
+ var g = void 0;
438
468
  try {
439
469
  if (typeof e[m] != "function") {
440
- var C = Error((l || "React class") + ": " + i + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
441
- throw C.name = "Invariant Violation", C;
470
+ var z = Error((p || "React class") + ": " + o + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
471
+ throw z.name = "Invariant Violation", z;
442
472
  }
443
- p = e[m](t, m, l, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
444
- } catch (R) {
445
- p = R;
473
+ g = e[m](n, m, p, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
474
+ } catch (_) {
475
+ g = _;
446
476
  }
447
- p && !(p instanceof Error) && (ne(h), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", i, m, typeof p), ne(null)), p instanceof Error && !(p.message in Ae) && (Ae[p.message] = !0, ne(h), P("Failed %s type: %s", i, p.message), ne(null));
477
+ g && !(g instanceof Error) && (ie(b), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", o, m, typeof g), ie(null)), g instanceof Error && !(g.message in Ne) && (Ne[g.message] = !0, ie(b), T("Failed %s type: %s", o, g.message), ie(null));
448
478
  }
449
479
  }
450
480
  }
451
- var gr = Array.isArray;
452
- function pe(e) {
453
- return gr(e);
481
+ var br = Array.isArray;
482
+ function ve(e) {
483
+ return br(e);
454
484
  }
455
- function mr(e) {
485
+ function wr(e) {
456
486
  {
457
- var t = typeof Symbol == "function" && Symbol.toStringTag, i = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
458
- return i;
487
+ var n = typeof Symbol == "function" && Symbol.toStringTag, o = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
488
+ return o;
459
489
  }
460
490
  }
461
- function hr(e) {
491
+ function Sr(e) {
462
492
  try {
463
- return je(e), !1;
493
+ return Me(e), !1;
464
494
  } catch {
465
495
  return !0;
466
496
  }
467
497
  }
468
- function je(e) {
498
+ function Me(e) {
469
499
  return "" + e;
470
500
  }
471
- function ke(e) {
472
- if (hr(e))
473
- return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mr(e)), je(e);
501
+ function $e(e) {
502
+ if (Sr(e))
503
+ return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), Me(e);
474
504
  }
475
- var J = I.ReactCurrentOwner, vr = {
505
+ var X = U.ReactCurrentOwner, Rr = {
476
506
  key: !0,
477
507
  ref: !0,
478
508
  __self: !0,
479
509
  __source: !0
480
- }, Fe, Le, ge;
481
- ge = {};
482
- function br(e) {
483
- if (te.call(e, "ref")) {
484
- var t = Object.getOwnPropertyDescriptor(e, "ref").get;
485
- if (t && t.isReactWarning)
510
+ }, We, Ke, be;
511
+ be = {};
512
+ function yr(e) {
513
+ if (ae.call(e, "ref")) {
514
+ var n = Object.getOwnPropertyDescriptor(e, "ref").get;
515
+ if (n && n.isReactWarning)
486
516
  return !1;
487
517
  }
488
518
  return e.ref !== void 0;
489
519
  }
490
- function wr(e) {
491
- if (te.call(e, "key")) {
492
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
493
- if (t && t.isReactWarning)
520
+ function _r(e) {
521
+ if (ae.call(e, "key")) {
522
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
523
+ if (n && n.isReactWarning)
494
524
  return !1;
495
525
  }
496
526
  return e.key !== void 0;
497
527
  }
498
- function Rr(e, t) {
499
- if (typeof e.ref == "string" && J.current && t && J.current.stateNode !== t) {
500
- var i = j(J.current.type);
501
- ge[i] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(J.current.type), e.ref), ge[i] = !0);
528
+ function Pr(e, n) {
529
+ if (typeof e.ref == "string" && X.current && n && X.current.stateNode !== n) {
530
+ var o = F(X.current.type);
531
+ be[o] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(X.current.type), e.ref), be[o] = !0);
502
532
  }
503
533
  }
504
- function Sr(e, t) {
534
+ function Er(e, n) {
505
535
  {
506
- var i = function() {
507
- Fe || (Fe = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
536
+ var o = function() {
537
+ We || (We = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
508
538
  };
509
- i.isReactWarning = !0, Object.defineProperty(e, "key", {
510
- get: i,
539
+ o.isReactWarning = !0, Object.defineProperty(e, "key", {
540
+ get: o,
511
541
  configurable: !0
512
542
  });
513
543
  }
514
544
  }
515
- function _r(e, t) {
545
+ function Cr(e, n) {
516
546
  {
517
- var i = function() {
518
- Le || (Le = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
547
+ var o = function() {
548
+ Ke || (Ke = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
519
549
  };
520
- i.isReactWarning = !0, Object.defineProperty(e, "ref", {
521
- get: i,
550
+ o.isReactWarning = !0, Object.defineProperty(e, "ref", {
551
+ get: o,
522
552
  configurable: !0
523
553
  });
524
554
  }
525
555
  }
526
- var Er = function(e, t, i, l, h, v, m) {
527
- var p = {
528
- $$typeof: n,
556
+ var Tr = function(e, n, o, p, b, S, m) {
557
+ var g = {
558
+ $$typeof: a,
529
559
  type: e,
530
- key: t,
531
- ref: i,
560
+ key: n,
561
+ ref: o,
532
562
  props: m,
533
- _owner: v
563
+ _owner: S
534
564
  };
535
- return p._store = {}, Object.defineProperty(p._store, "validated", {
565
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
536
566
  configurable: !1,
537
567
  enumerable: !1,
538
568
  writable: !0,
539
569
  value: !1
540
- }), Object.defineProperty(p, "_self", {
570
+ }), Object.defineProperty(g, "_self", {
541
571
  configurable: !1,
542
572
  enumerable: !1,
543
573
  writable: !1,
544
- value: l
545
- }), Object.defineProperty(p, "_source", {
574
+ value: p
575
+ }), Object.defineProperty(g, "_source", {
546
576
  configurable: !1,
547
577
  enumerable: !1,
548
578
  writable: !1,
549
- value: h
550
- }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
579
+ value: b
580
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
551
581
  };
552
- function yr(e, t, i, l, h) {
582
+ function zr(e, n, o, p, b) {
553
583
  {
554
- var v, m = {}, p = null, C = null;
555
- i !== void 0 && (ke(i), p = "" + i), wr(t) && (ke(t.key), p = "" + t.key), br(t) && (C = t.ref, Rr(t, h));
556
- for (v in t)
557
- te.call(t, v) && !vr.hasOwnProperty(v) && (m[v] = t[v]);
584
+ var S, m = {}, g = null, z = null;
585
+ o !== void 0 && ($e(o), g = "" + o), _r(n) && ($e(n.key), g = "" + n.key), yr(n) && (z = n.ref, Pr(n, b));
586
+ for (S in n)
587
+ ae.call(n, S) && !Rr.hasOwnProperty(S) && (m[S] = n[S]);
558
588
  if (e && e.defaultProps) {
559
- var R = e.defaultProps;
560
- for (v in R)
561
- m[v] === void 0 && (m[v] = R[v]);
589
+ var _ = e.defaultProps;
590
+ for (S in _)
591
+ m[S] === void 0 && (m[S] = _[S]);
562
592
  }
563
- if (p || C) {
564
- var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
565
- p && Sr(m, _), C && _r(m, _);
593
+ if (g || z) {
594
+ var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
595
+ g && Er(m, E), z && Cr(m, E);
566
596
  }
567
- return Er(e, p, C, h, l, J.current, m);
597
+ return Tr(e, g, z, b, p, X.current, m);
568
598
  }
569
599
  }
570
- var me = I.ReactCurrentOwner, qe = I.ReactDebugCurrentFrame;
571
- function M(e) {
600
+ var we = U.ReactCurrentOwner, Ve = U.ReactDebugCurrentFrame;
601
+ function Y(e) {
572
602
  if (e) {
573
- var t = e._owner, i = re(e.type, e._source, t ? t.type : null);
574
- qe.setExtraStackFrame(i);
603
+ var n = e._owner, o = ne(e.type, e._source, n ? n.type : null);
604
+ Ve.setExtraStackFrame(o);
575
605
  } else
576
- qe.setExtraStackFrame(null);
606
+ Ve.setExtraStackFrame(null);
577
607
  }
578
- var he;
579
- he = !1;
580
- function ve(e) {
581
- return typeof e == "object" && e !== null && e.$$typeof === n;
608
+ var Se;
609
+ Se = !1;
610
+ function Re(e) {
611
+ return typeof e == "object" && e !== null && e.$$typeof === a;
582
612
  }
583
- function Ie() {
613
+ function Ye() {
584
614
  {
585
- if (me.current) {
586
- var e = j(me.current.type);
615
+ if (we.current) {
616
+ var e = F(we.current.type);
587
617
  if (e)
588
618
  return `
589
619
 
@@ -592,149 +622,149 @@ Check the render method of \`` + e + "`.";
592
622
  return "";
593
623
  }
594
624
  }
595
- function Tr(e) {
625
+ function Ar(e) {
596
626
  {
597
627
  if (e !== void 0) {
598
- var t = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
628
+ var n = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
599
629
  return `
600
630
 
601
- Check your code at ` + t + ":" + i + ".";
631
+ Check your code at ` + n + ":" + o + ".";
602
632
  }
603
633
  return "";
604
634
  }
605
635
  }
606
- var Ue = {};
607
- function Pr(e) {
636
+ var Be = {};
637
+ function Or(e) {
608
638
  {
609
- var t = Ie();
610
- if (!t) {
611
- var i = typeof e == "string" ? e : e.displayName || e.name;
612
- i && (t = `
639
+ var n = Ye();
640
+ if (!n) {
641
+ var o = typeof e == "string" ? e : e.displayName || e.name;
642
+ o && (n = `
613
643
 
614
- Check the top-level render call using <` + i + ">.");
644
+ Check the top-level render call using <` + o + ">.");
615
645
  }
616
- return t;
646
+ return n;
617
647
  }
618
648
  }
619
- function $e(e, t) {
649
+ function Ge(e, n) {
620
650
  {
621
651
  if (!e._store || e._store.validated || e.key != null)
622
652
  return;
623
653
  e._store.validated = !0;
624
- var i = Pr(t);
625
- if (Ue[i])
654
+ var o = Or(n);
655
+ if (Be[o])
626
656
  return;
627
- Ue[i] = !0;
628
- var l = "";
629
- e && e._owner && e._owner !== me.current && (l = " It was passed a child from " + j(e._owner.type) + "."), M(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, l), M(null);
657
+ Be[o] = !0;
658
+ var p = "";
659
+ e && e._owner && e._owner !== we.current && (p = " It was passed a child from " + F(e._owner.type) + "."), Y(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, p), Y(null);
630
660
  }
631
661
  }
632
- function Ne(e, t) {
662
+ function He(e, n) {
633
663
  {
634
664
  if (typeof e != "object")
635
665
  return;
636
- if (pe(e))
637
- for (var i = 0; i < e.length; i++) {
638
- var l = e[i];
639
- ve(l) && $e(l, t);
666
+ if (ve(e))
667
+ for (var o = 0; o < e.length; o++) {
668
+ var p = e[o];
669
+ Re(p) && Ge(p, n);
640
670
  }
641
- else if (ve(e))
671
+ else if (Re(e))
642
672
  e._store && (e._store.validated = !0);
643
673
  else if (e) {
644
- var h = le(e);
645
- if (typeof h == "function" && h !== e.entries)
646
- for (var v = h.call(e), m; !(m = v.next()).done; )
647
- ve(m.value) && $e(m.value, t);
674
+ var b = pe(e);
675
+ if (typeof b == "function" && b !== e.entries)
676
+ for (var S = b.call(e), m; !(m = S.next()).done; )
677
+ Re(m.value) && Ge(m.value, n);
648
678
  }
649
679
  }
650
680
  }
651
- function Cr(e) {
681
+ function xr(e) {
652
682
  {
653
- var t = e.type;
654
- if (t == null || typeof t == "string")
683
+ var n = e.type;
684
+ if (n == null || typeof n == "string")
655
685
  return;
656
- var i;
657
- if (typeof t == "function")
658
- i = t.propTypes;
659
- else if (typeof t == "object" && (t.$$typeof === b || t.$$typeof === w))
660
- i = t.propTypes;
686
+ var o;
687
+ if (typeof n == "function")
688
+ o = n.propTypes;
689
+ else if (typeof n == "object" && (n.$$typeof === v || n.$$typeof === h))
690
+ o = n.propTypes;
661
691
  else
662
692
  return;
663
- if (i) {
664
- var l = j(t);
665
- pr(i, e.props, "prop", l, e);
666
- } else if (t.PropTypes !== void 0 && !he) {
667
- he = !0;
668
- var h = j(t);
669
- P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
693
+ if (o) {
694
+ var p = F(n);
695
+ vr(o, e.props, "prop", p, e);
696
+ } else if (n.PropTypes !== void 0 && !Se) {
697
+ Se = !0;
698
+ var b = F(n);
699
+ T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
670
700
  }
671
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
701
+ typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
672
702
  }
673
703
  }
674
- function Or(e) {
704
+ function Dr(e) {
675
705
  {
676
- for (var t = Object.keys(e.props), i = 0; i < t.length; i++) {
677
- var l = t[i];
678
- if (l !== "children" && l !== "key") {
679
- M(e), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), M(null);
706
+ for (var n = Object.keys(e.props), o = 0; o < n.length; o++) {
707
+ var p = n[o];
708
+ if (p !== "children" && p !== "key") {
709
+ Y(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), Y(null);
680
710
  break;
681
711
  }
682
712
  }
683
- e.ref !== null && (M(e), P("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
713
+ e.ref !== null && (Y(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
684
714
  }
685
715
  }
686
- function We(e, t, i, l, h, v) {
716
+ function Je(e, n, o, p, b, S) {
687
717
  {
688
- var m = or(e);
718
+ var m = ur(e);
689
719
  if (!m) {
690
- var p = "";
691
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (p += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
692
- var C = Tr(h);
693
- C ? p += C : p += Ie();
694
- var R;
695
- e === null ? R = "null" : pe(e) ? R = "array" : e !== void 0 && e.$$typeof === n ? (R = "<" + (j(e.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, p);
720
+ var g = "";
721
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
722
+ var z = Ar(b);
723
+ z ? g += z : g += Ye();
724
+ var _;
725
+ e === null ? _ = "null" : ve(e) ? _ = "array" : e !== void 0 && e.$$typeof === a ? (_ = "<" + (F(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, g);
696
726
  }
697
- var _ = yr(e, t, i, h, v);
698
- if (_ == null)
699
- return _;
727
+ var E = zr(e, n, o, b, S);
728
+ if (E == null)
729
+ return E;
700
730
  if (m) {
701
- var z = t.children;
702
- if (z !== void 0)
703
- if (l)
704
- if (pe(z)) {
705
- for (var Y = 0; Y < z.length; Y++)
706
- Ne(z[Y], e);
707
- Object.freeze && Object.freeze(z);
731
+ var k = n.children;
732
+ if (k !== void 0)
733
+ if (p)
734
+ if (ve(k)) {
735
+ for (var B = 0; B < k.length; B++)
736
+ He(k[B], e);
737
+ Object.freeze && Object.freeze(k);
708
738
  } else
709
- P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
739
+ T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
710
740
  else
711
- Ne(z, e);
741
+ He(k, e);
712
742
  }
713
- return e === c ? Or(_) : Cr(_), _;
743
+ return e === c ? Dr(E) : xr(E), E;
714
744
  }
715
745
  }
716
- function zr(e, t, i) {
717
- return We(e, t, i, !0);
746
+ function kr(e, n, o) {
747
+ return Je(e, n, o, !0);
718
748
  }
719
- function xr(e, t, i) {
720
- return We(e, t, i, !1);
749
+ function Ir(e, n, o) {
750
+ return Je(e, n, o, !1);
721
751
  }
722
- var Ar = xr, Dr = zr;
723
- K.Fragment = c, K.jsx = Ar, K.jsxs = Dr;
724
- }()), K;
752
+ var jr = Ir, Fr = kr;
753
+ Z.Fragment = c, Z.jsx = jr, Z.jsxs = Fr;
754
+ }()), Z;
725
755
  }
726
- (function(a) {
727
- process.env.NODE_ENV === "production" ? a.exports = Yr() : a.exports = Vr();
728
- })(ce);
729
- const B = ce.exports.Fragment, r = ce.exports.jsx, E = ce.exports.jsxs;
730
- function Br({
731
- postSubmit: a,
732
- styles: n = se
756
+ (function(t) {
757
+ process.env.NODE_ENV === "production" ? t.exports = Gr() : t.exports = Hr();
758
+ })(de);
759
+ const $ = de.exports.Fragment, r = de.exports.jsx, w = de.exports.jsxs;
760
+ function Jr({
761
+ postSubmit: t,
762
+ styles: a = ue
733
763
  }) {
734
764
  const {
735
765
  control: s,
736
766
  handleSubmit: c
737
- } = oe({
767
+ } = ee({
738
768
  defaultValues: {
739
769
  type: "postgresql",
740
770
  key: "",
@@ -747,20 +777,20 @@ function Br({
747
777
  }
748
778
  }
749
779
  });
750
- return /* @__PURE__ */ r(N, {
780
+ return /* @__PURE__ */ r(L, {
751
781
  mx: "auto",
752
- children: /* @__PURE__ */ E("form", {
782
+ children: /* @__PURE__ */ w("form", {
753
783
  onSubmit: c(async ({
754
- type: o,
755
- key: u,
784
+ type: i,
785
+ key: l,
756
786
  config: f
757
787
  }) => {
758
- if (V({
788
+ if (M({
759
789
  id: "for-creating",
760
790
  title: "Pending",
761
791
  message: "Adding data source...",
762
792
  loading: !0
763
- }), !await D.datasource.create(o, u, f)) {
793
+ }), !await x.datasource.create(i, l, f)) {
764
794
  A({
765
795
  id: "for-creating",
766
796
  title: "Failed",
@@ -774,17 +804,17 @@ function Br({
774
804
  title: "Successful",
775
805
  message: "Data source is added",
776
806
  color: "green"
777
- }), a();
807
+ }), t();
778
808
  }),
779
- children: [/* @__PURE__ */ r(T, {
809
+ children: [/* @__PURE__ */ r(P, {
780
810
  name: "type",
781
811
  control: s,
782
812
  render: ({
783
- field: o
784
- }) => /* @__PURE__ */ r(jr, {
813
+ field: i
814
+ }) => /* @__PURE__ */ r(qr, {
785
815
  fullWidth: !0,
786
- mb: n.spacing,
787
- size: n.size,
816
+ mb: a.spacing,
817
+ size: a.size,
788
818
  data: [{
789
819
  label: "PostgreSQL",
790
820
  value: "postgresql"
@@ -796,113 +826,113 @@ function Br({
796
826
  value: "http",
797
827
  disabled: !0
798
828
  }],
799
- ...o
829
+ ...i
800
830
  })
801
- }), /* @__PURE__ */ r(T, {
831
+ }), /* @__PURE__ */ r(P, {
802
832
  name: "key",
803
833
  control: s,
804
834
  render: ({
805
- field: o
806
- }) => /* @__PURE__ */ r(F, {
807
- mb: n.spacing,
808
- size: n.size,
835
+ field: i
836
+ }) => /* @__PURE__ */ r(I, {
837
+ mb: a.spacing,
838
+ size: a.size,
809
839
  required: !0,
810
840
  label: "Name",
811
841
  placeholder: "A unique name",
812
- ...o
842
+ ...i
813
843
  })
814
- }), /* @__PURE__ */ r(Be, {
844
+ }), /* @__PURE__ */ r(er, {
815
845
  label: "Connection Info",
816
846
  labelPosition: "center"
817
- }), /* @__PURE__ */ E(L, {
847
+ }), /* @__PURE__ */ w(j, {
818
848
  grow: !0,
819
- children: [/* @__PURE__ */ r(T, {
849
+ children: [/* @__PURE__ */ r(P, {
820
850
  name: "config.host",
821
851
  control: s,
822
852
  render: ({
823
- field: o
824
- }) => /* @__PURE__ */ r(F, {
825
- mb: n.spacing,
826
- size: n.size,
853
+ field: i
854
+ }) => /* @__PURE__ */ r(I, {
855
+ mb: a.spacing,
856
+ size: a.size,
827
857
  required: !0,
828
858
  label: "Host",
829
859
  sx: {
830
860
  flexGrow: 1
831
861
  },
832
- ...o
862
+ ...i
833
863
  })
834
- }), /* @__PURE__ */ r(T, {
864
+ }), /* @__PURE__ */ r(P, {
835
865
  name: "config.port",
836
866
  control: s,
837
867
  render: ({
838
- field: o
839
- }) => /* @__PURE__ */ r(kr, {
840
- mb: n.spacing,
841
- size: n.size,
868
+ field: i
869
+ }) => /* @__PURE__ */ r(Lr, {
870
+ mb: a.spacing,
871
+ size: a.size,
842
872
  required: !0,
843
873
  label: "Port",
844
874
  hideControls: !0,
845
875
  sx: {
846
876
  width: "8em"
847
877
  },
848
- ...o
878
+ ...i
849
879
  })
850
880
  })]
851
- }), /* @__PURE__ */ r(T, {
881
+ }), /* @__PURE__ */ r(P, {
852
882
  name: "config.username",
853
883
  control: s,
854
884
  render: ({
855
- field: o
856
- }) => /* @__PURE__ */ r(F, {
857
- mb: n.spacing,
858
- size: n.size,
885
+ field: i
886
+ }) => /* @__PURE__ */ r(I, {
887
+ mb: a.spacing,
888
+ size: a.size,
859
889
  required: !0,
860
890
  label: "Username",
861
- ...o
891
+ ...i
862
892
  })
863
- }), /* @__PURE__ */ r(T, {
893
+ }), /* @__PURE__ */ r(P, {
864
894
  name: "config.password",
865
895
  control: s,
866
896
  render: ({
867
- field: o
868
- }) => /* @__PURE__ */ r(ie, {
869
- mb: n.spacing,
870
- size: n.size,
897
+ field: i
898
+ }) => /* @__PURE__ */ r(se, {
899
+ mb: a.spacing,
900
+ size: a.size,
871
901
  required: !0,
872
902
  label: "Password",
873
- ...o
903
+ ...i
874
904
  })
875
- }), /* @__PURE__ */ r(T, {
905
+ }), /* @__PURE__ */ r(P, {
876
906
  name: "config.database",
877
907
  control: s,
878
908
  render: ({
879
- field: o
880
- }) => /* @__PURE__ */ r(F, {
881
- mb: n.spacing,
882
- size: n.size,
909
+ field: i
910
+ }) => /* @__PURE__ */ r(I, {
911
+ mb: a.spacing,
912
+ size: a.size,
883
913
  required: !0,
884
914
  label: "Database",
885
- ...o
915
+ ...i
886
916
  })
887
- }), /* @__PURE__ */ r(L, {
917
+ }), /* @__PURE__ */ r(j, {
888
918
  position: "right",
889
- mt: n.spacing,
890
- children: /* @__PURE__ */ r(q, {
919
+ mt: a.spacing,
920
+ children: /* @__PURE__ */ r(D, {
891
921
  type: "submit",
892
- size: n.button.size,
922
+ size: a.button.size,
893
923
  children: "Save"
894
924
  })
895
925
  })]
896
926
  })
897
927
  });
898
928
  }
899
- function Gr({
900
- onSuccess: a,
901
- styles: n = se
929
+ function Xr({
930
+ onSuccess: t,
931
+ styles: a = ue
902
932
  }) {
903
- const [s, c] = Q.useState(!1), d = () => c(!0), o = () => c(!1);
904
- return /* @__PURE__ */ E(B, {
905
- children: [/* @__PURE__ */ r(we, {
933
+ const [s, c] = H.useState(!1), u = () => c(!0), i = () => c(!1);
934
+ return /* @__PURE__ */ w($, {
935
+ children: [/* @__PURE__ */ r(oe, {
906
936
  overflow: "inside",
907
937
  opened: s,
908
938
  onClose: () => c(!1),
@@ -911,43 +941,43 @@ function Gr({
911
941
  onDragStart: (f) => {
912
942
  f.stopPropagation();
913
943
  },
914
- children: /* @__PURE__ */ r(Br, {
944
+ children: /* @__PURE__ */ r(Jr, {
915
945
  postSubmit: () => {
916
- a(), o();
946
+ t(), i();
917
947
  },
918
- styles: n
948
+ styles: a
919
949
  })
920
- }), /* @__PURE__ */ r(q, {
921
- size: n.button.size,
922
- onClick: d,
923
- leftIcon: /* @__PURE__ */ r(Xe, {
950
+ }), /* @__PURE__ */ r(D, {
951
+ size: a.button.size,
952
+ onClick: u,
953
+ leftIcon: /* @__PURE__ */ r(Ee, {
924
954
  size: 20
925
955
  }),
926
956
  children: "Add a Data Source"
927
957
  })]
928
958
  });
929
959
  }
930
- function Hr({
931
- id: a,
932
- name: n,
960
+ function Qr({
961
+ id: t,
962
+ name: a,
933
963
  onSuccess: s,
934
- styles: c = se
964
+ styles: c = ue
935
965
  }) {
936
- const d = Qe(), o = async () => {
937
- !a || (V({
966
+ const u = ce(), i = async () => {
967
+ !t || (M({
938
968
  id: "for-deleting",
939
969
  title: "Pending",
940
970
  message: "Deleting data source...",
941
971
  loading: !0
942
- }), await D.datasource.delete(a), A({
972
+ }), await x.datasource.delete(t), A({
943
973
  id: "for-deleting",
944
974
  title: "Successful",
945
- message: `Data source [${n}] is deleted`,
975
+ message: `Data source [${a}] is deleted`,
946
976
  color: "green"
947
977
  }), s());
948
- }, u = () => d.openConfirmModal({
978
+ }, l = () => u.openConfirmModal({
949
979
  title: "Delete this data source?",
950
- children: /* @__PURE__ */ r(be, {
980
+ children: /* @__PURE__ */ r(ye, {
951
981
  size: c.size,
952
982
  children: "This action won't affect your database."
953
983
  }),
@@ -956,55 +986,56 @@ function Hr({
956
986
  cancel: "Cancel"
957
987
  },
958
988
  onCancel: () => console.log("Cancel"),
959
- onConfirm: o
989
+ onConfirm: i
960
990
  });
961
- return /* @__PURE__ */ r(q, {
991
+ return /* @__PURE__ */ r(D, {
962
992
  size: c.button.size,
963
993
  color: "red",
964
- onClick: u,
965
- leftIcon: /* @__PURE__ */ r(Ke, {
994
+ onClick: l,
995
+ leftIcon: /* @__PURE__ */ r(Ce, {
966
996
  size: 20
967
997
  }),
968
998
  children: "Delete"
969
999
  });
970
1000
  }
971
- function ut({
972
- styles: a = se,
973
- config: n
1001
+ function vt({
1002
+ styles: t = ue,
1003
+ config: a
974
1004
  }) {
1005
+ le(a);
975
1006
  const {
976
1007
  data: s = [],
977
1008
  loading: c,
978
- refresh: d
979
- } = ae(async () => {
1009
+ refresh: u
1010
+ } = G(async () => {
980
1011
  const {
981
- data: o
982
- } = await D.datasource.list();
983
- return o;
1012
+ data: i
1013
+ } = await x.datasource.list();
1014
+ return i;
984
1015
  }, {
985
1016
  refreshDeps: []
986
1017
  });
987
- return y.baseURL !== n.apiBaseURL && (y.baseURL = n.apiBaseURL), /* @__PURE__ */ E(B, {
988
- children: [/* @__PURE__ */ r(L, {
989
- pt: a.spacing,
1018
+ return /* @__PURE__ */ w($, {
1019
+ children: [/* @__PURE__ */ r(j, {
1020
+ pt: t.spacing,
990
1021
  position: "right",
991
- children: /* @__PURE__ */ r(Gr, {
992
- onSuccess: d
1022
+ children: /* @__PURE__ */ r(Xr, {
1023
+ onSuccess: u
993
1024
  })
994
- }), /* @__PURE__ */ E(N, {
995
- mt: a.spacing,
1025
+ }), /* @__PURE__ */ w(L, {
1026
+ mt: t.spacing,
996
1027
  sx: {
997
1028
  position: "relative"
998
1029
  },
999
- children: [/* @__PURE__ */ r(Ge, {
1030
+ children: [/* @__PURE__ */ r(_e, {
1000
1031
  visible: c
1001
- }), /* @__PURE__ */ E(He, {
1002
- horizontalSpacing: a.spacing,
1003
- verticalSpacing: a.spacing,
1004
- fontSize: a.size,
1032
+ }), /* @__PURE__ */ w(Pe, {
1033
+ horizontalSpacing: t.spacing,
1034
+ verticalSpacing: t.spacing,
1035
+ fontSize: t.size,
1005
1036
  highlightOnHover: !0,
1006
1037
  children: [/* @__PURE__ */ r("thead", {
1007
- children: /* @__PURE__ */ E("tr", {
1038
+ children: /* @__PURE__ */ w("tr", {
1008
1039
  children: [/* @__PURE__ */ r("th", {
1009
1040
  children: "Type"
1010
1041
  }), /* @__PURE__ */ r("th", {
@@ -1015,59 +1046,59 @@ function ut({
1015
1046
  })
1016
1047
  }), /* @__PURE__ */ r("tbody", {
1017
1048
  children: s.map(({
1018
- id: o,
1019
- key: u,
1049
+ id: i,
1050
+ key: l,
1020
1051
  type: f
1021
- }) => /* @__PURE__ */ E("tr", {
1052
+ }) => /* @__PURE__ */ w("tr", {
1022
1053
  children: [/* @__PURE__ */ r("td", {
1023
1054
  width: 200,
1024
1055
  children: f
1025
1056
  }), /* @__PURE__ */ r("td", {
1026
- children: u
1057
+ children: l
1027
1058
  }), /* @__PURE__ */ r("td", {
1028
1059
  width: 200,
1029
- children: /* @__PURE__ */ r(L, {
1060
+ children: /* @__PURE__ */ r(j, {
1030
1061
  position: "left",
1031
- children: /* @__PURE__ */ r(Hr, {
1032
- id: o,
1033
- name: u,
1034
- onSuccess: d
1062
+ children: /* @__PURE__ */ r(Qr, {
1063
+ id: i,
1064
+ name: l,
1065
+ onSuccess: u
1035
1066
  })
1036
1067
  })
1037
1068
  })]
1038
- }, u))
1069
+ }, l))
1039
1070
  })]
1040
1071
  })]
1041
1072
  })]
1042
1073
  });
1043
1074
  }
1044
- const Jr = Je(({
1045
- label: a,
1046
- value: n,
1075
+ const Zr = tr(({
1076
+ label: t,
1077
+ value: a,
1047
1078
  description: s,
1048
1079
  ...c
1049
- }, d) => /* @__PURE__ */ E(Fr, {
1080
+ }, u) => /* @__PURE__ */ w(rr, {
1050
1081
  spacing: 2,
1051
- ref: d,
1082
+ ref: u,
1052
1083
  ...c,
1053
- children: [/* @__PURE__ */ r(be, {
1084
+ children: [/* @__PURE__ */ r(ye, {
1054
1085
  size: "sm",
1055
- children: a
1056
- }), /* @__PURE__ */ r(be, {
1086
+ children: t
1087
+ }), /* @__PURE__ */ r(ye, {
1057
1088
  size: "xs",
1058
1089
  color: "dimmed",
1059
1090
  className: "role-description",
1060
1091
  children: s
1061
1092
  })]
1062
- })), Ze = Je(({
1063
- styles: a,
1064
- value: n,
1093
+ })), Te = tr(({
1094
+ styles: t,
1095
+ value: a,
1065
1096
  onChange: s
1066
1097
  }, c) => {
1067
1098
  const {
1068
- data: d = [],
1069
- loading: o
1070
- } = ae(async () => (await D.role.list()).map((f) => ({
1099
+ data: u = [],
1100
+ loading: i
1101
+ } = G(async () => (await x.role.list()).map((f) => ({
1071
1102
  label: f.name,
1072
1103
  value: f.id,
1073
1104
  description: f.description,
@@ -1075,15 +1106,15 @@ const Jr = Je(({
1075
1106
  })), {
1076
1107
  refreshDeps: []
1077
1108
  });
1078
- return /* @__PURE__ */ r(Lr, {
1109
+ return /* @__PURE__ */ r(Nr, {
1079
1110
  ref: c,
1080
- mb: a.spacing,
1081
- size: a.size,
1111
+ mb: t.spacing,
1112
+ size: t.size,
1082
1113
  required: !0,
1083
1114
  label: "Role",
1084
- itemComponent: Jr,
1085
- data: d,
1086
- disabled: o,
1115
+ itemComponent: Zr,
1116
+ data: u,
1117
+ disabled: i,
1087
1118
  styles: () => ({
1088
1119
  item: {
1089
1120
  "&[data-selected]": {
@@ -1095,25 +1126,25 @@ const Jr = Je(({
1095
1126
  }
1096
1127
  }
1097
1128
  }),
1098
- value: n,
1129
+ value: a,
1099
1130
  onChange: s
1100
1131
  });
1101
- }), U = {
1132
+ }), W = {
1102
1133
  size: "sm",
1103
1134
  spacing: "md",
1104
1135
  button: {
1105
1136
  size: "xs"
1106
1137
  }
1107
1138
  };
1108
- function Xr({
1109
- postSubmit: a,
1110
- styles: n = U,
1139
+ function et({
1140
+ postSubmit: t,
1141
+ styles: a = W,
1111
1142
  initialRoleID: s
1112
1143
  }) {
1113
1144
  const {
1114
1145
  control: c,
1115
- handleSubmit: d
1116
- } = oe({
1146
+ handleSubmit: u
1147
+ } = ee({
1117
1148
  defaultValues: {
1118
1149
  name: "",
1119
1150
  email: "",
@@ -1121,146 +1152,146 @@ function Xr({
1121
1152
  password: ""
1122
1153
  }
1123
1154
  });
1124
- return /* @__PURE__ */ r(N, {
1155
+ return /* @__PURE__ */ r(L, {
1125
1156
  mx: "auto",
1126
- children: /* @__PURE__ */ E("form", {
1127
- onSubmit: d(async ({
1128
- name: u,
1157
+ children: /* @__PURE__ */ w("form", {
1158
+ onSubmit: u(async ({
1159
+ name: l,
1129
1160
  email: f,
1130
- password: b,
1131
- role_id: O
1161
+ password: v,
1162
+ role_id: R
1132
1163
  }) => {
1133
1164
  try {
1134
- V({
1165
+ M({
1135
1166
  id: "for-creating",
1136
1167
  title: "Pending",
1137
1168
  message: "Adding account...",
1138
1169
  loading: !0
1139
- }), await D.account.create(u, f, b, O), A({
1170
+ }), await x.account.create(l, f, v, R), A({
1140
1171
  id: "for-creating",
1141
1172
  title: "Successful",
1142
1173
  message: "Account is added",
1143
1174
  color: "green"
1144
- }), a();
1145
- } catch (S) {
1175
+ }), t();
1176
+ } catch (y) {
1146
1177
  A({
1147
1178
  id: "for-creating",
1148
1179
  title: "Failed",
1149
- message: S.message,
1180
+ message: y.message,
1150
1181
  color: "red"
1151
1182
  });
1152
1183
  }
1153
1184
  }),
1154
- children: [/* @__PURE__ */ r(T, {
1185
+ children: [/* @__PURE__ */ r(P, {
1155
1186
  name: "name",
1156
1187
  control: c,
1157
1188
  render: ({
1158
- field: u
1159
- }) => /* @__PURE__ */ r(F, {
1160
- mb: n.spacing,
1161
- size: n.size,
1189
+ field: l
1190
+ }) => /* @__PURE__ */ r(I, {
1191
+ mb: a.spacing,
1192
+ size: a.size,
1162
1193
  required: !0,
1163
1194
  label: "Username",
1164
- ...u
1195
+ ...l
1165
1196
  })
1166
- }), /* @__PURE__ */ r(T, {
1197
+ }), /* @__PURE__ */ r(P, {
1167
1198
  name: "email",
1168
1199
  control: c,
1169
1200
  render: ({
1170
- field: u
1171
- }) => /* @__PURE__ */ r(F, {
1172
- mb: n.spacing,
1173
- size: n.size,
1201
+ field: l
1202
+ }) => /* @__PURE__ */ r(I, {
1203
+ mb: a.spacing,
1204
+ size: a.size,
1174
1205
  required: !0,
1175
1206
  label: "Email",
1176
- ...u
1207
+ ...l
1177
1208
  })
1178
- }), /* @__PURE__ */ r(T, {
1209
+ }), /* @__PURE__ */ r(P, {
1179
1210
  name: "password",
1180
1211
  control: c,
1181
1212
  render: ({
1182
- field: u
1183
- }) => /* @__PURE__ */ r(ie, {
1184
- mb: n.spacing,
1185
- size: n.size,
1213
+ field: l
1214
+ }) => /* @__PURE__ */ r(se, {
1215
+ mb: a.spacing,
1216
+ size: a.size,
1186
1217
  required: !0,
1187
1218
  label: "Password",
1188
1219
  description: "Password must be at least 8 characters long",
1189
- ...u
1220
+ ...l
1190
1221
  })
1191
- }), /* @__PURE__ */ r(T, {
1222
+ }), /* @__PURE__ */ r(P, {
1192
1223
  name: "role_id",
1193
1224
  control: c,
1194
1225
  render: ({
1195
- field: u
1196
- }) => /* @__PURE__ */ r(Ze, {
1197
- styles: n,
1198
- ...u
1226
+ field: l
1227
+ }) => /* @__PURE__ */ r(Te, {
1228
+ styles: a,
1229
+ ...l
1199
1230
  })
1200
- }), /* @__PURE__ */ r(L, {
1231
+ }), /* @__PURE__ */ r(j, {
1201
1232
  position: "right",
1202
- mt: n.spacing,
1203
- children: /* @__PURE__ */ r(q, {
1233
+ mt: a.spacing,
1234
+ children: /* @__PURE__ */ r(D, {
1204
1235
  type: "submit",
1205
- size: n.button.size,
1236
+ size: a.button.size,
1206
1237
  children: "Save"
1207
1238
  })
1208
1239
  })]
1209
1240
  })
1210
1241
  });
1211
1242
  }
1212
- function Kr({
1213
- onSuccess: a,
1214
- styles: n = U,
1243
+ function rt({
1244
+ onSuccess: t,
1245
+ styles: a = W,
1215
1246
  initialRoleID: s
1216
1247
  }) {
1217
- const [c, d] = Q.useState(!1), o = () => d(!0), u = () => d(!1);
1218
- return /* @__PURE__ */ E(B, {
1219
- children: [/* @__PURE__ */ r(we, {
1248
+ const [c, u] = H.useState(!1), i = () => u(!0), l = () => u(!1);
1249
+ return /* @__PURE__ */ w($, {
1250
+ children: [/* @__PURE__ */ r(oe, {
1220
1251
  overflow: "inside",
1221
1252
  opened: c,
1222
- onClose: () => d(!1),
1253
+ onClose: () => u(!1),
1223
1254
  title: "Add an Account",
1224
1255
  trapFocus: !0,
1225
- onDragStart: (b) => {
1226
- b.stopPropagation();
1256
+ onDragStart: (v) => {
1257
+ v.stopPropagation();
1227
1258
  },
1228
- children: /* @__PURE__ */ r(Xr, {
1259
+ children: /* @__PURE__ */ r(et, {
1229
1260
  postSubmit: () => {
1230
- a(), u();
1261
+ t(), l();
1231
1262
  },
1232
- styles: n,
1263
+ styles: a,
1233
1264
  initialRoleID: s
1234
1265
  })
1235
- }), /* @__PURE__ */ r(q, {
1236
- size: n.button.size,
1237
- onClick: o,
1238
- leftIcon: /* @__PURE__ */ r(Xe, {
1266
+ }), /* @__PURE__ */ r(D, {
1267
+ size: a.button.size,
1268
+ onClick: i,
1269
+ leftIcon: /* @__PURE__ */ r(Ee, {
1239
1270
  size: 20
1240
1271
  }),
1241
1272
  children: "Add an Account"
1242
1273
  })]
1243
1274
  });
1244
1275
  }
1245
- function Qr({
1246
- id: a,
1247
- name: n,
1276
+ function tt({
1277
+ id: t,
1278
+ name: a,
1248
1279
  onSuccess: s,
1249
- styles: c = U
1280
+ styles: c = W
1250
1281
  }) {
1251
- const d = Qe(), o = async () => {
1252
- if (!!a) {
1253
- V({
1282
+ const u = ce(), i = async () => {
1283
+ if (!!t) {
1284
+ M({
1254
1285
  id: "for-deleting",
1255
1286
  title: "Pending",
1256
1287
  message: "Deleting account...",
1257
1288
  loading: !0
1258
1289
  });
1259
1290
  try {
1260
- await D.account.delete(a), A({
1291
+ await x.account.delete(t), A({
1261
1292
  id: "for-deleting",
1262
1293
  title: "Successful",
1263
- message: `Account [${n}] is deleted`,
1294
+ message: `Account [${a}] is deleted`,
1264
1295
  color: "green"
1265
1296
  }), s();
1266
1297
  } catch (f) {
@@ -1272,250 +1303,251 @@ function Qr({
1272
1303
  });
1273
1304
  }
1274
1305
  }
1275
- }, u = () => d.openConfirmModal({
1306
+ }, l = () => u.openConfirmModal({
1276
1307
  title: "Delete this account?",
1277
1308
  labels: {
1278
1309
  confirm: "Confirm",
1279
1310
  cancel: "Cancel"
1280
1311
  },
1281
1312
  onCancel: () => console.log("Cancel"),
1282
- onConfirm: o
1313
+ onConfirm: i
1283
1314
  });
1284
- return /* @__PURE__ */ r(q, {
1315
+ return /* @__PURE__ */ r(D, {
1285
1316
  size: c.button.size,
1286
1317
  color: "red",
1287
- onClick: u,
1288
- leftIcon: /* @__PURE__ */ r(Ke, {
1318
+ onClick: l,
1319
+ leftIcon: /* @__PURE__ */ r(Ce, {
1289
1320
  size: 20
1290
1321
  }),
1291
1322
  children: "Delete"
1292
1323
  });
1293
1324
  }
1294
- function Zr({
1295
- id: a,
1296
- name: n,
1325
+ function nt({
1326
+ id: t,
1327
+ name: a,
1297
1328
  email: s,
1298
1329
  role_id: c,
1299
- postSubmit: d,
1300
- styles: o = U
1330
+ postSubmit: u,
1331
+ styles: i = W
1301
1332
  }) {
1302
1333
  const {
1303
- control: u,
1334
+ control: l,
1304
1335
  handleSubmit: f,
1305
- watch: b
1306
- } = oe({
1336
+ watch: v
1337
+ } = ee({
1307
1338
  defaultValues: {
1308
- name: n,
1339
+ name: a,
1309
1340
  email: s,
1310
1341
  role_id: c,
1311
1342
  reset_password: !1,
1312
1343
  new_password: ""
1313
1344
  }
1314
- }), O = async ({
1315
- name: g,
1316
- email: x,
1317
- role_id: W,
1318
- reset_password: G,
1319
- new_password: le
1345
+ }), R = async ({
1346
+ name: d,
1347
+ email: O,
1348
+ role_id: N,
1349
+ reset_password: K,
1350
+ new_password: pe
1320
1351
  }) => {
1321
1352
  try {
1322
- V({
1353
+ M({
1323
1354
  id: "for-updating",
1324
1355
  title: "Pending",
1325
1356
  message: "Updating account...",
1326
1357
  loading: !0
1327
- }), await D.account.edit({
1328
- id: a,
1329
- name: g,
1330
- email: x,
1331
- role_id: W,
1332
- reset_password: G,
1333
- new_password: le
1358
+ }), await x.account.edit({
1359
+ id: t,
1360
+ name: d,
1361
+ email: O,
1362
+ role_id: N,
1363
+ reset_password: K,
1364
+ new_password: pe
1334
1365
  }), A({
1335
1366
  id: "for-updating",
1336
1367
  title: "Successful",
1337
1368
  message: "Account is updated",
1338
1369
  color: "green"
1339
- }), d();
1340
- } catch (I) {
1370
+ }), u();
1371
+ } catch (U) {
1341
1372
  A({
1342
1373
  id: "for-updating",
1343
1374
  title: "Failed",
1344
- message: I.message,
1375
+ message: U.message,
1345
1376
  color: "red"
1346
1377
  });
1347
1378
  }
1348
- }, [S, w] = b(["reset_password", "new_password"]);
1349
- return /* @__PURE__ */ r(N, {
1379
+ }, [y, h] = v(["reset_password", "new_password"]);
1380
+ return /* @__PURE__ */ r(L, {
1350
1381
  mx: "auto",
1351
- children: /* @__PURE__ */ E("form", {
1352
- onSubmit: f(O),
1353
- children: [/* @__PURE__ */ r(T, {
1382
+ children: /* @__PURE__ */ w("form", {
1383
+ onSubmit: f(R),
1384
+ children: [/* @__PURE__ */ r(P, {
1354
1385
  name: "name",
1355
- control: u,
1386
+ control: l,
1356
1387
  render: ({
1357
- field: g
1358
- }) => /* @__PURE__ */ r(F, {
1359
- mb: o.spacing,
1360
- size: o.size,
1388
+ field: d
1389
+ }) => /* @__PURE__ */ r(I, {
1390
+ mb: i.spacing,
1391
+ size: i.size,
1361
1392
  required: !0,
1362
1393
  label: "Username",
1363
- ...g
1394
+ ...d
1364
1395
  })
1365
- }), /* @__PURE__ */ r(T, {
1396
+ }), /* @__PURE__ */ r(P, {
1366
1397
  name: "email",
1367
- control: u,
1398
+ control: l,
1368
1399
  render: ({
1369
- field: g
1370
- }) => /* @__PURE__ */ r(F, {
1371
- mb: o.spacing,
1372
- size: o.size,
1400
+ field: d
1401
+ }) => /* @__PURE__ */ r(I, {
1402
+ mb: i.spacing,
1403
+ size: i.size,
1373
1404
  required: !0,
1374
1405
  label: "Email",
1375
- ...g
1406
+ ...d
1376
1407
  })
1377
- }), /* @__PURE__ */ r(T, {
1408
+ }), /* @__PURE__ */ r(P, {
1378
1409
  name: "role_id",
1379
- control: u,
1410
+ control: l,
1380
1411
  render: ({
1381
- field: g
1382
- }) => /* @__PURE__ */ r(Ze, {
1383
- styles: o,
1384
- ...g
1412
+ field: d
1413
+ }) => /* @__PURE__ */ r(Te, {
1414
+ styles: i,
1415
+ ...d
1385
1416
  })
1386
- }), /* @__PURE__ */ r(Be, {
1417
+ }), /* @__PURE__ */ r(er, {
1387
1418
  my: 20,
1388
1419
  variant: "dashed",
1389
1420
  label: "",
1390
1421
  labelPosition: "center"
1391
- }), /* @__PURE__ */ r(T, {
1422
+ }), /* @__PURE__ */ r(P, {
1392
1423
  name: "reset_password",
1393
- control: u,
1424
+ control: l,
1394
1425
  render: ({
1395
- field: g
1396
- }) => /* @__PURE__ */ r(qr, {
1397
- mb: o.spacing,
1398
- size: o.size,
1426
+ field: d
1427
+ }) => /* @__PURE__ */ r(Ur, {
1428
+ mb: i.spacing,
1429
+ size: i.size,
1399
1430
  label: "Reset password",
1400
- checked: g.value,
1401
- onChange: (x) => g.onChange(x.currentTarget.checked),
1431
+ checked: d.value,
1432
+ onChange: (O) => d.onChange(O.currentTarget.checked),
1402
1433
  styles: {
1403
1434
  label: {
1404
1435
  verticalAlign: "middle"
1405
1436
  }
1406
1437
  }
1407
1438
  })
1408
- }), S && /* @__PURE__ */ r(T, {
1439
+ }), y && /* @__PURE__ */ r(P, {
1409
1440
  name: "new_password",
1410
- control: u,
1441
+ control: l,
1411
1442
  render: ({
1412
- field: g
1413
- }) => /* @__PURE__ */ r(ie, {
1443
+ field: d
1444
+ }) => /* @__PURE__ */ r(se, {
1414
1445
  autoComplete: "off",
1415
- mb: o.spacing,
1416
- size: o.size,
1446
+ mb: i.spacing,
1447
+ size: i.size,
1417
1448
  required: !0,
1418
1449
  description: "Password must be at least 8 characters long",
1419
1450
  label: "New Password",
1420
- ...g
1451
+ ...d
1421
1452
  })
1422
- }), /* @__PURE__ */ r(L, {
1453
+ }), /* @__PURE__ */ r(j, {
1423
1454
  position: "right",
1424
- mt: o.spacing,
1425
- children: /* @__PURE__ */ r(q, {
1455
+ mt: i.spacing,
1456
+ children: /* @__PURE__ */ r(D, {
1426
1457
  type: "submit",
1427
- size: o.button.size,
1458
+ size: i.button.size,
1428
1459
  children: "Submit"
1429
1460
  })
1430
1461
  })]
1431
1462
  })
1432
1463
  });
1433
1464
  }
1434
- function et({
1435
- account: a,
1436
- onSuccess: n,
1437
- styles: s = U
1465
+ function at({
1466
+ account: t,
1467
+ onSuccess: a,
1468
+ styles: s = W
1438
1469
  }) {
1439
- const [c, d] = Q.useState(!1), o = () => d(!0), u = () => d(!1), f = () => {
1440
- n(), u();
1470
+ const [c, u] = H.useState(!1), i = () => u(!0), l = () => u(!1), f = () => {
1471
+ a(), l();
1441
1472
  };
1442
- return /* @__PURE__ */ E(B, {
1443
- children: [/* @__PURE__ */ r(we, {
1473
+ return /* @__PURE__ */ w($, {
1474
+ children: [/* @__PURE__ */ r(oe, {
1444
1475
  overflow: "inside",
1445
1476
  opened: c,
1446
- onClose: () => d(!1),
1447
- title: `Editing ${a.name}`,
1477
+ onClose: () => u(!1),
1478
+ title: `Editing ${t.name}`,
1448
1479
  trapFocus: !0,
1449
- onDragStart: (b) => {
1450
- b.stopPropagation();
1480
+ onDragStart: (v) => {
1481
+ v.stopPropagation();
1451
1482
  },
1452
- children: /* @__PURE__ */ r(Zr, {
1453
- ...a,
1483
+ children: /* @__PURE__ */ r(nt, {
1484
+ ...t,
1454
1485
  postSubmit: f,
1455
1486
  styles: s
1456
1487
  })
1457
- }), /* @__PURE__ */ r(q, {
1488
+ }), /* @__PURE__ */ r(D, {
1458
1489
  size: s.button.size,
1459
- onClick: o,
1460
- leftIcon: /* @__PURE__ */ r(Ur, {
1490
+ onClick: i,
1491
+ leftIcon: /* @__PURE__ */ r(Mr, {
1461
1492
  size: 20
1462
1493
  }),
1463
1494
  children: "Edit"
1464
1495
  })]
1465
1496
  });
1466
1497
  }
1467
- function dt({
1468
- styles: a = U,
1469
- config: n
1498
+ function bt({
1499
+ styles: t = W,
1500
+ config: a
1470
1501
  }) {
1471
- var O, S;
1502
+ var R, y;
1503
+ le(a);
1472
1504
  const {
1473
1505
  data: s = [],
1474
1506
  loading: c,
1475
- refresh: d
1476
- } = ae(async () => {
1507
+ refresh: u
1508
+ } = G(async () => {
1477
1509
  const {
1478
- data: w
1479
- } = await D.account.list();
1480
- return w;
1510
+ data: h
1511
+ } = await x.account.list();
1512
+ return h;
1481
1513
  }, {
1482
1514
  refreshDeps: []
1483
1515
  }), {
1484
- data: o = [],
1485
- loading: u
1486
- } = ae(async () => (await D.role.list()).map((g) => ({
1487
- label: g.name,
1488
- value: g.id,
1489
- description: g.description,
1490
- disabled: g.id === 50
1516
+ data: i = [],
1517
+ loading: l
1518
+ } = G(async () => (await x.role.list()).map((d) => ({
1519
+ label: d.name,
1520
+ value: d.id,
1521
+ description: d.description,
1522
+ disabled: d.id === 50
1491
1523
  })), {
1492
1524
  refreshDeps: []
1493
- }), f = Ir(() => o.reduce((w, g) => (w.set(g.value, g.label), w), /* @__PURE__ */ new Map()), [o]), b = (w) => {
1494
- var g;
1495
- return (g = f.get(w)) != null ? g : w;
1525
+ }), f = nr(() => i.reduce((h, d) => (h.set(d.value, d.label), h), /* @__PURE__ */ new Map()), [i]), v = (h) => {
1526
+ var d;
1527
+ return (d = f.get(h)) != null ? d : h;
1496
1528
  };
1497
- return y.baseURL !== n.apiBaseURL && (y.baseURL = n.apiBaseURL), /* @__PURE__ */ E(B, {
1498
- children: [/* @__PURE__ */ r(L, {
1499
- pt: a.spacing,
1529
+ return /* @__PURE__ */ w($, {
1530
+ children: [/* @__PURE__ */ r(j, {
1531
+ pt: t.spacing,
1500
1532
  position: "right",
1501
- children: /* @__PURE__ */ r(Kr, {
1502
- onSuccess: d,
1503
- initialRoleID: (S = (O = o == null ? void 0 : o[0]) == null ? void 0 : O.value) != null ? S : 0
1533
+ children: /* @__PURE__ */ r(rt, {
1534
+ onSuccess: u,
1535
+ initialRoleID: (y = (R = i == null ? void 0 : i[0]) == null ? void 0 : R.value) != null ? y : 0
1504
1536
  })
1505
- }), /* @__PURE__ */ E(N, {
1506
- mt: a.spacing,
1537
+ }), /* @__PURE__ */ w(L, {
1538
+ mt: t.spacing,
1507
1539
  sx: {
1508
1540
  position: "relative"
1509
1541
  },
1510
- children: [/* @__PURE__ */ r(Ge, {
1511
- visible: c || u
1512
- }), /* @__PURE__ */ E(He, {
1513
- horizontalSpacing: a.spacing,
1514
- verticalSpacing: a.spacing,
1515
- fontSize: a.size,
1542
+ children: [/* @__PURE__ */ r(_e, {
1543
+ visible: c || l
1544
+ }), /* @__PURE__ */ w(Pe, {
1545
+ horizontalSpacing: t.spacing,
1546
+ verticalSpacing: t.spacing,
1547
+ fontSize: t.size,
1516
1548
  highlightOnHover: !0,
1517
1549
  children: [/* @__PURE__ */ r("thead", {
1518
- children: /* @__PURE__ */ E("tr", {
1550
+ children: /* @__PURE__ */ w("tr", {
1519
1551
  children: [/* @__PURE__ */ r("th", {
1520
1552
  children: "Username"
1521
1553
  }), /* @__PURE__ */ r("th", {
@@ -1527,78 +1559,78 @@ function dt({
1527
1559
  })]
1528
1560
  })
1529
1561
  }), /* @__PURE__ */ r("tbody", {
1530
- children: s.map((w) => {
1562
+ children: s.map((h) => {
1531
1563
  const {
1532
- id: g,
1533
- name: x,
1534
- email: W,
1535
- role_id: G
1536
- } = w;
1537
- return /* @__PURE__ */ E("tr", {
1564
+ id: d,
1565
+ name: O,
1566
+ email: N,
1567
+ role_id: K
1568
+ } = h;
1569
+ return /* @__PURE__ */ w("tr", {
1538
1570
  children: [/* @__PURE__ */ r("td", {
1539
1571
  width: 200,
1540
- children: x
1572
+ children: O
1541
1573
  }), /* @__PURE__ */ r("td", {
1542
1574
  width: 200,
1543
- children: W
1575
+ children: N
1544
1576
  }), /* @__PURE__ */ r("td", {
1545
1577
  width: 200,
1546
- children: b(G)
1578
+ children: v(K)
1547
1579
  }), /* @__PURE__ */ r("td", {
1548
1580
  width: 200,
1549
- children: /* @__PURE__ */ E(L, {
1581
+ children: /* @__PURE__ */ w(j, {
1550
1582
  position: "left",
1551
- children: [/* @__PURE__ */ r(et, {
1552
- account: w,
1553
- onSuccess: d
1554
- }), /* @__PURE__ */ r(Qr, {
1555
- id: g,
1556
- name: x,
1557
- onSuccess: d
1583
+ children: [/* @__PURE__ */ r(at, {
1584
+ account: h,
1585
+ onSuccess: u
1586
+ }), /* @__PURE__ */ r(tt, {
1587
+ id: d,
1588
+ name: O,
1589
+ onSuccess: u
1558
1590
  })]
1559
1591
  })
1560
1592
  })]
1561
- }, g);
1593
+ }, d);
1562
1594
  })
1563
1595
  })]
1564
1596
  })]
1565
1597
  })]
1566
1598
  });
1567
1599
  }
1568
- function rt({
1569
- postSubmit: a,
1570
- styles: n = U
1600
+ function it({
1601
+ postSubmit: t,
1602
+ styles: a = W
1571
1603
  }) {
1572
1604
  const {
1573
1605
  control: s,
1574
1606
  handleSubmit: c
1575
- } = oe({
1607
+ } = ee({
1576
1608
  defaultValues: {
1577
1609
  name: "",
1578
1610
  password: ""
1579
1611
  }
1580
1612
  });
1581
- return /* @__PURE__ */ r(N, {
1613
+ return /* @__PURE__ */ r(L, {
1582
1614
  mx: "auto",
1583
- children: /* @__PURE__ */ E("form", {
1615
+ children: /* @__PURE__ */ w("form", {
1584
1616
  onSubmit: c(async ({
1585
- name: o,
1586
- password: u
1617
+ name: i,
1618
+ password: l
1587
1619
  }) => {
1588
1620
  try {
1589
- V({
1621
+ M({
1590
1622
  id: "for-login",
1591
1623
  title: "Pending",
1592
1624
  message: "Loggin in...",
1593
1625
  loading: !0
1594
1626
  });
1595
- const f = await D.account.login(o, u);
1627
+ const f = await x.account.login(i, l);
1596
1628
  window.localStorage.setItem("token", f.token), A({
1597
1629
  id: "for-login",
1598
1630
  title: "Successful",
1599
1631
  message: "Logged in",
1600
1632
  color: "green"
1601
- }), a(f);
1633
+ }), t(f);
1602
1634
  } catch (f) {
1603
1635
  A({
1604
1636
  id: "for-login",
@@ -1608,66 +1640,369 @@ function rt({
1608
1640
  });
1609
1641
  }
1610
1642
  }),
1611
- children: [/* @__PURE__ */ r(T, {
1643
+ children: [/* @__PURE__ */ r(P, {
1612
1644
  name: "name",
1613
1645
  control: s,
1614
1646
  render: ({
1615
- field: o
1616
- }) => /* @__PURE__ */ r(F, {
1617
- mb: n.spacing,
1618
- size: n.size,
1647
+ field: i
1648
+ }) => /* @__PURE__ */ r(I, {
1649
+ mb: a.spacing,
1650
+ size: a.size,
1619
1651
  required: !0,
1620
1652
  label: "Username",
1621
- ...o
1653
+ ...i
1622
1654
  })
1623
- }), /* @__PURE__ */ r(T, {
1655
+ }), /* @__PURE__ */ r(P, {
1624
1656
  name: "password",
1625
1657
  control: s,
1626
1658
  render: ({
1627
- field: o
1628
- }) => /* @__PURE__ */ r(ie, {
1629
- mb: n.spacing,
1630
- size: n.size,
1659
+ field: i
1660
+ }) => /* @__PURE__ */ r(se, {
1661
+ mb: a.spacing,
1662
+ size: a.size,
1631
1663
  required: !0,
1632
1664
  label: "Password",
1633
- ...o
1665
+ ...i
1634
1666
  })
1635
- }), /* @__PURE__ */ r(L, {
1667
+ }), /* @__PURE__ */ r(j, {
1636
1668
  position: "right",
1637
- mt: n.spacing,
1638
- children: /* @__PURE__ */ r(q, {
1669
+ mt: a.spacing,
1670
+ children: /* @__PURE__ */ r(D, {
1639
1671
  type: "submit",
1640
- size: n.button.size,
1672
+ size: a.button.size,
1641
1673
  children: "Submit"
1642
1674
  })
1643
1675
  })]
1644
1676
  })
1645
1677
  });
1646
1678
  }
1647
- function ft({
1648
- styles: a = U,
1649
- config: n,
1679
+ function wt({
1680
+ styles: t = W,
1681
+ config: a,
1650
1682
  onSuccess: s
1651
1683
  }) {
1652
- return y.baseURL !== n.apiBaseURL && (y.baseURL = n.apiBaseURL), /* @__PURE__ */ r(B, {
1653
- children: /* @__PURE__ */ r(N, {
1654
- mt: a.spacing,
1684
+ return le(a), /* @__PURE__ */ r($, {
1685
+ children: /* @__PURE__ */ r(L, {
1686
+ mt: t.spacing,
1655
1687
  sx: {
1656
1688
  position: "relative"
1657
1689
  },
1658
- children: /* @__PURE__ */ r(rt, {
1659
- styles: a,
1690
+ children: /* @__PURE__ */ r(it, {
1691
+ styles: t,
1660
1692
  postSubmit: s
1661
1693
  })
1662
1694
  })
1663
1695
  });
1664
1696
  }
1697
+ const fe = {
1698
+ size: "sm",
1699
+ spacing: "md",
1700
+ button: {
1701
+ size: "xs"
1702
+ }
1703
+ };
1704
+ function ot({
1705
+ postSubmit: t,
1706
+ styles: a = fe,
1707
+ initialRoleID: s
1708
+ }) {
1709
+ const {
1710
+ control: c,
1711
+ handleSubmit: u
1712
+ } = ee({
1713
+ defaultValues: {
1714
+ name: "",
1715
+ role_id: s,
1716
+ domain: ""
1717
+ }
1718
+ });
1719
+ return /* @__PURE__ */ r(L, {
1720
+ mx: "auto",
1721
+ children: /* @__PURE__ */ w("form", {
1722
+ onSubmit: u(async ({
1723
+ name: l,
1724
+ role_id: f,
1725
+ domain: v
1726
+ }) => {
1727
+ try {
1728
+ M({
1729
+ id: "for-creating",
1730
+ title: "Pending",
1731
+ message: "Adding API Key...",
1732
+ loading: !0
1733
+ });
1734
+ const R = await x.api_key.create(l, f, v);
1735
+ A({
1736
+ id: "for-creating",
1737
+ title: "Successful",
1738
+ message: "API Key is added",
1739
+ color: "green"
1740
+ }), t(R);
1741
+ } catch (R) {
1742
+ A({
1743
+ id: "for-creating",
1744
+ title: "Failed",
1745
+ message: R.message,
1746
+ color: "red"
1747
+ });
1748
+ }
1749
+ }),
1750
+ children: [/* @__PURE__ */ r(P, {
1751
+ name: "name",
1752
+ control: c,
1753
+ render: ({
1754
+ field: l
1755
+ }) => /* @__PURE__ */ r(I, {
1756
+ mb: a.spacing,
1757
+ size: a.size,
1758
+ required: !0,
1759
+ label: "Name",
1760
+ ...l
1761
+ })
1762
+ }), /* @__PURE__ */ r(P, {
1763
+ name: "domain",
1764
+ control: c,
1765
+ render: ({
1766
+ field: l
1767
+ }) => /* @__PURE__ */ r(I, {
1768
+ mb: a.spacing,
1769
+ size: a.size,
1770
+ required: !0,
1771
+ label: "Domain",
1772
+ ...l
1773
+ })
1774
+ }), /* @__PURE__ */ r(P, {
1775
+ name: "role_id",
1776
+ control: c,
1777
+ render: ({
1778
+ field: l
1779
+ }) => /* @__PURE__ */ r(Te, {
1780
+ styles: a,
1781
+ ...l
1782
+ })
1783
+ }), /* @__PURE__ */ r(j, {
1784
+ position: "right",
1785
+ mt: a.spacing,
1786
+ children: /* @__PURE__ */ r(D, {
1787
+ type: "submit",
1788
+ size: a.button.size,
1789
+ children: "Save"
1790
+ })
1791
+ })]
1792
+ })
1793
+ });
1794
+ }
1795
+ function st({
1796
+ onSuccess: t,
1797
+ styles: a = fe,
1798
+ initialRoleID: s
1799
+ }) {
1800
+ const c = ce(), [u, i] = H.useState(!1), l = () => i(!0), f = () => i(!1);
1801
+ return /* @__PURE__ */ w($, {
1802
+ children: [/* @__PURE__ */ r(oe, {
1803
+ overflow: "inside",
1804
+ opened: u,
1805
+ onClose: () => i(!1),
1806
+ title: "Add an API Key",
1807
+ trapFocus: !0,
1808
+ onDragStart: (R) => {
1809
+ R.stopPropagation();
1810
+ },
1811
+ children: /* @__PURE__ */ r(ot, {
1812
+ postSubmit: (R) => {
1813
+ f(), c.openModal({
1814
+ title: "API Key is generated",
1815
+ children: /* @__PURE__ */ w(rr, {
1816
+ children: [/* @__PURE__ */ r(I, {
1817
+ defaultValue: R,
1818
+ disabled: !0,
1819
+ label: "Generated API Key",
1820
+ description: "Make sure you save it - you won't be able to access it again.",
1821
+ styles: {
1822
+ input: {
1823
+ cursor: "text !important"
1824
+ }
1825
+ }
1826
+ }), /* @__PURE__ */ r(D, {
1827
+ size: "sm",
1828
+ onClick: () => {
1829
+ Wr(), t();
1830
+ },
1831
+ children: "I've saved this API Key"
1832
+ })]
1833
+ })
1834
+ });
1835
+ },
1836
+ styles: a,
1837
+ initialRoleID: s
1838
+ })
1839
+ }), /* @__PURE__ */ r(D, {
1840
+ size: a.button.size,
1841
+ onClick: l,
1842
+ leftIcon: /* @__PURE__ */ r(Ee, {
1843
+ size: 20
1844
+ }),
1845
+ children: "Add an API Key"
1846
+ })]
1847
+ });
1848
+ }
1849
+ function ct({
1850
+ id: t,
1851
+ name: a,
1852
+ onSuccess: s,
1853
+ styles: c = fe
1854
+ }) {
1855
+ const u = ce(), i = async () => {
1856
+ if (!!t) {
1857
+ M({
1858
+ id: "for-deleting",
1859
+ title: "Pending",
1860
+ message: "Deleting API Key...",
1861
+ loading: !0
1862
+ });
1863
+ try {
1864
+ await x.api_key.delete(t), A({
1865
+ id: "for-deleting",
1866
+ title: "Successful",
1867
+ message: `API Key [${a}] is deleted`,
1868
+ color: "green"
1869
+ }), s();
1870
+ } catch (f) {
1871
+ A({
1872
+ id: "for-deleting",
1873
+ title: "Failed",
1874
+ message: f.message,
1875
+ color: "red"
1876
+ });
1877
+ }
1878
+ }
1879
+ }, l = () => u.openConfirmModal({
1880
+ title: "Delete this api-key?",
1881
+ labels: {
1882
+ confirm: "Confirm",
1883
+ cancel: "Cancel"
1884
+ },
1885
+ onCancel: () => console.log("Cancel"),
1886
+ onConfirm: i
1887
+ });
1888
+ return /* @__PURE__ */ r(D, {
1889
+ size: c.button.size,
1890
+ color: "red",
1891
+ onClick: l,
1892
+ leftIcon: /* @__PURE__ */ r(Ce, {
1893
+ size: 20
1894
+ }),
1895
+ children: "Delete"
1896
+ });
1897
+ }
1898
+ function St({
1899
+ styles: t = fe,
1900
+ config: a
1901
+ }) {
1902
+ var R, y;
1903
+ le(a);
1904
+ const {
1905
+ data: s = [],
1906
+ loading: c,
1907
+ refresh: u
1908
+ } = G(async () => {
1909
+ const {
1910
+ data: h
1911
+ } = await x.api_key.list();
1912
+ return h;
1913
+ }, {
1914
+ refreshDeps: []
1915
+ }), {
1916
+ data: i = [],
1917
+ loading: l
1918
+ } = G(async () => (await x.role.list()).map((d) => ({
1919
+ label: d.name,
1920
+ value: d.id,
1921
+ description: d.description,
1922
+ disabled: d.id === 50
1923
+ })), {
1924
+ refreshDeps: []
1925
+ }), f = nr(() => i.reduce((h, d) => (h.set(d.value, d.label), h), /* @__PURE__ */ new Map()), [i]), v = (h) => {
1926
+ var d;
1927
+ return (d = f.get(h)) != null ? d : h;
1928
+ };
1929
+ return /* @__PURE__ */ w($, {
1930
+ children: [/* @__PURE__ */ r(j, {
1931
+ pt: t.spacing,
1932
+ position: "right",
1933
+ children: /* @__PURE__ */ r(st, {
1934
+ onSuccess: u,
1935
+ initialRoleID: (y = (R = i == null ? void 0 : i[0]) == null ? void 0 : R.value) != null ? y : 0
1936
+ })
1937
+ }), /* @__PURE__ */ w(L, {
1938
+ mt: t.spacing,
1939
+ sx: {
1940
+ position: "relative"
1941
+ },
1942
+ children: [/* @__PURE__ */ r(_e, {
1943
+ visible: c || l
1944
+ }), /* @__PURE__ */ w(Pe, {
1945
+ horizontalSpacing: t.spacing,
1946
+ verticalSpacing: t.spacing,
1947
+ fontSize: t.size,
1948
+ highlightOnHover: !0,
1949
+ children: [/* @__PURE__ */ r("thead", {
1950
+ children: /* @__PURE__ */ w("tr", {
1951
+ children: [/* @__PURE__ */ r("th", {
1952
+ children: "Name"
1953
+ }), /* @__PURE__ */ r("th", {
1954
+ children: "Domain"
1955
+ }), /* @__PURE__ */ r("th", {
1956
+ children: "Role"
1957
+ }), /* @__PURE__ */ r("th", {
1958
+ children: "Action"
1959
+ })]
1960
+ })
1961
+ }), /* @__PURE__ */ r("tbody", {
1962
+ children: s.map((h) => {
1963
+ const {
1964
+ id: d,
1965
+ name: O,
1966
+ domain: N,
1967
+ role_id: K
1968
+ } = h;
1969
+ return /* @__PURE__ */ w("tr", {
1970
+ children: [/* @__PURE__ */ r("td", {
1971
+ width: 200,
1972
+ children: O
1973
+ }), /* @__PURE__ */ r("td", {
1974
+ width: 200,
1975
+ children: N
1976
+ }), /* @__PURE__ */ r("td", {
1977
+ width: 200,
1978
+ children: v(K)
1979
+ }), /* @__PURE__ */ r("td", {
1980
+ width: 200,
1981
+ children: /* @__PURE__ */ r(j, {
1982
+ position: "left",
1983
+ children: /* @__PURE__ */ r(ct, {
1984
+ id: d,
1985
+ name: O,
1986
+ onSuccess: u
1987
+ })
1988
+ })
1989
+ })]
1990
+ }, d);
1991
+ })
1992
+ })]
1993
+ })]
1994
+ })]
1995
+ });
1996
+ }
1665
1997
  export {
1666
- dt as AccountList,
1667
- Kr as AddAccount,
1668
- Gr as AddDataSource,
1669
- ut as DataSourceList,
1670
- Qr as DeleteAccount,
1671
- Hr as DeleteDataSource,
1672
- ft as Login
1998
+ St as APIKeyList,
1999
+ bt as AccountList,
2000
+ st as AddAPIKey,
2001
+ rt as AddAccount,
2002
+ Xr as AddDataSource,
2003
+ vt as DataSourceList,
2004
+ ct as DeleteAPIKey,
2005
+ tt as DeleteAccount,
2006
+ Qr as DeleteDataSource,
2007
+ wt as Login
1673
2008
  };