@devtable/settings-form 6.46.0 → 7.0.0

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,88 +1,88 @@
1
- import { Modal as ce, Button as k, Box as L, SegmentedControl as Mr, TextInput as j, Divider as tr, Group as I, NumberInput as Nr, PasswordInput as le, useMantineTheme as Ur, Tooltip as $r, Text as se, LoadingOverlay as Ee, Table as Ce, Stack as nr, Select as Wr, Switch as Vr } from "@mantine/core";
2
- import { showNotification as U, updateNotification as z } from "@mantine/notifications";
3
- import * as Q from "react";
4
- import J, { forwardRef as ar, useMemo as ir } from "react";
5
- import { useForm as re, Controller as E } from "react-hook-form";
6
- import { PlaylistAdd as Te, Trash as Oe, Edit as Yr } from "tabler-icons-react";
7
- import Kr from "axios";
8
- import Br from "crypto-js";
9
- import Gr from "lodash";
10
- import { useRequest as G } from "ahooks";
11
- import { useModals as ue, closeAllModals as Jr } from "@mantine/modals";
12
- function Hr(t) {
13
- t = t || {};
14
- const n = Object.keys(t).sort(), o = [];
15
- for (let s = 0; s < n.length; s++) {
16
- const u = n[s];
17
- if (u != "authentication" && t[u])
18
- o.push(n[s] + "=" + (typeof t[u] == "object" ? JSON.stringify(t[u]) : t[u]));
1
+ import { Box as me, TextInput as fe, Divider as Or, Group as se, NumberInput as Vt, PasswordInput as rr, Button as oe, Modal as Ve, Stack as Pr, SegmentedControl as Bt, useMantineTheme as Kt, Tooltip as Ht, Text as Qe, LoadingOverlay as Rr, Table as _r, Select as Gt, Switch as Jt } from "@mantine/core";
2
+ import { showNotification as _e, updateNotification as le } from "@mantine/notifications";
3
+ import * as $e from "react";
4
+ import De, { useEffect as we, memo as ft, useRef as ue, useState as Ie, useCallback as Er, forwardRef as xr, useMemo as dt } from "react";
5
+ import { Recycle as Xt, PlaylistAdd as Cr, Trash as jr, Edit as Qt } from "tabler-icons-react";
6
+ import Zt from "axios";
7
+ import en from "crypto-js";
8
+ import rn from "lodash";
9
+ import { useForm as ke, Controller as J } from "react-hook-form";
10
+ import { useBoolean as tn, useRequest as ze } from "ahooks";
11
+ import { useModals as tr, closeAllModals as nn } from "@mantine/modals";
12
+ function on(e) {
13
+ e = e || {};
14
+ const r = Object.keys(e).sort(), t = [];
15
+ for (let o = 0; o < r.length; o++) {
16
+ const s = r[o];
17
+ if (s != "authentication" && e[s])
18
+ t.push(r[o] + "=" + (typeof e[s] == "object" ? JSON.stringify(e[s]) : e[s]));
19
19
  else {
20
- const i = Object.keys(t[u]).sort();
21
- for (let l = 0; l < i.length; l++) {
22
- const d = i[l];
23
- d != "sign" && t[u][d] && o.push(
24
- i[l] + "=" + (typeof t[u][d] == "object" ? JSON.stringify(t[u][d]) : t[u][d])
20
+ const i = Object.keys(e[s]).sort();
21
+ for (let c = 0; c < i.length; c++) {
22
+ const u = i[c];
23
+ u != "sign" && e[s][u] && t.push(
24
+ i[c] + "=" + (typeof e[s][u] == "object" ? JSON.stringify(e[s][u]) : e[s][u])
25
25
  );
26
26
  }
27
27
  }
28
28
  }
29
- return o.sort().join("&");
29
+ return t.sort().join("&");
30
30
  }
31
- function Xr(t, n) {
32
- let o = Hr(t);
33
- return o += "&key=" + n, Br.MD5(o).toString().toUpperCase();
31
+ function an(e, r) {
32
+ let t = on(e);
33
+ return t += "&key=" + r, en.MD5(t).toString().toUpperCase();
34
34
  }
35
- const C = {
35
+ const ne = {
36
36
  baseURL: "http://localhost:31200",
37
37
  app_id: "",
38
38
  app_secret: "",
39
- getAuthentication(t) {
39
+ getAuthentication(e) {
40
40
  if (!this.app_id || !this.app_secret)
41
41
  return;
42
- const n = new Date().getTime().toString();
42
+ const r = new Date().getTime().toString();
43
43
  return {
44
44
  app_id: this.app_id,
45
- nonce_str: n,
46
- sign: Xr(
45
+ nonce_str: r,
46
+ sign: an(
47
47
  {
48
48
  app_id: this.app_id,
49
- nonce_str: n,
50
- ...t
49
+ nonce_str: r,
50
+ ...e
51
51
  },
52
52
  this.app_secret
53
53
  )
54
54
  };
55
55
  },
56
- getRequest(t) {
57
- return (n, o, s = {}) => {
58
- const u = window.localStorage.getItem("token"), i = {
56
+ getRequest(e) {
57
+ return (r, t, o = {}) => {
58
+ const s = window.localStorage.getItem("token"), i = {
59
59
  "X-Requested-With": "XMLHttpRequest",
60
- "Content-Type": s.string ? "application/x-www-form-urlencoded" : "application/json",
61
- authorization: u ? `bearer ${u}` : "",
62
- ...s.headers
63
- }, l = {
60
+ "Content-Type": o.string ? "application/x-www-form-urlencoded" : "application/json",
61
+ authorization: s ? `bearer ${s}` : "",
62
+ ...o.headers
63
+ }, c = {
64
64
  baseURL: this.baseURL,
65
- method: t,
66
- url: n,
67
- params: t === "GET" ? o : s.params,
65
+ method: e,
66
+ url: r,
67
+ params: e === "GET" ? t : o.params,
68
68
  headers: i
69
69
  };
70
- return ["POST", "PUT"].includes(t) && (l.data = s.string ? JSON.stringify(o) : o, l.data.authentication = this.getAuthentication(l.data)), Kr(l).then((d) => d.data).catch((d) => Gr.has(d, "response.data.detail.message") ? Promise.reject(new Error(d.response.data.detail.message)) : Promise.reject(d));
70
+ return ["POST", "PUT"].includes(e) && (c.data = o.string ? JSON.stringify(t) : t, c.data.authentication = this.getAuthentication(c.data)), Zt(c).then((u) => u.data).catch((u) => rn.has(u, "response.data.detail.message") ? Promise.reject(new Error(u.response.data.detail.message)) : Promise.reject(u));
71
71
  };
72
72
  }
73
73
  };
74
- function de(t) {
75
- C.baseURL !== t.apiBaseURL && (C.baseURL = t.apiBaseURL), t.app_id && (C.app_id = t.app_id), t.app_secret && (C.app_secret = t.app_secret);
76
- }
77
- const Qr = {
78
- login: async (t, n) => {
79
- const o = {
80
- name: t,
81
- password: n
74
+ function nr(e) {
75
+ ne.baseURL !== e.apiBaseURL && (ne.baseURL = e.apiBaseURL), e.app_id && (ne.app_id = e.app_id), e.app_secret && (ne.app_secret = e.app_secret);
76
+ }
77
+ const sn = {
78
+ login: async (e, r) => {
79
+ const t = {
80
+ name: e,
81
+ password: r
82
82
  };
83
- return await C.getRequest("POST")("/account/login", o);
83
+ return await ne.getRequest("POST")("/account/login", t);
84
84
  },
85
- list: async () => await C.getRequest("POST")("/account/list", {
85
+ list: async () => await ne.getRequest("POST")("/account/list", {
86
86
  filter: {
87
87
  search: ""
88
88
  },
@@ -95,34 +95,34 @@ const Qr = {
95
95
  pagesize: 100
96
96
  }
97
97
  }),
98
- get: async () => await C.getRequest("GET")("/account/get", {}),
99
- update: async (t, n) => {
100
- const o = {
101
- name: t,
102
- email: n
98
+ get: async () => await ne.getRequest("GET")("/account/get", {}),
99
+ update: async (e, r) => {
100
+ const t = {
101
+ name: e,
102
+ email: r
103
103
  };
104
- return await C.getRequest("PUT")("/account/update", o);
104
+ return await ne.getRequest("PUT")("/account/update", t);
105
105
  },
106
- changepassword: async (t, n) => {
107
- const o = {
108
- old_password: t,
109
- new_password: n
106
+ changepassword: async (e, r) => {
107
+ const t = {
108
+ old_password: e,
109
+ new_password: r
110
110
  };
111
- return await C.getRequest("POST")("/account/changepassword", o);
111
+ return await ne.getRequest("POST")("/account/changepassword", t);
112
112
  },
113
- create: async (t, n, o, s) => await C.getRequest("POST")("/account/create", {
114
- name: t,
115
- email: n,
116
- password: o,
117
- role_id: s
113
+ create: async (e, r, t, o) => await ne.getRequest("POST")("/account/create", {
114
+ name: e,
115
+ email: r,
116
+ password: t,
117
+ role_id: o
118
118
  }),
119
- edit: async (t) => (t.reset_password || (t.new_password = void 0), await C.getRequest("PUT")("/account/edit", t)),
120
- delete: async (t) => {
121
- if (!!t)
122
- return C.getRequest("POST")("/account/delete", { id: t });
119
+ edit: async (e) => (e.reset_password || (e.new_password = void 0), await ne.getRequest("PUT")("/account/edit", e)),
120
+ delete: async (e) => {
121
+ if (!!e)
122
+ return ne.getRequest("POST")("/account/delete", { id: e });
123
123
  }
124
- }, Zr = {
125
- list: async () => await C.getRequest("POST")("/api/key/list", {
124
+ }, cn = {
125
+ list: async () => await ne.getRequest("POST")("/api/key/list", {
126
126
  filter: {
127
127
  search: ""
128
128
  },
@@ -135,16 +135,16 @@ const Qr = {
135
135
  pagesize: 100
136
136
  }
137
137
  }),
138
- create: async (t, n) => C.getRequest("POST")("/api/key/create", {
139
- name: t,
140
- role_id: n
138
+ create: async (e, r) => ne.getRequest("POST")("/api/key/create", {
139
+ name: e,
140
+ role_id: r
141
141
  }),
142
- delete: async (t) => {
143
- if (!!t)
144
- return C.getRequest("POST")("/api/key/delete", { id: t });
142
+ delete: async (e) => {
143
+ if (!!e)
144
+ return ne.getRequest("POST")("/api/key/delete", { id: e });
145
145
  }
146
- }, et = {
147
- list: async () => await C.getRequest("POST")("/datasource/list", {
146
+ }, un = {
147
+ list: async () => await ne.getRequest("POST")("/datasource/list", {
148
148
  filter: {},
149
149
  sort: {
150
150
  field: "create_time",
@@ -155,29 +155,29 @@ const Qr = {
155
155
  pagesize: 100
156
156
  }
157
157
  }),
158
- create: async (t, n, o) => await C.getRequest("POST")("/datasource/create", {
159
- type: t,
160
- key: n,
161
- config: o
158
+ create: async (e, r, t) => await ne.getRequest("POST")("/datasource/create", {
159
+ type: e,
160
+ key: r,
161
+ config: t
162
162
  }),
163
- delete: async (t) => {
164
- await C.getRequest("POST")("/datasource/delete", { id: t });
163
+ delete: async (e) => {
164
+ await ne.getRequest("POST")("/datasource/delete", { id: e });
165
165
  }
166
- }, rt = {
167
- list: async () => await C.getRequest("GET")("/role/list", {})
168
- }, x = {
169
- datasource: et,
170
- account: Qr,
171
- role: rt,
172
- api_key: Zr
173
- }, fe = {
166
+ }, ln = {
167
+ list: async () => await ne.getRequest("GET")("/role/list", {})
168
+ }, de = {
169
+ datasource: un,
170
+ account: sn,
171
+ role: ln,
172
+ api_key: cn
173
+ }, qe = {
174
174
  size: "sm",
175
175
  spacing: "md",
176
176
  button: {
177
177
  size: "xs"
178
178
  }
179
179
  };
180
- var pe = { exports: {} }, Z = {};
180
+ var or = { exports: {} }, Le = {};
181
181
  /**
182
182
  * @license React
183
183
  * react-jsx-runtime.production.min.js
@@ -187,25 +187,25 @@ var pe = { exports: {} }, Z = {};
187
187
  * This source code is licensed under the MIT license found in the
188
188
  * LICENSE file in the root directory of this source tree.
189
189
  */
190
- var er;
191
- function tt() {
192
- if (er)
193
- return Z;
194
- er = 1;
195
- var t = J, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = 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 };
196
- function l(d, g, _) {
197
- var w, m = {}, f = null, A = null;
198
- _ !== void 0 && (f = "" + _), g.key !== void 0 && (f = "" + g.key), g.ref !== void 0 && (A = g.ref);
199
- for (w in g)
200
- s.call(g, w) && !i.hasOwnProperty(w) && (m[w] = g[w]);
201
- if (d && d.defaultProps)
202
- for (w in g = d.defaultProps, g)
203
- m[w] === void 0 && (m[w] = g[w]);
204
- return { $$typeof: n, type: d, key: f, ref: A, props: m, _owner: u.current };
190
+ var Kr;
191
+ function fn() {
192
+ if (Kr)
193
+ return Le;
194
+ Kr = 1;
195
+ var e = De, r = Symbol.for("react.element"), t = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
196
+ function c(u, d, v) {
197
+ var y, h = {}, m = null, x = null;
198
+ v !== void 0 && (m = "" + v), d.key !== void 0 && (m = "" + d.key), d.ref !== void 0 && (x = d.ref);
199
+ for (y in d)
200
+ o.call(d, y) && !i.hasOwnProperty(y) && (h[y] = d[y]);
201
+ if (u && u.defaultProps)
202
+ for (y in d = u.defaultProps, d)
203
+ h[y] === void 0 && (h[y] = d[y]);
204
+ return { $$typeof: r, type: u, key: m, ref: x, props: h, _owner: s.current };
205
205
  }
206
- return Z.Fragment = o, Z.jsx = l, Z.jsxs = l, Z;
206
+ return Le.Fragment = t, Le.jsx = c, Le.jsxs = c, Le;
207
207
  }
208
- var ee = {};
208
+ var Ue = {};
209
209
  /**
210
210
  * @license React
211
211
  * react-jsx-runtime.development.js
@@ -215,87 +215,87 @@ var ee = {};
215
215
  * This source code is licensed under the MIT license found in the
216
216
  * LICENSE file in the root directory of this source tree.
217
217
  */
218
- var rr;
219
- function nt() {
220
- return rr || (rr = 1, process.env.NODE_ENV !== "production" && function() {
221
- var t = J, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), M = Symbol.iterator, V = "@@iterator";
222
- function me(e) {
223
- if (e === null || typeof e != "object")
218
+ var Hr;
219
+ function dn() {
220
+ return Hr || (Hr = 1, process.env.NODE_ENV !== "production" && function() {
221
+ var e = De, r = Symbol.for("react.element"), t = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), u = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), Y = Symbol.iterator, D = "@@iterator";
222
+ function G(n) {
223
+ if (n === null || typeof n != "object")
224
224
  return null;
225
- var a = M && e[M] || e[V];
226
- return typeof a == "function" ? a : null;
225
+ var f = Y && n[Y] || n[D];
226
+ return typeof f == "function" ? f : null;
227
227
  }
228
- var N = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
229
- function T(e) {
228
+ var K = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
229
+ function k(n) {
230
230
  {
231
- for (var a = arguments.length, c = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
232
- c[p - 1] = arguments[p];
233
- or("error", e, c);
231
+ for (var f = arguments.length, b = new Array(f > 1 ? f - 1 : 0), E = 1; E < f; E++)
232
+ b[E - 1] = arguments[E];
233
+ H("error", n, b);
234
234
  }
235
235
  }
236
- function or(e, a, c) {
236
+ function H(n, f, b) {
237
237
  {
238
- var p = N.ReactDebugCurrentFrame, b = p.getStackAddendum();
239
- b !== "" && (a += "%s", c = c.concat([b]));
240
- var y = c.map(function(v) {
241
- return String(v);
238
+ var E = K.ReactDebugCurrentFrame, L = E.getStackAddendum();
239
+ L !== "" && (f += "%s", b = b.concat([L]));
240
+ var V = b.map(function(q) {
241
+ return String(q);
242
242
  });
243
- y.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, y);
243
+ V.unshift("Warning: " + f), Function.prototype.apply.call(console[n], console, V);
244
244
  }
245
245
  }
246
- var sr = !1, cr = !1, lr = !1, ur = !1, dr = !1, Ae;
247
- Ae = Symbol.for("react.module.reference");
248
- function fr(e) {
249
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === i || dr || e === u || e === _ || e === w || ur || e === A || sr || cr || lr || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === m || e.$$typeof === l || e.$$typeof === d || e.$$typeof === g || e.$$typeof === Ae || e.getModuleId !== void 0));
246
+ var N = !1, p = !1, X = !1, ee = !1, Se = !1, Q;
247
+ Q = Symbol.for("react.module.reference");
248
+ function $(n) {
249
+ return !!(typeof n == "string" || typeof n == "function" || n === o || n === i || Se || n === s || n === v || n === y || ee || n === x || N || p || X || typeof n == "object" && n !== null && (n.$$typeof === m || n.$$typeof === h || n.$$typeof === c || n.$$typeof === u || n.$$typeof === d || n.$$typeof === Q || n.getModuleId !== void 0));
250
250
  }
251
- function pr(e, a, c) {
252
- var p = e.displayName;
253
- if (p)
254
- return p;
255
- var b = a.displayName || a.name || "";
256
- return b !== "" ? c + "(" + b + ")" : c;
251
+ function ge(n, f, b) {
252
+ var E = n.displayName;
253
+ if (E)
254
+ return E;
255
+ var L = f.displayName || f.name || "";
256
+ return L !== "" ? b + "(" + L + ")" : b;
257
257
  }
258
- function xe(e) {
259
- return e.displayName || "Context";
258
+ function be(n) {
259
+ return n.displayName || "Context";
260
260
  }
261
- function F(e) {
262
- if (e == null)
261
+ function ie(n) {
262
+ if (n == null)
263
263
  return null;
264
- 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")
265
- return e.displayName || e.name || null;
266
- if (typeof e == "string")
267
- return e;
268
- switch (e) {
269
- case s:
270
- return "Fragment";
264
+ if (typeof n.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
265
+ return n.displayName || n.name || null;
266
+ if (typeof n == "string")
267
+ return n;
268
+ switch (n) {
271
269
  case o:
270
+ return "Fragment";
271
+ case t:
272
272
  return "Portal";
273
273
  case i:
274
274
  return "Profiler";
275
- case u:
275
+ case s:
276
276
  return "StrictMode";
277
- case _:
277
+ case v:
278
278
  return "Suspense";
279
- case w:
279
+ case y:
280
280
  return "SuspenseList";
281
281
  }
282
- if (typeof e == "object")
283
- switch (e.$$typeof) {
282
+ if (typeof n == "object")
283
+ switch (n.$$typeof) {
284
+ case u:
285
+ var f = n;
286
+ return be(f) + ".Consumer";
287
+ case c:
288
+ var b = n;
289
+ return be(b._context) + ".Provider";
284
290
  case d:
285
- var a = e;
286
- return xe(a) + ".Consumer";
287
- case l:
288
- var c = e;
289
- return xe(c._context) + ".Provider";
290
- case g:
291
- return pr(e, e.render, "ForwardRef");
292
- case m:
293
- var p = e.displayName || null;
294
- return p !== null ? p : F(e.type) || "Memo";
295
- case f: {
296
- var b = e, y = b._payload, v = b._init;
291
+ return ge(n, n.render, "ForwardRef");
292
+ case h:
293
+ var E = n.displayName || null;
294
+ return E !== null ? E : ie(n.type) || "Memo";
295
+ case m: {
296
+ var L = n, V = L._payload, q = L._init;
297
297
  try {
298
- return F(v(y));
298
+ return ie(q(V));
299
299
  } catch {
300
300
  return null;
301
301
  }
@@ -303,510 +303,512 @@ function nt() {
303
303
  }
304
304
  return null;
305
305
  }
306
- var Y = Object.assign, H = 0, ke, De, je, Ie, Fe, qe, Le;
307
- function Me() {
306
+ var z = Object.assign, B = 0, te, pe, Ee, Pe, l, g, T;
307
+ function O() {
308
308
  }
309
- Me.__reactDisabledLog = !0;
310
- function gr() {
309
+ O.__reactDisabledLog = !0;
310
+ function P() {
311
311
  {
312
- if (H === 0) {
313
- ke = console.log, De = console.info, je = console.warn, Ie = console.error, Fe = console.group, qe = console.groupCollapsed, Le = console.groupEnd;
314
- var e = {
312
+ if (B === 0) {
313
+ te = console.log, pe = console.info, Ee = console.warn, Pe = console.error, l = console.group, g = console.groupCollapsed, T = console.groupEnd;
314
+ var n = {
315
315
  configurable: !0,
316
316
  enumerable: !0,
317
- value: Me,
317
+ value: O,
318
318
  writable: !0
319
319
  };
320
320
  Object.defineProperties(console, {
321
- info: e,
322
- log: e,
323
- warn: e,
324
- error: e,
325
- group: e,
326
- groupCollapsed: e,
327
- groupEnd: e
321
+ info: n,
322
+ log: n,
323
+ warn: n,
324
+ error: n,
325
+ group: n,
326
+ groupCollapsed: n,
327
+ groupEnd: n
328
328
  });
329
329
  }
330
- H++;
330
+ B++;
331
331
  }
332
332
  }
333
- function mr() {
333
+ function C() {
334
334
  {
335
- if (H--, H === 0) {
336
- var e = {
335
+ if (B--, B === 0) {
336
+ var n = {
337
337
  configurable: !0,
338
338
  enumerable: !0,
339
339
  writable: !0
340
340
  };
341
341
  Object.defineProperties(console, {
342
- log: Y({}, e, {
343
- value: ke
342
+ log: z({}, n, {
343
+ value: te
344
344
  }),
345
- info: Y({}, e, {
346
- value: De
345
+ info: z({}, n, {
346
+ value: pe
347
347
  }),
348
- warn: Y({}, e, {
349
- value: je
348
+ warn: z({}, n, {
349
+ value: Ee
350
350
  }),
351
- error: Y({}, e, {
352
- value: Ie
351
+ error: z({}, n, {
352
+ value: Pe
353
353
  }),
354
- group: Y({}, e, {
355
- value: Fe
354
+ group: z({}, n, {
355
+ value: l
356
356
  }),
357
- groupCollapsed: Y({}, e, {
358
- value: qe
357
+ groupCollapsed: z({}, n, {
358
+ value: g
359
359
  }),
360
- groupEnd: Y({}, e, {
361
- value: Le
360
+ groupEnd: z({}, n, {
361
+ value: T
362
362
  })
363
363
  });
364
364
  }
365
- H < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
365
+ B < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
366
366
  }
367
367
  }
368
- var he = N.ReactCurrentDispatcher, ve;
369
- function te(e, a, c) {
368
+ var R = K.ReactCurrentDispatcher, _;
369
+ function j(n, f, b) {
370
370
  {
371
- if (ve === void 0)
371
+ if (_ === void 0)
372
372
  try {
373
373
  throw Error();
374
- } catch (b) {
375
- var p = b.stack.trim().match(/\n( *(at )?)/);
376
- ve = p && p[1] || "";
374
+ } catch (L) {
375
+ var E = L.stack.trim().match(/\n( *(at )?)/);
376
+ _ = E && E[1] || "";
377
377
  }
378
378
  return `
379
- ` + ve + e;
379
+ ` + _ + n;
380
380
  }
381
381
  }
382
- var be = !1, ne;
382
+ var F = !1, A;
383
383
  {
384
- var hr = typeof WeakMap == "function" ? WeakMap : Map;
385
- ne = new hr();
384
+ var ae = typeof WeakMap == "function" ? WeakMap : Map;
385
+ A = new ae();
386
386
  }
387
- function Ne(e, a) {
388
- if (!e || be)
387
+ function w(n, f) {
388
+ if (!n || F)
389
389
  return "";
390
390
  {
391
- var c = ne.get(e);
392
- if (c !== void 0)
393
- return c;
391
+ var b = A.get(n);
392
+ if (b !== void 0)
393
+ return b;
394
394
  }
395
- var p;
396
- be = !0;
397
- var b = Error.prepareStackTrace;
395
+ var E;
396
+ F = !0;
397
+ var L = Error.prepareStackTrace;
398
398
  Error.prepareStackTrace = void 0;
399
- var y;
400
- y = he.current, he.current = null, gr();
399
+ var V;
400
+ V = R.current, R.current = null, P();
401
401
  try {
402
- if (a) {
403
- var v = function() {
402
+ if (f) {
403
+ var q = function() {
404
404
  throw Error();
405
405
  };
406
- if (Object.defineProperty(v.prototype, "props", {
406
+ if (Object.defineProperty(q.prototype, "props", {
407
407
  set: function() {
408
408
  throw Error();
409
409
  }
410
410
  }), typeof Reflect == "object" && Reflect.construct) {
411
411
  try {
412
- Reflect.construct(v, []);
413
- } catch (q) {
414
- p = q;
412
+ Reflect.construct(q, []);
413
+ } catch (Te) {
414
+ E = Te;
415
415
  }
416
- Reflect.construct(e, [], v);
416
+ Reflect.construct(n, [], q);
417
417
  } else {
418
418
  try {
419
- v.call();
420
- } catch (q) {
421
- p = q;
419
+ q.call();
420
+ } catch (Te) {
421
+ E = Te;
422
422
  }
423
- e.call(v.prototype);
423
+ n.call(q.prototype);
424
424
  }
425
425
  } else {
426
426
  try {
427
427
  throw Error();
428
- } catch (q) {
429
- p = q;
428
+ } catch (Te) {
429
+ E = Te;
430
430
  }
431
- e();
431
+ n();
432
432
  }
433
- } catch (q) {
434
- if (q && p && typeof q.stack == "string") {
435
- for (var h = q.stack.split(`
436
- `), O = p.stack.split(`
437
- `), R = h.length - 1, P = O.length - 1; R >= 1 && P >= 0 && h[R] !== O[P]; )
438
- P--;
439
- for (; R >= 1 && P >= 0; R--, P--)
440
- if (h[R] !== O[P]) {
441
- if (R !== 1 || P !== 1)
433
+ } catch (Te) {
434
+ if (Te && E && typeof Te.stack == "string") {
435
+ for (var M = Te.stack.split(`
436
+ `), ce = E.stack.split(`
437
+ `), Z = M.length - 1, re = ce.length - 1; Z >= 1 && re >= 0 && M[Z] !== ce[re]; )
438
+ re--;
439
+ for (; Z >= 1 && re >= 0; Z--, re--)
440
+ if (M[Z] !== ce[re]) {
441
+ if (Z !== 1 || re !== 1)
442
442
  do
443
- if (R--, P--, P < 0 || h[R] !== O[P]) {
444
- var D = `
445
- ` + h[R].replace(" at new ", " at ");
446
- return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && ne.set(e, D), D;
443
+ if (Z--, re--, re < 0 || M[Z] !== ce[re]) {
444
+ var ve = `
445
+ ` + M[Z].replace(" at new ", " at ");
446
+ return n.displayName && ve.includes("<anonymous>") && (ve = ve.replace("<anonymous>", n.displayName)), typeof n == "function" && A.set(n, ve), ve;
447
447
  }
448
- while (R >= 1 && P >= 0);
448
+ while (Z >= 1 && re >= 0);
449
449
  break;
450
450
  }
451
451
  }
452
452
  } finally {
453
- be = !1, he.current = y, mr(), Error.prepareStackTrace = b;
453
+ F = !1, R.current = V, C(), Error.prepareStackTrace = L;
454
454
  }
455
- var B = e ? e.displayName || e.name : "", Ze = B ? te(B) : "";
456
- return typeof e == "function" && ne.set(e, Ze), Ze;
455
+ var Me = n ? n.displayName || n.name : "", Br = Me ? j(Me) : "";
456
+ return typeof n == "function" && A.set(n, Br), Br;
457
457
  }
458
- function vr(e, a, c) {
459
- return Ne(e, !1);
458
+ function he(n, f, b) {
459
+ return w(n, !1);
460
460
  }
461
- function br(e) {
462
- var a = e.prototype;
463
- return !!(a && a.isReactComponent);
461
+ function je(n) {
462
+ var f = n.prototype;
463
+ return !!(f && f.isReactComponent);
464
464
  }
465
- function ae(e, a, c) {
466
- if (e == null)
465
+ function Ce(n, f, b) {
466
+ if (n == null)
467
467
  return "";
468
- if (typeof e == "function")
469
- return Ne(e, br(e));
470
- if (typeof e == "string")
471
- return te(e);
472
- switch (e) {
473
- case _:
474
- return te("Suspense");
475
- case w:
476
- return te("SuspenseList");
468
+ if (typeof n == "function")
469
+ return w(n, je(n));
470
+ if (typeof n == "string")
471
+ return j(n);
472
+ switch (n) {
473
+ case v:
474
+ return j("Suspense");
475
+ case y:
476
+ return j("SuspenseList");
477
477
  }
478
- if (typeof e == "object")
479
- switch (e.$$typeof) {
480
- case g:
481
- return vr(e.render);
482
- case m:
483
- return ae(e.type, a, c);
484
- case f: {
485
- var p = e, b = p._payload, y = p._init;
478
+ if (typeof n == "object")
479
+ switch (n.$$typeof) {
480
+ case d:
481
+ return he(n.render);
482
+ case h:
483
+ return Ce(n.type, f, b);
484
+ case m: {
485
+ var E = n, L = E._payload, V = E._init;
486
486
  try {
487
- return ae(y(b), a, c);
487
+ return Ce(V(L), f, b);
488
488
  } catch {
489
489
  }
490
490
  }
491
491
  }
492
492
  return "";
493
493
  }
494
- var ie = Object.prototype.hasOwnProperty, Ue = {}, $e = N.ReactDebugCurrentFrame;
495
- function oe(e) {
496
- if (e) {
497
- var a = e._owner, c = ae(e.type, e._source, a ? a.type : null);
498
- $e.setExtraStackFrame(c);
494
+ var Ke = Object.prototype.hasOwnProperty, zr = {}, Dr = K.ReactDebugCurrentFrame;
495
+ function He(n) {
496
+ if (n) {
497
+ var f = n._owner, b = Ce(n.type, n._source, f ? f.type : null);
498
+ Dr.setExtraStackFrame(b);
499
499
  } else
500
- $e.setExtraStackFrame(null);
500
+ Dr.setExtraStackFrame(null);
501
501
  }
502
- function wr(e, a, c, p, b) {
502
+ function Pt(n, f, b, E, L) {
503
503
  {
504
- var y = Function.call.bind(ie);
505
- for (var v in e)
506
- if (y(e, v)) {
507
- var h = void 0;
504
+ var V = Function.call.bind(Ke);
505
+ for (var q in n)
506
+ if (V(n, q)) {
507
+ var M = void 0;
508
508
  try {
509
- if (typeof e[v] != "function") {
510
- var O = Error((p || "React class") + ": " + c + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
511
- throw O.name = "Invariant Violation", O;
509
+ if (typeof n[q] != "function") {
510
+ var ce = Error((E || "React class") + ": " + b + " type `" + q + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[q] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
511
+ throw ce.name = "Invariant Violation", ce;
512
512
  }
513
- h = e[v](a, v, p, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
514
- } catch (R) {
515
- h = R;
513
+ M = n[q](f, q, E, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
514
+ } catch (Z) {
515
+ M = Z;
516
516
  }
517
- h && !(h instanceof Error) && (oe(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", c, v, typeof h), oe(null)), h instanceof Error && !(h.message in Ue) && (Ue[h.message] = !0, oe(b), T("Failed %s type: %s", c, h.message), oe(null));
517
+ M && !(M instanceof Error) && (He(L), k("%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).", E || "React class", b, q, typeof M), He(null)), M instanceof Error && !(M.message in zr) && (zr[M.message] = !0, He(L), k("Failed %s type: %s", b, M.message), He(null));
518
518
  }
519
519
  }
520
520
  }
521
- var Sr = Array.isArray;
522
- function we(e) {
523
- return Sr(e);
521
+ var Rt = Array.isArray;
522
+ function sr(n) {
523
+ return Rt(n);
524
524
  }
525
- function _r(e) {
525
+ function _t(n) {
526
526
  {
527
- var a = typeof Symbol == "function" && Symbol.toStringTag, c = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
528
- return c;
527
+ var f = typeof Symbol == "function" && Symbol.toStringTag, b = f && n[Symbol.toStringTag] || n.constructor.name || "Object";
528
+ return b;
529
529
  }
530
530
  }
531
- function yr(e) {
531
+ function xt(n) {
532
532
  try {
533
- return We(e), !1;
533
+ return kr(n), !1;
534
534
  } catch {
535
535
  return !0;
536
536
  }
537
537
  }
538
- function We(e) {
539
- return "" + e;
538
+ function kr(n) {
539
+ return "" + n;
540
540
  }
541
- function Ve(e) {
542
- if (yr(e))
543
- return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _r(e)), We(e);
541
+ function qr(n) {
542
+ if (xt(n))
543
+ return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _t(n)), kr(n);
544
544
  }
545
- var X = N.ReactCurrentOwner, Rr = {
545
+ var Fe = K.ReactCurrentOwner, Ct = {
546
546
  key: !0,
547
547
  ref: !0,
548
548
  __self: !0,
549
549
  __source: !0
550
- }, Ye, Ke, Se;
551
- Se = {};
552
- function Pr(e) {
553
- if (ie.call(e, "ref")) {
554
- var a = Object.getOwnPropertyDescriptor(e, "ref").get;
555
- if (a && a.isReactWarning)
550
+ }, Fr, $r, cr;
551
+ cr = {};
552
+ function jt(n) {
553
+ if (Ke.call(n, "ref")) {
554
+ var f = Object.getOwnPropertyDescriptor(n, "ref").get;
555
+ if (f && f.isReactWarning)
556
556
  return !1;
557
557
  }
558
- return e.ref !== void 0;
558
+ return n.ref !== void 0;
559
559
  }
560
- function Er(e) {
561
- if (ie.call(e, "key")) {
562
- var a = Object.getOwnPropertyDescriptor(e, "key").get;
563
- if (a && a.isReactWarning)
560
+ function At(n) {
561
+ if (Ke.call(n, "key")) {
562
+ var f = Object.getOwnPropertyDescriptor(n, "key").get;
563
+ if (f && f.isReactWarning)
564
564
  return !1;
565
565
  }
566
- return e.key !== void 0;
566
+ return n.key !== void 0;
567
567
  }
568
- function Cr(e, a) {
569
- if (typeof e.ref == "string" && X.current && a && X.current.stateNode !== a) {
570
- var c = F(X.current.type);
571
- Se[c] || (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), Se[c] = !0);
568
+ function Mt(n, f) {
569
+ if (typeof n.ref == "string" && Fe.current && f && Fe.current.stateNode !== f) {
570
+ var b = ie(Fe.current.type);
571
+ cr[b] || (k('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', ie(Fe.current.type), n.ref), cr[b] = !0);
572
572
  }
573
573
  }
574
- function Tr(e, a) {
574
+ function It(n, f) {
575
575
  {
576
- var c = function() {
577
- Ye || (Ye = !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)", a));
576
+ var b = function() {
577
+ Fr || (Fr = !0, k("%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)", f));
578
578
  };
579
- c.isReactWarning = !0, Object.defineProperty(e, "key", {
580
- get: c,
579
+ b.isReactWarning = !0, Object.defineProperty(n, "key", {
580
+ get: b,
581
581
  configurable: !0
582
582
  });
583
583
  }
584
584
  }
585
- function Or(e, a) {
585
+ function zt(n, f) {
586
586
  {
587
- var c = function() {
588
- 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)", a));
587
+ var b = function() {
588
+ $r || ($r = !0, k("%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)", f));
589
589
  };
590
- c.isReactWarning = !0, Object.defineProperty(e, "ref", {
591
- get: c,
590
+ b.isReactWarning = !0, Object.defineProperty(n, "ref", {
591
+ get: b,
592
592
  configurable: !0
593
593
  });
594
594
  }
595
595
  }
596
- var zr = function(e, a, c, p, b, y, v) {
597
- var h = {
598
- $$typeof: n,
599
- type: e,
600
- key: a,
601
- ref: c,
602
- props: v,
603
- _owner: y
596
+ var Dt = function(n, f, b, E, L, V, q) {
597
+ var M = {
598
+ $$typeof: r,
599
+ type: n,
600
+ key: f,
601
+ ref: b,
602
+ props: q,
603
+ _owner: V
604
604
  };
605
- return h._store = {}, Object.defineProperty(h._store, "validated", {
605
+ return M._store = {}, Object.defineProperty(M._store, "validated", {
606
606
  configurable: !1,
607
607
  enumerable: !1,
608
608
  writable: !0,
609
609
  value: !1
610
- }), Object.defineProperty(h, "_self", {
610
+ }), Object.defineProperty(M, "_self", {
611
611
  configurable: !1,
612
612
  enumerable: !1,
613
613
  writable: !1,
614
- value: p
615
- }), Object.defineProperty(h, "_source", {
614
+ value: E
615
+ }), Object.defineProperty(M, "_source", {
616
616
  configurable: !1,
617
617
  enumerable: !1,
618
618
  writable: !1,
619
- value: b
620
- }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
619
+ value: L
620
+ }), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
621
621
  };
622
- function Ar(e, a, c, p, b) {
622
+ function kt(n, f, b, E, L) {
623
623
  {
624
- var y, v = {}, h = null, O = null;
625
- c !== void 0 && (Ve(c), h = "" + c), Er(a) && (Ve(a.key), h = "" + a.key), Pr(a) && (O = a.ref, Cr(a, b));
626
- for (y in a)
627
- ie.call(a, y) && !Rr.hasOwnProperty(y) && (v[y] = a[y]);
628
- if (e && e.defaultProps) {
629
- var R = e.defaultProps;
630
- for (y in R)
631
- v[y] === void 0 && (v[y] = R[y]);
624
+ var V, q = {}, M = null, ce = null;
625
+ b !== void 0 && (qr(b), M = "" + b), At(f) && (qr(f.key), M = "" + f.key), jt(f) && (ce = f.ref, Mt(f, L));
626
+ for (V in f)
627
+ Ke.call(f, V) && !Ct.hasOwnProperty(V) && (q[V] = f[V]);
628
+ if (n && n.defaultProps) {
629
+ var Z = n.defaultProps;
630
+ for (V in Z)
631
+ q[V] === void 0 && (q[V] = Z[V]);
632
632
  }
633
- if (h || O) {
634
- var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
635
- h && Tr(v, P), O && Or(v, P);
633
+ if (M || ce) {
634
+ var re = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
635
+ M && It(q, re), ce && zt(q, re);
636
636
  }
637
- return zr(e, h, O, b, p, X.current, v);
637
+ return Dt(n, M, ce, L, E, Fe.current, q);
638
638
  }
639
639
  }
640
- var _e = N.ReactCurrentOwner, Be = N.ReactDebugCurrentFrame;
641
- function K(e) {
642
- if (e) {
643
- var a = e._owner, c = ae(e.type, e._source, a ? a.type : null);
644
- Be.setExtraStackFrame(c);
640
+ var ur = K.ReactCurrentOwner, Lr = K.ReactDebugCurrentFrame;
641
+ function Ae(n) {
642
+ if (n) {
643
+ var f = n._owner, b = Ce(n.type, n._source, f ? f.type : null);
644
+ Lr.setExtraStackFrame(b);
645
645
  } else
646
- Be.setExtraStackFrame(null);
646
+ Lr.setExtraStackFrame(null);
647
647
  }
648
- var ye;
649
- ye = !1;
650
- function Re(e) {
651
- return typeof e == "object" && e !== null && e.$$typeof === n;
648
+ var lr;
649
+ lr = !1;
650
+ function fr(n) {
651
+ return typeof n == "object" && n !== null && n.$$typeof === r;
652
652
  }
653
- function Ge() {
653
+ function Ur() {
654
654
  {
655
- if (_e.current) {
656
- var e = F(_e.current.type);
657
- if (e)
655
+ if (ur.current) {
656
+ var n = ie(ur.current.type);
657
+ if (n)
658
658
  return `
659
659
 
660
- Check the render method of \`` + e + "`.";
660
+ Check the render method of \`` + n + "`.";
661
661
  }
662
662
  return "";
663
663
  }
664
664
  }
665
- function xr(e) {
665
+ function qt(n) {
666
666
  {
667
- if (e !== void 0) {
668
- var a = e.fileName.replace(/^.*[\\\/]/, ""), c = e.lineNumber;
667
+ if (n !== void 0) {
668
+ var f = n.fileName.replace(/^.*[\\\/]/, ""), b = n.lineNumber;
669
669
  return `
670
670
 
671
- Check your code at ` + a + ":" + c + ".";
671
+ Check your code at ` + f + ":" + b + ".";
672
672
  }
673
673
  return "";
674
674
  }
675
675
  }
676
- var Je = {};
677
- function kr(e) {
676
+ var Wr = {};
677
+ function Ft(n) {
678
678
  {
679
- var a = Ge();
680
- if (!a) {
681
- var c = typeof e == "string" ? e : e.displayName || e.name;
682
- c && (a = `
679
+ var f = Ur();
680
+ if (!f) {
681
+ var b = typeof n == "string" ? n : n.displayName || n.name;
682
+ b && (f = `
683
683
 
684
- Check the top-level render call using <` + c + ">.");
684
+ Check the top-level render call using <` + b + ">.");
685
685
  }
686
- return a;
686
+ return f;
687
687
  }
688
688
  }
689
- function He(e, a) {
689
+ function Yr(n, f) {
690
690
  {
691
- if (!e._store || e._store.validated || e.key != null)
691
+ if (!n._store || n._store.validated || n.key != null)
692
692
  return;
693
- e._store.validated = !0;
694
- var c = kr(a);
695
- if (Je[c])
693
+ n._store.validated = !0;
694
+ var b = Ft(f);
695
+ if (Wr[b])
696
696
  return;
697
- Je[c] = !0;
698
- var p = "";
699
- e && e._owner && e._owner !== _e.current && (p = " It was passed a child from " + F(e._owner.type) + "."), K(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.', c, p), K(null);
697
+ Wr[b] = !0;
698
+ var E = "";
699
+ n && n._owner && n._owner !== ur.current && (E = " It was passed a child from " + ie(n._owner.type) + "."), Ae(n), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, E), Ae(null);
700
700
  }
701
701
  }
702
- function Xe(e, a) {
702
+ function Nr(n, f) {
703
703
  {
704
- if (typeof e != "object")
704
+ if (typeof n != "object")
705
705
  return;
706
- if (we(e))
707
- for (var c = 0; c < e.length; c++) {
708
- var p = e[c];
709
- Re(p) && He(p, a);
706
+ if (sr(n))
707
+ for (var b = 0; b < n.length; b++) {
708
+ var E = n[b];
709
+ fr(E) && Yr(E, f);
710
710
  }
711
- else if (Re(e))
712
- e._store && (e._store.validated = !0);
713
- else if (e) {
714
- var b = me(e);
715
- if (typeof b == "function" && b !== e.entries)
716
- for (var y = b.call(e), v; !(v = y.next()).done; )
717
- Re(v.value) && He(v.value, a);
711
+ else if (fr(n))
712
+ n._store && (n._store.validated = !0);
713
+ else if (n) {
714
+ var L = G(n);
715
+ if (typeof L == "function" && L !== n.entries)
716
+ for (var V = L.call(n), q; !(q = V.next()).done; )
717
+ fr(q.value) && Yr(q.value, f);
718
718
  }
719
719
  }
720
720
  }
721
- function Dr(e) {
721
+ function $t(n) {
722
722
  {
723
- var a = e.type;
724
- if (a == null || typeof a == "string")
723
+ var f = n.type;
724
+ if (f == null || typeof f == "string")
725
725
  return;
726
- var c;
727
- if (typeof a == "function")
728
- c = a.propTypes;
729
- else if (typeof a == "object" && (a.$$typeof === g || a.$$typeof === m))
730
- c = a.propTypes;
726
+ var b;
727
+ if (typeof f == "function")
728
+ b = f.propTypes;
729
+ else if (typeof f == "object" && (f.$$typeof === d || f.$$typeof === h))
730
+ b = f.propTypes;
731
731
  else
732
732
  return;
733
- if (c) {
734
- var p = F(a);
735
- wr(c, e.props, "prop", p, e);
736
- } else if (a.PropTypes !== void 0 && !ye) {
737
- ye = !0;
738
- var b = F(a);
739
- T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
733
+ if (b) {
734
+ var E = ie(f);
735
+ Pt(b, n.props, "prop", E, n);
736
+ } else if (f.PropTypes !== void 0 && !lr) {
737
+ lr = !0;
738
+ var L = ie(f);
739
+ k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", L || "Unknown");
740
740
  }
741
- typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
741
+ typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
742
742
  }
743
743
  }
744
- function jr(e) {
744
+ function Lt(n) {
745
745
  {
746
- for (var a = Object.keys(e.props), c = 0; c < a.length; c++) {
747
- var p = a[c];
748
- if (p !== "children" && p !== "key") {
749
- K(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), K(null);
746
+ for (var f = Object.keys(n.props), b = 0; b < f.length; b++) {
747
+ var E = f[b];
748
+ if (E !== "children" && E !== "key") {
749
+ Ae(n), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), Ae(null);
750
750
  break;
751
751
  }
752
752
  }
753
- e.ref !== null && (K(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
753
+ n.ref !== null && (Ae(n), k("Invalid attribute `ref` supplied to `React.Fragment`."), Ae(null));
754
754
  }
755
755
  }
756
- function Qe(e, a, c, p, b, y) {
756
+ function Vr(n, f, b, E, L, V) {
757
757
  {
758
- var v = fr(e);
759
- if (!v) {
760
- var h = "";
761
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
762
- var O = xr(b);
763
- O ? h += O : h += Ge();
764
- var R;
765
- e === null ? R = "null" : we(e) ? R = "array" : e !== void 0 && e.$$typeof === n ? (R = "<" + (F(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : R = 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", R, h);
758
+ var q = $(n);
759
+ if (!q) {
760
+ var M = "";
761
+ (n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (M += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
762
+ var ce = qt(L);
763
+ ce ? M += ce : M += Ur();
764
+ var Z;
765
+ n === null ? Z = "null" : sr(n) ? Z = "array" : n !== void 0 && n.$$typeof === r ? (Z = "<" + (ie(n.type) || "Unknown") + " />", M = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof n, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, M);
766
766
  }
767
- var P = Ar(e, a, c, b, y);
768
- if (P == null)
769
- return P;
770
- if (v) {
771
- var D = a.children;
772
- if (D !== void 0)
773
- if (p)
774
- if (we(D)) {
775
- for (var B = 0; B < D.length; B++)
776
- Xe(D[B], e);
777
- Object.freeze && Object.freeze(D);
767
+ var re = kt(n, f, b, L, V);
768
+ if (re == null)
769
+ return re;
770
+ if (q) {
771
+ var ve = f.children;
772
+ if (ve !== void 0)
773
+ if (E)
774
+ if (sr(ve)) {
775
+ for (var Me = 0; Me < ve.length; Me++)
776
+ Nr(ve[Me], n);
777
+ Object.freeze && Object.freeze(ve);
778
778
  } else
779
- 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.");
779
+ k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
780
780
  else
781
- Xe(D, e);
781
+ Nr(ve, n);
782
782
  }
783
- return e === s ? jr(P) : Dr(P), P;
783
+ return n === o ? Lt(re) : $t(re), re;
784
784
  }
785
785
  }
786
- function Ir(e, a, c) {
787
- return Qe(e, a, c, !0);
786
+ function Ut(n, f, b) {
787
+ return Vr(n, f, b, !0);
788
788
  }
789
- function Fr(e, a, c) {
790
- return Qe(e, a, c, !1);
789
+ function Wt(n, f, b) {
790
+ return Vr(n, f, b, !1);
791
791
  }
792
- var qr = Fr, Lr = Ir;
793
- ee.Fragment = s, ee.jsx = qr, ee.jsxs = Lr;
794
- }()), ee;
792
+ var Yt = Wt, Nt = Ut;
793
+ Ue.Fragment = o, Ue.jsx = Yt, Ue.jsxs = Nt;
794
+ }()), Ue;
795
795
  }
796
- (function(t) {
797
- process.env.NODE_ENV === "production" ? t.exports = tt() : t.exports = nt();
798
- })(pe);
799
- const $ = pe.exports.Fragment, r = pe.exports.jsx, S = pe.exports.jsxs;
800
- function at({
801
- postSubmit: t,
802
- styles: n = fe
796
+ (function(e) {
797
+ process.env.NODE_ENV === "production" ? e.exports = fn() : e.exports = dn();
798
+ })(or);
799
+ const Oe = or.exports.Fragment, a = or.exports.jsx, I = or.exports.jsxs;
800
+ function pn({
801
+ submit: e,
802
+ styles: r = qe,
803
+ type: t
803
804
  }) {
804
805
  const {
805
806
  control: o,
806
- handleSubmit: s
807
- } = re({
807
+ setValue: s,
808
+ handleSubmit: i
809
+ } = ke({
808
810
  defaultValues: {
809
- type: "postgresql",
811
+ type: t,
810
812
  key: "",
811
813
  config: {
812
814
  host: "",
@@ -817,243 +819,1852 @@ function at({
817
819
  }
818
820
  }
819
821
  });
820
- return /* @__PURE__ */ r(L, {
822
+ return we(() => {
823
+ s("type", t);
824
+ }, [s, t]), /* @__PURE__ */ a(me, {
821
825
  mx: "auto",
822
- children: /* @__PURE__ */ S("form", {
823
- onSubmit: s(async ({
824
- type: i,
825
- key: l,
826
- config: d
827
- }) => {
828
- U({
829
- id: "for-creating",
830
- title: "Pending",
831
- message: "Adding data source...",
832
- loading: !0
833
- });
834
- try {
835
- await x.datasource.create(i, l, d), z({
836
- id: "for-creating",
837
- title: "Successful",
838
- message: "Data source is added",
839
- color: "green"
840
- }), t();
841
- } catch (g) {
842
- z({
843
- id: "for-creating",
844
- title: "Failed",
845
- message: g.message,
846
- color: "red"
847
- });
848
- }
849
- }),
850
- children: [/* @__PURE__ */ r(E, {
851
- name: "type",
852
- control: o,
853
- render: ({
854
- field: i
855
- }) => /* @__PURE__ */ r(Mr, {
856
- fullWidth: !0,
857
- mb: n.spacing,
858
- size: n.size,
859
- data: [{
860
- label: "PostgreSQL",
861
- value: "postgresql"
862
- }, {
863
- label: "MySQL",
864
- value: "mysql"
865
- }, {
866
- label: "HTTP",
867
- value: "http",
868
- disabled: !0
869
- }],
870
- ...i
871
- })
872
- }), /* @__PURE__ */ r(E, {
826
+ children: /* @__PURE__ */ I("form", {
827
+ onSubmit: i(e),
828
+ children: [/* @__PURE__ */ a(J, {
873
829
  name: "key",
874
830
  control: o,
875
831
  render: ({
876
- field: i
877
- }) => /* @__PURE__ */ r(j, {
878
- mb: n.spacing,
879
- size: n.size,
832
+ field: c
833
+ }) => /* @__PURE__ */ a(fe, {
834
+ mb: r.spacing,
835
+ size: r.size,
880
836
  required: !0,
881
837
  label: "Name",
882
838
  placeholder: "A unique name",
883
- ...i
839
+ ...c
884
840
  })
885
- }), /* @__PURE__ */ r(tr, {
841
+ }), /* @__PURE__ */ a(Or, {
886
842
  label: "Connection Info",
887
843
  labelPosition: "center"
888
- }), /* @__PURE__ */ S(I, {
844
+ }), /* @__PURE__ */ I(se, {
889
845
  grow: !0,
890
- children: [/* @__PURE__ */ r(E, {
846
+ children: [/* @__PURE__ */ a(J, {
891
847
  name: "config.host",
892
848
  control: o,
893
849
  render: ({
894
- field: i
895
- }) => /* @__PURE__ */ r(j, {
896
- mb: n.spacing,
897
- size: n.size,
850
+ field: c
851
+ }) => /* @__PURE__ */ a(fe, {
852
+ mb: r.spacing,
853
+ size: r.size,
898
854
  required: !0,
899
855
  label: "Host",
900
856
  sx: {
901
857
  flexGrow: 1
902
858
  },
903
- ...i
859
+ ...c
904
860
  })
905
- }), /* @__PURE__ */ r(E, {
861
+ }), /* @__PURE__ */ a(J, {
906
862
  name: "config.port",
907
863
  control: o,
908
864
  render: ({
909
- field: i
910
- }) => /* @__PURE__ */ r(Nr, {
911
- mb: n.spacing,
912
- size: n.size,
865
+ field: c
866
+ }) => /* @__PURE__ */ a(Vt, {
867
+ mb: r.spacing,
868
+ size: r.size,
913
869
  required: !0,
914
870
  label: "Port",
915
871
  hideControls: !0,
916
872
  sx: {
917
873
  width: "8em"
918
874
  },
919
- ...i
875
+ ...c
920
876
  })
921
877
  })]
922
- }), /* @__PURE__ */ r(E, {
878
+ }), /* @__PURE__ */ a(J, {
923
879
  name: "config.username",
924
880
  control: o,
925
881
  render: ({
926
- field: i
927
- }) => /* @__PURE__ */ r(j, {
928
- mb: n.spacing,
929
- size: n.size,
882
+ field: c
883
+ }) => /* @__PURE__ */ a(fe, {
884
+ mb: r.spacing,
885
+ size: r.size,
930
886
  required: !0,
931
887
  label: "Username",
932
- ...i
888
+ ...c
933
889
  })
934
- }), /* @__PURE__ */ r(E, {
890
+ }), /* @__PURE__ */ a(J, {
935
891
  name: "config.password",
936
892
  control: o,
937
893
  render: ({
938
- field: i
939
- }) => /* @__PURE__ */ r(le, {
940
- mb: n.spacing,
941
- size: n.size,
894
+ field: c
895
+ }) => /* @__PURE__ */ a(rr, {
896
+ mb: r.spacing,
897
+ size: r.size,
942
898
  required: !0,
943
899
  label: "Password",
944
- ...i
900
+ ...c
945
901
  })
946
- }), /* @__PURE__ */ r(E, {
902
+ }), /* @__PURE__ */ a(J, {
947
903
  name: "config.database",
948
904
  control: o,
949
905
  render: ({
950
- field: i
951
- }) => /* @__PURE__ */ r(j, {
952
- mb: n.spacing,
953
- size: n.size,
906
+ field: c
907
+ }) => /* @__PURE__ */ a(fe, {
908
+ mb: r.spacing,
909
+ size: r.size,
954
910
  required: !0,
955
911
  label: "Database",
912
+ ...c
913
+ })
914
+ }), /* @__PURE__ */ a(se, {
915
+ position: "right",
916
+ mt: r.spacing,
917
+ children: /* @__PURE__ */ a(oe, {
918
+ type: "submit",
919
+ size: r.button.size,
920
+ children: "Save"
921
+ })
922
+ })]
923
+ })
924
+ });
925
+ }
926
+ function gn(e, r, t) {
927
+ return r in e ? Object.defineProperty(e, r, {
928
+ value: t,
929
+ enumerable: !0,
930
+ configurable: !0,
931
+ writable: !0
932
+ }) : e[r] = t, e;
933
+ }
934
+ function Gr(e, r) {
935
+ var t = Object.keys(e);
936
+ if (Object.getOwnPropertySymbols) {
937
+ var o = Object.getOwnPropertySymbols(e);
938
+ r && (o = o.filter(function(s) {
939
+ return Object.getOwnPropertyDescriptor(e, s).enumerable;
940
+ })), t.push.apply(t, o);
941
+ }
942
+ return t;
943
+ }
944
+ function Jr(e) {
945
+ for (var r = 1; r < arguments.length; r++) {
946
+ var t = arguments[r] != null ? arguments[r] : {};
947
+ r % 2 ? Gr(Object(t), !0).forEach(function(o) {
948
+ gn(e, o, t[o]);
949
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Gr(Object(t)).forEach(function(o) {
950
+ Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
951
+ });
952
+ }
953
+ return e;
954
+ }
955
+ function hn(e, r) {
956
+ if (e == null)
957
+ return {};
958
+ var t = {}, o = Object.keys(e), s, i;
959
+ for (i = 0; i < o.length; i++)
960
+ s = o[i], !(r.indexOf(s) >= 0) && (t[s] = e[s]);
961
+ return t;
962
+ }
963
+ function vn(e, r) {
964
+ if (e == null)
965
+ return {};
966
+ var t = hn(e, r), o, s;
967
+ if (Object.getOwnPropertySymbols) {
968
+ var i = Object.getOwnPropertySymbols(e);
969
+ for (s = 0; s < i.length; s++)
970
+ o = i[s], !(r.indexOf(o) >= 0) && (!Object.prototype.propertyIsEnumerable.call(e, o) || (t[o] = e[o]));
971
+ }
972
+ return t;
973
+ }
974
+ function mn(e, r) {
975
+ return bn(e) || yn(e, r) || wn(e, r) || Sn();
976
+ }
977
+ function bn(e) {
978
+ if (Array.isArray(e))
979
+ return e;
980
+ }
981
+ function yn(e, r) {
982
+ if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
983
+ var t = [], o = !0, s = !1, i = void 0;
984
+ try {
985
+ for (var c = e[Symbol.iterator](), u; !(o = (u = c.next()).done) && (t.push(u.value), !(r && t.length === r)); o = !0)
986
+ ;
987
+ } catch (d) {
988
+ s = !0, i = d;
989
+ } finally {
990
+ try {
991
+ !o && c.return != null && c.return();
992
+ } finally {
993
+ if (s)
994
+ throw i;
995
+ }
996
+ }
997
+ return t;
998
+ }
999
+ }
1000
+ function wn(e, r) {
1001
+ if (!!e) {
1002
+ if (typeof e == "string")
1003
+ return Xr(e, r);
1004
+ var t = Object.prototype.toString.call(e).slice(8, -1);
1005
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
1006
+ return Array.from(e);
1007
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
1008
+ return Xr(e, r);
1009
+ }
1010
+ }
1011
+ function Xr(e, r) {
1012
+ (r == null || r > e.length) && (r = e.length);
1013
+ for (var t = 0, o = new Array(r); t < r; t++)
1014
+ o[t] = e[t];
1015
+ return o;
1016
+ }
1017
+ function Sn() {
1018
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1019
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1020
+ }
1021
+ function En(e, r, t) {
1022
+ return r in e ? Object.defineProperty(e, r, {
1023
+ value: t,
1024
+ enumerable: !0,
1025
+ configurable: !0,
1026
+ writable: !0
1027
+ }) : e[r] = t, e;
1028
+ }
1029
+ function Qr(e, r) {
1030
+ var t = Object.keys(e);
1031
+ if (Object.getOwnPropertySymbols) {
1032
+ var o = Object.getOwnPropertySymbols(e);
1033
+ r && (o = o.filter(function(s) {
1034
+ return Object.getOwnPropertyDescriptor(e, s).enumerable;
1035
+ })), t.push.apply(t, o);
1036
+ }
1037
+ return t;
1038
+ }
1039
+ function Zr(e) {
1040
+ for (var r = 1; r < arguments.length; r++) {
1041
+ var t = arguments[r] != null ? arguments[r] : {};
1042
+ r % 2 ? Qr(Object(t), !0).forEach(function(o) {
1043
+ En(e, o, t[o]);
1044
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Qr(Object(t)).forEach(function(o) {
1045
+ Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
1046
+ });
1047
+ }
1048
+ return e;
1049
+ }
1050
+ function Tn() {
1051
+ for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++)
1052
+ r[t] = arguments[t];
1053
+ return function(o) {
1054
+ return r.reduceRight(function(s, i) {
1055
+ return i(s);
1056
+ }, o);
1057
+ };
1058
+ }
1059
+ function We(e) {
1060
+ return function r() {
1061
+ for (var t = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
1062
+ s[i] = arguments[i];
1063
+ return s.length >= e.length ? e.apply(this, s) : function() {
1064
+ for (var c = arguments.length, u = new Array(c), d = 0; d < c; d++)
1065
+ u[d] = arguments[d];
1066
+ return r.apply(t, [].concat(s, u));
1067
+ };
1068
+ };
1069
+ }
1070
+ function Ze(e) {
1071
+ return {}.toString.call(e).includes("Object");
1072
+ }
1073
+ function On(e) {
1074
+ return !Object.keys(e).length;
1075
+ }
1076
+ function Ne(e) {
1077
+ return typeof e == "function";
1078
+ }
1079
+ function Pn(e, r) {
1080
+ return Object.prototype.hasOwnProperty.call(e, r);
1081
+ }
1082
+ function Rn(e, r) {
1083
+ return Ze(r) || Re("changeType"), Object.keys(r).some(function(t) {
1084
+ return !Pn(e, t);
1085
+ }) && Re("changeField"), r;
1086
+ }
1087
+ function _n(e) {
1088
+ Ne(e) || Re("selectorType");
1089
+ }
1090
+ function xn(e) {
1091
+ Ne(e) || Ze(e) || Re("handlerType"), Ze(e) && Object.values(e).some(function(r) {
1092
+ return !Ne(r);
1093
+ }) && Re("handlersType");
1094
+ }
1095
+ function Cn(e) {
1096
+ e || Re("initialIsRequired"), Ze(e) || Re("initialType"), On(e) && Re("initialContent");
1097
+ }
1098
+ function jn(e, r) {
1099
+ throw new Error(e[r] || e.default);
1100
+ }
1101
+ var An = {
1102
+ initialIsRequired: "initial state is required",
1103
+ initialType: "initial state should be an object",
1104
+ initialContent: "initial state shouldn't be an empty object",
1105
+ handlerType: "handler should be an object or a function",
1106
+ handlersType: "all handlers should be a functions",
1107
+ selectorType: "selector should be a function",
1108
+ changeType: "provided value of changes should be an object",
1109
+ changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
1110
+ default: "an unknown error accured in `state-local` package"
1111
+ }, Re = We(jn)(An), Ge = {
1112
+ changes: Rn,
1113
+ selector: _n,
1114
+ handler: xn,
1115
+ initial: Cn
1116
+ };
1117
+ function Mn(e) {
1118
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1119
+ Ge.initial(e), Ge.handler(r);
1120
+ var t = {
1121
+ current: e
1122
+ }, o = We(Dn)(t, r), s = We(zn)(t), i = We(Ge.changes)(e), c = We(In)(t);
1123
+ function u() {
1124
+ var v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(y) {
1125
+ return y;
1126
+ };
1127
+ return Ge.selector(v), v(t.current);
1128
+ }
1129
+ function d(v) {
1130
+ Tn(o, s, i, c)(v);
1131
+ }
1132
+ return [u, d];
1133
+ }
1134
+ function In(e, r) {
1135
+ return Ne(r) ? r(e.current) : r;
1136
+ }
1137
+ function zn(e, r) {
1138
+ return e.current = Zr(Zr({}, e.current), r), r;
1139
+ }
1140
+ function Dn(e, r, t) {
1141
+ return Ne(r) ? r(e.current) : Object.keys(t).forEach(function(o) {
1142
+ var s;
1143
+ return (s = r[o]) === null || s === void 0 ? void 0 : s.call(r, e.current[o]);
1144
+ }), t;
1145
+ }
1146
+ var kn = {
1147
+ create: Mn
1148
+ }, qn = {
1149
+ paths: {
1150
+ vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"
1151
+ }
1152
+ };
1153
+ function Fn(e) {
1154
+ return function r() {
1155
+ for (var t = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
1156
+ s[i] = arguments[i];
1157
+ return s.length >= e.length ? e.apply(this, s) : function() {
1158
+ for (var c = arguments.length, u = new Array(c), d = 0; d < c; d++)
1159
+ u[d] = arguments[d];
1160
+ return r.apply(t, [].concat(s, u));
1161
+ };
1162
+ };
1163
+ }
1164
+ function $n(e) {
1165
+ return {}.toString.call(e).includes("Object");
1166
+ }
1167
+ function Ln(e) {
1168
+ return e || et("configIsRequired"), $n(e) || et("configType"), e.urls ? (Un(), {
1169
+ paths: {
1170
+ vs: e.urls.monacoBase
1171
+ }
1172
+ }) : e;
1173
+ }
1174
+ function Un() {
1175
+ console.warn(pt.deprecation);
1176
+ }
1177
+ function Wn(e, r) {
1178
+ throw new Error(e[r] || e.default);
1179
+ }
1180
+ var pt = {
1181
+ configIsRequired: "the configuration object is required",
1182
+ configType: "the configuration object should be an object",
1183
+ default: "an unknown error accured in `@monaco-editor/loader` package",
1184
+ deprecation: `Deprecation warning!
1185
+ You are using deprecated way of configuration.
1186
+
1187
+ Instead of using
1188
+ monaco.config({ urls: { monacoBase: '...' } })
1189
+ use
1190
+ monaco.config({ paths: { vs: '...' } })
1191
+
1192
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
1193
+ `
1194
+ }, et = Fn(Wn)(pt), Yn = {
1195
+ config: Ln
1196
+ }, Nn = function() {
1197
+ for (var r = arguments.length, t = new Array(r), o = 0; o < r; o++)
1198
+ t[o] = arguments[o];
1199
+ return function(s) {
1200
+ return t.reduceRight(function(i, c) {
1201
+ return c(i);
1202
+ }, s);
1203
+ };
1204
+ };
1205
+ function gt(e, r) {
1206
+ return Object.keys(r).forEach(function(t) {
1207
+ r[t] instanceof Object && e[t] && Object.assign(r[t], gt(e[t], r[t]));
1208
+ }), Jr(Jr({}, e), r);
1209
+ }
1210
+ var Vn = {
1211
+ type: "cancelation",
1212
+ msg: "operation is manually canceled"
1213
+ };
1214
+ function dr(e) {
1215
+ var r = !1, t = new Promise(function(o, s) {
1216
+ e.then(function(i) {
1217
+ return r ? s(Vn) : o(i);
1218
+ }), e.catch(s);
1219
+ });
1220
+ return t.cancel = function() {
1221
+ return r = !0;
1222
+ }, t;
1223
+ }
1224
+ var Bn = kn.create({
1225
+ config: qn,
1226
+ isInitialized: !1,
1227
+ resolve: null,
1228
+ reject: null,
1229
+ monaco: null
1230
+ }), ht = mn(Bn, 2), Be = ht[0], ir = ht[1];
1231
+ function Kn(e) {
1232
+ var r = Yn.config(e), t = r.monaco, o = vn(r, ["monaco"]);
1233
+ ir(function(s) {
1234
+ return {
1235
+ config: gt(s.config, o),
1236
+ monaco: t
1237
+ };
1238
+ });
1239
+ }
1240
+ function Hn() {
1241
+ var e = Be(function(r) {
1242
+ var t = r.monaco, o = r.isInitialized, s = r.resolve;
1243
+ return {
1244
+ monaco: t,
1245
+ isInitialized: o,
1246
+ resolve: s
1247
+ };
1248
+ });
1249
+ if (!e.isInitialized) {
1250
+ if (ir({
1251
+ isInitialized: !0
1252
+ }), e.monaco)
1253
+ return e.resolve(e.monaco), dr(pr);
1254
+ if (window.monaco && window.monaco.editor)
1255
+ return vt(window.monaco), e.resolve(window.monaco), dr(pr);
1256
+ Nn(Gn, Xn)(Qn);
1257
+ }
1258
+ return dr(pr);
1259
+ }
1260
+ function Gn(e) {
1261
+ return document.body.appendChild(e);
1262
+ }
1263
+ function Jn(e) {
1264
+ var r = document.createElement("script");
1265
+ return e && (r.src = e), r;
1266
+ }
1267
+ function Xn(e) {
1268
+ var r = Be(function(o) {
1269
+ var s = o.config, i = o.reject;
1270
+ return {
1271
+ config: s,
1272
+ reject: i
1273
+ };
1274
+ }), t = Jn("".concat(r.config.paths.vs, "/loader.js"));
1275
+ return t.onload = function() {
1276
+ return e();
1277
+ }, t.onerror = r.reject, t;
1278
+ }
1279
+ function Qn() {
1280
+ var e = Be(function(t) {
1281
+ var o = t.config, s = t.resolve, i = t.reject;
1282
+ return {
1283
+ config: o,
1284
+ resolve: s,
1285
+ reject: i
1286
+ };
1287
+ }), r = window.require;
1288
+ r.config(e.config), r(["vs/editor/editor.main"], function(t) {
1289
+ vt(t), e.resolve(t);
1290
+ }, function(t) {
1291
+ e.reject(t);
1292
+ });
1293
+ }
1294
+ function vt(e) {
1295
+ Be().monaco || ir({
1296
+ monaco: e
1297
+ });
1298
+ }
1299
+ function Zn() {
1300
+ return Be(function(e) {
1301
+ var r = e.monaco;
1302
+ return r;
1303
+ });
1304
+ }
1305
+ var pr = new Promise(function(e, r) {
1306
+ return ir({
1307
+ resolve: e,
1308
+ reject: r
1309
+ });
1310
+ }), mt = {
1311
+ config: Kn,
1312
+ init: Hn,
1313
+ __getMonacoInstance: Zn
1314
+ }, S = { exports: {} }, gr = { exports: {} }, U = {};
1315
+ /** @license React v16.13.1
1316
+ * react-is.production.min.js
1317
+ *
1318
+ * Copyright (c) Facebook, Inc. and its affiliates.
1319
+ *
1320
+ * This source code is licensed under the MIT license found in the
1321
+ * LICENSE file in the root directory of this source tree.
1322
+ */
1323
+ var rt;
1324
+ function eo() {
1325
+ if (rt)
1326
+ return U;
1327
+ rt = 1;
1328
+ var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, s = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, c = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, d = e ? Symbol.for("react.async_mode") : 60111, v = e ? Symbol.for("react.concurrent_mode") : 60111, y = e ? Symbol.for("react.forward_ref") : 60112, h = e ? Symbol.for("react.suspense") : 60113, m = e ? Symbol.for("react.suspense_list") : 60120, x = e ? Symbol.for("react.memo") : 60115, Y = e ? Symbol.for("react.lazy") : 60116, D = e ? Symbol.for("react.block") : 60121, G = e ? Symbol.for("react.fundamental") : 60117, K = e ? Symbol.for("react.responder") : 60118, k = e ? Symbol.for("react.scope") : 60119;
1329
+ function H(p) {
1330
+ if (typeof p == "object" && p !== null) {
1331
+ var X = p.$$typeof;
1332
+ switch (X) {
1333
+ case r:
1334
+ switch (p = p.type, p) {
1335
+ case d:
1336
+ case v:
1337
+ case o:
1338
+ case i:
1339
+ case s:
1340
+ case h:
1341
+ return p;
1342
+ default:
1343
+ switch (p = p && p.$$typeof, p) {
1344
+ case u:
1345
+ case y:
1346
+ case Y:
1347
+ case x:
1348
+ case c:
1349
+ return p;
1350
+ default:
1351
+ return X;
1352
+ }
1353
+ }
1354
+ case t:
1355
+ return X;
1356
+ }
1357
+ }
1358
+ }
1359
+ function N(p) {
1360
+ return H(p) === v;
1361
+ }
1362
+ return U.AsyncMode = d, U.ConcurrentMode = v, U.ContextConsumer = u, U.ContextProvider = c, U.Element = r, U.ForwardRef = y, U.Fragment = o, U.Lazy = Y, U.Memo = x, U.Portal = t, U.Profiler = i, U.StrictMode = s, U.Suspense = h, U.isAsyncMode = function(p) {
1363
+ return N(p) || H(p) === d;
1364
+ }, U.isConcurrentMode = N, U.isContextConsumer = function(p) {
1365
+ return H(p) === u;
1366
+ }, U.isContextProvider = function(p) {
1367
+ return H(p) === c;
1368
+ }, U.isElement = function(p) {
1369
+ return typeof p == "object" && p !== null && p.$$typeof === r;
1370
+ }, U.isForwardRef = function(p) {
1371
+ return H(p) === y;
1372
+ }, U.isFragment = function(p) {
1373
+ return H(p) === o;
1374
+ }, U.isLazy = function(p) {
1375
+ return H(p) === Y;
1376
+ }, U.isMemo = function(p) {
1377
+ return H(p) === x;
1378
+ }, U.isPortal = function(p) {
1379
+ return H(p) === t;
1380
+ }, U.isProfiler = function(p) {
1381
+ return H(p) === i;
1382
+ }, U.isStrictMode = function(p) {
1383
+ return H(p) === s;
1384
+ }, U.isSuspense = function(p) {
1385
+ return H(p) === h;
1386
+ }, U.isValidElementType = function(p) {
1387
+ return typeof p == "string" || typeof p == "function" || p === o || p === v || p === i || p === s || p === h || p === m || typeof p == "object" && p !== null && (p.$$typeof === Y || p.$$typeof === x || p.$$typeof === c || p.$$typeof === u || p.$$typeof === y || p.$$typeof === G || p.$$typeof === K || p.$$typeof === k || p.$$typeof === D);
1388
+ }, U.typeOf = H, U;
1389
+ }
1390
+ var W = {};
1391
+ /** @license React v16.13.1
1392
+ * react-is.development.js
1393
+ *
1394
+ * Copyright (c) Facebook, Inc. and its affiliates.
1395
+ *
1396
+ * This source code is licensed under the MIT license found in the
1397
+ * LICENSE file in the root directory of this source tree.
1398
+ */
1399
+ var tt;
1400
+ function ro() {
1401
+ return tt || (tt = 1, process.env.NODE_ENV !== "production" && function() {
1402
+ var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, s = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, c = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, d = e ? Symbol.for("react.async_mode") : 60111, v = e ? Symbol.for("react.concurrent_mode") : 60111, y = e ? Symbol.for("react.forward_ref") : 60112, h = e ? Symbol.for("react.suspense") : 60113, m = e ? Symbol.for("react.suspense_list") : 60120, x = e ? Symbol.for("react.memo") : 60115, Y = e ? Symbol.for("react.lazy") : 60116, D = e ? Symbol.for("react.block") : 60121, G = e ? Symbol.for("react.fundamental") : 60117, K = e ? Symbol.for("react.responder") : 60118, k = e ? Symbol.for("react.scope") : 60119;
1403
+ function H(w) {
1404
+ return typeof w == "string" || typeof w == "function" || w === o || w === v || w === i || w === s || w === h || w === m || typeof w == "object" && w !== null && (w.$$typeof === Y || w.$$typeof === x || w.$$typeof === c || w.$$typeof === u || w.$$typeof === y || w.$$typeof === G || w.$$typeof === K || w.$$typeof === k || w.$$typeof === D);
1405
+ }
1406
+ function N(w) {
1407
+ if (typeof w == "object" && w !== null) {
1408
+ var he = w.$$typeof;
1409
+ switch (he) {
1410
+ case r:
1411
+ var je = w.type;
1412
+ switch (je) {
1413
+ case d:
1414
+ case v:
1415
+ case o:
1416
+ case i:
1417
+ case s:
1418
+ case h:
1419
+ return je;
1420
+ default:
1421
+ var Ce = je && je.$$typeof;
1422
+ switch (Ce) {
1423
+ case u:
1424
+ case y:
1425
+ case Y:
1426
+ case x:
1427
+ case c:
1428
+ return Ce;
1429
+ default:
1430
+ return he;
1431
+ }
1432
+ }
1433
+ case t:
1434
+ return he;
1435
+ }
1436
+ }
1437
+ }
1438
+ var p = d, X = v, ee = u, Se = c, Q = r, $ = y, ge = o, be = Y, ie = x, z = t, B = i, te = s, pe = h, Ee = !1;
1439
+ function Pe(w) {
1440
+ return Ee || (Ee = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), l(w) || N(w) === d;
1441
+ }
1442
+ function l(w) {
1443
+ return N(w) === v;
1444
+ }
1445
+ function g(w) {
1446
+ return N(w) === u;
1447
+ }
1448
+ function T(w) {
1449
+ return N(w) === c;
1450
+ }
1451
+ function O(w) {
1452
+ return typeof w == "object" && w !== null && w.$$typeof === r;
1453
+ }
1454
+ function P(w) {
1455
+ return N(w) === y;
1456
+ }
1457
+ function C(w) {
1458
+ return N(w) === o;
1459
+ }
1460
+ function R(w) {
1461
+ return N(w) === Y;
1462
+ }
1463
+ function _(w) {
1464
+ return N(w) === x;
1465
+ }
1466
+ function j(w) {
1467
+ return N(w) === t;
1468
+ }
1469
+ function F(w) {
1470
+ return N(w) === i;
1471
+ }
1472
+ function A(w) {
1473
+ return N(w) === s;
1474
+ }
1475
+ function ae(w) {
1476
+ return N(w) === h;
1477
+ }
1478
+ W.AsyncMode = p, W.ConcurrentMode = X, W.ContextConsumer = ee, W.ContextProvider = Se, W.Element = Q, W.ForwardRef = $, W.Fragment = ge, W.Lazy = be, W.Memo = ie, W.Portal = z, W.Profiler = B, W.StrictMode = te, W.Suspense = pe, W.isAsyncMode = Pe, W.isConcurrentMode = l, W.isContextConsumer = g, W.isContextProvider = T, W.isElement = O, W.isForwardRef = P, W.isFragment = C, W.isLazy = R, W.isMemo = _, W.isPortal = j, W.isProfiler = F, W.isStrictMode = A, W.isSuspense = ae, W.isValidElementType = H, W.typeOf = N;
1479
+ }()), W;
1480
+ }
1481
+ var nt;
1482
+ function bt() {
1483
+ return nt || (nt = 1, function(e) {
1484
+ process.env.NODE_ENV === "production" ? e.exports = eo() : e.exports = ro();
1485
+ }(gr)), gr.exports;
1486
+ }
1487
+ /*
1488
+ object-assign
1489
+ (c) Sindre Sorhus
1490
+ @license MIT
1491
+ */
1492
+ var hr, ot;
1493
+ function to() {
1494
+ if (ot)
1495
+ return hr;
1496
+ ot = 1;
1497
+ var e = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
1498
+ function o(i) {
1499
+ if (i == null)
1500
+ throw new TypeError("Object.assign cannot be called with null or undefined");
1501
+ return Object(i);
1502
+ }
1503
+ function s() {
1504
+ try {
1505
+ if (!Object.assign)
1506
+ return !1;
1507
+ var i = new String("abc");
1508
+ if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
1509
+ return !1;
1510
+ for (var c = {}, u = 0; u < 10; u++)
1511
+ c["_" + String.fromCharCode(u)] = u;
1512
+ var d = Object.getOwnPropertyNames(c).map(function(y) {
1513
+ return c[y];
1514
+ });
1515
+ if (d.join("") !== "0123456789")
1516
+ return !1;
1517
+ var v = {};
1518
+ return "abcdefghijklmnopqrst".split("").forEach(function(y) {
1519
+ v[y] = y;
1520
+ }), Object.keys(Object.assign({}, v)).join("") === "abcdefghijklmnopqrst";
1521
+ } catch {
1522
+ return !1;
1523
+ }
1524
+ }
1525
+ return hr = s() ? Object.assign : function(i, c) {
1526
+ for (var u, d = o(i), v, y = 1; y < arguments.length; y++) {
1527
+ u = Object(arguments[y]);
1528
+ for (var h in u)
1529
+ r.call(u, h) && (d[h] = u[h]);
1530
+ if (e) {
1531
+ v = e(u);
1532
+ for (var m = 0; m < v.length; m++)
1533
+ t.call(u, v[m]) && (d[v[m]] = u[v[m]]);
1534
+ }
1535
+ }
1536
+ return d;
1537
+ }, hr;
1538
+ }
1539
+ var vr, it;
1540
+ function Ar() {
1541
+ if (it)
1542
+ return vr;
1543
+ it = 1;
1544
+ var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
1545
+ return vr = e, vr;
1546
+ }
1547
+ var mr, at;
1548
+ function yt() {
1549
+ return at || (at = 1, mr = Function.call.bind(Object.prototype.hasOwnProperty)), mr;
1550
+ }
1551
+ var br, st;
1552
+ function no() {
1553
+ if (st)
1554
+ return br;
1555
+ st = 1;
1556
+ var e = function() {
1557
+ };
1558
+ if (process.env.NODE_ENV !== "production") {
1559
+ var r = Ar(), t = {}, o = yt();
1560
+ e = function(i) {
1561
+ var c = "Warning: " + i;
1562
+ typeof console < "u" && console.error(c);
1563
+ try {
1564
+ throw new Error(c);
1565
+ } catch {
1566
+ }
1567
+ };
1568
+ }
1569
+ function s(i, c, u, d, v) {
1570
+ if (process.env.NODE_ENV !== "production") {
1571
+ for (var y in i)
1572
+ if (o(i, y)) {
1573
+ var h;
1574
+ try {
1575
+ if (typeof i[y] != "function") {
1576
+ var m = Error(
1577
+ (d || "React class") + ": " + u + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
1578
+ );
1579
+ throw m.name = "Invariant Violation", m;
1580
+ }
1581
+ h = i[y](c, y, d, u, null, r);
1582
+ } catch (Y) {
1583
+ h = Y;
1584
+ }
1585
+ if (h && !(h instanceof Error) && e(
1586
+ (d || "React class") + ": type specification of " + u + " `" + y + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
1587
+ ), h instanceof Error && !(h.message in t)) {
1588
+ t[h.message] = !0;
1589
+ var x = v ? v() : "";
1590
+ e(
1591
+ "Failed " + u + " type: " + h.message + (x != null ? x : "")
1592
+ );
1593
+ }
1594
+ }
1595
+ }
1596
+ }
1597
+ return s.resetWarningCache = function() {
1598
+ process.env.NODE_ENV !== "production" && (t = {});
1599
+ }, br = s, br;
1600
+ }
1601
+ var yr, ct;
1602
+ function oo() {
1603
+ if (ct)
1604
+ return yr;
1605
+ ct = 1;
1606
+ var e = bt(), r = to(), t = Ar(), o = yt(), s = no(), i = function() {
1607
+ };
1608
+ process.env.NODE_ENV !== "production" && (i = function(u) {
1609
+ var d = "Warning: " + u;
1610
+ typeof console < "u" && console.error(d);
1611
+ try {
1612
+ throw new Error(d);
1613
+ } catch {
1614
+ }
1615
+ });
1616
+ function c() {
1617
+ return null;
1618
+ }
1619
+ return yr = function(u, d) {
1620
+ var v = typeof Symbol == "function" && Symbol.iterator, y = "@@iterator";
1621
+ function h(l) {
1622
+ var g = l && (v && l[v] || l[y]);
1623
+ if (typeof g == "function")
1624
+ return g;
1625
+ }
1626
+ var m = "<<anonymous>>", x = {
1627
+ array: K("array"),
1628
+ bigint: K("bigint"),
1629
+ bool: K("boolean"),
1630
+ func: K("function"),
1631
+ number: K("number"),
1632
+ object: K("object"),
1633
+ string: K("string"),
1634
+ symbol: K("symbol"),
1635
+ any: k(),
1636
+ arrayOf: H,
1637
+ element: N(),
1638
+ elementType: p(),
1639
+ instanceOf: X,
1640
+ node: $(),
1641
+ objectOf: Se,
1642
+ oneOf: ee,
1643
+ oneOfType: Q,
1644
+ shape: be,
1645
+ exact: ie
1646
+ };
1647
+ function Y(l, g) {
1648
+ return l === g ? l !== 0 || 1 / l === 1 / g : l !== l && g !== g;
1649
+ }
1650
+ function D(l, g) {
1651
+ this.message = l, this.data = g && typeof g == "object" ? g : {}, this.stack = "";
1652
+ }
1653
+ D.prototype = Error.prototype;
1654
+ function G(l) {
1655
+ if (process.env.NODE_ENV !== "production")
1656
+ var g = {}, T = 0;
1657
+ function O(C, R, _, j, F, A, ae) {
1658
+ if (j = j || m, A = A || _, ae !== t) {
1659
+ if (d) {
1660
+ var w = new Error(
1661
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
1662
+ );
1663
+ throw w.name = "Invariant Violation", w;
1664
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1665
+ var he = j + ":" + _;
1666
+ !g[he] && T < 3 && (i(
1667
+ "You are manually calling a React.PropTypes validation function for the `" + A + "` prop on `" + j + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1668
+ ), g[he] = !0, T++);
1669
+ }
1670
+ }
1671
+ return R[_] == null ? C ? R[_] === null ? new D("The " + F + " `" + A + "` is marked as required " + ("in `" + j + "`, but its value is `null`.")) : new D("The " + F + " `" + A + "` is marked as required in " + ("`" + j + "`, but its value is `undefined`.")) : null : l(R, _, j, F, A);
1672
+ }
1673
+ var P = O.bind(null, !1);
1674
+ return P.isRequired = O.bind(null, !0), P;
1675
+ }
1676
+ function K(l) {
1677
+ function g(T, O, P, C, R, _) {
1678
+ var j = T[O], F = te(j);
1679
+ if (F !== l) {
1680
+ var A = pe(j);
1681
+ return new D(
1682
+ "Invalid " + C + " `" + R + "` of type " + ("`" + A + "` supplied to `" + P + "`, expected ") + ("`" + l + "`."),
1683
+ { expectedType: l }
1684
+ );
1685
+ }
1686
+ return null;
1687
+ }
1688
+ return G(g);
1689
+ }
1690
+ function k() {
1691
+ return G(c);
1692
+ }
1693
+ function H(l) {
1694
+ function g(T, O, P, C, R) {
1695
+ if (typeof l != "function")
1696
+ return new D("Property `" + R + "` of component `" + P + "` has invalid PropType notation inside arrayOf.");
1697
+ var _ = T[O];
1698
+ if (!Array.isArray(_)) {
1699
+ var j = te(_);
1700
+ return new D("Invalid " + C + " `" + R + "` of type " + ("`" + j + "` supplied to `" + P + "`, expected an array."));
1701
+ }
1702
+ for (var F = 0; F < _.length; F++) {
1703
+ var A = l(_, F, P, C, R + "[" + F + "]", t);
1704
+ if (A instanceof Error)
1705
+ return A;
1706
+ }
1707
+ return null;
1708
+ }
1709
+ return G(g);
1710
+ }
1711
+ function N() {
1712
+ function l(g, T, O, P, C) {
1713
+ var R = g[T];
1714
+ if (!u(R)) {
1715
+ var _ = te(R);
1716
+ return new D("Invalid " + P + " `" + C + "` of type " + ("`" + _ + "` supplied to `" + O + "`, expected a single ReactElement."));
1717
+ }
1718
+ return null;
1719
+ }
1720
+ return G(l);
1721
+ }
1722
+ function p() {
1723
+ function l(g, T, O, P, C) {
1724
+ var R = g[T];
1725
+ if (!e.isValidElementType(R)) {
1726
+ var _ = te(R);
1727
+ return new D("Invalid " + P + " `" + C + "` of type " + ("`" + _ + "` supplied to `" + O + "`, expected a single ReactElement type."));
1728
+ }
1729
+ return null;
1730
+ }
1731
+ return G(l);
1732
+ }
1733
+ function X(l) {
1734
+ function g(T, O, P, C, R) {
1735
+ if (!(T[O] instanceof l)) {
1736
+ var _ = l.name || m, j = Pe(T[O]);
1737
+ return new D("Invalid " + C + " `" + R + "` of type " + ("`" + j + "` supplied to `" + P + "`, expected ") + ("instance of `" + _ + "`."));
1738
+ }
1739
+ return null;
1740
+ }
1741
+ return G(g);
1742
+ }
1743
+ function ee(l) {
1744
+ if (!Array.isArray(l))
1745
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
1746
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
1747
+ ) : i("Invalid argument supplied to oneOf, expected an array.")), c;
1748
+ function g(T, O, P, C, R) {
1749
+ for (var _ = T[O], j = 0; j < l.length; j++)
1750
+ if (Y(_, l[j]))
1751
+ return null;
1752
+ var F = JSON.stringify(l, function(ae, w) {
1753
+ var he = pe(w);
1754
+ return he === "symbol" ? String(w) : w;
1755
+ });
1756
+ return new D("Invalid " + C + " `" + R + "` of value `" + String(_) + "` " + ("supplied to `" + P + "`, expected one of " + F + "."));
1757
+ }
1758
+ return G(g);
1759
+ }
1760
+ function Se(l) {
1761
+ function g(T, O, P, C, R) {
1762
+ if (typeof l != "function")
1763
+ return new D("Property `" + R + "` of component `" + P + "` has invalid PropType notation inside objectOf.");
1764
+ var _ = T[O], j = te(_);
1765
+ if (j !== "object")
1766
+ return new D("Invalid " + C + " `" + R + "` of type " + ("`" + j + "` supplied to `" + P + "`, expected an object."));
1767
+ for (var F in _)
1768
+ if (o(_, F)) {
1769
+ var A = l(_, F, P, C, R + "." + F, t);
1770
+ if (A instanceof Error)
1771
+ return A;
1772
+ }
1773
+ return null;
1774
+ }
1775
+ return G(g);
1776
+ }
1777
+ function Q(l) {
1778
+ if (!Array.isArray(l))
1779
+ return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), c;
1780
+ for (var g = 0; g < l.length; g++) {
1781
+ var T = l[g];
1782
+ if (typeof T != "function")
1783
+ return i(
1784
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Ee(T) + " at index " + g + "."
1785
+ ), c;
1786
+ }
1787
+ function O(P, C, R, _, j) {
1788
+ for (var F = [], A = 0; A < l.length; A++) {
1789
+ var ae = l[A], w = ae(P, C, R, _, j, t);
1790
+ if (w == null)
1791
+ return null;
1792
+ w.data && o(w.data, "expectedType") && F.push(w.data.expectedType);
1793
+ }
1794
+ var he = F.length > 0 ? ", expected one of type [" + F.join(", ") + "]" : "";
1795
+ return new D("Invalid " + _ + " `" + j + "` supplied to " + ("`" + R + "`" + he + "."));
1796
+ }
1797
+ return G(O);
1798
+ }
1799
+ function $() {
1800
+ function l(g, T, O, P, C) {
1801
+ return z(g[T]) ? null : new D("Invalid " + P + " `" + C + "` supplied to " + ("`" + O + "`, expected a ReactNode."));
1802
+ }
1803
+ return G(l);
1804
+ }
1805
+ function ge(l, g, T, O, P) {
1806
+ return new D(
1807
+ (l || "React class") + ": " + g + " type `" + T + "." + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + P + "`."
1808
+ );
1809
+ }
1810
+ function be(l) {
1811
+ function g(T, O, P, C, R) {
1812
+ var _ = T[O], j = te(_);
1813
+ if (j !== "object")
1814
+ return new D("Invalid " + C + " `" + R + "` of type `" + j + "` " + ("supplied to `" + P + "`, expected `object`."));
1815
+ for (var F in l) {
1816
+ var A = l[F];
1817
+ if (typeof A != "function")
1818
+ return ge(P, C, R, F, pe(A));
1819
+ var ae = A(_, F, P, C, R + "." + F, t);
1820
+ if (ae)
1821
+ return ae;
1822
+ }
1823
+ return null;
1824
+ }
1825
+ return G(g);
1826
+ }
1827
+ function ie(l) {
1828
+ function g(T, O, P, C, R) {
1829
+ var _ = T[O], j = te(_);
1830
+ if (j !== "object")
1831
+ return new D("Invalid " + C + " `" + R + "` of type `" + j + "` " + ("supplied to `" + P + "`, expected `object`."));
1832
+ var F = r({}, T[O], l);
1833
+ for (var A in F) {
1834
+ var ae = l[A];
1835
+ if (o(l, A) && typeof ae != "function")
1836
+ return ge(P, C, R, A, pe(ae));
1837
+ if (!ae)
1838
+ return new D(
1839
+ "Invalid " + C + " `" + R + "` key `" + A + "` supplied to `" + P + "`.\nBad object: " + JSON.stringify(T[O], null, " ") + `
1840
+ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
1841
+ );
1842
+ var w = ae(_, A, P, C, R + "." + A, t);
1843
+ if (w)
1844
+ return w;
1845
+ }
1846
+ return null;
1847
+ }
1848
+ return G(g);
1849
+ }
1850
+ function z(l) {
1851
+ switch (typeof l) {
1852
+ case "number":
1853
+ case "string":
1854
+ case "undefined":
1855
+ return !0;
1856
+ case "boolean":
1857
+ return !l;
1858
+ case "object":
1859
+ if (Array.isArray(l))
1860
+ return l.every(z);
1861
+ if (l === null || u(l))
1862
+ return !0;
1863
+ var g = h(l);
1864
+ if (g) {
1865
+ var T = g.call(l), O;
1866
+ if (g !== l.entries) {
1867
+ for (; !(O = T.next()).done; )
1868
+ if (!z(O.value))
1869
+ return !1;
1870
+ } else
1871
+ for (; !(O = T.next()).done; ) {
1872
+ var P = O.value;
1873
+ if (P && !z(P[1]))
1874
+ return !1;
1875
+ }
1876
+ } else
1877
+ return !1;
1878
+ return !0;
1879
+ default:
1880
+ return !1;
1881
+ }
1882
+ }
1883
+ function B(l, g) {
1884
+ return l === "symbol" ? !0 : g ? g["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && g instanceof Symbol : !1;
1885
+ }
1886
+ function te(l) {
1887
+ var g = typeof l;
1888
+ return Array.isArray(l) ? "array" : l instanceof RegExp ? "object" : B(g, l) ? "symbol" : g;
1889
+ }
1890
+ function pe(l) {
1891
+ if (typeof l > "u" || l === null)
1892
+ return "" + l;
1893
+ var g = te(l);
1894
+ if (g === "object") {
1895
+ if (l instanceof Date)
1896
+ return "date";
1897
+ if (l instanceof RegExp)
1898
+ return "regexp";
1899
+ }
1900
+ return g;
1901
+ }
1902
+ function Ee(l) {
1903
+ var g = pe(l);
1904
+ switch (g) {
1905
+ case "array":
1906
+ case "object":
1907
+ return "an " + g;
1908
+ case "boolean":
1909
+ case "date":
1910
+ case "regexp":
1911
+ return "a " + g;
1912
+ default:
1913
+ return g;
1914
+ }
1915
+ }
1916
+ function Pe(l) {
1917
+ return !l.constructor || !l.constructor.name ? m : l.constructor.name;
1918
+ }
1919
+ return x.checkPropTypes = s, x.resetWarningCache = s.resetWarningCache, x.PropTypes = x, x;
1920
+ }, yr;
1921
+ }
1922
+ var wr, ut;
1923
+ function io() {
1924
+ if (ut)
1925
+ return wr;
1926
+ ut = 1;
1927
+ var e = Ar();
1928
+ function r() {
1929
+ }
1930
+ function t() {
1931
+ }
1932
+ return t.resetWarningCache = r, wr = function() {
1933
+ function o(c, u, d, v, y, h) {
1934
+ if (h !== e) {
1935
+ var m = new Error(
1936
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
1937
+ );
1938
+ throw m.name = "Invariant Violation", m;
1939
+ }
1940
+ }
1941
+ o.isRequired = o;
1942
+ function s() {
1943
+ return o;
1944
+ }
1945
+ var i = {
1946
+ array: o,
1947
+ bigint: o,
1948
+ bool: o,
1949
+ func: o,
1950
+ number: o,
1951
+ object: o,
1952
+ string: o,
1953
+ symbol: o,
1954
+ any: o,
1955
+ arrayOf: s,
1956
+ element: o,
1957
+ elementType: o,
1958
+ instanceOf: s,
1959
+ node: o,
1960
+ objectOf: s,
1961
+ oneOf: s,
1962
+ oneOfType: s,
1963
+ shape: s,
1964
+ exact: s,
1965
+ checkPropTypes: t,
1966
+ resetWarningCache: r
1967
+ };
1968
+ return i.PropTypes = i, i;
1969
+ }, wr;
1970
+ }
1971
+ if (process.env.NODE_ENV !== "production") {
1972
+ var ao = bt(), so = !0;
1973
+ S.exports = oo()(ao.isElement, so);
1974
+ } else
1975
+ S.exports = io()();
1976
+ const co = {
1977
+ display: "flex",
1978
+ height: "100%",
1979
+ width: "100%",
1980
+ justifyContent: "center",
1981
+ alignItems: "center"
1982
+ };
1983
+ function uo({
1984
+ content: e
1985
+ }) {
1986
+ return /* @__PURE__ */ a("div", {
1987
+ style: co,
1988
+ children: e
1989
+ });
1990
+ }
1991
+ const Sr = {
1992
+ wrapper: {
1993
+ display: "flex",
1994
+ position: "relative",
1995
+ textAlign: "initial"
1996
+ },
1997
+ fullWidth: {
1998
+ width: "100%"
1999
+ },
2000
+ hide: {
2001
+ display: "none"
2002
+ }
2003
+ };
2004
+ function wt({
2005
+ width: e,
2006
+ height: r,
2007
+ isEditorReady: t,
2008
+ loading: o,
2009
+ _ref: s,
2010
+ className: i,
2011
+ wrapperProps: c
2012
+ }) {
2013
+ return /* @__PURE__ */ I("section", {
2014
+ style: {
2015
+ ...Sr.wrapper,
2016
+ width: e,
2017
+ height: r
2018
+ },
2019
+ ...c,
2020
+ children: [!t && /* @__PURE__ */ a(uo, {
2021
+ content: o
2022
+ }), /* @__PURE__ */ a("div", {
2023
+ ref: s,
2024
+ style: {
2025
+ ...Sr.fullWidth,
2026
+ ...!t && Sr.hide
2027
+ },
2028
+ className: i
2029
+ })]
2030
+ });
2031
+ }
2032
+ wt.propTypes = {
2033
+ width: S.exports.oneOfType([S.exports.number, S.exports.string]).isRequired,
2034
+ height: S.exports.oneOfType([S.exports.number, S.exports.string]).isRequired,
2035
+ loading: S.exports.oneOfType([S.exports.element, S.exports.string]).isRequired,
2036
+ isEditorReady: S.exports.bool.isRequired,
2037
+ className: S.exports.string,
2038
+ wrapperProps: S.exports.object
2039
+ };
2040
+ var St = /* @__PURE__ */ ft(wt);
2041
+ function Et(e) {
2042
+ we(e, []);
2043
+ }
2044
+ function ye(e, r, t = !0) {
2045
+ const o = ue(!0);
2046
+ we(o.current || !t ? () => {
2047
+ o.current = !1;
2048
+ } : e, r);
2049
+ }
2050
+ function Ye() {
2051
+ }
2052
+ function er(e, r, t, o) {
2053
+ return lo(e, o) || fo(e, r, t, o);
2054
+ }
2055
+ function lo(e, r) {
2056
+ return e.editor.getModel(Tt(e, r));
2057
+ }
2058
+ function fo(e, r, t, o) {
2059
+ return e.editor.createModel(r, t, o && Tt(e, o));
2060
+ }
2061
+ function Tt(e, r) {
2062
+ return e.Uri.parse(r);
2063
+ }
2064
+ function po(e) {
2065
+ return e === void 0;
2066
+ }
2067
+ function Ot({
2068
+ original: e,
2069
+ modified: r,
2070
+ language: t,
2071
+ originalLanguage: o,
2072
+ modifiedLanguage: s,
2073
+ originalModelPath: i,
2074
+ modifiedModelPath: c,
2075
+ keepCurrentOriginalModel: u,
2076
+ keepCurrentModifiedModel: d,
2077
+ theme: v,
2078
+ loading: y,
2079
+ options: h,
2080
+ height: m,
2081
+ width: x,
2082
+ className: Y,
2083
+ wrapperProps: D,
2084
+ beforeMount: G,
2085
+ onMount: K
2086
+ }) {
2087
+ const [k, H] = Ie(!1), [N, p] = Ie(!0), X = ue(null), ee = ue(null), Se = ue(null), Q = ue(K), $ = ue(G);
2088
+ Et(() => {
2089
+ const z = mt.init();
2090
+ return z.then((B) => (ee.current = B) && p(!1)).catch((B) => (B == null ? void 0 : B.type) !== "cancelation" && console.error("Monaco initialization: error:", B)), () => X.current ? ie() : z.cancel();
2091
+ }), ye(() => {
2092
+ const z = X.current.getModifiedEditor();
2093
+ z.getOption(ee.current.editor.EditorOption.readOnly) ? z.setValue(r) : r !== z.getValue() && (z.executeEdits("", [{
2094
+ range: z.getModel().getFullModelRange(),
2095
+ text: r,
2096
+ forceMoveMarkers: !0
2097
+ }]), z.pushUndoStop());
2098
+ }, [r], k), ye(() => {
2099
+ X.current.getModel().original.setValue(e);
2100
+ }, [e], k), ye(() => {
2101
+ const {
2102
+ original: z,
2103
+ modified: B
2104
+ } = X.current.getModel();
2105
+ ee.current.editor.setModelLanguage(z, o || t), ee.current.editor.setModelLanguage(B, s || t);
2106
+ }, [t, o, s], k), ye(() => {
2107
+ ee.current.editor.setTheme(v);
2108
+ }, [v], k), ye(() => {
2109
+ X.current.updateOptions(h);
2110
+ }, [h], k);
2111
+ const ge = Er(() => {
2112
+ $.current(ee.current);
2113
+ const z = er(ee.current, e, o || t, i), B = er(ee.current, r, s || t, c);
2114
+ X.current.setModel({
2115
+ original: z,
2116
+ modified: B
2117
+ });
2118
+ }, [t, r, s, e, o, i, c]), be = Er(() => {
2119
+ X.current = ee.current.editor.createDiffEditor(Se.current, {
2120
+ automaticLayout: !0,
2121
+ ...h
2122
+ }), ge(), ee.current.editor.setTheme(v), H(!0);
2123
+ }, [h, v, ge]);
2124
+ we(() => {
2125
+ k && Q.current(X.current, ee.current);
2126
+ }, [k]), we(() => {
2127
+ !N && !k && be();
2128
+ }, [N, k, be]);
2129
+ function ie() {
2130
+ const z = X.current.getModel();
2131
+ if (!u) {
2132
+ var B;
2133
+ (B = z.original) === null || B === void 0 || B.dispose();
2134
+ }
2135
+ if (!d) {
2136
+ var te;
2137
+ (te = z.modified) === null || te === void 0 || te.dispose();
2138
+ }
2139
+ X.current.dispose();
2140
+ }
2141
+ return /* @__PURE__ */ a(St, {
2142
+ width: x,
2143
+ height: m,
2144
+ isEditorReady: k,
2145
+ loading: y,
2146
+ _ref: Se,
2147
+ className: Y,
2148
+ wrapperProps: D
2149
+ });
2150
+ }
2151
+ Ot.propTypes = {
2152
+ original: S.exports.string,
2153
+ modified: S.exports.string,
2154
+ language: S.exports.string,
2155
+ originalLanguage: S.exports.string,
2156
+ modifiedLanguage: S.exports.string,
2157
+ originalModelPath: S.exports.string,
2158
+ modifiedModelPath: S.exports.string,
2159
+ keepCurrentOriginalModel: S.exports.bool,
2160
+ keepCurrentModifiedModel: S.exports.bool,
2161
+ theme: S.exports.string,
2162
+ loading: S.exports.oneOfType([S.exports.element, S.exports.string]),
2163
+ options: S.exports.object,
2164
+ width: S.exports.oneOfType([S.exports.number, S.exports.string]),
2165
+ height: S.exports.oneOfType([S.exports.number, S.exports.string]),
2166
+ className: S.exports.string,
2167
+ wrapperProps: S.exports.object,
2168
+ beforeMount: S.exports.func,
2169
+ onMount: S.exports.func
2170
+ };
2171
+ Ot.defaultProps = {
2172
+ theme: "light",
2173
+ loading: "Loading...",
2174
+ options: {},
2175
+ keepCurrentOriginalModel: !1,
2176
+ keepCurrentModifiedModel: !1,
2177
+ width: "100%",
2178
+ height: "100%",
2179
+ wrapperProps: {},
2180
+ beforeMount: Ye,
2181
+ onMount: Ye
2182
+ };
2183
+ function go(e) {
2184
+ const r = ue();
2185
+ return we(() => {
2186
+ r.current = e;
2187
+ }, [e]), r.current;
2188
+ }
2189
+ const Je = /* @__PURE__ */ new Map();
2190
+ function Mr({
2191
+ defaultValue: e,
2192
+ defaultLanguage: r,
2193
+ defaultPath: t,
2194
+ value: o,
2195
+ language: s,
2196
+ path: i,
2197
+ theme: c,
2198
+ line: u,
2199
+ loading: d,
2200
+ options: v,
2201
+ overrideServices: y,
2202
+ saveViewState: h,
2203
+ keepCurrentModel: m,
2204
+ width: x,
2205
+ height: Y,
2206
+ className: D,
2207
+ wrapperProps: G,
2208
+ beforeMount: K,
2209
+ onMount: k,
2210
+ onChange: H,
2211
+ onValidate: N
2212
+ }) {
2213
+ const [p, X] = Ie(!1), [ee, Se] = Ie(!0), Q = ue(null), $ = ue(null), ge = ue(null), be = ue(k), ie = ue(K), z = ue(null), B = ue(o), te = go(i), pe = ue(!1);
2214
+ Et(() => {
2215
+ const l = mt.init();
2216
+ return l.then((g) => (Q.current = g) && Se(!1)).catch((g) => (g == null ? void 0 : g.type) !== "cancelation" && console.error("Monaco initialization: error:", g)), () => $.current ? Pe() : l.cancel();
2217
+ }), ye(() => {
2218
+ const l = er(Q.current, e || o, r || s, i);
2219
+ l !== $.current.getModel() && (h && Je.set(te, $.current.saveViewState()), $.current.setModel(l), h && $.current.restoreViewState(Je.get(i)));
2220
+ }, [i], p), ye(() => {
2221
+ $.current.updateOptions(v);
2222
+ }, [v], p), ye(() => {
2223
+ $.current.getOption(Q.current.editor.EditorOption.readOnly) ? $.current.setValue(o) : o !== $.current.getValue() && ($.current.executeEdits("", [{
2224
+ range: $.current.getModel().getFullModelRange(),
2225
+ text: o,
2226
+ forceMoveMarkers: !0
2227
+ }]), $.current.pushUndoStop());
2228
+ }, [o], p), ye(() => {
2229
+ Q.current.editor.setModelLanguage($.current.getModel(), s);
2230
+ }, [s], p), ye(() => {
2231
+ po(u) || $.current.revealLine(u);
2232
+ }, [u], p), ye(() => {
2233
+ Q.current.editor.setTheme(c);
2234
+ }, [c], p);
2235
+ const Ee = Er(() => {
2236
+ if (!pe.current) {
2237
+ ie.current(Q.current);
2238
+ const l = i || t, g = er(Q.current, o || e, r || s, l);
2239
+ $.current = Q.current.editor.create(ge.current, {
2240
+ model: g,
2241
+ automaticLayout: !0,
2242
+ ...v
2243
+ }, y), h && $.current.restoreViewState(Je.get(l)), Q.current.editor.setTheme(c), X(!0), pe.current = !0;
2244
+ }
2245
+ }, [e, r, t, o, s, i, v, y, h, c]);
2246
+ we(() => {
2247
+ p && be.current($.current, Q.current);
2248
+ }, [p]), we(() => {
2249
+ !ee && !p && Ee();
2250
+ }, [ee, p, Ee]), B.current = o, we(() => {
2251
+ if (p && H) {
2252
+ var l, g;
2253
+ (l = z.current) === null || l === void 0 || l.dispose(), z.current = (g = $.current) === null || g === void 0 ? void 0 : g.onDidChangeModelContent((T) => {
2254
+ H($.current.getValue(), T);
2255
+ });
2256
+ }
2257
+ }, [p, H]), we(() => {
2258
+ if (p) {
2259
+ const l = Q.current.editor.onDidChangeMarkers((g) => {
2260
+ var T;
2261
+ const O = (T = $.current.getModel()) === null || T === void 0 ? void 0 : T.uri;
2262
+ if (O && g.find((C) => C.path === O.path)) {
2263
+ const C = Q.current.editor.getModelMarkers({
2264
+ resource: O
2265
+ });
2266
+ N == null || N(C);
2267
+ }
2268
+ });
2269
+ return () => {
2270
+ l == null || l.dispose();
2271
+ };
2272
+ }
2273
+ }, [p, N]);
2274
+ function Pe() {
2275
+ var l;
2276
+ if ((l = z.current) === null || l === void 0 || l.dispose(), m)
2277
+ h && Je.set(i, $.current.saveViewState());
2278
+ else {
2279
+ var g;
2280
+ (g = $.current.getModel()) === null || g === void 0 || g.dispose();
2281
+ }
2282
+ $.current.dispose();
2283
+ }
2284
+ return /* @__PURE__ */ a(St, {
2285
+ width: x,
2286
+ height: Y,
2287
+ isEditorReady: p,
2288
+ loading: d,
2289
+ _ref: ge,
2290
+ className: D,
2291
+ wrapperProps: G
2292
+ });
2293
+ }
2294
+ Mr.propTypes = {
2295
+ defaultValue: S.exports.string,
2296
+ defaultPath: S.exports.string,
2297
+ defaultLanguage: S.exports.string,
2298
+ value: S.exports.string,
2299
+ language: S.exports.string,
2300
+ path: S.exports.string,
2301
+ theme: S.exports.string,
2302
+ line: S.exports.number,
2303
+ loading: S.exports.oneOfType([S.exports.element, S.exports.string]),
2304
+ options: S.exports.object,
2305
+ overrideServices: S.exports.object,
2306
+ saveViewState: S.exports.bool,
2307
+ keepCurrentModel: S.exports.bool,
2308
+ width: S.exports.oneOfType([S.exports.number, S.exports.string]),
2309
+ height: S.exports.oneOfType([S.exports.number, S.exports.string]),
2310
+ className: S.exports.string,
2311
+ wrapperProps: S.exports.object,
2312
+ beforeMount: S.exports.func,
2313
+ onMount: S.exports.func,
2314
+ onChange: S.exports.func,
2315
+ onValidate: S.exports.func
2316
+ };
2317
+ Mr.defaultProps = {
2318
+ theme: "light",
2319
+ loading: "Loading...",
2320
+ options: {},
2321
+ overrideServices: {},
2322
+ saveViewState: !0,
2323
+ keepCurrentModel: !1,
2324
+ width: "100%",
2325
+ height: "100%",
2326
+ wrapperProps: {},
2327
+ beforeMount: Ye,
2328
+ onMount: Ye,
2329
+ onValidate: Ye
2330
+ };
2331
+ var ho = /* @__PURE__ */ ft(Mr);
2332
+ const vo = ({
2333
+ value: e,
2334
+ onChange: r
2335
+ }) => /* @__PURE__ */ a(me, {
2336
+ sx: {
2337
+ position: "relative"
2338
+ },
2339
+ children: /* @__PURE__ */ a(ho, {
2340
+ height: "500px",
2341
+ defaultLanguage: "javascript",
2342
+ value: e,
2343
+ onChange: (o) => {
2344
+ !o || r(o);
2345
+ },
2346
+ theme: "vs-dark",
2347
+ options: {
2348
+ minimap: {
2349
+ enabled: !1
2350
+ }
2351
+ }
2352
+ })
2353
+ }), lt = xr(({
2354
+ value: e,
2355
+ onChange: r,
2356
+ label: t,
2357
+ modalTitle: o,
2358
+ defaultValue: s,
2359
+ styles: i
2360
+ }, c) => {
2361
+ const [u, {
2362
+ setTrue: d,
2363
+ setFalse: v
2364
+ }] = tn(), [y, h] = Ie(e), m = () => {
2365
+ v(), r(y);
2366
+ }, x = () => {
2367
+ v(), h(e);
2368
+ }, Y = () => {
2369
+ h(s);
2370
+ };
2371
+ return we(() => {
2372
+ h(e);
2373
+ }, [e]), /* @__PURE__ */ I(Oe, {
2374
+ children: [/* @__PURE__ */ a(oe, {
2375
+ variant: "filled",
2376
+ size: i.button.size,
2377
+ onClick: d,
2378
+ sx: {
2379
+ flexGrow: 1
2380
+ },
2381
+ children: t
2382
+ }), /* @__PURE__ */ a(Ve, {
2383
+ size: 800,
2384
+ title: o,
2385
+ opened: u,
2386
+ onClose: v,
2387
+ closeOnClickOutside: !1,
2388
+ withCloseButton: !1,
2389
+ children: u && /* @__PURE__ */ I(Pr, {
2390
+ children: [/* @__PURE__ */ a(vo, {
2391
+ value: y,
2392
+ onChange: h
2393
+ }), /* @__PURE__ */ I(se, {
2394
+ position: "apart",
2395
+ children: [/* @__PURE__ */ a(oe, {
2396
+ onClick: Y,
2397
+ color: "red",
2398
+ leftIcon: /* @__PURE__ */ a(Xt, {
2399
+ size: 20
2400
+ }),
2401
+ children: "Rest"
2402
+ }), /* @__PURE__ */ I(se, {
2403
+ position: "right",
2404
+ children: [/* @__PURE__ */ a(oe, {
2405
+ onClick: x,
2406
+ variant: "subtle",
2407
+ children: "Cancel"
2408
+ }), /* @__PURE__ */ a(oe, {
2409
+ onClick: m,
2410
+ children: "OK"
2411
+ })]
2412
+ })]
2413
+ })]
2414
+ })
2415
+ })]
2416
+ });
2417
+ }), Xe = {
2418
+ pre: ["function pre_process({ method, url, params, headers, data }, utils) {", " // your code goes here", " return { method, url, params, headers, data }", "}"].join(`
2419
+ `),
2420
+ post: ["function post_process(res, utils) {", " // your code goes here", " return data", "}"].join(`
2421
+ `)
2422
+ };
2423
+ function mo({
2424
+ submit: e,
2425
+ styles: r = qe
2426
+ }) {
2427
+ const {
2428
+ control: t,
2429
+ setValue: o,
2430
+ handleSubmit: s
2431
+ } = ke({
2432
+ defaultValues: {
2433
+ type: "http",
2434
+ key: "",
2435
+ config: {
2436
+ host: "",
2437
+ processing: {
2438
+ pre: Xe.pre,
2439
+ post: Xe.post
2440
+ }
2441
+ }
2442
+ }
2443
+ });
2444
+ return /* @__PURE__ */ a(me, {
2445
+ mx: "auto",
2446
+ children: /* @__PURE__ */ I("form", {
2447
+ onSubmit: s(e),
2448
+ children: [/* @__PURE__ */ a(J, {
2449
+ name: "key",
2450
+ control: t,
2451
+ render: ({
2452
+ field: i
2453
+ }) => /* @__PURE__ */ a(fe, {
2454
+ mb: r.spacing,
2455
+ size: r.size,
2456
+ required: !0,
2457
+ label: "Name",
2458
+ placeholder: "A unique name",
956
2459
  ...i
957
2460
  })
958
- }), /* @__PURE__ */ r(I, {
2461
+ }), /* @__PURE__ */ a(Or, {
2462
+ label: "Connection Info",
2463
+ labelPosition: "center"
2464
+ }), /* @__PURE__ */ a(J, {
2465
+ name: "config.host",
2466
+ control: t,
2467
+ render: ({
2468
+ field: i
2469
+ }) => /* @__PURE__ */ a(fe, {
2470
+ mb: r.spacing,
2471
+ size: r.size,
2472
+ required: !0,
2473
+ label: "Base URL",
2474
+ sx: {
2475
+ flexGrow: 1
2476
+ },
2477
+ ...i
2478
+ })
2479
+ }), /* @__PURE__ */ I(se, {
2480
+ grow: !0,
2481
+ children: [/* @__PURE__ */ a(J, {
2482
+ name: "config.processing.pre",
2483
+ control: t,
2484
+ render: ({
2485
+ field: i
2486
+ }) => /* @__PURE__ */ a(lt, {
2487
+ label: "Pre Processing",
2488
+ modalTitle: "This function will run before sending the request (for scenarios like encryption)",
2489
+ defaultValue: Xe.pre,
2490
+ ...i,
2491
+ styles: r
2492
+ })
2493
+ }), /* @__PURE__ */ a(J, {
2494
+ name: "config.processing.post",
2495
+ control: t,
2496
+ render: ({
2497
+ field: i
2498
+ }) => /* @__PURE__ */ a(lt, {
2499
+ label: "Post Processing",
2500
+ modalTitle: "This function will run after sending the request (for scenarios like decryption)",
2501
+ defaultValue: Xe.post,
2502
+ ...i,
2503
+ styles: r
2504
+ })
2505
+ })]
2506
+ }), /* @__PURE__ */ a(se, {
959
2507
  position: "right",
960
- mt: n.spacing,
961
- children: /* @__PURE__ */ r(k, {
2508
+ mt: r.spacing,
2509
+ children: /* @__PURE__ */ a(oe, {
962
2510
  type: "submit",
963
- size: n.button.size,
2511
+ size: r.button.size,
964
2512
  children: "Save"
965
2513
  })
966
2514
  })]
967
2515
  })
968
2516
  });
969
2517
  }
970
- function it({
971
- onSuccess: t,
972
- styles: n = fe
2518
+ function bo({
2519
+ postSubmit: e,
2520
+ styles: r = qe
2521
+ }) {
2522
+ const [t, o] = Ie("postgresql"), s = async ({
2523
+ type: u,
2524
+ key: d,
2525
+ config: v
2526
+ }) => {
2527
+ _e({
2528
+ id: "for-creating",
2529
+ title: "Pending",
2530
+ message: "Adding data source...",
2531
+ loading: !0
2532
+ });
2533
+ try {
2534
+ console.log({
2535
+ type: u,
2536
+ key: d,
2537
+ config: v
2538
+ }), await de.datasource.create(u, d, v), le({
2539
+ id: "for-creating",
2540
+ title: "Successful",
2541
+ message: "Data source is added",
2542
+ color: "green"
2543
+ }), e();
2544
+ } catch (y) {
2545
+ le({
2546
+ id: "for-creating",
2547
+ title: "Failed",
2548
+ message: y.message,
2549
+ color: "red"
2550
+ });
2551
+ }
2552
+ }, i = t === "postgresql" || t === "mysql", c = t === "http";
2553
+ return /* @__PURE__ */ I(me, {
2554
+ mx: "auto",
2555
+ children: [/* @__PURE__ */ a(Bt, {
2556
+ fullWidth: !0,
2557
+ mb: r.spacing,
2558
+ size: r.size,
2559
+ data: [{
2560
+ label: "PostgreSQL",
2561
+ value: "postgresql"
2562
+ }, {
2563
+ label: "MySQL",
2564
+ value: "mysql"
2565
+ }, {
2566
+ label: "HTTP",
2567
+ value: "http"
2568
+ }],
2569
+ value: t,
2570
+ onChange: (u) => o(u)
2571
+ }), i && /* @__PURE__ */ a(pn, {
2572
+ submit: s,
2573
+ styles: r,
2574
+ type: t
2575
+ }), c && /* @__PURE__ */ a(mo, {
2576
+ submit: s,
2577
+ styles: r
2578
+ })]
2579
+ });
2580
+ }
2581
+ function yo({
2582
+ onSuccess: e,
2583
+ styles: r = qe
973
2584
  }) {
974
- const [o, s] = J.useState(!1), u = () => s(!0), i = () => s(!1);
975
- return /* @__PURE__ */ S($, {
976
- children: [/* @__PURE__ */ r(ce, {
2585
+ const [t, o] = De.useState(!1), s = () => o(!0), i = () => o(!1);
2586
+ return /* @__PURE__ */ I(Oe, {
2587
+ children: [/* @__PURE__ */ a(Ve, {
977
2588
  overflow: "inside",
978
- opened: o,
979
- onClose: () => s(!1),
2589
+ opened: t,
2590
+ onClose: () => o(!1),
980
2591
  title: "Add a data source",
981
2592
  trapFocus: !0,
982
- onDragStart: (d) => {
983
- d.stopPropagation();
2593
+ onDragStart: (u) => {
2594
+ u.stopPropagation();
984
2595
  },
985
- children: /* @__PURE__ */ r(at, {
2596
+ children: /* @__PURE__ */ a(bo, {
986
2597
  postSubmit: () => {
987
- t(), i();
2598
+ e(), i();
988
2599
  },
989
- styles: n
2600
+ styles: r
990
2601
  })
991
- }), /* @__PURE__ */ r(k, {
992
- size: n.button.size,
993
- onClick: u,
994
- leftIcon: /* @__PURE__ */ r(Te, {
2602
+ }), /* @__PURE__ */ a(oe, {
2603
+ size: r.button.size,
2604
+ onClick: s,
2605
+ leftIcon: /* @__PURE__ */ a(Cr, {
995
2606
  size: 20
996
2607
  }),
997
2608
  children: "Add a Data Source"
998
2609
  })]
999
2610
  });
1000
2611
  }
1001
- function Pe() {
1002
- return Pe = Object.assign ? Object.assign.bind() : function(t) {
1003
- for (var n = 1; n < arguments.length; n++) {
1004
- var o = arguments[n];
1005
- for (var s in o)
1006
- Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
2612
+ function Tr() {
2613
+ return Tr = Object.assign ? Object.assign.bind() : function(e) {
2614
+ for (var r = 1; r < arguments.length; r++) {
2615
+ var t = arguments[r];
2616
+ for (var o in t)
2617
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
1007
2618
  }
1008
- return t;
1009
- }, Pe.apply(this, arguments);
2619
+ return e;
2620
+ }, Tr.apply(this, arguments);
1010
2621
  }
1011
- function ot(t, n) {
1012
- if (t == null)
2622
+ function wo(e, r) {
2623
+ if (e == null)
1013
2624
  return {};
1014
- var o, s, u = function(l, d) {
1015
- if (l == null)
2625
+ var t, o, s = function(c, u) {
2626
+ if (c == null)
1016
2627
  return {};
1017
- var g, _, w = {}, m = Object.keys(l);
1018
- for (_ = 0; _ < m.length; _++)
1019
- g = m[_], d.indexOf(g) >= 0 || (w[g] = l[g]);
1020
- return w;
1021
- }(t, n);
2628
+ var d, v, y = {}, h = Object.keys(c);
2629
+ for (v = 0; v < h.length; v++)
2630
+ d = h[v], u.indexOf(d) >= 0 || (y[d] = c[d]);
2631
+ return y;
2632
+ }(e, r);
1022
2633
  if (Object.getOwnPropertySymbols) {
1023
- var i = Object.getOwnPropertySymbols(t);
1024
- for (s = 0; s < i.length; s++)
1025
- o = i[s], n.indexOf(o) >= 0 || Object.prototype.propertyIsEnumerable.call(t, o) && (u[o] = t[o]);
2634
+ var i = Object.getOwnPropertySymbols(e);
2635
+ for (o = 0; o < i.length; o++)
2636
+ t = i[o], r.indexOf(t) >= 0 || Object.prototype.propertyIsEnumerable.call(e, t) && (s[t] = e[t]);
1026
2637
  }
1027
- return u;
1028
- }
1029
- var st = ["size", "color", "stroke"];
1030
- function ct(t) {
1031
- var n = t.size, o = n === void 0 ? 24 : n, s = t.color, u = s === void 0 ? "currentColor" : s, i = t.stroke, l = i === void 0 ? 2 : i, d = ot(t, st);
1032
- return Q.createElement("svg", Pe({ xmlns: "http://www.w3.org/2000/svg", className: "icon icon-tabler icon-tabler-lock", width: o, height: o, viewBox: "0 0 24 24", strokeWidth: l, stroke: u, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, d), Q.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), Q.createElement("rect", { x: 5, y: 11, width: 14, height: 10, rx: 2 }), Q.createElement("circle", { cx: 12, cy: 16, r: 1 }), Q.createElement("path", { d: "M8 11v-4a4 4 0 0 1 8 0v4" }));
1033
- }
1034
- function lt({
1035
- id: t,
1036
- name: n,
1037
- isProtected: o,
1038
- onSuccess: s,
1039
- styles: u = fe
2638
+ return s;
2639
+ }
2640
+ var So = ["size", "color", "stroke"];
2641
+ function Eo(e) {
2642
+ var r = e.size, t = r === void 0 ? 24 : r, o = e.color, s = o === void 0 ? "currentColor" : o, i = e.stroke, c = i === void 0 ? 2 : i, u = wo(e, So);
2643
+ return $e.createElement("svg", Tr({ xmlns: "http://www.w3.org/2000/svg", className: "icon icon-tabler icon-tabler-lock", width: t, height: t, viewBox: "0 0 24 24", strokeWidth: c, stroke: s, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, u), $e.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), $e.createElement("rect", { x: 5, y: 11, width: 14, height: 10, rx: 2 }), $e.createElement("circle", { cx: 12, cy: 16, r: 1 }), $e.createElement("path", { d: "M8 11v-4a4 4 0 0 1 8 0v4" }));
2644
+ }
2645
+ function To({
2646
+ id: e,
2647
+ name: r,
2648
+ isProtected: t,
2649
+ onSuccess: o,
2650
+ styles: s = qe
1040
2651
  }) {
1041
- const i = ue(), l = async () => {
1042
- !t || (U({
2652
+ const i = tr(), c = async () => {
2653
+ !e || (_e({
1043
2654
  id: "for-deleting",
1044
2655
  title: "Pending",
1045
2656
  message: "Deleting data source...",
1046
2657
  loading: !0
1047
- }), await x.datasource.delete(t), z({
2658
+ }), await de.datasource.delete(e), le({
1048
2659
  id: "for-deleting",
1049
2660
  title: "Successful",
1050
- message: `Data source [${n}] is deleted`,
2661
+ message: `Data source [${r}] is deleted`,
1051
2662
  color: "green"
1052
- }), s());
1053
- }, d = () => i.openConfirmModal({
2663
+ }), o());
2664
+ }, u = () => i.openConfirmModal({
1054
2665
  title: "Delete this data source?",
1055
- children: /* @__PURE__ */ r(se, {
1056
- size: u.size,
2666
+ children: /* @__PURE__ */ a(Qe, {
2667
+ size: s.size,
1057
2668
  children: "This action won't affect your database."
1058
2669
  }),
1059
2670
  labels: {
@@ -1061,9 +2672,9 @@ function lt({
1061
2672
  cancel: "Cancel"
1062
2673
  },
1063
2674
  onCancel: () => console.log("Cancel"),
1064
- onConfirm: l
1065
- }), g = Ur();
1066
- return o ? /* @__PURE__ */ r($r, {
2675
+ onConfirm: c
2676
+ }), d = Kt();
2677
+ return t ? /* @__PURE__ */ a(Ht, {
1067
2678
  withArrow: !0,
1068
2679
  events: {
1069
2680
  hover: !0,
@@ -1071,140 +2682,140 @@ function lt({
1071
2682
  focus: !1
1072
2683
  },
1073
2684
  label: "This is a preset datasource, it can not be deleted",
1074
- children: /* @__PURE__ */ r("span", {
1075
- children: /* @__PURE__ */ r(ct, {
2685
+ children: /* @__PURE__ */ a("span", {
2686
+ children: /* @__PURE__ */ a(Eo, {
1076
2687
  size: 16,
1077
- color: g.colors.gray[7]
2688
+ color: d.colors.gray[7]
1078
2689
  })
1079
2690
  })
1080
- }) : /* @__PURE__ */ r(k, {
1081
- size: u.button.size,
2691
+ }) : /* @__PURE__ */ a(oe, {
2692
+ size: s.button.size,
1082
2693
  color: "red",
1083
- onClick: d,
1084
- leftIcon: /* @__PURE__ */ r(Oe, {
2694
+ onClick: u,
2695
+ leftIcon: /* @__PURE__ */ a(jr, {
1085
2696
  size: 20
1086
2697
  }),
1087
2698
  children: "Delete"
1088
2699
  });
1089
2700
  }
1090
- function At({
1091
- styles: t = fe,
1092
- config: n
2701
+ function No({
2702
+ styles: e = qe,
2703
+ config: r
1093
2704
  }) {
1094
- de(n);
2705
+ nr(r);
1095
2706
  const {
1096
- data: o = [],
1097
- loading: s,
1098
- refresh: u
1099
- } = G(async () => {
2707
+ data: t = [],
2708
+ loading: o,
2709
+ refresh: s
2710
+ } = ze(async () => {
1100
2711
  const {
1101
2712
  data: i
1102
- } = await x.datasource.list();
2713
+ } = await de.datasource.list();
1103
2714
  return i;
1104
2715
  }, {
1105
2716
  refreshDeps: []
1106
2717
  });
1107
- return /* @__PURE__ */ S($, {
1108
- children: [/* @__PURE__ */ r(I, {
1109
- pt: t.spacing,
2718
+ return /* @__PURE__ */ I(Oe, {
2719
+ children: [/* @__PURE__ */ a(se, {
2720
+ pt: e.spacing,
1110
2721
  position: "right",
1111
- children: /* @__PURE__ */ r(it, {
1112
- onSuccess: u
2722
+ children: /* @__PURE__ */ a(yo, {
2723
+ onSuccess: s
1113
2724
  })
1114
- }), /* @__PURE__ */ S(L, {
1115
- mt: t.spacing,
2725
+ }), /* @__PURE__ */ I(me, {
2726
+ mt: e.spacing,
1116
2727
  sx: {
1117
2728
  position: "relative"
1118
2729
  },
1119
- children: [/* @__PURE__ */ r(Ee, {
1120
- visible: s
1121
- }), /* @__PURE__ */ S(Ce, {
1122
- horizontalSpacing: t.spacing,
1123
- verticalSpacing: t.spacing,
1124
- fontSize: t.size,
2730
+ children: [/* @__PURE__ */ a(Rr, {
2731
+ visible: o
2732
+ }), /* @__PURE__ */ I(_r, {
2733
+ horizontalSpacing: e.spacing,
2734
+ verticalSpacing: e.spacing,
2735
+ fontSize: e.size,
1125
2736
  highlightOnHover: !0,
1126
- children: [/* @__PURE__ */ r("thead", {
1127
- children: /* @__PURE__ */ S("tr", {
1128
- children: [/* @__PURE__ */ r("th", {
2737
+ children: [/* @__PURE__ */ a("thead", {
2738
+ children: /* @__PURE__ */ I("tr", {
2739
+ children: [/* @__PURE__ */ a("th", {
1129
2740
  children: "Type"
1130
- }), /* @__PURE__ */ r("th", {
2741
+ }), /* @__PURE__ */ a("th", {
1131
2742
  children: "Name"
1132
- }), /* @__PURE__ */ r("th", {
2743
+ }), /* @__PURE__ */ a("th", {
1133
2744
  children: "Action"
1134
2745
  })]
1135
2746
  })
1136
- }), /* @__PURE__ */ r("tbody", {
1137
- children: o.map(({
2747
+ }), /* @__PURE__ */ a("tbody", {
2748
+ children: t.map(({
1138
2749
  id: i,
1139
- key: l,
1140
- type: d,
1141
- is_preset: g
1142
- }) => /* @__PURE__ */ S("tr", {
1143
- children: [/* @__PURE__ */ r("td", {
2750
+ key: c,
2751
+ type: u,
2752
+ is_preset: d
2753
+ }) => /* @__PURE__ */ I("tr", {
2754
+ children: [/* @__PURE__ */ a("td", {
1144
2755
  width: 200,
1145
- children: d
1146
- }), /* @__PURE__ */ r("td", {
1147
- children: l
1148
- }), /* @__PURE__ */ r("td", {
2756
+ children: u
2757
+ }), /* @__PURE__ */ a("td", {
2758
+ children: c
2759
+ }), /* @__PURE__ */ a("td", {
1149
2760
  width: 200,
1150
- children: /* @__PURE__ */ r(I, {
2761
+ children: /* @__PURE__ */ a(se, {
1151
2762
  position: "left",
1152
- children: /* @__PURE__ */ r(lt, {
1153
- isProtected: g,
2763
+ children: /* @__PURE__ */ a(To, {
2764
+ isProtected: d,
1154
2765
  id: i,
1155
- name: l,
1156
- onSuccess: u
2766
+ name: c,
2767
+ onSuccess: s
1157
2768
  })
1158
2769
  })
1159
2770
  })]
1160
- }, l))
2771
+ }, c))
1161
2772
  })]
1162
2773
  })]
1163
2774
  })]
1164
2775
  });
1165
2776
  }
1166
- const ut = ar(({
1167
- label: t,
1168
- value: n,
1169
- description: o,
1170
- ...s
1171
- }, u) => /* @__PURE__ */ S(nr, {
2777
+ const Oo = xr(({
2778
+ label: e,
2779
+ value: r,
2780
+ description: t,
2781
+ ...o
2782
+ }, s) => /* @__PURE__ */ I(Pr, {
1172
2783
  spacing: 2,
1173
- ref: u,
1174
- ...s,
1175
- children: [/* @__PURE__ */ r(se, {
2784
+ ref: s,
2785
+ ...o,
2786
+ children: [/* @__PURE__ */ a(Qe, {
1176
2787
  size: "sm",
1177
- children: t
1178
- }), /* @__PURE__ */ r(se, {
2788
+ children: e
2789
+ }), /* @__PURE__ */ a(Qe, {
1179
2790
  size: "xs",
1180
2791
  color: "dimmed",
1181
2792
  className: "role-description",
1182
- children: o
2793
+ children: t
1183
2794
  })]
1184
- })), ze = ar(({
1185
- styles: t,
1186
- value: n,
1187
- onChange: o
1188
- }, s) => {
2795
+ })), Ir = xr(({
2796
+ styles: e,
2797
+ value: r,
2798
+ onChange: t
2799
+ }, o) => {
1189
2800
  const {
1190
- data: u = [],
2801
+ data: s = [],
1191
2802
  loading: i
1192
- } = G(async () => (await x.role.list()).map((d) => ({
1193
- label: d.name,
1194
- value: d.id,
1195
- description: d.description,
1196
- disabled: d.id === 50
2803
+ } = ze(async () => (await de.role.list()).map((u) => ({
2804
+ label: u.name,
2805
+ value: u.id,
2806
+ description: u.description,
2807
+ disabled: u.id === 50
1197
2808
  })), {
1198
2809
  refreshDeps: []
1199
2810
  });
1200
- return /* @__PURE__ */ r(Wr, {
1201
- ref: s,
1202
- mb: t.spacing,
1203
- size: t.size,
2811
+ return /* @__PURE__ */ a(Gt, {
2812
+ ref: o,
2813
+ mb: e.spacing,
2814
+ size: e.size,
1204
2815
  required: !0,
1205
2816
  label: "Role",
1206
- itemComponent: ut,
1207
- data: u,
2817
+ itemComponent: Oo,
2818
+ data: s,
1208
2819
  disabled: i,
1209
2820
  styles: () => ({
1210
2821
  item: {
@@ -1217,184 +2828,184 @@ const ut = ar(({
1217
2828
  }
1218
2829
  }
1219
2830
  }),
1220
- value: n,
1221
- onChange: o
2831
+ value: r,
2832
+ onChange: t
1222
2833
  });
1223
- }), W = {
2834
+ }), xe = {
1224
2835
  size: "sm",
1225
2836
  spacing: "md",
1226
2837
  button: {
1227
2838
  size: "xs"
1228
2839
  }
1229
2840
  };
1230
- function dt({
1231
- postSubmit: t,
1232
- styles: n = W,
1233
- initialRoleID: o
2841
+ function Po({
2842
+ postSubmit: e,
2843
+ styles: r = xe,
2844
+ initialRoleID: t
1234
2845
  }) {
1235
2846
  const {
1236
- control: s,
1237
- handleSubmit: u
1238
- } = re({
2847
+ control: o,
2848
+ handleSubmit: s
2849
+ } = ke({
1239
2850
  defaultValues: {
1240
2851
  name: "",
1241
2852
  email: "",
1242
- role_id: o,
2853
+ role_id: t,
1243
2854
  password: ""
1244
2855
  }
1245
2856
  });
1246
- return /* @__PURE__ */ r(L, {
2857
+ return /* @__PURE__ */ a(me, {
1247
2858
  mx: "auto",
1248
- children: /* @__PURE__ */ S("form", {
1249
- onSubmit: u(async ({
1250
- name: l,
1251
- email: d,
1252
- password: g,
1253
- role_id: _
2859
+ children: /* @__PURE__ */ I("form", {
2860
+ onSubmit: s(async ({
2861
+ name: c,
2862
+ email: u,
2863
+ password: d,
2864
+ role_id: v
1254
2865
  }) => {
1255
2866
  try {
1256
- U({
2867
+ _e({
1257
2868
  id: "for-creating",
1258
2869
  title: "Pending",
1259
2870
  message: "Adding account...",
1260
2871
  loading: !0
1261
- }), await x.account.create(l, d, g, _), z({
2872
+ }), await de.account.create(c, u, d, v), le({
1262
2873
  id: "for-creating",
1263
2874
  title: "Successful",
1264
2875
  message: "Account is added",
1265
2876
  color: "green"
1266
- }), t();
1267
- } catch (w) {
1268
- z({
2877
+ }), e();
2878
+ } catch (y) {
2879
+ le({
1269
2880
  id: "for-creating",
1270
2881
  title: "Failed",
1271
- message: w.message,
2882
+ message: y.message,
1272
2883
  color: "red"
1273
2884
  });
1274
2885
  }
1275
2886
  }),
1276
- children: [/* @__PURE__ */ r(E, {
2887
+ children: [/* @__PURE__ */ a(J, {
1277
2888
  name: "name",
1278
- control: s,
2889
+ control: o,
1279
2890
  render: ({
1280
- field: l
1281
- }) => /* @__PURE__ */ r(j, {
1282
- mb: n.spacing,
1283
- size: n.size,
2891
+ field: c
2892
+ }) => /* @__PURE__ */ a(fe, {
2893
+ mb: r.spacing,
2894
+ size: r.size,
1284
2895
  required: !0,
1285
2896
  label: "Username",
1286
- ...l
2897
+ ...c
1287
2898
  })
1288
- }), /* @__PURE__ */ r(E, {
2899
+ }), /* @__PURE__ */ a(J, {
1289
2900
  name: "email",
1290
- control: s,
2901
+ control: o,
1291
2902
  render: ({
1292
- field: l
1293
- }) => /* @__PURE__ */ r(j, {
1294
- mb: n.spacing,
1295
- size: n.size,
2903
+ field: c
2904
+ }) => /* @__PURE__ */ a(fe, {
2905
+ mb: r.spacing,
2906
+ size: r.size,
1296
2907
  required: !0,
1297
2908
  label: "Email",
1298
- ...l
2909
+ ...c
1299
2910
  })
1300
- }), /* @__PURE__ */ r(E, {
2911
+ }), /* @__PURE__ */ a(J, {
1301
2912
  name: "password",
1302
- control: s,
2913
+ control: o,
1303
2914
  render: ({
1304
- field: l
1305
- }) => /* @__PURE__ */ r(le, {
1306
- mb: n.spacing,
1307
- size: n.size,
2915
+ field: c
2916
+ }) => /* @__PURE__ */ a(rr, {
2917
+ mb: r.spacing,
2918
+ size: r.size,
1308
2919
  required: !0,
1309
2920
  label: "Password",
1310
2921
  description: "Password must be at least 8 characters long",
1311
- ...l
2922
+ ...c
1312
2923
  })
1313
- }), /* @__PURE__ */ r(E, {
2924
+ }), /* @__PURE__ */ a(J, {
1314
2925
  name: "role_id",
1315
- control: s,
2926
+ control: o,
1316
2927
  render: ({
1317
- field: l
1318
- }) => /* @__PURE__ */ r(ze, {
1319
- styles: n,
1320
- ...l
2928
+ field: c
2929
+ }) => /* @__PURE__ */ a(Ir, {
2930
+ styles: r,
2931
+ ...c
1321
2932
  })
1322
- }), /* @__PURE__ */ r(I, {
2933
+ }), /* @__PURE__ */ a(se, {
1323
2934
  position: "right",
1324
- mt: n.spacing,
1325
- children: /* @__PURE__ */ r(k, {
2935
+ mt: r.spacing,
2936
+ children: /* @__PURE__ */ a(oe, {
1326
2937
  type: "submit",
1327
- size: n.button.size,
2938
+ size: r.button.size,
1328
2939
  children: "Save"
1329
2940
  })
1330
2941
  })]
1331
2942
  })
1332
2943
  });
1333
2944
  }
1334
- function ft({
1335
- onSuccess: t,
1336
- styles: n = W,
1337
- initialRoleID: o
2945
+ function Ro({
2946
+ onSuccess: e,
2947
+ styles: r = xe,
2948
+ initialRoleID: t
1338
2949
  }) {
1339
- const [s, u] = J.useState(!1), i = () => u(!0), l = () => u(!1);
1340
- return /* @__PURE__ */ S($, {
1341
- children: [/* @__PURE__ */ r(ce, {
2950
+ const [o, s] = De.useState(!1), i = () => s(!0), c = () => s(!1);
2951
+ return /* @__PURE__ */ I(Oe, {
2952
+ children: [/* @__PURE__ */ a(Ve, {
1342
2953
  overflow: "inside",
1343
- opened: s,
1344
- onClose: () => u(!1),
2954
+ opened: o,
2955
+ onClose: () => s(!1),
1345
2956
  title: "Add an Account",
1346
2957
  trapFocus: !0,
1347
- onDragStart: (g) => {
1348
- g.stopPropagation();
2958
+ onDragStart: (d) => {
2959
+ d.stopPropagation();
1349
2960
  },
1350
- children: /* @__PURE__ */ r(dt, {
2961
+ children: /* @__PURE__ */ a(Po, {
1351
2962
  postSubmit: () => {
1352
- t(), l();
2963
+ e(), c();
1353
2964
  },
1354
- styles: n,
1355
- initialRoleID: o
2965
+ styles: r,
2966
+ initialRoleID: t
1356
2967
  })
1357
- }), /* @__PURE__ */ r(k, {
1358
- size: n.button.size,
2968
+ }), /* @__PURE__ */ a(oe, {
2969
+ size: r.button.size,
1359
2970
  onClick: i,
1360
- leftIcon: /* @__PURE__ */ r(Te, {
2971
+ leftIcon: /* @__PURE__ */ a(Cr, {
1361
2972
  size: 20
1362
2973
  }),
1363
2974
  children: "Add an Account"
1364
2975
  })]
1365
2976
  });
1366
2977
  }
1367
- function pt({
1368
- id: t,
1369
- name: n,
1370
- onSuccess: o,
1371
- styles: s = W
2978
+ function _o({
2979
+ id: e,
2980
+ name: r,
2981
+ onSuccess: t,
2982
+ styles: o = xe
1372
2983
  }) {
1373
- const u = ue(), i = async () => {
1374
- if (!!t) {
1375
- U({
2984
+ const s = tr(), i = async () => {
2985
+ if (!!e) {
2986
+ _e({
1376
2987
  id: "for-deleting",
1377
2988
  title: "Pending",
1378
2989
  message: "Deleting account...",
1379
2990
  loading: !0
1380
2991
  });
1381
2992
  try {
1382
- await x.account.delete(t), z({
2993
+ await de.account.delete(e), le({
1383
2994
  id: "for-deleting",
1384
2995
  title: "Successful",
1385
- message: `Account [${n}] is deleted`,
2996
+ message: `Account [${r}] is deleted`,
1386
2997
  color: "green"
1387
- }), o();
1388
- } catch (d) {
1389
- z({
2998
+ }), t();
2999
+ } catch (u) {
3000
+ le({
1390
3001
  id: "for-deleting",
1391
3002
  title: "Failed",
1392
- message: d.message,
3003
+ message: u.message,
1393
3004
  color: "red"
1394
3005
  });
1395
3006
  }
1396
3007
  }
1397
- }, l = () => u.openConfirmModal({
3008
+ }, c = () => s.openConfirmModal({
1398
3009
  title: "Delete this account?",
1399
3010
  labels: {
1400
3011
  confirm: "Confirm",
@@ -1403,148 +3014,148 @@ function pt({
1403
3014
  onCancel: () => console.log("Cancel"),
1404
3015
  onConfirm: i
1405
3016
  });
1406
- return /* @__PURE__ */ r(k, {
1407
- size: s.button.size,
3017
+ return /* @__PURE__ */ a(oe, {
3018
+ size: o.button.size,
1408
3019
  color: "red",
1409
- onClick: l,
1410
- leftIcon: /* @__PURE__ */ r(Oe, {
3020
+ onClick: c,
3021
+ leftIcon: /* @__PURE__ */ a(jr, {
1411
3022
  size: 20
1412
3023
  }),
1413
3024
  children: "Delete"
1414
3025
  });
1415
3026
  }
1416
- function gt({
1417
- id: t,
1418
- name: n,
1419
- email: o,
1420
- role_id: s,
1421
- postSubmit: u,
1422
- styles: i = W
3027
+ function xo({
3028
+ id: e,
3029
+ name: r,
3030
+ email: t,
3031
+ role_id: o,
3032
+ postSubmit: s,
3033
+ styles: i = xe
1423
3034
  }) {
1424
3035
  const {
1425
- control: l,
1426
- handleSubmit: d,
1427
- watch: g
1428
- } = re({
3036
+ control: c,
3037
+ handleSubmit: u,
3038
+ watch: d
3039
+ } = ke({
1429
3040
  defaultValues: {
1430
- name: n,
1431
- email: o,
1432
- role_id: s,
3041
+ name: r,
3042
+ email: t,
3043
+ role_id: o,
1433
3044
  reset_password: !1,
1434
3045
  new_password: ""
1435
3046
  }
1436
- }), _ = async ({
1437
- name: f,
1438
- email: A,
1439
- role_id: M,
1440
- reset_password: V,
1441
- new_password: me
3047
+ }), v = async ({
3048
+ name: m,
3049
+ email: x,
3050
+ role_id: Y,
3051
+ reset_password: D,
3052
+ new_password: G
1442
3053
  }) => {
1443
3054
  try {
1444
- U({
3055
+ _e({
1445
3056
  id: "for-updating",
1446
3057
  title: "Pending",
1447
3058
  message: "Updating account...",
1448
3059
  loading: !0
1449
- }), await x.account.edit({
1450
- id: t,
1451
- name: f,
1452
- email: A,
1453
- role_id: M,
1454
- reset_password: V,
1455
- new_password: me
1456
- }), z({
3060
+ }), await de.account.edit({
3061
+ id: e,
3062
+ name: m,
3063
+ email: x,
3064
+ role_id: Y,
3065
+ reset_password: D,
3066
+ new_password: G
3067
+ }), le({
1457
3068
  id: "for-updating",
1458
3069
  title: "Successful",
1459
3070
  message: "Account is updated",
1460
3071
  color: "green"
1461
- }), u();
1462
- } catch (N) {
1463
- z({
3072
+ }), s();
3073
+ } catch (K) {
3074
+ le({
1464
3075
  id: "for-updating",
1465
3076
  title: "Failed",
1466
- message: N.message,
3077
+ message: K.message,
1467
3078
  color: "red"
1468
3079
  });
1469
3080
  }
1470
- }, [w, m] = g(["reset_password", "new_password"]);
1471
- return /* @__PURE__ */ r(L, {
3081
+ }, [y, h] = d(["reset_password", "new_password"]);
3082
+ return /* @__PURE__ */ a(me, {
1472
3083
  mx: "auto",
1473
- children: /* @__PURE__ */ S("form", {
1474
- onSubmit: d(_),
1475
- children: [/* @__PURE__ */ r(E, {
3084
+ children: /* @__PURE__ */ I("form", {
3085
+ onSubmit: u(v),
3086
+ children: [/* @__PURE__ */ a(J, {
1476
3087
  name: "name",
1477
- control: l,
3088
+ control: c,
1478
3089
  render: ({
1479
- field: f
1480
- }) => /* @__PURE__ */ r(j, {
3090
+ field: m
3091
+ }) => /* @__PURE__ */ a(fe, {
1481
3092
  mb: i.spacing,
1482
3093
  size: i.size,
1483
3094
  required: !0,
1484
3095
  label: "Username",
1485
- ...f
3096
+ ...m
1486
3097
  })
1487
- }), /* @__PURE__ */ r(E, {
3098
+ }), /* @__PURE__ */ a(J, {
1488
3099
  name: "email",
1489
- control: l,
3100
+ control: c,
1490
3101
  render: ({
1491
- field: f
1492
- }) => /* @__PURE__ */ r(j, {
3102
+ field: m
3103
+ }) => /* @__PURE__ */ a(fe, {
1493
3104
  mb: i.spacing,
1494
3105
  size: i.size,
1495
3106
  required: !0,
1496
3107
  label: "Email",
1497
- ...f
3108
+ ...m
1498
3109
  })
1499
- }), /* @__PURE__ */ r(E, {
3110
+ }), /* @__PURE__ */ a(J, {
1500
3111
  name: "role_id",
1501
- control: l,
3112
+ control: c,
1502
3113
  render: ({
1503
- field: f
1504
- }) => /* @__PURE__ */ r(ze, {
3114
+ field: m
3115
+ }) => /* @__PURE__ */ a(Ir, {
1505
3116
  styles: i,
1506
- ...f
3117
+ ...m
1507
3118
  })
1508
- }), /* @__PURE__ */ r(tr, {
3119
+ }), /* @__PURE__ */ a(Or, {
1509
3120
  my: 20,
1510
3121
  variant: "dashed",
1511
3122
  label: "",
1512
3123
  labelPosition: "center"
1513
- }), /* @__PURE__ */ r(E, {
3124
+ }), /* @__PURE__ */ a(J, {
1514
3125
  name: "reset_password",
1515
- control: l,
3126
+ control: c,
1516
3127
  render: ({
1517
- field: f
1518
- }) => /* @__PURE__ */ r(Vr, {
3128
+ field: m
3129
+ }) => /* @__PURE__ */ a(Jt, {
1519
3130
  mb: i.spacing,
1520
3131
  size: i.size,
1521
3132
  label: "Reset password",
1522
- checked: f.value,
1523
- onChange: (A) => f.onChange(A.currentTarget.checked),
3133
+ checked: m.value,
3134
+ onChange: (x) => m.onChange(x.currentTarget.checked),
1524
3135
  styles: {
1525
3136
  label: {
1526
3137
  verticalAlign: "middle"
1527
3138
  }
1528
3139
  }
1529
3140
  })
1530
- }), w && /* @__PURE__ */ r(E, {
3141
+ }), y && /* @__PURE__ */ a(J, {
1531
3142
  name: "new_password",
1532
- control: l,
3143
+ control: c,
1533
3144
  render: ({
1534
- field: f
1535
- }) => /* @__PURE__ */ r(le, {
3145
+ field: m
3146
+ }) => /* @__PURE__ */ a(rr, {
1536
3147
  autoComplete: "off",
1537
3148
  mb: i.spacing,
1538
3149
  size: i.size,
1539
3150
  required: !0,
1540
3151
  description: "Password must be at least 8 characters long",
1541
3152
  label: "New Password",
1542
- ...f
3153
+ ...m
1543
3154
  })
1544
- }), /* @__PURE__ */ r(I, {
3155
+ }), /* @__PURE__ */ a(se, {
1545
3156
  position: "right",
1546
3157
  mt: i.spacing,
1547
- children: /* @__PURE__ */ r(k, {
3158
+ children: /* @__PURE__ */ a(oe, {
1548
3159
  type: "submit",
1549
3160
  size: i.button.size,
1550
3161
  children: "Submit"
@@ -1553,351 +3164,351 @@ function gt({
1553
3164
  })
1554
3165
  });
1555
3166
  }
1556
- function mt({
1557
- account: t,
1558
- onSuccess: n,
1559
- styles: o = W
3167
+ function Co({
3168
+ account: e,
3169
+ onSuccess: r,
3170
+ styles: t = xe
1560
3171
  }) {
1561
- const [s, u] = J.useState(!1), i = () => u(!0), l = () => u(!1), d = () => {
1562
- n(), l();
3172
+ const [o, s] = De.useState(!1), i = () => s(!0), c = () => s(!1), u = () => {
3173
+ r(), c();
1563
3174
  };
1564
- return /* @__PURE__ */ S($, {
1565
- children: [/* @__PURE__ */ r(ce, {
3175
+ return /* @__PURE__ */ I(Oe, {
3176
+ children: [/* @__PURE__ */ a(Ve, {
1566
3177
  overflow: "inside",
1567
- opened: s,
1568
- onClose: () => u(!1),
1569
- title: `Editing ${t.name}`,
3178
+ opened: o,
3179
+ onClose: () => s(!1),
3180
+ title: `Editing ${e.name}`,
1570
3181
  trapFocus: !0,
1571
- onDragStart: (g) => {
1572
- g.stopPropagation();
3182
+ onDragStart: (d) => {
3183
+ d.stopPropagation();
1573
3184
  },
1574
- children: /* @__PURE__ */ r(gt, {
1575
- ...t,
1576
- postSubmit: d,
1577
- styles: o
3185
+ children: /* @__PURE__ */ a(xo, {
3186
+ ...e,
3187
+ postSubmit: u,
3188
+ styles: t
1578
3189
  })
1579
- }), /* @__PURE__ */ r(k, {
1580
- size: o.button.size,
3190
+ }), /* @__PURE__ */ a(oe, {
3191
+ size: t.button.size,
1581
3192
  onClick: i,
1582
- leftIcon: /* @__PURE__ */ r(Yr, {
3193
+ leftIcon: /* @__PURE__ */ a(Qt, {
1583
3194
  size: 20
1584
3195
  }),
1585
3196
  children: "Edit"
1586
3197
  })]
1587
3198
  });
1588
3199
  }
1589
- function xt({
1590
- styles: t = W,
1591
- config: n
3200
+ function Vo({
3201
+ styles: e = xe,
3202
+ config: r
1592
3203
  }) {
1593
- var _, w;
1594
- de(n);
3204
+ var v, y;
3205
+ nr(r);
1595
3206
  const {
1596
- data: o = [],
1597
- loading: s,
1598
- refresh: u
1599
- } = G(async () => {
3207
+ data: t = [],
3208
+ loading: o,
3209
+ refresh: s
3210
+ } = ze(async () => {
1600
3211
  const {
1601
- data: m
1602
- } = await x.account.list();
1603
- return m;
3212
+ data: h
3213
+ } = await de.account.list();
3214
+ return h;
1604
3215
  }, {
1605
3216
  refreshDeps: []
1606
3217
  }), {
1607
3218
  data: i = [],
1608
- loading: l
1609
- } = G(async () => (await x.role.list()).map((f) => ({
1610
- label: f.name,
1611
- value: f.id,
1612
- description: f.description,
1613
- disabled: f.id === 50
3219
+ loading: c
3220
+ } = ze(async () => (await de.role.list()).map((m) => ({
3221
+ label: m.name,
3222
+ value: m.id,
3223
+ description: m.description,
3224
+ disabled: m.id === 50
1614
3225
  })), {
1615
3226
  refreshDeps: []
1616
- }), d = ir(() => i.reduce((m, f) => (m.set(f.value, f.label), m), /* @__PURE__ */ new Map()), [i]), g = (m) => {
1617
- var f;
1618
- return (f = d.get(m)) != null ? f : m;
3227
+ }), u = dt(() => i.reduce((h, m) => (h.set(m.value, m.label), h), /* @__PURE__ */ new Map()), [i]), d = (h) => {
3228
+ var m;
3229
+ return (m = u.get(h)) != null ? m : h;
1619
3230
  };
1620
- return /* @__PURE__ */ S($, {
1621
- children: [/* @__PURE__ */ r(I, {
1622
- pt: t.spacing,
3231
+ return /* @__PURE__ */ I(Oe, {
3232
+ children: [/* @__PURE__ */ a(se, {
3233
+ pt: e.spacing,
1623
3234
  position: "right",
1624
- children: /* @__PURE__ */ r(ft, {
1625
- onSuccess: u,
1626
- initialRoleID: (w = (_ = i == null ? void 0 : i[0]) == null ? void 0 : _.value) != null ? w : 0
3235
+ children: /* @__PURE__ */ a(Ro, {
3236
+ onSuccess: s,
3237
+ initialRoleID: (y = (v = i == null ? void 0 : i[0]) == null ? void 0 : v.value) != null ? y : 0
1627
3238
  })
1628
- }), /* @__PURE__ */ S(L, {
1629
- mt: t.spacing,
3239
+ }), /* @__PURE__ */ I(me, {
3240
+ mt: e.spacing,
1630
3241
  sx: {
1631
3242
  position: "relative"
1632
3243
  },
1633
- children: [/* @__PURE__ */ r(Ee, {
1634
- visible: s || l
1635
- }), /* @__PURE__ */ S(Ce, {
1636
- horizontalSpacing: t.spacing,
1637
- verticalSpacing: t.spacing,
1638
- fontSize: t.size,
3244
+ children: [/* @__PURE__ */ a(Rr, {
3245
+ visible: o || c
3246
+ }), /* @__PURE__ */ I(_r, {
3247
+ horizontalSpacing: e.spacing,
3248
+ verticalSpacing: e.spacing,
3249
+ fontSize: e.size,
1639
3250
  highlightOnHover: !0,
1640
- children: [/* @__PURE__ */ r("thead", {
1641
- children: /* @__PURE__ */ S("tr", {
1642
- children: [/* @__PURE__ */ r("th", {
3251
+ children: [/* @__PURE__ */ a("thead", {
3252
+ children: /* @__PURE__ */ I("tr", {
3253
+ children: [/* @__PURE__ */ a("th", {
1643
3254
  children: "Username"
1644
- }), /* @__PURE__ */ r("th", {
3255
+ }), /* @__PURE__ */ a("th", {
1645
3256
  children: "Email"
1646
- }), /* @__PURE__ */ r("th", {
3257
+ }), /* @__PURE__ */ a("th", {
1647
3258
  children: "Role"
1648
- }), /* @__PURE__ */ r("th", {
3259
+ }), /* @__PURE__ */ a("th", {
1649
3260
  children: "Action"
1650
3261
  })]
1651
3262
  })
1652
- }), /* @__PURE__ */ r("tbody", {
1653
- children: o.map((m) => {
3263
+ }), /* @__PURE__ */ a("tbody", {
3264
+ children: t.map((h) => {
1654
3265
  const {
1655
- id: f,
1656
- name: A,
1657
- email: M,
1658
- role_id: V
1659
- } = m;
1660
- return /* @__PURE__ */ S("tr", {
1661
- children: [/* @__PURE__ */ r("td", {
3266
+ id: m,
3267
+ name: x,
3268
+ email: Y,
3269
+ role_id: D
3270
+ } = h;
3271
+ return /* @__PURE__ */ I("tr", {
3272
+ children: [/* @__PURE__ */ a("td", {
1662
3273
  width: 200,
1663
- children: A
1664
- }), /* @__PURE__ */ r("td", {
3274
+ children: x
3275
+ }), /* @__PURE__ */ a("td", {
1665
3276
  width: 200,
1666
- children: M
1667
- }), /* @__PURE__ */ r("td", {
3277
+ children: Y
3278
+ }), /* @__PURE__ */ a("td", {
1668
3279
  width: 200,
1669
- children: g(V)
1670
- }), /* @__PURE__ */ r("td", {
3280
+ children: d(D)
3281
+ }), /* @__PURE__ */ a("td", {
1671
3282
  width: 200,
1672
- children: /* @__PURE__ */ S(I, {
3283
+ children: /* @__PURE__ */ I(se, {
1673
3284
  position: "left",
1674
- children: [/* @__PURE__ */ r(mt, {
1675
- account: m,
1676
- onSuccess: u
1677
- }), /* @__PURE__ */ r(pt, {
1678
- id: f,
1679
- name: A,
1680
- onSuccess: u
3285
+ children: [/* @__PURE__ */ a(Co, {
3286
+ account: h,
3287
+ onSuccess: s
3288
+ }), /* @__PURE__ */ a(_o, {
3289
+ id: m,
3290
+ name: x,
3291
+ onSuccess: s
1681
3292
  })]
1682
3293
  })
1683
3294
  })]
1684
- }, f);
3295
+ }, m);
1685
3296
  })
1686
3297
  })]
1687
3298
  })]
1688
3299
  })]
1689
3300
  });
1690
3301
  }
1691
- function ht({
1692
- postSubmit: t,
1693
- styles: n = W
3302
+ function jo({
3303
+ postSubmit: e,
3304
+ styles: r = xe
1694
3305
  }) {
1695
3306
  const {
1696
- control: o,
1697
- handleSubmit: s
1698
- } = re({
3307
+ control: t,
3308
+ handleSubmit: o
3309
+ } = ke({
1699
3310
  defaultValues: {
1700
3311
  name: "",
1701
3312
  password: ""
1702
3313
  }
1703
3314
  });
1704
- return /* @__PURE__ */ r(L, {
3315
+ return /* @__PURE__ */ a(me, {
1705
3316
  mx: "auto",
1706
- children: /* @__PURE__ */ S("form", {
1707
- onSubmit: s(async ({
3317
+ children: /* @__PURE__ */ I("form", {
3318
+ onSubmit: o(async ({
1708
3319
  name: i,
1709
- password: l
3320
+ password: c
1710
3321
  }) => {
1711
3322
  try {
1712
- U({
3323
+ _e({
1713
3324
  id: "for-login",
1714
3325
  title: "Pending",
1715
3326
  message: "Loggin in...",
1716
3327
  loading: !0
1717
3328
  });
1718
- const d = await x.account.login(i, l);
1719
- window.localStorage.setItem("token", d.token), z({
3329
+ const u = await de.account.login(i, c);
3330
+ window.localStorage.setItem("token", u.token), le({
1720
3331
  id: "for-login",
1721
3332
  title: "Successful",
1722
3333
  message: "Logged in",
1723
3334
  color: "green"
1724
- }), t(d);
1725
- } catch (d) {
1726
- z({
3335
+ }), e(u);
3336
+ } catch (u) {
3337
+ le({
1727
3338
  id: "for-login",
1728
3339
  title: "Login Failed",
1729
- message: d.message,
3340
+ message: u.message,
1730
3341
  color: "red"
1731
3342
  });
1732
3343
  }
1733
3344
  }),
1734
- children: [/* @__PURE__ */ r(E, {
3345
+ children: [/* @__PURE__ */ a(J, {
1735
3346
  name: "name",
1736
- control: o,
3347
+ control: t,
1737
3348
  render: ({
1738
3349
  field: i
1739
- }) => /* @__PURE__ */ r(j, {
1740
- mb: n.spacing,
1741
- size: n.size,
3350
+ }) => /* @__PURE__ */ a(fe, {
3351
+ mb: r.spacing,
3352
+ size: r.size,
1742
3353
  required: !0,
1743
3354
  label: "Username",
1744
3355
  ...i
1745
3356
  })
1746
- }), /* @__PURE__ */ r(E, {
3357
+ }), /* @__PURE__ */ a(J, {
1747
3358
  name: "password",
1748
- control: o,
3359
+ control: t,
1749
3360
  render: ({
1750
3361
  field: i
1751
- }) => /* @__PURE__ */ r(le, {
1752
- mb: n.spacing,
1753
- size: n.size,
3362
+ }) => /* @__PURE__ */ a(rr, {
3363
+ mb: r.spacing,
3364
+ size: r.size,
1754
3365
  required: !0,
1755
3366
  label: "Password",
1756
3367
  ...i
1757
3368
  })
1758
- }), /* @__PURE__ */ r(I, {
3369
+ }), /* @__PURE__ */ a(se, {
1759
3370
  position: "right",
1760
- mt: n.spacing,
1761
- children: /* @__PURE__ */ r(k, {
3371
+ mt: r.spacing,
3372
+ children: /* @__PURE__ */ a(oe, {
1762
3373
  type: "submit",
1763
- size: n.button.size,
3374
+ size: r.button.size,
1764
3375
  children: "Submit"
1765
3376
  })
1766
3377
  })]
1767
3378
  })
1768
3379
  });
1769
3380
  }
1770
- function kt({
1771
- styles: t = W,
1772
- config: n,
1773
- onSuccess: o
3381
+ function Bo({
3382
+ styles: e = xe,
3383
+ config: r,
3384
+ onSuccess: t
1774
3385
  }) {
1775
- return de(n), /* @__PURE__ */ r($, {
1776
- children: /* @__PURE__ */ r(L, {
1777
- mt: t.spacing,
3386
+ return nr(r), /* @__PURE__ */ a(Oe, {
3387
+ children: /* @__PURE__ */ a(me, {
3388
+ mt: e.spacing,
1778
3389
  sx: {
1779
3390
  position: "relative"
1780
3391
  },
1781
- children: /* @__PURE__ */ r(ht, {
1782
- styles: t,
1783
- postSubmit: o
3392
+ children: /* @__PURE__ */ a(jo, {
3393
+ styles: e,
3394
+ postSubmit: t
1784
3395
  })
1785
3396
  })
1786
3397
  });
1787
3398
  }
1788
- const ge = {
3399
+ const ar = {
1789
3400
  size: "sm",
1790
3401
  spacing: "md",
1791
3402
  button: {
1792
3403
  size: "xs"
1793
3404
  }
1794
3405
  };
1795
- function vt({
1796
- postSubmit: t,
1797
- styles: n = ge,
1798
- initialRoleID: o
3406
+ function Ao({
3407
+ postSubmit: e,
3408
+ styles: r = ar,
3409
+ initialRoleID: t
1799
3410
  }) {
1800
3411
  const {
1801
- control: s,
1802
- handleSubmit: u
1803
- } = re({
3412
+ control: o,
3413
+ handleSubmit: s
3414
+ } = ke({
1804
3415
  defaultValues: {
1805
3416
  name: "",
1806
- role_id: o
3417
+ role_id: t
1807
3418
  }
1808
3419
  });
1809
- return /* @__PURE__ */ r(L, {
3420
+ return /* @__PURE__ */ a(me, {
1810
3421
  mx: "auto",
1811
- children: /* @__PURE__ */ S("form", {
1812
- onSubmit: u(async ({
1813
- name: l,
1814
- role_id: d
3422
+ children: /* @__PURE__ */ I("form", {
3423
+ onSubmit: s(async ({
3424
+ name: c,
3425
+ role_id: u
1815
3426
  }) => {
1816
3427
  try {
1817
- U({
3428
+ _e({
1818
3429
  id: "for-creating",
1819
3430
  title: "Pending",
1820
3431
  message: "Adding API Key...",
1821
3432
  loading: !0
1822
3433
  });
1823
3434
  const {
1824
- app_id: g,
1825
- app_secret: _
1826
- } = await x.api_key.create(l, d);
1827
- z({
3435
+ app_id: d,
3436
+ app_secret: v
3437
+ } = await de.api_key.create(c, u);
3438
+ le({
1828
3439
  id: "for-creating",
1829
3440
  title: "Successful",
1830
3441
  message: "API Key is added",
1831
3442
  color: "green"
1832
- }), t(g, _);
1833
- } catch (g) {
1834
- z({
3443
+ }), e(d, v);
3444
+ } catch (d) {
3445
+ le({
1835
3446
  id: "for-creating",
1836
3447
  title: "Failed",
1837
- message: g.message,
3448
+ message: d.message,
1838
3449
  color: "red"
1839
3450
  });
1840
3451
  }
1841
3452
  }),
1842
- children: [/* @__PURE__ */ r(E, {
3453
+ children: [/* @__PURE__ */ a(J, {
1843
3454
  name: "name",
1844
- control: s,
3455
+ control: o,
1845
3456
  render: ({
1846
- field: l
1847
- }) => /* @__PURE__ */ r(j, {
1848
- mb: n.spacing,
1849
- size: n.size,
3457
+ field: c
3458
+ }) => /* @__PURE__ */ a(fe, {
3459
+ mb: r.spacing,
3460
+ size: r.size,
1850
3461
  required: !0,
1851
3462
  label: "Name",
1852
- ...l
3463
+ ...c
1853
3464
  })
1854
- }), /* @__PURE__ */ r(E, {
3465
+ }), /* @__PURE__ */ a(J, {
1855
3466
  name: "role_id",
1856
- control: s,
3467
+ control: o,
1857
3468
  render: ({
1858
- field: l
1859
- }) => /* @__PURE__ */ r(ze, {
1860
- styles: n,
1861
- ...l
3469
+ field: c
3470
+ }) => /* @__PURE__ */ a(Ir, {
3471
+ styles: r,
3472
+ ...c
1862
3473
  })
1863
- }), /* @__PURE__ */ r(I, {
3474
+ }), /* @__PURE__ */ a(se, {
1864
3475
  position: "right",
1865
- mt: n.spacing,
1866
- children: /* @__PURE__ */ r(k, {
3476
+ mt: r.spacing,
3477
+ children: /* @__PURE__ */ a(oe, {
1867
3478
  type: "submit",
1868
- size: n.button.size,
3479
+ size: r.button.size,
1869
3480
  children: "Save"
1870
3481
  })
1871
3482
  })]
1872
3483
  })
1873
3484
  });
1874
3485
  }
1875
- function bt({
1876
- onSuccess: t,
1877
- styles: n = ge,
1878
- initialRoleID: o
3486
+ function Mo({
3487
+ onSuccess: e,
3488
+ styles: r = ar,
3489
+ initialRoleID: t
1879
3490
  }) {
1880
- const s = ue(), [u, i] = J.useState(!1), l = () => i(!0), d = () => i(!1);
1881
- return /* @__PURE__ */ S($, {
1882
- children: [/* @__PURE__ */ r(ce, {
3491
+ const o = tr(), [s, i] = De.useState(!1), c = () => i(!0), u = () => i(!1);
3492
+ return /* @__PURE__ */ I(Oe, {
3493
+ children: [/* @__PURE__ */ a(Ve, {
1883
3494
  overflow: "inside",
1884
- opened: u,
3495
+ opened: s,
1885
3496
  onClose: () => i(!1),
1886
3497
  title: "Add an API Key",
1887
3498
  trapFocus: !0,
1888
- onDragStart: (_) => {
1889
- _.stopPropagation();
3499
+ onDragStart: (v) => {
3500
+ v.stopPropagation();
1890
3501
  },
1891
- children: /* @__PURE__ */ r(vt, {
1892
- postSubmit: (_, w) => {
1893
- d(), s.openModal({
3502
+ children: /* @__PURE__ */ a(Ao, {
3503
+ postSubmit: (v, y) => {
3504
+ u(), o.openModal({
1894
3505
  title: "API Key is generated",
1895
- children: /* @__PURE__ */ S(nr, {
1896
- children: [/* @__PURE__ */ r(se, {
3506
+ children: /* @__PURE__ */ I(Pr, {
3507
+ children: [/* @__PURE__ */ a(Qe, {
1897
3508
  color: "dimmed",
1898
3509
  children: "Make sure you save it - you won't be able to access it again."
1899
- }), /* @__PURE__ */ r(j, {
1900
- defaultValue: _,
3510
+ }), /* @__PURE__ */ a(fe, {
3511
+ defaultValue: v,
1901
3512
  disabled: !0,
1902
3513
  label: "APP ID",
1903
3514
  styles: {
@@ -1905,8 +3516,8 @@ function bt({
1905
3516
  cursor: "text !important"
1906
3517
  }
1907
3518
  }
1908
- }), /* @__PURE__ */ r(j, {
1909
- defaultValue: w,
3519
+ }), /* @__PURE__ */ a(fe, {
3520
+ defaultValue: y,
1910
3521
  disabled: !0,
1911
3522
  label: "APP Secret",
1912
3523
  styles: {
@@ -1914,63 +3525,63 @@ function bt({
1914
3525
  cursor: "text !important"
1915
3526
  }
1916
3527
  }
1917
- }), /* @__PURE__ */ r(k, {
3528
+ }), /* @__PURE__ */ a(oe, {
1918
3529
  size: "sm",
1919
3530
  onClick: () => {
1920
- Jr();
3531
+ nn();
1921
3532
  },
1922
3533
  children: "I've saved this API Key"
1923
3534
  })]
1924
3535
  }),
1925
3536
  onClose: () => {
1926
- t();
3537
+ e();
1927
3538
  }
1928
3539
  });
1929
3540
  },
1930
- styles: n,
1931
- initialRoleID: o
3541
+ styles: r,
3542
+ initialRoleID: t
1932
3543
  })
1933
- }), /* @__PURE__ */ r(k, {
1934
- size: n.button.size,
1935
- onClick: l,
1936
- leftIcon: /* @__PURE__ */ r(Te, {
3544
+ }), /* @__PURE__ */ a(oe, {
3545
+ size: r.button.size,
3546
+ onClick: c,
3547
+ leftIcon: /* @__PURE__ */ a(Cr, {
1937
3548
  size: 20
1938
3549
  }),
1939
3550
  children: "Add an API Key"
1940
3551
  })]
1941
3552
  });
1942
3553
  }
1943
- function wt({
1944
- id: t,
1945
- name: n,
1946
- onSuccess: o,
1947
- styles: s = ge
3554
+ function Io({
3555
+ id: e,
3556
+ name: r,
3557
+ onSuccess: t,
3558
+ styles: o = ar
1948
3559
  }) {
1949
- const u = ue(), i = async () => {
1950
- if (!!t) {
1951
- U({
3560
+ const s = tr(), i = async () => {
3561
+ if (!!e) {
3562
+ _e({
1952
3563
  id: "for-deleting",
1953
3564
  title: "Pending",
1954
3565
  message: "Deleting API Key...",
1955
3566
  loading: !0
1956
3567
  });
1957
3568
  try {
1958
- await x.api_key.delete(t), z({
3569
+ await de.api_key.delete(e), le({
1959
3570
  id: "for-deleting",
1960
3571
  title: "Successful",
1961
- message: `API Key [${n}] is deleted`,
3572
+ message: `API Key [${r}] is deleted`,
1962
3573
  color: "green"
1963
- }), o();
1964
- } catch (d) {
1965
- z({
3574
+ }), t();
3575
+ } catch (u) {
3576
+ le({
1966
3577
  id: "for-deleting",
1967
3578
  title: "Failed",
1968
- message: d.message,
3579
+ message: u.message,
1969
3580
  color: "red"
1970
3581
  });
1971
3582
  }
1972
3583
  }
1973
- }, l = () => u.openConfirmModal({
3584
+ }, c = () => s.openConfirmModal({
1974
3585
  title: "Delete this api-key?",
1975
3586
  labels: {
1976
3587
  confirm: "Confirm",
@@ -1979,126 +3590,126 @@ function wt({
1979
3590
  onCancel: () => console.log("Cancel"),
1980
3591
  onConfirm: i
1981
3592
  });
1982
- return /* @__PURE__ */ r(k, {
1983
- size: s.button.size,
3593
+ return /* @__PURE__ */ a(oe, {
3594
+ size: o.button.size,
1984
3595
  color: "red",
1985
- onClick: l,
1986
- leftIcon: /* @__PURE__ */ r(Oe, {
3596
+ onClick: c,
3597
+ leftIcon: /* @__PURE__ */ a(jr, {
1987
3598
  size: 20
1988
3599
  }),
1989
3600
  children: "Delete"
1990
3601
  });
1991
3602
  }
1992
- function Dt({
1993
- styles: t = ge,
1994
- config: n
3603
+ function Ko({
3604
+ styles: e = ar,
3605
+ config: r
1995
3606
  }) {
1996
- var _, w;
1997
- de(n);
3607
+ var v, y;
3608
+ nr(r);
1998
3609
  const {
1999
- data: o = [],
2000
- loading: s,
2001
- refresh: u
2002
- } = G(async () => {
3610
+ data: t = [],
3611
+ loading: o,
3612
+ refresh: s
3613
+ } = ze(async () => {
2003
3614
  const {
2004
- data: m
2005
- } = await x.api_key.list();
2006
- return m;
3615
+ data: h
3616
+ } = await de.api_key.list();
3617
+ return h;
2007
3618
  }, {
2008
3619
  refreshDeps: []
2009
3620
  }), {
2010
3621
  data: i = [],
2011
- loading: l
2012
- } = G(async () => (await x.role.list()).map((f) => ({
2013
- label: f.name,
2014
- value: f.id,
2015
- description: f.description,
2016
- disabled: f.id === 50
3622
+ loading: c
3623
+ } = ze(async () => (await de.role.list()).map((m) => ({
3624
+ label: m.name,
3625
+ value: m.id,
3626
+ description: m.description,
3627
+ disabled: m.id === 50
2017
3628
  })), {
2018
3629
  refreshDeps: []
2019
- }), d = ir(() => i.reduce((m, f) => (m.set(f.value, f.label), m), /* @__PURE__ */ new Map()), [i]), g = (m) => {
2020
- var f;
2021
- return (f = d.get(m)) != null ? f : m;
3630
+ }), u = dt(() => i.reduce((h, m) => (h.set(m.value, m.label), h), /* @__PURE__ */ new Map()), [i]), d = (h) => {
3631
+ var m;
3632
+ return (m = u.get(h)) != null ? m : h;
2022
3633
  };
2023
- return /* @__PURE__ */ S($, {
2024
- children: [/* @__PURE__ */ r(I, {
2025
- pt: t.spacing,
3634
+ return /* @__PURE__ */ I(Oe, {
3635
+ children: [/* @__PURE__ */ a(se, {
3636
+ pt: e.spacing,
2026
3637
  position: "right",
2027
- children: /* @__PURE__ */ r(bt, {
2028
- onSuccess: u,
2029
- initialRoleID: (w = (_ = i == null ? void 0 : i[0]) == null ? void 0 : _.value) != null ? w : 0
3638
+ children: /* @__PURE__ */ a(Mo, {
3639
+ onSuccess: s,
3640
+ initialRoleID: (y = (v = i == null ? void 0 : i[0]) == null ? void 0 : v.value) != null ? y : 0
2030
3641
  })
2031
- }), /* @__PURE__ */ S(L, {
2032
- mt: t.spacing,
3642
+ }), /* @__PURE__ */ I(me, {
3643
+ mt: e.spacing,
2033
3644
  sx: {
2034
3645
  position: "relative"
2035
3646
  },
2036
- children: [/* @__PURE__ */ r(Ee, {
2037
- visible: s || l
2038
- }), /* @__PURE__ */ S(Ce, {
2039
- horizontalSpacing: t.spacing,
2040
- verticalSpacing: t.spacing,
2041
- fontSize: t.size,
3647
+ children: [/* @__PURE__ */ a(Rr, {
3648
+ visible: o || c
3649
+ }), /* @__PURE__ */ I(_r, {
3650
+ horizontalSpacing: e.spacing,
3651
+ verticalSpacing: e.spacing,
3652
+ fontSize: e.size,
2042
3653
  highlightOnHover: !0,
2043
- children: [/* @__PURE__ */ r("thead", {
2044
- children: /* @__PURE__ */ S("tr", {
2045
- children: [/* @__PURE__ */ r("th", {
3654
+ children: [/* @__PURE__ */ a("thead", {
3655
+ children: /* @__PURE__ */ I("tr", {
3656
+ children: [/* @__PURE__ */ a("th", {
2046
3657
  children: "Name"
2047
- }), /* @__PURE__ */ r("th", {
3658
+ }), /* @__PURE__ */ a("th", {
2048
3659
  children: "APP ID"
2049
- }), /* @__PURE__ */ r("th", {
3660
+ }), /* @__PURE__ */ a("th", {
2050
3661
  children: "Role"
2051
- }), /* @__PURE__ */ r("th", {
3662
+ }), /* @__PURE__ */ a("th", {
2052
3663
  children: "Action"
2053
3664
  })]
2054
3665
  })
2055
- }), /* @__PURE__ */ r("tbody", {
2056
- children: o.map((m) => {
3666
+ }), /* @__PURE__ */ a("tbody", {
3667
+ children: t.map((h) => {
2057
3668
  const {
2058
- id: f,
2059
- name: A,
2060
- app_id: M,
2061
- role_id: V
2062
- } = m;
2063
- return /* @__PURE__ */ S("tr", {
2064
- children: [/* @__PURE__ */ r("td", {
3669
+ id: m,
3670
+ name: x,
3671
+ app_id: Y,
3672
+ role_id: D
3673
+ } = h;
3674
+ return /* @__PURE__ */ I("tr", {
3675
+ children: [/* @__PURE__ */ a("td", {
2065
3676
  width: 200,
2066
- children: A
2067
- }), /* @__PURE__ */ r("td", {
3677
+ children: x
3678
+ }), /* @__PURE__ */ a("td", {
2068
3679
  width: 200,
2069
- children: M
2070
- }), /* @__PURE__ */ r("td", {
3680
+ children: Y
3681
+ }), /* @__PURE__ */ a("td", {
2071
3682
  width: 200,
2072
- children: g(V)
2073
- }), /* @__PURE__ */ r("td", {
3683
+ children: d(D)
3684
+ }), /* @__PURE__ */ a("td", {
2074
3685
  width: 200,
2075
- children: /* @__PURE__ */ r(I, {
3686
+ children: /* @__PURE__ */ a(se, {
2076
3687
  position: "left",
2077
- children: /* @__PURE__ */ r(wt, {
2078
- id: f,
2079
- name: A,
2080
- onSuccess: u
3688
+ children: /* @__PURE__ */ a(Io, {
3689
+ id: m,
3690
+ name: x,
3691
+ onSuccess: s
2081
3692
  })
2082
3693
  })
2083
3694
  })]
2084
- }, f);
3695
+ }, m);
2085
3696
  })
2086
3697
  })]
2087
3698
  })]
2088
3699
  })]
2089
3700
  });
2090
3701
  }
2091
- const jt = () => import("./package.c0c6ada2.mjs").then(({ version: t }) => (console.log(`[@devtable/dashboard] version: ${t}`), t));
3702
+ const Ho = () => import("./package.868e8e5e.mjs").then(({ version: e }) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
2092
3703
  export {
2093
- Dt as APIKeyList,
2094
- xt as AccountList,
2095
- bt as AddAPIKey,
2096
- ft as AddAccount,
2097
- it as AddDataSource,
2098
- At as DataSourceList,
2099
- wt as DeleteAPIKey,
2100
- pt as DeleteAccount,
2101
- lt as DeleteDataSource,
2102
- kt as Login,
2103
- jt as getVersion
3704
+ Ko as APIKeyList,
3705
+ Vo as AccountList,
3706
+ Mo as AddAPIKey,
3707
+ Ro as AddAccount,
3708
+ yo as AddDataSource,
3709
+ No as DataSourceList,
3710
+ Io as DeleteAPIKey,
3711
+ _o as DeleteAccount,
3712
+ To as DeleteDataSource,
3713
+ Bo as Login,
3714
+ Ho as getVersion
2104
3715
  };