@e7w/easy-model 0.1.4 → 0.1.6
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/README.md +511 -20
- package/dist/index.d.ts +76 -0
- package/dist/index.es.js +522 -112
- package/dist/index.umd.js +22 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1,157 +1,567 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var Pe = (e, r, n) => r in e ? Te(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n;
|
|
3
|
+
var g = (e, r, n) => Pe(e, typeof r != "symbol" ? r + "" : r, n);
|
|
4
|
+
import Oe, { useReducer as Se, useEffect as je, createContext as xe, useContext as ae } from "react";
|
|
5
|
+
const G = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), ce = Symbol("origin");
|
|
6
|
+
let v = null;
|
|
7
|
+
const U = ["includes", "indexOf", "lastIndexOf"], Ae = [Promise, RegExp, Date, WeakMap, WeakSet, Map, Set];
|
|
8
|
+
function C(e) {
|
|
9
|
+
if (e = _(e), !e || Ae.some((i) => e instanceof i)) return e;
|
|
10
|
+
if (G.has(e)) return G.get(e);
|
|
11
|
+
const r = {}, n = {}, a = new Proxy(e, {
|
|
12
|
+
get(i, o, c) {
|
|
13
|
+
if (o === ce) return i;
|
|
14
|
+
let s = ue(i, o);
|
|
15
|
+
return s || (s = Reflect.get(i, o, c), typeof s == "function" ? (n[o] || (n[o] = s.bind(C(i))), s = n[o]) : typeof s == "object" && s !== null && (r[o] || (r[o] = q(s, re(e, o))), s = C(s)), s);
|
|
13
16
|
},
|
|
14
|
-
set(i,
|
|
15
|
-
let
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
17
|
+
set(i, o, c, s) {
|
|
18
|
+
let f = Reflect.get(i, o, s);
|
|
19
|
+
if (f = _(f), c = _(c), f === c) return !0;
|
|
20
|
+
const l = Reflect.set(i, o, c, s);
|
|
21
|
+
if (l) {
|
|
22
|
+
r[o] && (r[o](), delete r[o]), typeof c == "object" && c !== null && (r[o] = q(c, re(e, o))), n[o] && delete n[o];
|
|
23
|
+
const b = v;
|
|
24
|
+
v = /* @__PURE__ */ new WeakSet(), J(i, [o], f, c), v = b;
|
|
22
25
|
}
|
|
23
|
-
return
|
|
26
|
+
return l;
|
|
24
27
|
},
|
|
25
|
-
deleteProperty(i,
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
deleteProperty(i, o) {
|
|
29
|
+
let c = Reflect.get(i, o);
|
|
30
|
+
c = _(c);
|
|
31
|
+
const s = Reflect.deleteProperty(i, o);
|
|
32
|
+
return s && (r[o] && (r[o](), delete r[o]), n[o] && delete n[o], J(i, [o], c, void 0)), s;
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
|
-
return
|
|
35
|
+
return G.set(e, a), a;
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
e =
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
|
|
37
|
+
function q(e, r) {
|
|
38
|
+
e = _(e), L.has(e) || L.set(e, /* @__PURE__ */ new Map());
|
|
39
|
+
const n = L.get(e), a = Symbol();
|
|
40
|
+
return n.set(a, r), function() {
|
|
41
|
+
n.delete(a);
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
|
-
function
|
|
42
|
-
return function(...
|
|
43
|
-
const [
|
|
44
|
-
|
|
44
|
+
function re(e, r) {
|
|
45
|
+
return function(...n) {
|
|
46
|
+
const [a, ...i] = n;
|
|
47
|
+
J(e, [r, ...a], ...i);
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
|
-
function
|
|
48
|
-
if (e =
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
[...
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
|
|
50
|
+
function J(e, ...r) {
|
|
51
|
+
if (e = _(e), v != null && v.has(e)) return;
|
|
52
|
+
v == null || v.add(e);
|
|
53
|
+
const n = L.get(e);
|
|
54
|
+
if (!n) return;
|
|
55
|
+
[...n.values()].forEach((i) => {
|
|
56
|
+
const o = new EventTarget(), c = new Event("__trigger__");
|
|
57
|
+
o.addEventListener(c.type, s), o.dispatchEvent(c);
|
|
58
|
+
function s() {
|
|
59
|
+
o.removeEventListener(c.type, s), i(...r);
|
|
57
60
|
}
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
return typeof e != "object" || e === null ? e : e[
|
|
63
|
+
function _(e) {
|
|
64
|
+
return typeof e != "object" || e === null ? e : e[ce] ?? e;
|
|
62
65
|
}
|
|
63
|
-
function
|
|
64
|
-
if (e =
|
|
65
|
-
return Reflect.get(e,
|
|
66
|
-
if (
|
|
67
|
-
return function(
|
|
68
|
-
return Object.prototype.hasOwnProperty.call(
|
|
66
|
+
function ue(e, r) {
|
|
67
|
+
if (e = _(e), ["constructor", "__proto__"].includes(r))
|
|
68
|
+
return Reflect.get(e, r);
|
|
69
|
+
if (r === "hasOwnProperty")
|
|
70
|
+
return function(n) {
|
|
71
|
+
return Object.prototype.hasOwnProperty.call(_(this), n);
|
|
69
72
|
};
|
|
70
|
-
if (Array.isArray(e) &&
|
|
71
|
-
return function(...
|
|
72
|
-
const
|
|
73
|
-
return
|
|
73
|
+
if (Array.isArray(e) && U.includes(r))
|
|
74
|
+
return function(...n) {
|
|
75
|
+
const a = U[r].apply(_(this), n);
|
|
76
|
+
return a === -1 || a === !1 ? U[r].apply(_(this), n.map(_)) : a;
|
|
74
77
|
};
|
|
75
78
|
}
|
|
76
|
-
const
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
+
const T = Symbol("instance"), M = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap();
|
|
80
|
+
function W(e) {
|
|
81
|
+
if (ne.has(e))
|
|
79
82
|
return e;
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
|
|
83
|
+
if (M.has(e))
|
|
84
|
+
return M.get(e);
|
|
85
|
+
const r = {};
|
|
86
|
+
o.prototype = new Proxy(
|
|
84
87
|
{
|
|
85
88
|
constructor: e,
|
|
86
89
|
__proto__: e.prototype
|
|
87
90
|
},
|
|
88
91
|
{
|
|
89
|
-
get(
|
|
90
|
-
let
|
|
91
|
-
return
|
|
92
|
-
return
|
|
93
|
-
}),
|
|
92
|
+
get(c, s, f) {
|
|
93
|
+
let l = ue(c, s);
|
|
94
|
+
return l || (l = Reflect.get(c, s, f), typeof s == "symbol" || ["constructor", "__proto__"].includes(s) || typeof l != "function") ? l : (r[s] || (r[s] = function(...b) {
|
|
95
|
+
return l.apply(C(this), b);
|
|
96
|
+
}), r[s]);
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
);
|
|
97
|
-
const
|
|
98
|
-
({ args:
|
|
99
|
-
var
|
|
100
|
-
|
|
100
|
+
const n = /* @__PURE__ */ new Map(), a = new FinalizationRegistry(
|
|
101
|
+
({ args: c, token: s }) => {
|
|
102
|
+
var f;
|
|
103
|
+
le(n, c), (f = V.get(s)) == null || f(), a.unregister(s);
|
|
101
104
|
}
|
|
102
105
|
), i = new Proxy(e, {
|
|
103
|
-
apply(
|
|
104
|
-
var
|
|
105
|
-
let
|
|
106
|
-
for (let
|
|
107
|
-
|
|
108
|
-
if (!
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
106
|
+
apply(c, s, f) {
|
|
107
|
+
var b, h, p, w;
|
|
108
|
+
let l = n;
|
|
109
|
+
for (let E = 0; E < f.length; E++)
|
|
110
|
+
l.has(f[E]) || l.set(f[E], /* @__PURE__ */ new Map()), l = l.get(f[E]);
|
|
111
|
+
if (!l.has(T) || l.get(T) !== void 0 && !((h = (b = l.get(T)) == null ? void 0 : b.deref) != null && h.call(b))) {
|
|
112
|
+
l.set(T, void 0);
|
|
113
|
+
const E = C(Reflect.construct(c, f, o));
|
|
114
|
+
l.set(T, new WeakRef(E));
|
|
115
|
+
const P = fe(E);
|
|
116
|
+
a.register(E, { args: f, token: P }, P);
|
|
114
117
|
}
|
|
115
|
-
return (
|
|
118
|
+
return (w = (p = l.get(T)) == null ? void 0 : p.deref) == null ? void 0 : w.call(p);
|
|
116
119
|
}
|
|
117
120
|
});
|
|
118
|
-
return
|
|
119
|
-
function
|
|
121
|
+
return M.set(e, i), ne.add(i), M.get(e);
|
|
122
|
+
function o() {
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
function
|
|
123
|
-
if (
|
|
124
|
-
const [
|
|
125
|
-
if (!(i instanceof Map && (
|
|
126
|
-
return e.delete(
|
|
125
|
+
function le(e, r) {
|
|
126
|
+
if (r.length === 0) return e.delete(T);
|
|
127
|
+
const [n, ...a] = r, i = e.get(n);
|
|
128
|
+
if (!(i instanceof Map && (le(i, a), i.size > 0)))
|
|
129
|
+
return e.delete(n);
|
|
127
130
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
131
|
+
function Je(e) {
|
|
132
|
+
const r = C(e), n = fe(r);
|
|
130
133
|
return {
|
|
131
|
-
register(
|
|
132
|
-
|
|
134
|
+
register(a) {
|
|
135
|
+
n && V.set(n, a);
|
|
133
136
|
},
|
|
134
137
|
unregister() {
|
|
135
|
-
|
|
138
|
+
n && V.delete(n);
|
|
136
139
|
}
|
|
137
140
|
};
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
return
|
|
142
|
+
function fe(e) {
|
|
143
|
+
return z.has(e) || z.set(e, {}), z.get(e);
|
|
144
|
+
}
|
|
145
|
+
const Ce = /* @__PURE__ */ Object.create(null);
|
|
146
|
+
function Ve(e, r) {
|
|
147
|
+
const n = W(e), a = r ? n(...r) : Ce;
|
|
148
|
+
return de(a);
|
|
149
|
+
}
|
|
150
|
+
function de(e) {
|
|
151
|
+
const [, r] = Se((n) => (n + 1) % 100, 0);
|
|
152
|
+
return je(() => (r(), q(e, () => r())), [e]), e;
|
|
153
|
+
}
|
|
154
|
+
class Me {
|
|
155
|
+
constructor(r, ...n) {
|
|
156
|
+
g(this, "symbol", Symbol());
|
|
157
|
+
g(this, "args");
|
|
158
|
+
this.target = r, this.args = n;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const Ne = W(Me);
|
|
162
|
+
class Le {
|
|
163
|
+
constructor() {
|
|
164
|
+
g(this, "loading", {});
|
|
165
|
+
g(this, "globalLoading", 0);
|
|
166
|
+
g(this, "onceTokens", /* @__PURE__ */ new WeakMap());
|
|
167
|
+
g(this, "oncePool", {});
|
|
168
|
+
}
|
|
169
|
+
addGlobalLoading() {
|
|
170
|
+
this.globalLoading++;
|
|
171
|
+
}
|
|
172
|
+
subGlobalLoading() {
|
|
173
|
+
this.globalLoading--;
|
|
174
|
+
}
|
|
175
|
+
load(r = !1) {
|
|
176
|
+
return (n, { name: a }) => {
|
|
177
|
+
const { loading: i, addGlobalLoading: o, subGlobalLoading: c } = this;
|
|
178
|
+
return async function(...s) {
|
|
179
|
+
const f = Reflect.get(this, a), l = Ne(f, ...s);
|
|
180
|
+
if (!!i[l.symbol]) return i[l.symbol][1];
|
|
181
|
+
const { promise: h, resolve: p, reject: w } = Promise.withResolvers();
|
|
182
|
+
i[l.symbol] = [f, h], r && o();
|
|
183
|
+
try {
|
|
184
|
+
const E = await n.apply(this, s);
|
|
185
|
+
p(E);
|
|
186
|
+
} catch (E) {
|
|
187
|
+
w(E);
|
|
188
|
+
}
|
|
189
|
+
return Reflect.deleteProperty(i, l.symbol), r && c(), h;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
once(r, { name: n }) {
|
|
194
|
+
const { oncePool: a, onceTokens: i } = this;
|
|
195
|
+
return function(...o) {
|
|
196
|
+
const c = Reflect.get(this, n);
|
|
197
|
+
i.has(c) || i.set(c, Symbol());
|
|
198
|
+
const s = i.get(c);
|
|
199
|
+
return !!a[s] || (a[s] = r.apply(this, o).catch((l) => (Reflect.deleteProperty(a, s), Promise.reject(l)))), a[s];
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
isLoading(r) {
|
|
203
|
+
return Object.getOwnPropertySymbols(this.loading).some(
|
|
204
|
+
(n) => this.loading[n][0] === r
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
get isGlobalLoading() {
|
|
208
|
+
return this.globalLoading > 0;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const We = W(Le)(), Xe = () => {
|
|
212
|
+
const { isGlobalLoading: e, isLoading: r } = de(We);
|
|
213
|
+
return { isGlobalLoading: e, isLoading: r };
|
|
214
|
+
};
|
|
215
|
+
var N = { exports: {} }, x = {};
|
|
216
|
+
/**
|
|
217
|
+
* @license React
|
|
218
|
+
* react-jsx-runtime.production.js
|
|
219
|
+
*
|
|
220
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the MIT license found in the
|
|
223
|
+
* LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/
|
|
225
|
+
var oe;
|
|
226
|
+
function Ie() {
|
|
227
|
+
if (oe) return x;
|
|
228
|
+
oe = 1;
|
|
229
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
230
|
+
function n(a, i, o) {
|
|
231
|
+
var c = null;
|
|
232
|
+
if (o !== void 0 && (c = "" + o), i.key !== void 0 && (c = "" + i.key), "key" in i) {
|
|
233
|
+
o = {};
|
|
234
|
+
for (var s in i)
|
|
235
|
+
s !== "key" && (o[s] = i[s]);
|
|
236
|
+
} else o = i;
|
|
237
|
+
return i = o.ref, {
|
|
238
|
+
$$typeof: e,
|
|
239
|
+
type: a,
|
|
240
|
+
key: c,
|
|
241
|
+
ref: i !== void 0 ? i : null,
|
|
242
|
+
props: o
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return x.Fragment = r, x.jsx = n, x.jsxs = n, x;
|
|
246
|
+
}
|
|
247
|
+
var A = {};
|
|
248
|
+
/**
|
|
249
|
+
* @license React
|
|
250
|
+
* react-jsx-runtime.development.js
|
|
251
|
+
*
|
|
252
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the MIT license found in the
|
|
255
|
+
* LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/
|
|
257
|
+
var se;
|
|
258
|
+
function Ye() {
|
|
259
|
+
return se || (se = 1, process.env.NODE_ENV !== "production" && function() {
|
|
260
|
+
function e(t) {
|
|
261
|
+
if (t == null) return null;
|
|
262
|
+
if (typeof t == "function")
|
|
263
|
+
return t.$$typeof === ke ? null : t.displayName || t.name || null;
|
|
264
|
+
if (typeof t == "string") return t;
|
|
265
|
+
switch (t) {
|
|
266
|
+
case P:
|
|
267
|
+
return "Fragment";
|
|
268
|
+
case me:
|
|
269
|
+
return "Profiler";
|
|
270
|
+
case be:
|
|
271
|
+
return "StrictMode";
|
|
272
|
+
case _e:
|
|
273
|
+
return "Suspense";
|
|
274
|
+
case ye:
|
|
275
|
+
return "SuspenseList";
|
|
276
|
+
case he:
|
|
277
|
+
return "Activity";
|
|
278
|
+
}
|
|
279
|
+
if (typeof t == "object")
|
|
280
|
+
switch (typeof t.tag == "number" && console.error(
|
|
281
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
282
|
+
), t.$$typeof) {
|
|
283
|
+
case E:
|
|
284
|
+
return "Portal";
|
|
285
|
+
case Ee:
|
|
286
|
+
return (t.displayName || "Context") + ".Provider";
|
|
287
|
+
case Re:
|
|
288
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
289
|
+
case pe:
|
|
290
|
+
var u = t.render;
|
|
291
|
+
return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
292
|
+
case ve:
|
|
293
|
+
return u = t.displayName || null, u !== null ? u : e(t.type) || "Memo";
|
|
294
|
+
case B:
|
|
295
|
+
u = t._payload, t = t._init;
|
|
296
|
+
try {
|
|
297
|
+
return e(t(u));
|
|
298
|
+
} catch {
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
function r(t) {
|
|
304
|
+
return "" + t;
|
|
305
|
+
}
|
|
306
|
+
function n(t) {
|
|
307
|
+
try {
|
|
308
|
+
r(t);
|
|
309
|
+
var u = !1;
|
|
310
|
+
} catch {
|
|
311
|
+
u = !0;
|
|
312
|
+
}
|
|
313
|
+
if (u) {
|
|
314
|
+
u = console;
|
|
315
|
+
var d = u.error, m = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
316
|
+
return d.call(
|
|
317
|
+
u,
|
|
318
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
319
|
+
m
|
|
320
|
+
), r(t);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function a(t) {
|
|
324
|
+
if (t === P) return "<>";
|
|
325
|
+
if (typeof t == "object" && t !== null && t.$$typeof === B)
|
|
326
|
+
return "<...>";
|
|
327
|
+
try {
|
|
328
|
+
var u = e(t);
|
|
329
|
+
return u ? "<" + u + ">" : "<...>";
|
|
330
|
+
} catch {
|
|
331
|
+
return "<...>";
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function i() {
|
|
335
|
+
var t = I.A;
|
|
336
|
+
return t === null ? null : t.getOwner();
|
|
337
|
+
}
|
|
338
|
+
function o() {
|
|
339
|
+
return Error("react-stack-top-frame");
|
|
340
|
+
}
|
|
341
|
+
function c(t) {
|
|
342
|
+
if (H.call(t, "key")) {
|
|
343
|
+
var u = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
344
|
+
if (u && u.isReactWarning) return !1;
|
|
345
|
+
}
|
|
346
|
+
return t.key !== void 0;
|
|
347
|
+
}
|
|
348
|
+
function s(t, u) {
|
|
349
|
+
function d() {
|
|
350
|
+
Z || (Z = !0, console.error(
|
|
351
|
+
"%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)",
|
|
352
|
+
u
|
|
353
|
+
));
|
|
354
|
+
}
|
|
355
|
+
d.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
356
|
+
get: d,
|
|
357
|
+
configurable: !0
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function f() {
|
|
361
|
+
var t = e(this.type);
|
|
362
|
+
return Q[t] || (Q[t] = !0, console.error(
|
|
363
|
+
"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."
|
|
364
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
365
|
+
}
|
|
366
|
+
function l(t, u, d, m, k, y, $, F) {
|
|
367
|
+
return d = y.ref, t = {
|
|
368
|
+
$$typeof: w,
|
|
369
|
+
type: t,
|
|
370
|
+
key: u,
|
|
371
|
+
props: y,
|
|
372
|
+
_owner: k
|
|
373
|
+
}, (d !== void 0 ? d : null) !== null ? Object.defineProperty(t, "ref", {
|
|
374
|
+
enumerable: !1,
|
|
375
|
+
get: f
|
|
376
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
377
|
+
configurable: !1,
|
|
378
|
+
enumerable: !1,
|
|
379
|
+
writable: !0,
|
|
380
|
+
value: 0
|
|
381
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
382
|
+
configurable: !1,
|
|
383
|
+
enumerable: !1,
|
|
384
|
+
writable: !0,
|
|
385
|
+
value: null
|
|
386
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
387
|
+
configurable: !1,
|
|
388
|
+
enumerable: !1,
|
|
389
|
+
writable: !0,
|
|
390
|
+
value: $
|
|
391
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
392
|
+
configurable: !1,
|
|
393
|
+
enumerable: !1,
|
|
394
|
+
writable: !0,
|
|
395
|
+
value: F
|
|
396
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
397
|
+
}
|
|
398
|
+
function b(t, u, d, m, k, y, $, F) {
|
|
399
|
+
var R = u.children;
|
|
400
|
+
if (R !== void 0)
|
|
401
|
+
if (m)
|
|
402
|
+
if (we(R)) {
|
|
403
|
+
for (m = 0; m < R.length; m++)
|
|
404
|
+
h(R[m]);
|
|
405
|
+
Object.freeze && Object.freeze(R);
|
|
406
|
+
} else
|
|
407
|
+
console.error(
|
|
408
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
409
|
+
);
|
|
410
|
+
else h(R);
|
|
411
|
+
if (H.call(u, "key")) {
|
|
412
|
+
R = e(t);
|
|
413
|
+
var O = Object.keys(u).filter(function(ge) {
|
|
414
|
+
return ge !== "key";
|
|
415
|
+
});
|
|
416
|
+
m = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", te[R + m] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
417
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
418
|
+
let props = %s;
|
|
419
|
+
<%s {...props} />
|
|
420
|
+
React keys must be passed directly to JSX without using spread:
|
|
421
|
+
let props = %s;
|
|
422
|
+
<%s key={someKey} {...props} />`,
|
|
423
|
+
m,
|
|
424
|
+
R,
|
|
425
|
+
O,
|
|
426
|
+
R
|
|
427
|
+
), te[R + m] = !0);
|
|
428
|
+
}
|
|
429
|
+
if (R = null, d !== void 0 && (n(d), R = "" + d), c(u) && (n(u.key), R = "" + u.key), "key" in u) {
|
|
430
|
+
d = {};
|
|
431
|
+
for (var D in u)
|
|
432
|
+
D !== "key" && (d[D] = u[D]);
|
|
433
|
+
} else d = u;
|
|
434
|
+
return R && s(
|
|
435
|
+
d,
|
|
436
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
437
|
+
), l(
|
|
438
|
+
t,
|
|
439
|
+
R,
|
|
440
|
+
y,
|
|
441
|
+
k,
|
|
442
|
+
i(),
|
|
443
|
+
d,
|
|
444
|
+
$,
|
|
445
|
+
F
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function h(t) {
|
|
449
|
+
typeof t == "object" && t !== null && t.$$typeof === w && t._store && (t._store.validated = 1);
|
|
450
|
+
}
|
|
451
|
+
var p = Oe, w = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), be = Symbol.for("react.strict_mode"), me = Symbol.for("react.profiler"), Re = Symbol.for("react.consumer"), Ee = Symbol.for("react.context"), pe = Symbol.for("react.forward_ref"), _e = Symbol.for("react.suspense"), ye = Symbol.for("react.suspense_list"), ve = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), he = Symbol.for("react.activity"), ke = Symbol.for("react.client.reference"), I = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, we = Array.isArray, Y = console.createTask ? console.createTask : function() {
|
|
452
|
+
return null;
|
|
453
|
+
};
|
|
454
|
+
p = {
|
|
455
|
+
"react-stack-bottom-frame": function(t) {
|
|
456
|
+
return t();
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
var Z, Q = {}, K = p["react-stack-bottom-frame"].bind(
|
|
460
|
+
p,
|
|
461
|
+
o
|
|
462
|
+
)(), ee = Y(a(o)), te = {};
|
|
463
|
+
A.Fragment = P, A.jsx = function(t, u, d, m, k) {
|
|
464
|
+
var y = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
465
|
+
return b(
|
|
466
|
+
t,
|
|
467
|
+
u,
|
|
468
|
+
d,
|
|
469
|
+
!1,
|
|
470
|
+
m,
|
|
471
|
+
k,
|
|
472
|
+
y ? Error("react-stack-top-frame") : K,
|
|
473
|
+
y ? Y(a(t)) : ee
|
|
474
|
+
);
|
|
475
|
+
}, A.jsxs = function(t, u, d, m, k) {
|
|
476
|
+
var y = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
477
|
+
return b(
|
|
478
|
+
t,
|
|
479
|
+
u,
|
|
480
|
+
d,
|
|
481
|
+
!0,
|
|
482
|
+
m,
|
|
483
|
+
k,
|
|
484
|
+
y ? Error("react-stack-top-frame") : K,
|
|
485
|
+
y ? Y(a(t)) : ee
|
|
486
|
+
);
|
|
487
|
+
};
|
|
488
|
+
}()), A;
|
|
489
|
+
}
|
|
490
|
+
var ie;
|
|
491
|
+
function $e() {
|
|
492
|
+
return ie || (ie = 1, process.env.NODE_ENV === "production" ? N.exports = Ie() : N.exports = Ye()), N.exports;
|
|
493
|
+
}
|
|
494
|
+
var Fe = $e();
|
|
495
|
+
const S = {}, j = {}, X = xe({ namespace: "" });
|
|
496
|
+
function De(e) {
|
|
497
|
+
return S[e] || (S[e] = /* @__PURE__ */ new Map()), S[e];
|
|
498
|
+
}
|
|
499
|
+
function Ge(e) {
|
|
500
|
+
return j[e] || (j[e] = /* @__PURE__ */ new Map()), j[e];
|
|
501
|
+
}
|
|
502
|
+
const Be = ({
|
|
503
|
+
children: e,
|
|
504
|
+
namespace: r = ""
|
|
505
|
+
}) => /* @__PURE__ */ Fe.jsx(X.Provider, { value: { namespace: r }, children: e });
|
|
506
|
+
function He({ schema: e, ctor: r }) {
|
|
507
|
+
const { namespace: n } = ae(X);
|
|
508
|
+
return De(n).set(e, r), null;
|
|
509
|
+
}
|
|
510
|
+
function Ze({
|
|
511
|
+
schema: e,
|
|
512
|
+
val: r
|
|
513
|
+
}) {
|
|
514
|
+
const { namespace: n } = ae(X);
|
|
515
|
+
return Ge(n).set(e, r), null;
|
|
516
|
+
}
|
|
517
|
+
function Qe(e, r = "") {
|
|
518
|
+
return (n, { static: a, kind: i }) => {
|
|
519
|
+
if (i !== "field")
|
|
520
|
+
throw new Error("inject 装饰器只能用于类的属性字段");
|
|
521
|
+
if (a)
|
|
522
|
+
throw new Error("inject 装饰器不能用于静态属性");
|
|
523
|
+
return function(o) {
|
|
524
|
+
var l;
|
|
525
|
+
if (!Ue(e, r))
|
|
526
|
+
return console.error(
|
|
527
|
+
`[IoC] 依赖注入失败 - namespace: "${r}", schema: ${e.description || "unknown"}`,
|
|
528
|
+
"未注册"
|
|
529
|
+
), o;
|
|
530
|
+
let c = o;
|
|
531
|
+
const s = (l = S[r]) == null ? void 0 : l.get(e);
|
|
532
|
+
if (s)
|
|
533
|
+
c = W(s)();
|
|
534
|
+
else {
|
|
535
|
+
const b = j[r];
|
|
536
|
+
b != null && b.has(e) && (c = b.get(e));
|
|
537
|
+
}
|
|
538
|
+
const f = e.safeParse(c);
|
|
539
|
+
return f.success ? c : (console.error(
|
|
540
|
+
`[IoC] 依赖注入失败 - namespace: "${r}", schema: ${e.description || "unknown"}`,
|
|
541
|
+
f.error.issues
|
|
542
|
+
), o);
|
|
543
|
+
};
|
|
544
|
+
};
|
|
141
545
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const o = U(e), c = n ? o(...n) : D;
|
|
145
|
-
return G(c);
|
|
546
|
+
function Ke(e) {
|
|
547
|
+
delete S[e], delete j[e];
|
|
146
548
|
}
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
return
|
|
549
|
+
function Ue(e, r = "") {
|
|
550
|
+
const n = S[r], a = j[r];
|
|
551
|
+
return (n == null ? void 0 : n.has(e)) || (a == null ? void 0 : a.has(e));
|
|
150
552
|
}
|
|
151
553
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
554
|
+
He as CInjection,
|
|
555
|
+
Be as Container,
|
|
556
|
+
Ze as VInjection,
|
|
557
|
+
Ke as clearNamespace,
|
|
558
|
+
Je as finalizationRegistry,
|
|
559
|
+
Qe as inject,
|
|
560
|
+
Ue as isRegistered,
|
|
561
|
+
We as loader,
|
|
562
|
+
W as provide,
|
|
563
|
+
de as useInstance,
|
|
564
|
+
Xe as useLoader,
|
|
565
|
+
Ve as useModel,
|
|
566
|
+
q as watch
|
|
157
567
|
};
|