@ptolemy2002/react-proxy-context 2.1.2 → 2.2.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.
- package/README.md +13 -3
- package/dist/main.d.ts +2 -1
- package/dist/main.js +315 -293
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ type OnChangeReinitCallback<T> =
|
|
|
22
22
|
|
|
23
23
|
type Dependency<T> = keyof T | (
|
|
24
24
|
<K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean
|
|
25
|
-
) | null | undefined | false
|
|
25
|
+
) | null | undefined | false | [keyof T, ...PropertyKey[]]
|
|
26
26
|
|
|
27
27
|
type ProxyContext<T> = ContextWithName<ProxyContextValue<T> | undefined>;
|
|
28
28
|
|
|
@@ -54,9 +54,19 @@ type UseProxyContextResult<T> = HookResultData<{
|
|
|
54
54
|
## Functions
|
|
55
55
|
The following functions are available in the library:
|
|
56
56
|
|
|
57
|
+
### evaluateDependency<T>
|
|
58
|
+
#### Description
|
|
59
|
+
Given a dependency, if it is an array instance, converts it to the equivalent function that will test for equality of a nested property. If it is not an array instance, returns the dependency as is.
|
|
60
|
+
|
|
61
|
+
#### Parameters
|
|
62
|
+
- `dependency` (`Dependency<T>`): The dependency to evaluate.
|
|
63
|
+
|
|
64
|
+
#### Returns
|
|
65
|
+
`Dependency<T>` - The evaluated dependency. If the dependency is an array, it will be converted to a function that tests for equality of a nested property.
|
|
66
|
+
|
|
57
67
|
### createProxyContext<T>
|
|
58
68
|
#### Description
|
|
59
|
-
Creates a new instance of the ProxyContext, essentially to be used as the context type, with the specified name. This is effectively just the normal React createContext function, but with a check to ensure that the browser supports Proxies. `T` represents the type of the object that will be stored in the context.
|
|
69
|
+
Creates a new instance of the ProxyContext, essentially to be used as the context type, with the specified name. This is effectively just the normal React `createContext` function, but with a check to ensure that the browser supports Proxies. `T` represents the type of the object that will be stored in the context.
|
|
60
70
|
|
|
61
71
|
#### Parameters
|
|
62
72
|
- `name` (String): The name of the context. This is used for debugging purposes.
|
|
@@ -88,7 +98,7 @@ A hook that uses the context provided by the `ProxyContextProvider` component. T
|
|
|
88
98
|
|
|
89
99
|
#### Parameters
|
|
90
100
|
- `contextClass` (`ProxyContext<T>`): The context class that was created using `createProxyContext`.
|
|
91
|
-
- `deps` (`Dependency<T>[] | null`): An array of dependencies to listen to. If any of these properties on the context change, the hook will re-render. If this is falsy, any mutation will trigger a re-render. You can also specify a function that returns a boolean to determine whether to re-render.
|
|
101
|
+
- `deps` (`Dependency<T>[] | null`): An array of dependencies to listen to. If any of these properties on the context change, the hook will re-render. If this is falsy, any mutation will trigger a re-render. If a dependency is an array, it represents a nested property dependency. You can also specify a function that returns a boolean to determine whether to re-render. By default, this is an empty array.
|
|
92
102
|
- `onChangeProp` (`OnChangePropCallback<T> | undefined`): A function that is called whenever a property of the context is changed. The first parameter is the property that was changed, the second parameter is the current value of the property, and the third parameter is the previous value of the property. This is useful for listening to changes in the provider's parent component.
|
|
93
103
|
- `onChangeReinit` (`OnChangeReinitCallback<T> | undefined`): A function that is called whenever the context is reinitialized. The first parameter is the current value of the context, and the second parameter is the previous value of the context. This is useful for listening to changes in the provider's parent component.
|
|
94
104
|
- `listenReinit` (`boolean`): Whether to listen to full reassignments of the context. If this is true, the hook will re-render whenever the context is reinitialized. By default, this is true.
|
package/dist/main.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export type ProxyContextValue<T> = {
|
|
|
12
12
|
unsubscribe: (id: string) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare function createProxyContext<T>(name: string): ProxyContext<T>;
|
|
15
|
-
export type Dependency<T> = keyof T | (<K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean) | null | undefined | false;
|
|
15
|
+
export type Dependency<T> = keyof T | (<K extends keyof T>(prop: K, current: T[K], prev: T[K], obj: T) => boolean) | null | undefined | false | [keyof T, ...PropertyKey[]];
|
|
16
|
+
export declare function evaluateDependency<T>(dep: Dependency<T>): Exclude<Dependency<T>, any[]> | keyof T;
|
|
16
17
|
export type ProxyContext<T> = ContextWithName<ProxyContextValue<T> | undefined>;
|
|
17
18
|
export type ProxyContextProviderProps<T> = {
|
|
18
19
|
children: ReactNode;
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $e, { useEffect as We, createContext as br, useRef as Z, useImperativeHandle as yr, useCallback as se, useContext as mr } from "react";
|
|
2
2
|
import { nanoid as Rr } from "nanoid";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import Y from "is-callable";
|
|
4
|
+
import Ye from "@ptolemy2002/react-force-rerender";
|
|
5
5
|
import gr from "@ptolemy2002/react-hook-result";
|
|
6
6
|
import { partialMemo as hr } from "@ptolemy2002/react-utils";
|
|
7
|
-
var
|
|
7
|
+
var ce = { exports: {} }, N = {};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.min.js
|
|
@@ -16,19 +16,19 @@ var se = { exports: {} }, B = {};
|
|
|
16
16
|
*/
|
|
17
17
|
var Fe;
|
|
18
18
|
function Er() {
|
|
19
|
-
if (Fe) return
|
|
19
|
+
if (Fe) return N;
|
|
20
20
|
Fe = 1;
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
for (
|
|
26
|
-
if (
|
|
27
|
-
return { $$typeof:
|
|
21
|
+
var v = $e, E = Symbol.for("react.element"), w = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, T = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
22
|
+
function p(i, s, P) {
|
|
23
|
+
var b, x = {}, O = null, R = null;
|
|
24
|
+
P !== void 0 && (O = "" + P), s.key !== void 0 && (O = "" + s.key), s.ref !== void 0 && (R = s.ref);
|
|
25
|
+
for (b in s) g.call(s, b) && !m.hasOwnProperty(b) && (x[b] = s[b]);
|
|
26
|
+
if (i && i.defaultProps) for (b in s = i.defaultProps, s) x[b] === void 0 && (x[b] = s[b]);
|
|
27
|
+
return { $$typeof: E, type: i, key: O, ref: R, props: x, _owner: T.current };
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return N.Fragment = w, N.jsx = p, N.jsxs = p, N;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var B = {};
|
|
32
32
|
/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-jsx-runtime.development.js
|
|
@@ -38,42 +38,42 @@ var J = {};
|
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
var
|
|
41
|
+
var Ie;
|
|
42
42
|
function _r() {
|
|
43
|
-
return
|
|
44
|
-
var
|
|
45
|
-
function
|
|
43
|
+
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
|
+
var v = $e, E = Symbol.for("react.element"), w = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), i = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), D = Symbol.iterator, C = "@@iterator";
|
|
45
|
+
function k(e) {
|
|
46
46
|
if (e === null || typeof e != "object")
|
|
47
47
|
return null;
|
|
48
|
-
var r =
|
|
48
|
+
var r = D && e[D] || e[C];
|
|
49
49
|
return typeof r == "function" ? r : null;
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var y = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52
|
+
function f(e) {
|
|
53
53
|
{
|
|
54
54
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
55
55
|
t[n - 1] = arguments[n];
|
|
56
|
-
|
|
56
|
+
I("error", e, t);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function I(e, r, t) {
|
|
60
60
|
{
|
|
61
|
-
var n =
|
|
61
|
+
var n = y.ReactDebugCurrentFrame, u = n.getStackAddendum();
|
|
62
62
|
u !== "" && (r += "%s", t = t.concat([u]));
|
|
63
|
-
var c = t.map(function(
|
|
64
|
-
return String(
|
|
63
|
+
var c = t.map(function(o) {
|
|
64
|
+
return String(o);
|
|
65
65
|
});
|
|
66
66
|
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
69
|
+
var J = !1, L = !1, q = !1, K = !1, Le = !1, fe;
|
|
70
|
+
fe = Symbol.for("react.module.reference");
|
|
71
71
|
function Ve(e) {
|
|
72
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
72
|
+
return !!(typeof e == "string" || typeof e == "function" || e === g || e === m || Le || e === T || e === P || e === b || K || e === R || J || L || q || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === x || e.$$typeof === p || e.$$typeof === i || e.$$typeof === s || // This needs to include all possible module reference object
|
|
73
73
|
// types supported by any Flight configuration anywhere since
|
|
74
74
|
// we don't know which Flight build this will end up being used
|
|
75
75
|
// with.
|
|
76
|
-
e.$$typeof ===
|
|
76
|
+
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
77
77
|
}
|
|
78
78
|
function Me(e, r, t) {
|
|
79
79
|
var n = e.displayName;
|
|
@@ -82,47 +82,47 @@ function _r() {
|
|
|
82
82
|
var u = r.displayName || r.name || "";
|
|
83
83
|
return u !== "" ? t + "(" + u + ")" : t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function le(e) {
|
|
86
86
|
return e.displayName || "Context";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function j(e) {
|
|
89
89
|
if (e == null)
|
|
90
90
|
return null;
|
|
91
|
-
if (typeof e.tag == "number" &&
|
|
91
|
+
if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
92
92
|
return e.displayName || e.name || null;
|
|
93
93
|
if (typeof e == "string")
|
|
94
94
|
return e;
|
|
95
95
|
switch (e) {
|
|
96
|
-
case
|
|
96
|
+
case g:
|
|
97
97
|
return "Fragment";
|
|
98
|
-
case
|
|
98
|
+
case w:
|
|
99
99
|
return "Portal";
|
|
100
|
-
case
|
|
100
|
+
case m:
|
|
101
101
|
return "Profiler";
|
|
102
|
-
case
|
|
102
|
+
case T:
|
|
103
103
|
return "StrictMode";
|
|
104
|
-
case
|
|
104
|
+
case P:
|
|
105
105
|
return "Suspense";
|
|
106
|
-
case
|
|
106
|
+
case b:
|
|
107
107
|
return "SuspenseList";
|
|
108
108
|
}
|
|
109
109
|
if (typeof e == "object")
|
|
110
110
|
switch (e.$$typeof) {
|
|
111
|
-
case
|
|
111
|
+
case i:
|
|
112
112
|
var r = e;
|
|
113
|
-
return
|
|
114
|
-
case
|
|
113
|
+
return le(r) + ".Consumer";
|
|
114
|
+
case p:
|
|
115
115
|
var t = e;
|
|
116
|
-
return
|
|
117
|
-
case
|
|
116
|
+
return le(t._context) + ".Provider";
|
|
117
|
+
case s:
|
|
118
118
|
return Me(e, e.render, "ForwardRef");
|
|
119
|
-
case
|
|
119
|
+
case x:
|
|
120
120
|
var n = e.displayName || null;
|
|
121
|
-
return n !== null ? n :
|
|
122
|
-
case
|
|
123
|
-
var u = e, c = u._payload,
|
|
121
|
+
return n !== null ? n : j(e.type) || "Memo";
|
|
122
|
+
case O: {
|
|
123
|
+
var u = e, c = u._payload, o = u._init;
|
|
124
124
|
try {
|
|
125
|
-
return
|
|
125
|
+
return j(o(c));
|
|
126
126
|
} catch {
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
@@ -130,18 +130,18 @@ function _r() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
133
|
+
var A = Object.assign, V = 0, de, ve, pe, be, ye, me, Re;
|
|
134
|
+
function ge() {
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
ge.__reactDisabledLog = !0;
|
|
137
137
|
function Ue() {
|
|
138
138
|
{
|
|
139
|
-
if (
|
|
140
|
-
|
|
139
|
+
if (V === 0) {
|
|
140
|
+
de = console.log, ve = console.info, pe = console.warn, be = console.error, ye = console.group, me = console.groupCollapsed, Re = console.groupEnd;
|
|
141
141
|
var e = {
|
|
142
142
|
configurable: !0,
|
|
143
143
|
enumerable: !0,
|
|
144
|
-
value:
|
|
144
|
+
value: ge,
|
|
145
145
|
writable: !0
|
|
146
146
|
};
|
|
147
147
|
Object.defineProperties(console, {
|
|
@@ -154,199 +154,199 @@ function _r() {
|
|
|
154
154
|
groupEnd: e
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
V++;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
function Ne() {
|
|
161
161
|
{
|
|
162
|
-
if (
|
|
162
|
+
if (V--, V === 0) {
|
|
163
163
|
var e = {
|
|
164
164
|
configurable: !0,
|
|
165
165
|
enumerable: !0,
|
|
166
166
|
writable: !0
|
|
167
167
|
};
|
|
168
168
|
Object.defineProperties(console, {
|
|
169
|
-
log:
|
|
170
|
-
value: le
|
|
171
|
-
}),
|
|
172
|
-
info: F({}, e, {
|
|
169
|
+
log: A({}, e, {
|
|
173
170
|
value: de
|
|
174
171
|
}),
|
|
175
|
-
|
|
172
|
+
info: A({}, e, {
|
|
176
173
|
value: ve
|
|
177
174
|
}),
|
|
178
|
-
|
|
175
|
+
warn: A({}, e, {
|
|
179
176
|
value: pe
|
|
180
177
|
}),
|
|
181
|
-
|
|
178
|
+
error: A({}, e, {
|
|
182
179
|
value: be
|
|
183
180
|
}),
|
|
184
|
-
|
|
181
|
+
group: A({}, e, {
|
|
185
182
|
value: ye
|
|
186
183
|
}),
|
|
187
|
-
|
|
184
|
+
groupCollapsed: A({}, e, {
|
|
188
185
|
value: me
|
|
186
|
+
}),
|
|
187
|
+
groupEnd: A({}, e, {
|
|
188
|
+
value: Re
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
V < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
var
|
|
196
|
-
function
|
|
195
|
+
var Q = y.ReactCurrentDispatcher, ee;
|
|
196
|
+
function G(e, r, t) {
|
|
197
197
|
{
|
|
198
|
-
if (
|
|
198
|
+
if (ee === void 0)
|
|
199
199
|
try {
|
|
200
200
|
throw Error();
|
|
201
201
|
} catch (u) {
|
|
202
202
|
var n = u.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
-
|
|
203
|
+
ee = n && n[1] || "";
|
|
204
204
|
}
|
|
205
205
|
return `
|
|
206
|
-
` +
|
|
206
|
+
` + ee + e;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var re = !1, z;
|
|
210
210
|
{
|
|
211
211
|
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
-
|
|
212
|
+
z = new Be();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
if (!e ||
|
|
214
|
+
function he(e, r) {
|
|
215
|
+
if (!e || re)
|
|
216
216
|
return "";
|
|
217
217
|
{
|
|
218
|
-
var t =
|
|
218
|
+
var t = z.get(e);
|
|
219
219
|
if (t !== void 0)
|
|
220
220
|
return t;
|
|
221
221
|
}
|
|
222
222
|
var n;
|
|
223
|
-
|
|
223
|
+
re = !0;
|
|
224
224
|
var u = Error.prepareStackTrace;
|
|
225
225
|
Error.prepareStackTrace = void 0;
|
|
226
226
|
var c;
|
|
227
|
-
c =
|
|
227
|
+
c = Q.current, Q.current = null, Ue();
|
|
228
228
|
try {
|
|
229
229
|
if (r) {
|
|
230
|
-
var
|
|
230
|
+
var o = function() {
|
|
231
231
|
throw Error();
|
|
232
232
|
};
|
|
233
|
-
if (Object.defineProperty(
|
|
233
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
234
234
|
set: function() {
|
|
235
235
|
throw Error();
|
|
236
236
|
}
|
|
237
237
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
238
238
|
try {
|
|
239
|
-
Reflect.construct(
|
|
240
|
-
} catch (
|
|
241
|
-
n =
|
|
239
|
+
Reflect.construct(o, []);
|
|
240
|
+
} catch (_) {
|
|
241
|
+
n = _;
|
|
242
242
|
}
|
|
243
|
-
Reflect.construct(e, [],
|
|
243
|
+
Reflect.construct(e, [], o);
|
|
244
244
|
} else {
|
|
245
245
|
try {
|
|
246
|
-
|
|
247
|
-
} catch (
|
|
248
|
-
n =
|
|
246
|
+
o.call();
|
|
247
|
+
} catch (_) {
|
|
248
|
+
n = _;
|
|
249
249
|
}
|
|
250
|
-
e.call(
|
|
250
|
+
e.call(o.prototype);
|
|
251
251
|
}
|
|
252
252
|
} else {
|
|
253
253
|
try {
|
|
254
254
|
throw Error();
|
|
255
|
-
} catch (
|
|
256
|
-
n =
|
|
255
|
+
} catch (_) {
|
|
256
|
+
n = _;
|
|
257
257
|
}
|
|
258
258
|
e();
|
|
259
259
|
}
|
|
260
|
-
} catch (
|
|
261
|
-
if (
|
|
262
|
-
for (var a =
|
|
263
|
-
`),
|
|
264
|
-
`),
|
|
265
|
-
|
|
266
|
-
for (;
|
|
267
|
-
if (a[
|
|
268
|
-
if (
|
|
260
|
+
} catch (_) {
|
|
261
|
+
if (_ && n && typeof _.stack == "string") {
|
|
262
|
+
for (var a = _.stack.split(`
|
|
263
|
+
`), h = n.stack.split(`
|
|
264
|
+
`), l = a.length - 1, d = h.length - 1; l >= 1 && d >= 0 && a[l] !== h[d]; )
|
|
265
|
+
d--;
|
|
266
|
+
for (; l >= 1 && d >= 0; l--, d--)
|
|
267
|
+
if (a[l] !== h[d]) {
|
|
268
|
+
if (l !== 1 || d !== 1)
|
|
269
269
|
do
|
|
270
|
-
if (
|
|
271
|
-
var
|
|
272
|
-
` + a[
|
|
273
|
-
return e.displayName &&
|
|
270
|
+
if (l--, d--, d < 0 || a[l] !== h[d]) {
|
|
271
|
+
var S = `
|
|
272
|
+
` + a[l].replace(" at new ", " at ");
|
|
273
|
+
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, S), S;
|
|
274
274
|
}
|
|
275
|
-
while (
|
|
275
|
+
while (l >= 1 && d >= 0);
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
} finally {
|
|
280
|
-
|
|
280
|
+
re = !1, Q.current = c, Ne(), Error.prepareStackTrace = u;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
283
|
-
return typeof e == "function" &&
|
|
282
|
+
var W = e ? e.displayName || e.name : "", F = W ? G(W) : "";
|
|
283
|
+
return typeof e == "function" && z.set(e, F), F;
|
|
284
284
|
}
|
|
285
285
|
function Je(e, r, t) {
|
|
286
|
-
return
|
|
286
|
+
return he(e, !1);
|
|
287
287
|
}
|
|
288
288
|
function qe(e) {
|
|
289
289
|
var r = e.prototype;
|
|
290
290
|
return !!(r && r.isReactComponent);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function H(e, r, t) {
|
|
293
293
|
if (e == null)
|
|
294
294
|
return "";
|
|
295
295
|
if (typeof e == "function")
|
|
296
|
-
return
|
|
296
|
+
return he(e, qe(e));
|
|
297
297
|
if (typeof e == "string")
|
|
298
|
-
return
|
|
298
|
+
return G(e);
|
|
299
299
|
switch (e) {
|
|
300
|
-
case
|
|
301
|
-
return
|
|
302
|
-
case
|
|
303
|
-
return
|
|
300
|
+
case P:
|
|
301
|
+
return G("Suspense");
|
|
302
|
+
case b:
|
|
303
|
+
return G("SuspenseList");
|
|
304
304
|
}
|
|
305
305
|
if (typeof e == "object")
|
|
306
306
|
switch (e.$$typeof) {
|
|
307
|
-
case
|
|
307
|
+
case s:
|
|
308
308
|
return Je(e.render);
|
|
309
|
-
case
|
|
310
|
-
return
|
|
311
|
-
case
|
|
309
|
+
case x:
|
|
310
|
+
return H(e.type, r, t);
|
|
311
|
+
case O: {
|
|
312
312
|
var n = e, u = n._payload, c = n._init;
|
|
313
313
|
try {
|
|
314
|
-
return
|
|
314
|
+
return H(c(u), r, t);
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
return "";
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
321
|
+
var M = Object.prototype.hasOwnProperty, Ee = {}, _e = y.ReactDebugCurrentFrame;
|
|
322
|
+
function X(e) {
|
|
323
323
|
if (e) {
|
|
324
|
-
var r = e._owner, t =
|
|
325
|
-
|
|
324
|
+
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
|
|
325
|
+
_e.setExtraStackFrame(t);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
_e.setExtraStackFrame(null);
|
|
328
328
|
}
|
|
329
329
|
function Ke(e, r, t, n, u) {
|
|
330
330
|
{
|
|
331
|
-
var c = Function.call.bind(
|
|
332
|
-
for (var
|
|
333
|
-
if (c(e,
|
|
331
|
+
var c = Function.call.bind(M);
|
|
332
|
+
for (var o in e)
|
|
333
|
+
if (c(e, o)) {
|
|
334
334
|
var a = void 0;
|
|
335
335
|
try {
|
|
336
|
-
if (typeof e[
|
|
337
|
-
var
|
|
338
|
-
throw
|
|
336
|
+
if (typeof e[o] != "function") {
|
|
337
|
+
var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
338
|
+
throw h.name = "Invariant Violation", h;
|
|
339
339
|
}
|
|
340
|
-
a = e[
|
|
341
|
-
} catch (
|
|
342
|
-
a =
|
|
340
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
341
|
+
} catch (l) {
|
|
342
|
+
a = l;
|
|
343
343
|
}
|
|
344
|
-
a && !(a instanceof Error) && (
|
|
344
|
+
a && !(a instanceof Error) && (X(u), f("%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).", n || "React class", t, o, typeof a), X(null)), a instanceof Error && !(a.message in Ee) && (Ee[a.message] = !0, X(u), f("Failed %s type: %s", t, a.message), X(null));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
var Ge = Array.isArray;
|
|
349
|
-
function
|
|
349
|
+
function te(e) {
|
|
350
350
|
return Ge(e);
|
|
351
351
|
}
|
|
352
352
|
function ze(e) {
|
|
@@ -357,27 +357,27 @@ function _r() {
|
|
|
357
357
|
}
|
|
358
358
|
function He(e) {
|
|
359
359
|
try {
|
|
360
|
-
return
|
|
360
|
+
return Te(e), !1;
|
|
361
361
|
} catch {
|
|
362
362
|
return !0;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Te(e) {
|
|
366
366
|
return "" + e;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Pe(e) {
|
|
369
369
|
if (He(e))
|
|
370
|
-
return
|
|
370
|
+
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), Te(e);
|
|
371
371
|
}
|
|
372
|
-
var
|
|
372
|
+
var U = y.ReactCurrentOwner, Xe = {
|
|
373
373
|
key: !0,
|
|
374
374
|
ref: !0,
|
|
375
375
|
__self: !0,
|
|
376
376
|
__source: !0
|
|
377
|
-
},
|
|
378
|
-
|
|
377
|
+
}, Se, xe, ne;
|
|
378
|
+
ne = {};
|
|
379
379
|
function Ze(e) {
|
|
380
|
-
if (
|
|
380
|
+
if (M.call(e, "ref")) {
|
|
381
381
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
382
382
|
if (r && r.isReactWarning)
|
|
383
383
|
return !1;
|
|
@@ -385,7 +385,7 @@ function _r() {
|
|
|
385
385
|
return e.ref !== void 0;
|
|
386
386
|
}
|
|
387
387
|
function Qe(e) {
|
|
388
|
-
if (
|
|
388
|
+
if (M.call(e, "key")) {
|
|
389
389
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
390
390
|
if (r && r.isReactWarning)
|
|
391
391
|
return !1;
|
|
@@ -393,15 +393,15 @@ function _r() {
|
|
|
393
393
|
return e.key !== void 0;
|
|
394
394
|
}
|
|
395
395
|
function er(e, r) {
|
|
396
|
-
if (typeof e.ref == "string" &&
|
|
397
|
-
var t =
|
|
398
|
-
|
|
396
|
+
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
|
|
397
|
+
var t = j(U.current.type);
|
|
398
|
+
ne[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(U.current.type), e.ref), ne[t] = !0);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
function rr(e, r) {
|
|
402
402
|
{
|
|
403
403
|
var t = function() {
|
|
404
|
-
|
|
404
|
+
Se || (Se = !0, f("%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)", r));
|
|
405
405
|
};
|
|
406
406
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
407
407
|
get: t,
|
|
@@ -412,7 +412,7 @@ function _r() {
|
|
|
412
412
|
function tr(e, r) {
|
|
413
413
|
{
|
|
414
414
|
var t = function() {
|
|
415
|
-
xe || (xe = !0,
|
|
415
|
+
xe || (xe = !0, f("%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)", r));
|
|
416
416
|
};
|
|
417
417
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
418
418
|
get: t,
|
|
@@ -420,15 +420,15 @@ function _r() {
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
var nr = function(e, r, t, n, u, c,
|
|
423
|
+
var nr = function(e, r, t, n, u, c, o) {
|
|
424
424
|
var a = {
|
|
425
425
|
// This tag allows us to uniquely identify this as a React Element
|
|
426
|
-
$$typeof:
|
|
426
|
+
$$typeof: E,
|
|
427
427
|
// Built-in properties that belong on the element
|
|
428
428
|
type: e,
|
|
429
429
|
key: r,
|
|
430
430
|
ref: t,
|
|
431
|
-
props:
|
|
431
|
+
props: o,
|
|
432
432
|
// Record the component responsible for creating this element.
|
|
433
433
|
_owner: c
|
|
434
434
|
};
|
|
@@ -451,39 +451,39 @@ function _r() {
|
|
|
451
451
|
};
|
|
452
452
|
function ar(e, r, t, n, u) {
|
|
453
453
|
{
|
|
454
|
-
var c,
|
|
455
|
-
t !== void 0 && (
|
|
454
|
+
var c, o = {}, a = null, h = null;
|
|
455
|
+
t !== void 0 && (Pe(t), a = "" + t), Qe(r) && (Pe(r.key), a = "" + r.key), Ze(r) && (h = r.ref, er(r, u));
|
|
456
456
|
for (c in r)
|
|
457
|
-
|
|
457
|
+
M.call(r, c) && !Xe.hasOwnProperty(c) && (o[c] = r[c]);
|
|
458
458
|
if (e && e.defaultProps) {
|
|
459
|
-
var
|
|
460
|
-
for (c in
|
|
461
|
-
|
|
459
|
+
var l = e.defaultProps;
|
|
460
|
+
for (c in l)
|
|
461
|
+
o[c] === void 0 && (o[c] = l[c]);
|
|
462
462
|
}
|
|
463
|
-
if (a ||
|
|
464
|
-
var
|
|
465
|
-
a && rr(
|
|
463
|
+
if (a || h) {
|
|
464
|
+
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
465
|
+
a && rr(o, d), h && tr(o, d);
|
|
466
466
|
}
|
|
467
|
-
return nr(e, a,
|
|
467
|
+
return nr(e, a, h, u, n, U.current, o);
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
var
|
|
471
|
-
function
|
|
470
|
+
var ae = y.ReactCurrentOwner, Ce = y.ReactDebugCurrentFrame;
|
|
471
|
+
function $(e) {
|
|
472
472
|
if (e) {
|
|
473
|
-
var r = e._owner, t =
|
|
473
|
+
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
|
|
474
474
|
Ce.setExtraStackFrame(t);
|
|
475
475
|
} else
|
|
476
476
|
Ce.setExtraStackFrame(null);
|
|
477
477
|
}
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
function
|
|
481
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
478
|
+
var oe;
|
|
479
|
+
oe = !1;
|
|
480
|
+
function ie(e) {
|
|
481
|
+
return typeof e == "object" && e !== null && e.$$typeof === E;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function we() {
|
|
484
484
|
{
|
|
485
|
-
if (
|
|
486
|
-
var e =
|
|
485
|
+
if (ae.current) {
|
|
486
|
+
var e = j(ae.current.type);
|
|
487
487
|
if (e)
|
|
488
488
|
return `
|
|
489
489
|
|
|
@@ -498,7 +498,7 @@ Check the render method of \`` + e + "`.";
|
|
|
498
498
|
var Oe = {};
|
|
499
499
|
function ir(e) {
|
|
500
500
|
{
|
|
501
|
-
var r =
|
|
501
|
+
var r = we();
|
|
502
502
|
if (!r) {
|
|
503
503
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
504
504
|
t && (r = `
|
|
@@ -508,7 +508,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
508
508
|
return r;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function je(e, r) {
|
|
512
512
|
{
|
|
513
513
|
if (!e._store || e._store.validated || e.key != null)
|
|
514
514
|
return;
|
|
@@ -518,25 +518,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
518
518
|
return;
|
|
519
519
|
Oe[t] = !0;
|
|
520
520
|
var n = "";
|
|
521
|
-
e && e._owner && e._owner !==
|
|
521
|
+
e && e._owner && e._owner !== ae.current && (n = " It was passed a child from " + j(e._owner.type) + "."), $(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), $(null);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function ke(e, r) {
|
|
525
525
|
{
|
|
526
526
|
if (typeof e != "object")
|
|
527
527
|
return;
|
|
528
|
-
if (
|
|
528
|
+
if (te(e))
|
|
529
529
|
for (var t = 0; t < e.length; t++) {
|
|
530
530
|
var n = e[t];
|
|
531
|
-
|
|
531
|
+
ie(n) && je(n, r);
|
|
532
532
|
}
|
|
533
|
-
else if (
|
|
533
|
+
else if (ie(e))
|
|
534
534
|
e._store && (e._store.validated = !0);
|
|
535
535
|
else if (e) {
|
|
536
|
-
var u =
|
|
536
|
+
var u = k(e);
|
|
537
537
|
if (typeof u == "function" && u !== e.entries)
|
|
538
|
-
for (var c = u.call(e),
|
|
539
|
-
|
|
538
|
+
for (var c = u.call(e), o; !(o = c.next()).done; )
|
|
539
|
+
ie(o.value) && je(o.value, r);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -548,21 +548,21 @@ Check the top-level render call using <` + t + ">.");
|
|
|
548
548
|
var t;
|
|
549
549
|
if (typeof r == "function")
|
|
550
550
|
t = r.propTypes;
|
|
551
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
551
|
+
else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
|
|
552
552
|
// Inner props are checked in the reconciler.
|
|
553
|
-
r.$$typeof ===
|
|
553
|
+
r.$$typeof === x))
|
|
554
554
|
t = r.propTypes;
|
|
555
555
|
else
|
|
556
556
|
return;
|
|
557
557
|
if (t) {
|
|
558
|
-
var n =
|
|
558
|
+
var n = j(r);
|
|
559
559
|
Ke(t, e.props, "prop", n, e);
|
|
560
|
-
} else if (r.PropTypes !== void 0 && !
|
|
561
|
-
|
|
562
|
-
var u =
|
|
563
|
-
|
|
560
|
+
} else if (r.PropTypes !== void 0 && !oe) {
|
|
561
|
+
oe = !0;
|
|
562
|
+
var u = j(r);
|
|
563
|
+
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
564
564
|
}
|
|
565
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
565
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
function sr(e) {
|
|
@@ -570,151 +570,173 @@ Check the top-level render call using <` + t + ">.");
|
|
|
570
570
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
571
571
|
var n = r[t];
|
|
572
572
|
if (n !== "children" && n !== "key") {
|
|
573
|
-
|
|
573
|
+
$(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), $(null);
|
|
574
574
|
break;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
e.ref !== null && (
|
|
577
|
+
e.ref !== null && ($(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
var
|
|
581
|
-
function
|
|
580
|
+
var De = {};
|
|
581
|
+
function Ae(e, r, t, n, u, c) {
|
|
582
582
|
{
|
|
583
|
-
var
|
|
584
|
-
if (!
|
|
583
|
+
var o = Ve(e);
|
|
584
|
+
if (!o) {
|
|
585
585
|
var a = "";
|
|
586
586
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
587
|
-
var
|
|
588
|
-
|
|
589
|
-
var
|
|
590
|
-
e === null ?
|
|
587
|
+
var h = or();
|
|
588
|
+
h ? a += h : a += we();
|
|
589
|
+
var l;
|
|
590
|
+
e === null ? l = "null" : te(e) ? l = "array" : e !== void 0 && e.$$typeof === E ? (l = "<" + (j(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
591
591
|
}
|
|
592
|
-
var
|
|
593
|
-
if (
|
|
594
|
-
return
|
|
595
|
-
if (
|
|
596
|
-
var
|
|
597
|
-
if (
|
|
592
|
+
var d = ar(e, r, t, u, c);
|
|
593
|
+
if (d == null)
|
|
594
|
+
return d;
|
|
595
|
+
if (o) {
|
|
596
|
+
var S = r.children;
|
|
597
|
+
if (S !== void 0)
|
|
598
598
|
if (n)
|
|
599
|
-
if (
|
|
600
|
-
for (var
|
|
601
|
-
|
|
602
|
-
Object.freeze && Object.freeze(
|
|
599
|
+
if (te(S)) {
|
|
600
|
+
for (var W = 0; W < S.length; W++)
|
|
601
|
+
ke(S[W], e);
|
|
602
|
+
Object.freeze && Object.freeze(S);
|
|
603
603
|
} else
|
|
604
|
-
|
|
604
|
+
f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
605
605
|
else
|
|
606
|
-
|
|
606
|
+
ke(S, e);
|
|
607
607
|
}
|
|
608
|
-
if (
|
|
609
|
-
var
|
|
608
|
+
if (M.call(r, "key")) {
|
|
609
|
+
var F = j(e), _ = Object.keys(r).filter(function(pr) {
|
|
610
610
|
return pr !== "key";
|
|
611
|
-
}),
|
|
612
|
-
if (!
|
|
613
|
-
var vr =
|
|
614
|
-
|
|
611
|
+
}), ue = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
612
|
+
if (!De[F + ue]) {
|
|
613
|
+
var vr = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}";
|
|
614
|
+
f(`A props object containing a "key" prop is being spread into JSX:
|
|
615
615
|
let props = %s;
|
|
616
616
|
<%s {...props} />
|
|
617
617
|
React keys must be passed directly to JSX without using spread:
|
|
618
618
|
let props = %s;
|
|
619
|
-
<%s key={someKey} {...props} />`,
|
|
619
|
+
<%s key={someKey} {...props} />`, ue, F, vr, F), De[F + ue] = !0;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
return e ===
|
|
622
|
+
return e === g ? sr(d) : ur(d), d;
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
function cr(e, r, t) {
|
|
626
|
-
return
|
|
626
|
+
return Ae(e, r, t, !0);
|
|
627
627
|
}
|
|
628
628
|
function fr(e, r, t) {
|
|
629
|
-
return
|
|
629
|
+
return Ae(e, r, t, !1);
|
|
630
630
|
}
|
|
631
631
|
var lr = fr, dr = cr;
|
|
632
|
-
|
|
633
|
-
}()),
|
|
632
|
+
B.Fragment = g, B.jsx = lr, B.jsxs = dr;
|
|
633
|
+
}()), B;
|
|
634
634
|
}
|
|
635
|
-
process.env.NODE_ENV === "production" ?
|
|
636
|
-
var Tr =
|
|
637
|
-
function Pr(
|
|
638
|
-
|
|
639
|
-
|
|
635
|
+
process.env.NODE_ENV === "production" ? ce.exports = Er() : ce.exports = _r();
|
|
636
|
+
var Tr = ce.exports;
|
|
637
|
+
function Pr(v) {
|
|
638
|
+
We(() => {
|
|
639
|
+
v();
|
|
640
640
|
}, []);
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
|
|
642
|
+
function Sr(v) {
|
|
643
|
+
We(() => v, []);
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function Ar(v) {
|
|
646
646
|
if (typeof Proxy > "u") throw new Error("Proxy is not supported in this environment.");
|
|
647
|
-
const
|
|
647
|
+
const E = br(
|
|
648
648
|
void 0
|
|
649
649
|
);
|
|
650
|
-
return
|
|
650
|
+
return E.name = v, E;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
652
|
+
function xr(v) {
|
|
653
|
+
if (Array.isArray(v)) {
|
|
654
|
+
const [E, ...w] = v;
|
|
655
|
+
return (g, T, m) => {
|
|
656
|
+
if (g !== E) return !1;
|
|
657
|
+
let p = T, i = m;
|
|
658
|
+
for (const s of w)
|
|
659
|
+
p = p == null ? void 0 : p[s], i = i == null ? void 0 : i[s];
|
|
660
|
+
return p !== i;
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
return v;
|
|
664
|
+
}
|
|
665
|
+
function Fr(v) {
|
|
666
|
+
return hr(
|
|
667
|
+
({
|
|
668
|
+
children: E,
|
|
669
|
+
value: w,
|
|
670
|
+
onChangeProp: g,
|
|
671
|
+
onChangeReinit: T,
|
|
672
|
+
proxyRef: m
|
|
673
|
+
}) => {
|
|
674
|
+
const p = Z({}), i = Z(), s = Z({}), P = Ye();
|
|
675
|
+
yr(m, () => i.current, [i.current]);
|
|
676
|
+
const b = se((R, D, C) => {
|
|
677
|
+
const k = Rr();
|
|
678
|
+
return p.current[k] = {
|
|
679
|
+
id: k,
|
|
680
|
+
deps: C,
|
|
681
|
+
propCallback: R,
|
|
682
|
+
reinitCallback: D
|
|
683
|
+
}, k;
|
|
684
|
+
}, []), x = se((R) => {
|
|
685
|
+
delete p.current[R];
|
|
686
|
+
}, []), O = se((R) => {
|
|
687
|
+
if (R !== i.current) {
|
|
688
|
+
const D = i.current;
|
|
689
|
+
R !== null ? i.current = new Proxy(R, {
|
|
690
|
+
get: function(C, k) {
|
|
691
|
+
const y = Reflect.get(C, k, R);
|
|
692
|
+
return Y(y) ? y.bind(i.current) : y;
|
|
693
|
+
},
|
|
694
|
+
set: function(C, k, y) {
|
|
695
|
+
const f = k, I = C[f];
|
|
696
|
+
return Reflect.set(C, f, y, R), y = C[f], Object.values(p.current).forEach((J) => {
|
|
697
|
+
var q;
|
|
698
|
+
const L = (q = J.deps) == null ? void 0 : q.map(xr);
|
|
699
|
+
(!L || L.includes(f) && I !== y || L.some(
|
|
700
|
+
(K) => Y(K) && K(f, y, I, R)
|
|
701
|
+
)) && J.propCallback(f, y, I);
|
|
702
|
+
}), Y(g) && g(f, y, I), !0;
|
|
703
|
+
}
|
|
704
|
+
}) : i.current = R, Object.values(p.current).forEach((C) => {
|
|
705
|
+
C.reinitCallback(i.current, D);
|
|
706
|
+
}), Y(T) && T(i.current, D), P();
|
|
707
|
+
}
|
|
708
|
+
return s.current.obj = i.current, i.current;
|
|
709
|
+
}, [g, T]);
|
|
710
|
+
return i.current === void 0 && (i.current = O(w)), s.current.obj = i.current, s.current.set = O, s.current.subscribe = b, s.current.unsubscribe = x, /* @__PURE__ */ Tr.jsx(v.Provider, { value: s.current, children: E });
|
|
711
|
+
},
|
|
712
|
+
["children", "onChangeProp", "onChangeReinit", "proxyRef"],
|
|
713
|
+
v.name + ".Provider"
|
|
714
|
+
);
|
|
694
715
|
}
|
|
695
|
-
function
|
|
696
|
-
const
|
|
697
|
-
if (
|
|
698
|
-
throw new Error(`No ${
|
|
716
|
+
function Ir(v, E = [], w, g, T = !0) {
|
|
717
|
+
const m = mr(v), p = Ye(), i = Z(null);
|
|
718
|
+
if (m === void 0)
|
|
719
|
+
throw new Error(`No ${v.name} provider found.`);
|
|
699
720
|
return Pr(() => {
|
|
700
|
-
|
|
701
|
-
(
|
|
702
|
-
|
|
721
|
+
i.current = m == null ? void 0 : m.subscribe(
|
|
722
|
+
(s, P, b) => {
|
|
723
|
+
p(), Y(w) && w(s, P, b);
|
|
703
724
|
},
|
|
704
|
-
(
|
|
705
|
-
|
|
725
|
+
(s, P) => {
|
|
726
|
+
T && p(), Y(g) && g(s, P);
|
|
706
727
|
},
|
|
707
|
-
|
|
728
|
+
E
|
|
708
729
|
);
|
|
709
|
-
}),
|
|
710
|
-
|
|
730
|
+
}), Sr(() => {
|
|
731
|
+
m.unsubscribe(i.current);
|
|
711
732
|
}), new gr(
|
|
712
|
-
{ value:
|
|
733
|
+
{ value: m.obj, set: m.set },
|
|
713
734
|
["value", "set"]
|
|
714
735
|
);
|
|
715
736
|
}
|
|
716
737
|
export {
|
|
717
|
-
|
|
738
|
+
Ar as createProxyContext,
|
|
718
739
|
Fr as createProxyContextProvider,
|
|
719
|
-
|
|
740
|
+
xr as evaluateDependency,
|
|
741
|
+
Ir as useProxyContext
|
|
720
742
|
};
|