@sigtes/ui 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/UserProvider-BzXtdnK7.cjs +22 -0
- package/dist/{locale-provider-CMJmJPPz.js → UserProvider-Cx4hp8vD.js} +436 -326
- package/dist/components/avatar/Avatar.d.ts +1 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components.cjs.js +295 -165
- package/dist/components.es.js +11627 -8609
- package/dist/globals.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.es.js +15 -123
- package/package.json +1 -1
- package/dist/locale-provider-muU_nRQs.cjs +0 -22
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
|
-
import
|
3
|
-
var
|
2
|
+
import be, { createContext as G, useState as F, useEffect as q, useContext as Z, useCallback as $ } from "react";
|
3
|
+
var x = { exports: {} }, R = {};
|
4
4
|
/**
|
5
5
|
* @license React
|
6
6
|
* react-jsx-runtime.production.js
|
@@ -10,29 +10,29 @@ var R = { exports: {} }, P = {};
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
12
12
|
*/
|
13
|
-
var
|
14
|
-
function
|
15
|
-
if (
|
16
|
-
|
13
|
+
var J;
|
14
|
+
function ge() {
|
15
|
+
if (J) return R;
|
16
|
+
J = 1;
|
17
17
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
18
|
-
function a(r,
|
19
|
-
var
|
20
|
-
if (
|
21
|
-
|
22
|
-
for (var l in
|
23
|
-
l !== "key" && (
|
24
|
-
} else
|
25
|
-
return
|
18
|
+
function a(r, o, s) {
|
19
|
+
var u = null;
|
20
|
+
if (s !== void 0 && (u = "" + s), o.key !== void 0 && (u = "" + o.key), "key" in o) {
|
21
|
+
s = {};
|
22
|
+
for (var l in o)
|
23
|
+
l !== "key" && (s[l] = o[l]);
|
24
|
+
} else s = o;
|
25
|
+
return o = s.ref, {
|
26
26
|
$$typeof: t,
|
27
27
|
type: r,
|
28
|
-
key:
|
29
|
-
ref:
|
30
|
-
props:
|
28
|
+
key: u,
|
29
|
+
ref: o !== void 0 ? o : null,
|
30
|
+
props: s
|
31
31
|
};
|
32
32
|
}
|
33
|
-
return
|
33
|
+
return R.Fragment = n, R.jsx = a, R.jsxs = a, R;
|
34
34
|
}
|
35
|
-
var
|
35
|
+
var j = {};
|
36
36
|
/**
|
37
37
|
* @license React
|
38
38
|
* react-jsx-runtime.development.js
|
@@ -42,47 +42,47 @@ var E = {};
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
44
44
|
*/
|
45
|
-
var
|
46
|
-
function
|
47
|
-
return
|
45
|
+
var H;
|
46
|
+
function ye() {
|
47
|
+
return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
|
48
48
|
function t(e) {
|
49
49
|
if (e == null) return null;
|
50
50
|
if (typeof e == "function")
|
51
|
-
return e.$$typeof ===
|
51
|
+
return e.$$typeof === me ? null : e.displayName || e.name || null;
|
52
52
|
if (typeof e == "string") return e;
|
53
53
|
switch (e) {
|
54
|
-
case
|
54
|
+
case w:
|
55
55
|
return "Fragment";
|
56
|
-
case
|
56
|
+
case re:
|
57
57
|
return "Profiler";
|
58
|
-
case
|
58
|
+
case ne:
|
59
59
|
return "StrictMode";
|
60
|
-
case
|
60
|
+
case ue:
|
61
61
|
return "Suspense";
|
62
|
-
case
|
62
|
+
case de:
|
63
63
|
return "SuspenseList";
|
64
|
-
case
|
64
|
+
case le:
|
65
65
|
return "Activity";
|
66
66
|
}
|
67
67
|
if (typeof e == "object")
|
68
68
|
switch (typeof e.tag == "number" && console.error(
|
69
69
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
70
70
|
), e.$$typeof) {
|
71
|
-
case
|
71
|
+
case p:
|
72
72
|
return "Portal";
|
73
|
-
case
|
73
|
+
case ie:
|
74
74
|
return (e.displayName || "Context") + ".Provider";
|
75
|
-
case
|
75
|
+
case oe:
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
77
|
-
case
|
78
|
-
var
|
79
|
-
return e = e.displayName, e || (e =
|
80
|
-
case
|
81
|
-
return
|
82
|
-
case
|
83
|
-
|
77
|
+
case se:
|
78
|
+
var i = e.render;
|
79
|
+
return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
80
|
+
case ce:
|
81
|
+
return i = e.displayName || null, i !== null ? i : t(e.type) || "Memo";
|
82
|
+
case L:
|
83
|
+
i = e._payload, e = e._init;
|
84
84
|
try {
|
85
|
-
return t(e(
|
85
|
+
return t(e(i));
|
86
86
|
} catch {
|
87
87
|
}
|
88
88
|
}
|
@@ -94,73 +94,73 @@ function le() {
|
|
94
94
|
function a(e) {
|
95
95
|
try {
|
96
96
|
n(e);
|
97
|
-
var
|
97
|
+
var i = !1;
|
98
98
|
} catch {
|
99
|
-
|
99
|
+
i = !0;
|
100
100
|
}
|
101
|
-
if (
|
102
|
-
|
103
|
-
var
|
104
|
-
return
|
105
|
-
|
101
|
+
if (i) {
|
102
|
+
i = console;
|
103
|
+
var d = i.error, m = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
104
|
+
return d.call(
|
105
|
+
i,
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
107
|
-
|
107
|
+
m
|
108
108
|
), n(e);
|
109
109
|
}
|
110
110
|
}
|
111
111
|
function r(e) {
|
112
|
-
if (e ===
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
112
|
+
if (e === w) return "<>";
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === L)
|
114
114
|
return "<...>";
|
115
115
|
try {
|
116
|
-
var
|
117
|
-
return
|
116
|
+
var i = t(e);
|
117
|
+
return i ? "<" + i + ">" : "<...>";
|
118
118
|
} catch {
|
119
119
|
return "<...>";
|
120
120
|
}
|
121
121
|
}
|
122
|
-
function
|
123
|
-
var e =
|
122
|
+
function o() {
|
123
|
+
var e = A.A;
|
124
124
|
return e === null ? null : e.getOwner();
|
125
125
|
}
|
126
|
-
function
|
126
|
+
function s() {
|
127
127
|
return Error("react-stack-top-frame");
|
128
128
|
}
|
129
|
-
function
|
130
|
-
if (
|
131
|
-
var
|
132
|
-
if (
|
129
|
+
function u(e) {
|
130
|
+
if (V.call(e, "key")) {
|
131
|
+
var i = Object.getOwnPropertyDescriptor(e, "key").get;
|
132
|
+
if (i && i.isReactWarning) return !1;
|
133
133
|
}
|
134
134
|
return e.key !== void 0;
|
135
135
|
}
|
136
|
-
function l(e,
|
137
|
-
function
|
138
|
-
|
136
|
+
function l(e, i) {
|
137
|
+
function d() {
|
138
|
+
Y || (Y = !0, console.error(
|
139
139
|
"%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://react.dev/link/special-props)",
|
140
|
-
|
140
|
+
i
|
141
141
|
));
|
142
142
|
}
|
143
|
-
|
144
|
-
get:
|
143
|
+
d.isReactWarning = !0, Object.defineProperty(e, "key", {
|
144
|
+
get: d,
|
145
145
|
configurable: !0
|
146
146
|
});
|
147
147
|
}
|
148
|
-
function
|
148
|
+
function h() {
|
149
149
|
var e = t(this.type);
|
150
|
-
return
|
150
|
+
return z[e] || (z[e] = !0, console.error(
|
151
151
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
152
152
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
153
153
|
}
|
154
|
-
function v(e,
|
155
|
-
return
|
156
|
-
$$typeof:
|
154
|
+
function v(e, i, d, m, k, b, O, D) {
|
155
|
+
return d = b.ref, e = {
|
156
|
+
$$typeof: c,
|
157
157
|
type: e,
|
158
|
-
key:
|
159
|
-
props:
|
160
|
-
_owner:
|
161
|
-
}, (
|
158
|
+
key: i,
|
159
|
+
props: b,
|
160
|
+
_owner: k
|
161
|
+
}, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
|
162
162
|
enumerable: !1,
|
163
|
-
get:
|
163
|
+
get: h
|
164
164
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
165
165
|
configurable: !1,
|
166
166
|
enumerable: !1,
|
@@ -175,112 +175,112 @@ function le() {
|
|
175
175
|
configurable: !1,
|
176
176
|
enumerable: !1,
|
177
177
|
writable: !0,
|
178
|
-
value:
|
178
|
+
value: O
|
179
179
|
}), Object.defineProperty(e, "_debugTask", {
|
180
180
|
configurable: !1,
|
181
181
|
enumerable: !1,
|
182
182
|
writable: !0,
|
183
|
-
value:
|
183
|
+
value: D
|
184
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
185
185
|
}
|
186
|
-
function
|
187
|
-
var
|
188
|
-
if (
|
189
|
-
if (
|
190
|
-
if (
|
191
|
-
for (
|
192
|
-
|
193
|
-
Object.freeze && Object.freeze(
|
186
|
+
function E(e, i, d, m, k, b, O, D) {
|
187
|
+
var f = i.children;
|
188
|
+
if (f !== void 0)
|
189
|
+
if (m)
|
190
|
+
if (fe(f)) {
|
191
|
+
for (m = 0; m < f.length; m++)
|
192
|
+
P(f[m]);
|
193
|
+
Object.freeze && Object.freeze(f);
|
194
194
|
} else
|
195
195
|
console.error(
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
197
197
|
);
|
198
|
-
else
|
199
|
-
if (
|
200
|
-
|
201
|
-
var
|
202
|
-
return
|
198
|
+
else P(f);
|
199
|
+
if (V.call(i, "key")) {
|
200
|
+
f = t(e);
|
201
|
+
var T = Object.keys(i).filter(function(he) {
|
202
|
+
return he !== "key";
|
203
203
|
});
|
204
|
-
|
204
|
+
m = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", X[f + m] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error(
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
206
206
|
let props = %s;
|
207
207
|
<%s {...props} />
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
209
209
|
let props = %s;
|
210
210
|
<%s key={someKey} {...props} />`,
|
211
|
-
c,
|
212
211
|
m,
|
213
|
-
|
214
|
-
|
215
|
-
|
212
|
+
f,
|
213
|
+
T,
|
214
|
+
f
|
215
|
+
), X[f + m] = !0);
|
216
216
|
}
|
217
|
-
if (
|
218
|
-
|
219
|
-
for (var
|
220
|
-
|
221
|
-
} else
|
222
|
-
return
|
223
|
-
|
217
|
+
if (f = null, d !== void 0 && (a(d), f = "" + d), u(i) && (a(i.key), f = "" + i.key), "key" in i) {
|
218
|
+
d = {};
|
219
|
+
for (var N in i)
|
220
|
+
N !== "key" && (d[N] = i[N]);
|
221
|
+
} else d = i;
|
222
|
+
return f && l(
|
223
|
+
d,
|
224
224
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
225
225
|
), v(
|
226
226
|
e,
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
227
|
+
f,
|
228
|
+
b,
|
229
|
+
k,
|
230
|
+
o(),
|
231
|
+
d,
|
232
|
+
O,
|
233
|
+
D
|
234
234
|
);
|
235
235
|
}
|
236
|
-
function
|
237
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
236
|
+
function P(e) {
|
237
|
+
typeof e == "object" && e !== null && e.$$typeof === c && e._store && (e._store.validated = 1);
|
238
238
|
}
|
239
|
-
var
|
239
|
+
var M = be, c = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), ne = Symbol.for("react.strict_mode"), re = Symbol.for("react.profiler"), oe = Symbol.for("react.consumer"), ie = Symbol.for("react.context"), se = Symbol.for("react.forward_ref"), ue = Symbol.for("react.suspense"), de = Symbol.for("react.suspense_list"), ce = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), me = Symbol.for("react.client.reference"), A = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, fe = Array.isArray, C = console.createTask ? console.createTask : function() {
|
240
240
|
return null;
|
241
241
|
};
|
242
|
-
|
242
|
+
M = {
|
243
243
|
react_stack_bottom_frame: function(e) {
|
244
244
|
return e();
|
245
245
|
}
|
246
246
|
};
|
247
|
-
var
|
248
|
-
|
249
|
-
|
250
|
-
)(),
|
251
|
-
|
252
|
-
var
|
253
|
-
return
|
247
|
+
var Y, z = {}, I = M.react_stack_bottom_frame.bind(
|
248
|
+
M,
|
249
|
+
s
|
250
|
+
)(), U = C(r(s)), X = {};
|
251
|
+
j.Fragment = w, j.jsx = function(e, i, d, m, k) {
|
252
|
+
var b = 1e4 > A.recentlyCreatedOwnerStacks++;
|
253
|
+
return E(
|
254
254
|
e,
|
255
|
-
|
256
|
-
|
255
|
+
i,
|
256
|
+
d,
|
257
257
|
!1,
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
258
|
+
m,
|
259
|
+
k,
|
260
|
+
b ? Error("react-stack-top-frame") : I,
|
261
|
+
b ? C(r(e)) : U
|
262
262
|
);
|
263
|
-
},
|
264
|
-
var
|
265
|
-
return
|
263
|
+
}, j.jsxs = function(e, i, d, m, k) {
|
264
|
+
var b = 1e4 > A.recentlyCreatedOwnerStacks++;
|
265
|
+
return E(
|
266
266
|
e,
|
267
|
-
|
268
|
-
|
267
|
+
i,
|
268
|
+
d,
|
269
269
|
!0,
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
270
|
+
m,
|
271
|
+
k,
|
272
|
+
b ? Error("react-stack-top-frame") : I,
|
273
|
+
b ? C(r(e)) : U
|
274
274
|
);
|
275
275
|
};
|
276
|
-
})()),
|
276
|
+
})()), j;
|
277
277
|
}
|
278
|
-
var
|
279
|
-
function
|
280
|
-
return
|
278
|
+
var Q;
|
279
|
+
function ve() {
|
280
|
+
return Q || (Q = 1, process.env.NODE_ENV === "production" ? x.exports = ge() : x.exports = ye()), x.exports;
|
281
281
|
}
|
282
|
-
var
|
283
|
-
const
|
282
|
+
var K = ve();
|
283
|
+
const pe = {
|
284
284
|
lessThanXSeconds: {
|
285
285
|
one: "less than a second",
|
286
286
|
other: "less than {{count}} seconds"
|
@@ -342,77 +342,77 @@ const be = {
|
|
342
342
|
one: "almost 1 year",
|
343
343
|
other: "almost {{count}} years"
|
344
344
|
}
|
345
|
-
},
|
345
|
+
}, we = (t, n, a) => {
|
346
346
|
let r;
|
347
|
-
const
|
348
|
-
return typeof
|
347
|
+
const o = pe[t];
|
348
|
+
return typeof o == "string" ? r = o : n === 1 ? r = o.one : r = o.other.replace("{{count}}", n.toString()), a?.addSuffix ? a.comparison && a.comparison > 0 ? "in " + r : r + " ago" : r;
|
349
349
|
};
|
350
|
-
function
|
350
|
+
function _(t) {
|
351
351
|
return (n = {}) => {
|
352
352
|
const a = n.width ? String(n.width) : t.defaultWidth;
|
353
353
|
return t.formats[a] || t.formats[t.defaultWidth];
|
354
354
|
};
|
355
355
|
}
|
356
|
-
const
|
356
|
+
const Pe = {
|
357
357
|
full: "EEEE, MMMM do, y",
|
358
358
|
long: "MMMM do, y",
|
359
359
|
medium: "MMM d, y",
|
360
360
|
short: "MM/dd/yyyy"
|
361
|
-
},
|
361
|
+
}, ke = {
|
362
362
|
full: "h:mm:ss a zzzz",
|
363
363
|
long: "h:mm:ss a z",
|
364
364
|
medium: "h:mm:ss a",
|
365
365
|
short: "h:mm a"
|
366
|
-
},
|
366
|
+
}, Ee = {
|
367
367
|
full: "{{date}} 'at' {{time}}",
|
368
368
|
long: "{{date}} 'at' {{time}}",
|
369
369
|
medium: "{{date}}, {{time}}",
|
370
370
|
short: "{{date}}, {{time}}"
|
371
|
-
},
|
372
|
-
date:
|
373
|
-
formats:
|
371
|
+
}, Me = {
|
372
|
+
date: _({
|
373
|
+
formats: Pe,
|
374
374
|
defaultWidth: "full"
|
375
375
|
}),
|
376
|
-
time:
|
377
|
-
formats:
|
376
|
+
time: _({
|
377
|
+
formats: ke,
|
378
378
|
defaultWidth: "full"
|
379
379
|
}),
|
380
|
-
dateTime:
|
381
|
-
formats:
|
380
|
+
dateTime: _({
|
381
|
+
formats: Ee,
|
382
382
|
defaultWidth: "full"
|
383
383
|
})
|
384
|
-
},
|
384
|
+
}, Te = {
|
385
385
|
lastWeek: "'last' eeee 'at' p",
|
386
386
|
yesterday: "'yesterday at' p",
|
387
387
|
today: "'today at' p",
|
388
388
|
tomorrow: "'tomorrow at' p",
|
389
389
|
nextWeek: "eeee 'at' p",
|
390
390
|
other: "P"
|
391
|
-
},
|
392
|
-
function
|
391
|
+
}, Se = (t, n, a, r) => Te[t];
|
392
|
+
function g(t) {
|
393
393
|
return (n, a) => {
|
394
394
|
const r = a?.context ? String(a.context) : "standalone";
|
395
|
-
let
|
395
|
+
let o;
|
396
396
|
if (r === "formatting" && t.formattingValues) {
|
397
|
-
const
|
398
|
-
|
397
|
+
const u = t.defaultFormattingWidth || t.defaultWidth, l = a?.width ? String(a.width) : u;
|
398
|
+
o = t.formattingValues[l] || t.formattingValues[u];
|
399
399
|
} else {
|
400
|
-
const
|
401
|
-
|
400
|
+
const u = t.defaultWidth, l = a?.width ? String(a.width) : t.defaultWidth;
|
401
|
+
o = t.values[l] || t.values[u];
|
402
402
|
}
|
403
|
-
const
|
404
|
-
return
|
403
|
+
const s = t.argumentCallback ? t.argumentCallback(n) : n;
|
404
|
+
return o[s];
|
405
405
|
};
|
406
406
|
}
|
407
|
-
const
|
407
|
+
const _e = {
|
408
408
|
narrow: ["B", "A"],
|
409
409
|
abbreviated: ["BC", "AD"],
|
410
410
|
wide: ["Before Christ", "Anno Domini"]
|
411
|
-
},
|
411
|
+
}, Re = {
|
412
412
|
narrow: ["1", "2", "3", "4"],
|
413
413
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
414
414
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
415
|
-
},
|
415
|
+
}, je = {
|
416
416
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
417
417
|
abbreviated: [
|
418
418
|
"Jan",
|
@@ -442,7 +442,7 @@ const ke = {
|
|
442
442
|
"November",
|
443
443
|
"December"
|
444
444
|
]
|
445
|
-
},
|
445
|
+
}, xe = {
|
446
446
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
447
447
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
448
448
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
@@ -455,7 +455,7 @@ const ke = {
|
|
455
455
|
"Friday",
|
456
456
|
"Saturday"
|
457
457
|
]
|
458
|
-
},
|
458
|
+
}, We = {
|
459
459
|
narrow: {
|
460
460
|
am: "a",
|
461
461
|
pm: "p",
|
@@ -486,7 +486,7 @@ const ke = {
|
|
486
486
|
evening: "evening",
|
487
487
|
night: "night"
|
488
488
|
}
|
489
|
-
},
|
489
|
+
}, Ae = {
|
490
490
|
narrow: {
|
491
491
|
am: "a",
|
492
492
|
pm: "p",
|
@@ -517,7 +517,7 @@ const ke = {
|
|
517
517
|
evening: "in the evening",
|
518
518
|
night: "at night"
|
519
519
|
}
|
520
|
-
},
|
520
|
+
}, Ce = (t, n) => {
|
521
521
|
const a = Number(t), r = a % 100;
|
522
522
|
if (r > 20 || r < 10)
|
523
523
|
switch (r % 10) {
|
@@ -529,89 +529,89 @@ const ke = {
|
|
529
529
|
return a + "rd";
|
530
530
|
}
|
531
531
|
return a + "th";
|
532
|
-
},
|
533
|
-
ordinalNumber:
|
534
|
-
era:
|
535
|
-
values:
|
532
|
+
}, Oe = {
|
533
|
+
ordinalNumber: Ce,
|
534
|
+
era: g({
|
535
|
+
values: _e,
|
536
536
|
defaultWidth: "wide"
|
537
537
|
}),
|
538
|
-
quarter:
|
539
|
-
values:
|
538
|
+
quarter: g({
|
539
|
+
values: Re,
|
540
540
|
defaultWidth: "wide",
|
541
541
|
argumentCallback: (t) => t - 1
|
542
542
|
}),
|
543
|
-
month:
|
544
|
-
values:
|
543
|
+
month: g({
|
544
|
+
values: je,
|
545
545
|
defaultWidth: "wide"
|
546
546
|
}),
|
547
|
-
day:
|
548
|
-
values:
|
547
|
+
day: g({
|
548
|
+
values: xe,
|
549
549
|
defaultWidth: "wide"
|
550
550
|
}),
|
551
|
-
dayPeriod:
|
552
|
-
values:
|
551
|
+
dayPeriod: g({
|
552
|
+
values: We,
|
553
553
|
defaultWidth: "wide",
|
554
|
-
formattingValues:
|
554
|
+
formattingValues: Ae,
|
555
555
|
defaultFormattingWidth: "wide"
|
556
556
|
})
|
557
557
|
};
|
558
|
-
function
|
558
|
+
function y(t) {
|
559
559
|
return (n, a = {}) => {
|
560
|
-
const r = a.width,
|
561
|
-
if (!
|
560
|
+
const r = a.width, o = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = n.match(o);
|
561
|
+
if (!s)
|
562
562
|
return null;
|
563
|
-
const
|
563
|
+
const u = s[0], l = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(l) ? Ne(l, (P) => P.test(u)) : (
|
564
564
|
// [TODO] -- I challenge you to fix the type
|
565
|
-
|
565
|
+
De(l, (P) => P.test(u))
|
566
566
|
);
|
567
567
|
let v;
|
568
|
-
v = t.valueCallback ? t.valueCallback(
|
568
|
+
v = t.valueCallback ? t.valueCallback(h) : h, v = a.valueCallback ? (
|
569
569
|
// [TODO] -- I challenge you to fix the type
|
570
570
|
a.valueCallback(v)
|
571
571
|
) : v;
|
572
|
-
const
|
573
|
-
return { value: v, rest:
|
572
|
+
const E = n.slice(u.length);
|
573
|
+
return { value: v, rest: E };
|
574
574
|
};
|
575
575
|
}
|
576
|
-
function
|
576
|
+
function De(t, n) {
|
577
577
|
for (const a in t)
|
578
578
|
if (Object.prototype.hasOwnProperty.call(t, a) && n(t[a]))
|
579
579
|
return a;
|
580
580
|
}
|
581
|
-
function
|
581
|
+
function Ne(t, n) {
|
582
582
|
for (let a = 0; a < t.length; a++)
|
583
583
|
if (n(t[a]))
|
584
584
|
return a;
|
585
585
|
}
|
586
|
-
function
|
586
|
+
function ee(t) {
|
587
587
|
return (n, a = {}) => {
|
588
588
|
const r = n.match(t.matchPattern);
|
589
589
|
if (!r) return null;
|
590
|
-
const
|
591
|
-
if (!
|
592
|
-
let
|
593
|
-
|
594
|
-
const l = n.slice(
|
595
|
-
return { value:
|
590
|
+
const o = r[0], s = n.match(t.parsePattern);
|
591
|
+
if (!s) return null;
|
592
|
+
let u = t.valueCallback ? t.valueCallback(s[0]) : s[0];
|
593
|
+
u = a.valueCallback ? a.valueCallback(u) : u;
|
594
|
+
const l = n.slice(o.length);
|
595
|
+
return { value: u, rest: l };
|
596
596
|
};
|
597
597
|
}
|
598
|
-
const
|
598
|
+
const $e = /^(\d+)(th|st|nd|rd)?/i, Fe = /\d+/i, qe = {
|
599
599
|
narrow: /^(b|a)/i,
|
600
600
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
601
601
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
602
|
-
},
|
602
|
+
}, Le = {
|
603
603
|
any: [/^b/i, /^(a|c)/i]
|
604
|
-
},
|
604
|
+
}, Ve = {
|
605
605
|
narrow: /^[1234]/i,
|
606
606
|
abbreviated: /^q[1234]/i,
|
607
607
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
608
|
-
},
|
608
|
+
}, Ye = {
|
609
609
|
any: [/1/i, /2/i, /3/i, /4/i]
|
610
|
-
},
|
610
|
+
}, ze = {
|
611
611
|
narrow: /^[jfmasond]/i,
|
612
612
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
613
613
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
614
|
-
},
|
614
|
+
}, Ie = {
|
615
615
|
narrow: [
|
616
616
|
/^j/i,
|
617
617
|
/^f/i,
|
@@ -640,18 +640,18 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
640
640
|
/^n/i,
|
641
641
|
/^d/i
|
642
642
|
]
|
643
|
-
},
|
643
|
+
}, Ue = {
|
644
644
|
narrow: /^[smtwf]/i,
|
645
645
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
646
646
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
647
647
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
648
|
-
},
|
648
|
+
}, Xe = {
|
649
649
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
650
650
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
651
|
-
},
|
651
|
+
}, Je = {
|
652
652
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
653
653
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
654
|
-
},
|
654
|
+
}, He = {
|
655
655
|
any: {
|
656
656
|
am: /^a/i,
|
657
657
|
pm: /^p/i,
|
@@ -662,55 +662,55 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
662
662
|
evening: /evening/i,
|
663
663
|
night: /night/i
|
664
664
|
}
|
665
|
-
},
|
666
|
-
ordinalNumber:
|
667
|
-
matchPattern:
|
668
|
-
parsePattern:
|
665
|
+
}, Qe = {
|
666
|
+
ordinalNumber: ee({
|
667
|
+
matchPattern: $e,
|
668
|
+
parsePattern: Fe,
|
669
669
|
valueCallback: (t) => parseInt(t, 10)
|
670
670
|
}),
|
671
|
-
era:
|
672
|
-
matchPatterns:
|
671
|
+
era: y({
|
672
|
+
matchPatterns: qe,
|
673
673
|
defaultMatchWidth: "wide",
|
674
|
-
parsePatterns:
|
674
|
+
parsePatterns: Le,
|
675
675
|
defaultParseWidth: "any"
|
676
676
|
}),
|
677
|
-
quarter:
|
678
|
-
matchPatterns:
|
677
|
+
quarter: y({
|
678
|
+
matchPatterns: Ve,
|
679
679
|
defaultMatchWidth: "wide",
|
680
|
-
parsePatterns:
|
680
|
+
parsePatterns: Ye,
|
681
681
|
defaultParseWidth: "any",
|
682
682
|
valueCallback: (t) => t + 1
|
683
683
|
}),
|
684
|
-
month:
|
685
|
-
matchPatterns:
|
684
|
+
month: y({
|
685
|
+
matchPatterns: ze,
|
686
686
|
defaultMatchWidth: "wide",
|
687
|
-
parsePatterns:
|
687
|
+
parsePatterns: Ie,
|
688
688
|
defaultParseWidth: "any"
|
689
689
|
}),
|
690
|
-
day:
|
691
|
-
matchPatterns:
|
690
|
+
day: y({
|
691
|
+
matchPatterns: Ue,
|
692
692
|
defaultMatchWidth: "wide",
|
693
|
-
parsePatterns:
|
693
|
+
parsePatterns: Xe,
|
694
694
|
defaultParseWidth: "any"
|
695
695
|
}),
|
696
|
-
dayPeriod:
|
697
|
-
matchPatterns:
|
696
|
+
dayPeriod: y({
|
697
|
+
matchPatterns: Je,
|
698
698
|
defaultMatchWidth: "any",
|
699
|
-
parsePatterns:
|
699
|
+
parsePatterns: He,
|
700
700
|
defaultParseWidth: "any"
|
701
701
|
})
|
702
|
-
},
|
702
|
+
}, Be = {
|
703
703
|
code: "en-US",
|
704
|
-
formatDistance:
|
705
|
-
formatLong:
|
706
|
-
formatRelative:
|
707
|
-
localize:
|
708
|
-
match:
|
704
|
+
formatDistance: we,
|
705
|
+
formatLong: Me,
|
706
|
+
formatRelative: Se,
|
707
|
+
localize: Oe,
|
708
|
+
match: Qe,
|
709
709
|
options: {
|
710
710
|
weekStartsOn: 0,
|
711
711
|
firstWeekContainsDate: 1
|
712
712
|
}
|
713
|
-
},
|
713
|
+
}, Ge = {
|
714
714
|
lessThanXSeconds: {
|
715
715
|
one: "menos de um segundo",
|
716
716
|
other: "menos de {{count}} segundos"
|
@@ -772,39 +772,39 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
772
772
|
one: "quase 1 ano",
|
773
773
|
other: "quase {{count}} anos"
|
774
774
|
}
|
775
|
-
},
|
775
|
+
}, Ze = (t, n, a) => {
|
776
776
|
let r;
|
777
|
-
const
|
778
|
-
return typeof
|
779
|
-
},
|
777
|
+
const o = Ge[t];
|
778
|
+
return typeof o == "string" ? r = o : n === 1 ? r = o.one : r = o.other.replace("{{count}}", String(n)), a?.addSuffix ? a.comparison && a.comparison > 0 ? "em " + r : "há " + r : r;
|
779
|
+
}, Ke = {
|
780
780
|
full: "EEEE, d 'de' MMMM 'de' y",
|
781
781
|
long: "d 'de' MMMM 'de' y",
|
782
782
|
medium: "d MMM y",
|
783
783
|
short: "dd/MM/yyyy"
|
784
|
-
},
|
784
|
+
}, et = {
|
785
785
|
full: "HH:mm:ss zzzz",
|
786
786
|
long: "HH:mm:ss z",
|
787
787
|
medium: "HH:mm:ss",
|
788
788
|
short: "HH:mm"
|
789
|
-
},
|
789
|
+
}, tt = {
|
790
790
|
full: "{{date}} 'às' {{time}}",
|
791
791
|
long: "{{date}} 'às' {{time}}",
|
792
792
|
medium: "{{date}}, {{time}}",
|
793
793
|
short: "{{date}}, {{time}}"
|
794
|
-
},
|
795
|
-
date:
|
796
|
-
formats:
|
794
|
+
}, at = {
|
795
|
+
date: _({
|
796
|
+
formats: Ke,
|
797
797
|
defaultWidth: "full"
|
798
798
|
}),
|
799
|
-
time:
|
800
|
-
formats:
|
799
|
+
time: _({
|
800
|
+
formats: et,
|
801
801
|
defaultWidth: "full"
|
802
802
|
}),
|
803
|
-
dateTime:
|
804
|
-
formats:
|
803
|
+
dateTime: _({
|
804
|
+
formats: tt,
|
805
805
|
defaultWidth: "full"
|
806
806
|
})
|
807
|
-
},
|
807
|
+
}, nt = {
|
808
808
|
lastWeek: (t) => {
|
809
809
|
const n = t.getDay();
|
810
810
|
return "'" + (n === 0 || n === 6 ? "último" : "última") + "' eeee 'às' p";
|
@@ -814,18 +814,18 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
814
814
|
tomorrow: "'amanhã às' p",
|
815
815
|
nextWeek: "eeee 'às' p",
|
816
816
|
other: "P"
|
817
|
-
},
|
818
|
-
const
|
819
|
-
return typeof
|
820
|
-
},
|
817
|
+
}, rt = (t, n, a, r) => {
|
818
|
+
const o = nt[t];
|
819
|
+
return typeof o == "function" ? o(n) : o;
|
820
|
+
}, ot = {
|
821
821
|
narrow: ["AC", "DC"],
|
822
822
|
abbreviated: ["AC", "DC"],
|
823
823
|
wide: ["antes de cristo", "depois de cristo"]
|
824
|
-
},
|
824
|
+
}, it = {
|
825
825
|
narrow: ["1", "2", "3", "4"],
|
826
826
|
abbreviated: ["T1", "T2", "T3", "T4"],
|
827
827
|
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
828
|
-
},
|
828
|
+
}, st = {
|
829
829
|
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
830
830
|
abbreviated: [
|
831
831
|
"jan",
|
@@ -855,7 +855,7 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
855
855
|
"novembro",
|
856
856
|
"dezembro"
|
857
857
|
]
|
858
|
-
},
|
858
|
+
}, ut = {
|
859
859
|
narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
|
860
860
|
short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
|
861
861
|
abbreviated: [
|
@@ -876,7 +876,7 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
876
876
|
"sexta-feira",
|
877
877
|
"sábado"
|
878
878
|
]
|
879
|
-
},
|
879
|
+
}, dt = {
|
880
880
|
narrow: {
|
881
881
|
am: "a",
|
882
882
|
pm: "p",
|
@@ -907,7 +907,7 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
907
907
|
evening: "tarde",
|
908
908
|
night: "noite"
|
909
909
|
}
|
910
|
-
},
|
910
|
+
}, ct = {
|
911
911
|
narrow: {
|
912
912
|
am: "a",
|
913
913
|
pm: "p",
|
@@ -938,52 +938,52 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
938
938
|
evening: "da tarde",
|
939
939
|
night: "da noite"
|
940
940
|
}
|
941
|
-
},
|
941
|
+
}, lt = (t, n) => {
|
942
942
|
const a = Number(t);
|
943
943
|
return n?.unit === "week" ? a + "ª" : a + "º";
|
944
|
-
},
|
945
|
-
ordinalNumber:
|
946
|
-
era:
|
947
|
-
values:
|
944
|
+
}, mt = {
|
945
|
+
ordinalNumber: lt,
|
946
|
+
era: g({
|
947
|
+
values: ot,
|
948
948
|
defaultWidth: "wide"
|
949
949
|
}),
|
950
|
-
quarter:
|
951
|
-
values:
|
950
|
+
quarter: g({
|
951
|
+
values: it,
|
952
952
|
defaultWidth: "wide",
|
953
953
|
argumentCallback: (t) => t - 1
|
954
954
|
}),
|
955
|
-
month:
|
956
|
-
values:
|
955
|
+
month: g({
|
956
|
+
values: st,
|
957
957
|
defaultWidth: "wide"
|
958
958
|
}),
|
959
|
-
day:
|
960
|
-
values:
|
959
|
+
day: g({
|
960
|
+
values: ut,
|
961
961
|
defaultWidth: "wide"
|
962
962
|
}),
|
963
|
-
dayPeriod:
|
964
|
-
values:
|
963
|
+
dayPeriod: g({
|
964
|
+
values: dt,
|
965
965
|
defaultWidth: "wide",
|
966
|
-
formattingValues:
|
966
|
+
formattingValues: ct,
|
967
967
|
defaultFormattingWidth: "wide"
|
968
968
|
})
|
969
|
-
},
|
969
|
+
}, ft = /^(\d+)[ºªo]?/i, ht = /\d+/i, bt = {
|
970
970
|
narrow: /^(ac|dc|a|d)/i,
|
971
971
|
abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
|
972
972
|
wide: /^(antes de cristo|depois de cristo)/i
|
973
|
-
},
|
973
|
+
}, gt = {
|
974
974
|
any: [/^ac/i, /^dc/i],
|
975
975
|
wide: [/^antes de cristo/i, /^depois de cristo/i]
|
976
|
-
},
|
976
|
+
}, yt = {
|
977
977
|
narrow: /^[1234]/i,
|
978
978
|
abbreviated: /^T[1234]/i,
|
979
979
|
wide: /^[1234](º)? trimestre/i
|
980
|
-
},
|
980
|
+
}, vt = {
|
981
981
|
any: [/1/i, /2/i, /3/i, /4/i]
|
982
|
-
},
|
982
|
+
}, pt = {
|
983
983
|
narrow: /^[jfmajsond]/i,
|
984
984
|
abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
|
985
985
|
wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
|
986
|
-
},
|
986
|
+
}, wt = {
|
987
987
|
narrow: [
|
988
988
|
/^j/i,
|
989
989
|
/^f/i,
|
@@ -1012,19 +1012,19 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
1012
1012
|
/^nov/i,
|
1013
1013
|
/^dez/i
|
1014
1014
|
]
|
1015
|
-
},
|
1015
|
+
}, Pt = {
|
1016
1016
|
narrow: /^(dom|[23456]ª?|s[aá]b)/i,
|
1017
1017
|
short: /^(dom|[23456]ª?|s[aá]b)/i,
|
1018
1018
|
abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
|
1019
1019
|
wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
|
1020
|
-
},
|
1020
|
+
}, kt = {
|
1021
1021
|
short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
1022
1022
|
narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
1023
1023
|
any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
|
1024
|
-
},
|
1024
|
+
}, Et = {
|
1025
1025
|
narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
|
1026
1026
|
any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
|
1027
|
-
},
|
1027
|
+
}, Mt = {
|
1028
1028
|
any: {
|
1029
1029
|
am: /^a/i,
|
1030
1030
|
pm: /^p/i,
|
@@ -1035,77 +1035,187 @@ const Oe = /^(\d+)(th|st|nd|rd)?/i, Ce = /\d+/i, De = {
|
|
1035
1035
|
evening: /tarde/i,
|
1036
1036
|
night: /noite/i
|
1037
1037
|
}
|
1038
|
-
},
|
1039
|
-
ordinalNumber:
|
1040
|
-
matchPattern:
|
1041
|
-
parsePattern:
|
1038
|
+
}, Tt = {
|
1039
|
+
ordinalNumber: ee({
|
1040
|
+
matchPattern: ft,
|
1041
|
+
parsePattern: ht,
|
1042
1042
|
valueCallback: (t) => parseInt(t, 10)
|
1043
1043
|
}),
|
1044
|
-
era:
|
1045
|
-
matchPatterns:
|
1044
|
+
era: y({
|
1045
|
+
matchPatterns: bt,
|
1046
1046
|
defaultMatchWidth: "wide",
|
1047
|
-
parsePatterns:
|
1047
|
+
parsePatterns: gt,
|
1048
1048
|
defaultParseWidth: "any"
|
1049
1049
|
}),
|
1050
|
-
quarter:
|
1051
|
-
matchPatterns:
|
1050
|
+
quarter: y({
|
1051
|
+
matchPatterns: yt,
|
1052
1052
|
defaultMatchWidth: "wide",
|
1053
|
-
parsePatterns:
|
1053
|
+
parsePatterns: vt,
|
1054
1054
|
defaultParseWidth: "any",
|
1055
1055
|
valueCallback: (t) => t + 1
|
1056
1056
|
}),
|
1057
|
-
month:
|
1058
|
-
matchPatterns:
|
1057
|
+
month: y({
|
1058
|
+
matchPatterns: pt,
|
1059
1059
|
defaultMatchWidth: "wide",
|
1060
|
-
parsePatterns:
|
1060
|
+
parsePatterns: wt,
|
1061
1061
|
defaultParseWidth: "any"
|
1062
1062
|
}),
|
1063
|
-
day:
|
1064
|
-
matchPatterns:
|
1063
|
+
day: y({
|
1064
|
+
matchPatterns: Pt,
|
1065
1065
|
defaultMatchWidth: "wide",
|
1066
|
-
parsePatterns:
|
1066
|
+
parsePatterns: kt,
|
1067
1067
|
defaultParseWidth: "any"
|
1068
1068
|
}),
|
1069
|
-
dayPeriod:
|
1070
|
-
matchPatterns:
|
1069
|
+
dayPeriod: y({
|
1070
|
+
matchPatterns: Et,
|
1071
1071
|
defaultMatchWidth: "any",
|
1072
|
-
parsePatterns:
|
1072
|
+
parsePatterns: Mt,
|
1073
1073
|
defaultParseWidth: "any"
|
1074
1074
|
})
|
1075
|
-
},
|
1075
|
+
}, St = {
|
1076
1076
|
code: "pt-BR",
|
1077
|
-
formatDistance:
|
1078
|
-
formatLong:
|
1079
|
-
formatRelative:
|
1080
|
-
localize:
|
1081
|
-
match:
|
1077
|
+
formatDistance: Ze,
|
1078
|
+
formatLong: at,
|
1079
|
+
formatRelative: rt,
|
1080
|
+
localize: mt,
|
1081
|
+
match: Tt,
|
1082
1082
|
options: {
|
1083
1083
|
weekStartsOn: 0,
|
1084
1084
|
firstWeekContainsDate: 1
|
1085
1085
|
}
|
1086
|
-
},
|
1087
|
-
ptBR:
|
1088
|
-
enUS:
|
1089
|
-
},
|
1086
|
+
}, B = {
|
1087
|
+
ptBR: St,
|
1088
|
+
enUS: Be
|
1089
|
+
}, te = G({
|
1090
1090
|
locale: void 0
|
1091
1091
|
});
|
1092
|
-
function
|
1093
|
-
return
|
1092
|
+
function Rt() {
|
1093
|
+
return Z(te);
|
1094
1094
|
}
|
1095
|
-
function
|
1095
|
+
function jt({
|
1096
1096
|
locale: t,
|
1097
1097
|
children: n
|
1098
1098
|
}) {
|
1099
|
-
const [a, r] =
|
1100
|
-
|
1101
|
-
r(
|
1099
|
+
const [a, r] = F(B[t]);
|
1100
|
+
q(() => {
|
1101
|
+
r(B[t]);
|
1102
1102
|
}, [t]);
|
1103
|
-
const
|
1104
|
-
return /* @__PURE__ */
|
1103
|
+
const o = { locale: a };
|
1104
|
+
return /* @__PURE__ */ K.jsx(te.Provider, { value: o, children: n });
|
1105
|
+
}
|
1106
|
+
const S = {
|
1107
|
+
id: "",
|
1108
|
+
username: "",
|
1109
|
+
email: "",
|
1110
|
+
created_at: null,
|
1111
|
+
updated_at: null,
|
1112
|
+
features: []
|
1113
|
+
}, W = {
|
1114
|
+
id: "123456",
|
1115
|
+
username: "admin",
|
1116
|
+
email: "admin@admin.com",
|
1117
|
+
created_at: /* @__PURE__ */ new Date(),
|
1118
|
+
updated_at: /* @__PURE__ */ new Date(),
|
1119
|
+
features: ["features"]
|
1120
|
+
}, ae = G({
|
1121
|
+
user: S,
|
1122
|
+
isLoading: !0,
|
1123
|
+
fetchUser: async () => {
|
1124
|
+
},
|
1125
|
+
logout: async () => {
|
1126
|
+
},
|
1127
|
+
login: async () => !1
|
1128
|
+
});
|
1129
|
+
function xt({
|
1130
|
+
children: t,
|
1131
|
+
sessionEndPoint: n,
|
1132
|
+
userEndPoint: a,
|
1133
|
+
useMock: r = !1
|
1134
|
+
}) {
|
1135
|
+
const [o, s] = F(S), [u, l] = F(!0), h = $(async () => {
|
1136
|
+
try {
|
1137
|
+
const c = await fetch(a), p = await c.json();
|
1138
|
+
if (c.status == 200) {
|
1139
|
+
const w = p;
|
1140
|
+
s(w), localStorage.setItem("user", JSON.stringify(w));
|
1141
|
+
} else
|
1142
|
+
s(S), localStorage.removeItem("user");
|
1143
|
+
} catch (c) {
|
1144
|
+
console.log(c);
|
1145
|
+
}
|
1146
|
+
}, [a]);
|
1147
|
+
q(() => {
|
1148
|
+
const c = localStorage.getItem("user");
|
1149
|
+
(async () => (c && u && await h(), l(!1)))();
|
1150
|
+
}, [h, u]);
|
1151
|
+
const v = $(async () => {
|
1152
|
+
try {
|
1153
|
+
if ((await fetch(n, {
|
1154
|
+
method: "DELETE",
|
1155
|
+
credentials: "include"
|
1156
|
+
})).status == 200) {
|
1157
|
+
const p = localStorage.getItem("theme") || "system";
|
1158
|
+
localStorage.clear(), localStorage.setItem("theme", p), s(S), l(!1);
|
1159
|
+
}
|
1160
|
+
} catch (c) {
|
1161
|
+
console.log(c);
|
1162
|
+
}
|
1163
|
+
}, [n]), E = $(
|
1164
|
+
async (c, p) => {
|
1165
|
+
try {
|
1166
|
+
return (await fetch(n, {
|
1167
|
+
method: "POST",
|
1168
|
+
headers: {
|
1169
|
+
"Content-Type": "application/json"
|
1170
|
+
},
|
1171
|
+
body: JSON.stringify({
|
1172
|
+
email: c,
|
1173
|
+
password: p
|
1174
|
+
})
|
1175
|
+
})).status === 201 ? (h(), !0) : !1;
|
1176
|
+
} catch (w) {
|
1177
|
+
return console.log(w), !1;
|
1178
|
+
}
|
1179
|
+
},
|
1180
|
+
[h, n]
|
1181
|
+
);
|
1182
|
+
q(() => {
|
1183
|
+
const c = localStorage.getItem("user");
|
1184
|
+
c && s(JSON.parse(c));
|
1185
|
+
}, [h]);
|
1186
|
+
const P = {
|
1187
|
+
user: o,
|
1188
|
+
isLoading: u,
|
1189
|
+
fetchUser: h,
|
1190
|
+
logout: v,
|
1191
|
+
login: E
|
1192
|
+
}, M = {
|
1193
|
+
user: o,
|
1194
|
+
isLoading: u,
|
1195
|
+
fetchUser: async () => {
|
1196
|
+
s(W), console.log(W);
|
1197
|
+
},
|
1198
|
+
logout: async () => {
|
1199
|
+
s(S), console.log(S);
|
1200
|
+
},
|
1201
|
+
login: async (c, p) => (console.log(c, p), s(W), console.log(W), !0)
|
1202
|
+
};
|
1203
|
+
return /* @__PURE__ */ K.jsx(
|
1204
|
+
ae.Provider,
|
1205
|
+
{
|
1206
|
+
value: r ? M : P,
|
1207
|
+
children: t
|
1208
|
+
}
|
1209
|
+
);
|
1210
|
+
}
|
1211
|
+
function Wt() {
|
1212
|
+
return Z(ae);
|
1105
1213
|
}
|
1106
1214
|
export {
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1215
|
+
jt as L,
|
1216
|
+
xt as U,
|
1217
|
+
Wt as a,
|
1218
|
+
Be as e,
|
1219
|
+
K as j,
|
1220
|
+
Rt as u
|
1111
1221
|
};
|