@edgepdf/viewer-react 0.0.11 → 0.0.13
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/{styles.css → index.css} +609 -720
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3312 -331
- package/dist/lib/use-markers.d.ts +2 -2
- package/package.json +3 -21
package/dist/index.js
CHANGED
|
@@ -1,43 +1,3181 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
|
|
28
|
+
var require_react_production_min = __commonJS({
|
|
29
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js"(exports) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var l = Symbol.for("react.element");
|
|
32
|
+
var n = Symbol.for("react.portal");
|
|
33
|
+
var p = Symbol.for("react.fragment");
|
|
34
|
+
var q = Symbol.for("react.strict_mode");
|
|
35
|
+
var r = Symbol.for("react.profiler");
|
|
36
|
+
var t = Symbol.for("react.provider");
|
|
37
|
+
var u = Symbol.for("react.context");
|
|
38
|
+
var v = Symbol.for("react.forward_ref");
|
|
39
|
+
var w = Symbol.for("react.suspense");
|
|
40
|
+
var x = Symbol.for("react.memo");
|
|
41
|
+
var y = Symbol.for("react.lazy");
|
|
42
|
+
var z = Symbol.iterator;
|
|
43
|
+
function A(a) {
|
|
44
|
+
if (null === a || "object" !== typeof a)
|
|
45
|
+
return null;
|
|
46
|
+
a = z && a[z] || a["@@iterator"];
|
|
47
|
+
return "function" === typeof a ? a : null;
|
|
48
|
+
}
|
|
49
|
+
var B = { isMounted: function() {
|
|
50
|
+
return false;
|
|
51
|
+
}, enqueueForceUpdate: function() {
|
|
52
|
+
}, enqueueReplaceState: function() {
|
|
53
|
+
}, enqueueSetState: function() {
|
|
54
|
+
} };
|
|
55
|
+
var C = Object.assign;
|
|
56
|
+
var D = {};
|
|
57
|
+
function E(a, b, e) {
|
|
58
|
+
this.props = a;
|
|
59
|
+
this.context = b;
|
|
60
|
+
this.refs = D;
|
|
61
|
+
this.updater = e || B;
|
|
62
|
+
}
|
|
63
|
+
E.prototype.isReactComponent = {};
|
|
64
|
+
E.prototype.setState = function(a, b) {
|
|
65
|
+
if ("object" !== typeof a && "function" !== typeof a && null != a)
|
|
66
|
+
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
67
|
+
this.updater.enqueueSetState(this, a, b, "setState");
|
|
68
|
+
};
|
|
69
|
+
E.prototype.forceUpdate = function(a) {
|
|
70
|
+
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
71
|
+
};
|
|
72
|
+
function F() {
|
|
73
|
+
}
|
|
74
|
+
F.prototype = E.prototype;
|
|
75
|
+
function G(a, b, e) {
|
|
76
|
+
this.props = a;
|
|
77
|
+
this.context = b;
|
|
78
|
+
this.refs = D;
|
|
79
|
+
this.updater = e || B;
|
|
80
|
+
}
|
|
81
|
+
var H = G.prototype = new F();
|
|
82
|
+
H.constructor = G;
|
|
83
|
+
C(H, E.prototype);
|
|
84
|
+
H.isPureReactComponent = true;
|
|
85
|
+
var I = Array.isArray;
|
|
86
|
+
var J = Object.prototype.hasOwnProperty;
|
|
87
|
+
var K = { current: null };
|
|
88
|
+
var L2 = { key: true, ref: true, __self: true, __source: true };
|
|
89
|
+
function M(a, b, e) {
|
|
90
|
+
var d, c = {}, k = null, h = null;
|
|
91
|
+
if (null != b)
|
|
92
|
+
for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b)
|
|
93
|
+
J.call(b, d) && !L2.hasOwnProperty(d) && (c[d] = b[d]);
|
|
94
|
+
var g = arguments.length - 2;
|
|
95
|
+
if (1 === g)
|
|
96
|
+
c.children = e;
|
|
97
|
+
else if (1 < g) {
|
|
98
|
+
for (var f = Array(g), m = 0; m < g; m++)
|
|
99
|
+
f[m] = arguments[m + 2];
|
|
100
|
+
c.children = f;
|
|
101
|
+
}
|
|
102
|
+
if (a && a.defaultProps)
|
|
103
|
+
for (d in g = a.defaultProps, g)
|
|
104
|
+
void 0 === c[d] && (c[d] = g[d]);
|
|
105
|
+
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
106
|
+
}
|
|
107
|
+
function N(a, b) {
|
|
108
|
+
return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner };
|
|
109
|
+
}
|
|
110
|
+
function O(a) {
|
|
111
|
+
return "object" === typeof a && null !== a && a.$$typeof === l;
|
|
112
|
+
}
|
|
113
|
+
function escape(a) {
|
|
114
|
+
var b = { "=": "=0", ":": "=2" };
|
|
115
|
+
return "$" + a.replace(/[=:]/g, function(a2) {
|
|
116
|
+
return b[a2];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
var P = /\/+/g;
|
|
120
|
+
function Q(a, b) {
|
|
121
|
+
return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
|
|
122
|
+
}
|
|
123
|
+
function R(a, b, e, d, c) {
|
|
124
|
+
var k = typeof a;
|
|
125
|
+
if ("undefined" === k || "boolean" === k)
|
|
126
|
+
a = null;
|
|
127
|
+
var h = false;
|
|
128
|
+
if (null === a)
|
|
129
|
+
h = true;
|
|
130
|
+
else
|
|
131
|
+
switch (k) {
|
|
132
|
+
case "string":
|
|
133
|
+
case "number":
|
|
134
|
+
h = true;
|
|
135
|
+
break;
|
|
136
|
+
case "object":
|
|
137
|
+
switch (a.$$typeof) {
|
|
138
|
+
case l:
|
|
139
|
+
case n:
|
|
140
|
+
h = true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (h)
|
|
144
|
+
return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a2) {
|
|
145
|
+
return a2;
|
|
146
|
+
})) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
|
|
147
|
+
h = 0;
|
|
148
|
+
d = "" === d ? "." : d + ":";
|
|
149
|
+
if (I(a))
|
|
150
|
+
for (var g = 0; g < a.length; g++) {
|
|
151
|
+
k = a[g];
|
|
152
|
+
var f = d + Q(k, g);
|
|
153
|
+
h += R(k, b, e, f, c);
|
|
154
|
+
}
|
|
155
|
+
else if (f = A(a), "function" === typeof f)
|
|
156
|
+
for (a = f.call(a), g = 0; !(k = a.next()).done; )
|
|
157
|
+
k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
|
|
158
|
+
else if ("object" === k)
|
|
159
|
+
throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
|
|
160
|
+
return h;
|
|
161
|
+
}
|
|
162
|
+
function S(a, b, e) {
|
|
163
|
+
if (null == a)
|
|
164
|
+
return a;
|
|
165
|
+
var d = [], c = 0;
|
|
166
|
+
R(a, d, "", "", function(a2) {
|
|
167
|
+
return b.call(e, a2, c++);
|
|
168
|
+
});
|
|
169
|
+
return d;
|
|
170
|
+
}
|
|
171
|
+
function T(a) {
|
|
172
|
+
if (-1 === a._status) {
|
|
173
|
+
var b = a._result;
|
|
174
|
+
b = b();
|
|
175
|
+
b.then(function(b2) {
|
|
176
|
+
if (0 === a._status || -1 === a._status)
|
|
177
|
+
a._status = 1, a._result = b2;
|
|
178
|
+
}, function(b2) {
|
|
179
|
+
if (0 === a._status || -1 === a._status)
|
|
180
|
+
a._status = 2, a._result = b2;
|
|
181
|
+
});
|
|
182
|
+
-1 === a._status && (a._status = 0, a._result = b);
|
|
183
|
+
}
|
|
184
|
+
if (1 === a._status)
|
|
185
|
+
return a._result.default;
|
|
186
|
+
throw a._result;
|
|
187
|
+
}
|
|
188
|
+
var U = { current: null };
|
|
189
|
+
var V = { transition: null };
|
|
190
|
+
var W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
|
|
191
|
+
function X() {
|
|
192
|
+
throw Error("act(...) is not supported in production builds of React.");
|
|
193
|
+
}
|
|
194
|
+
exports.Children = { map: S, forEach: function(a, b, e) {
|
|
195
|
+
S(a, function() {
|
|
196
|
+
b.apply(this, arguments);
|
|
197
|
+
}, e);
|
|
198
|
+
}, count: function(a) {
|
|
199
|
+
var b = 0;
|
|
200
|
+
S(a, function() {
|
|
201
|
+
b++;
|
|
202
|
+
});
|
|
203
|
+
return b;
|
|
204
|
+
}, toArray: function(a) {
|
|
205
|
+
return S(a, function(a2) {
|
|
206
|
+
return a2;
|
|
207
|
+
}) || [];
|
|
208
|
+
}, only: function(a) {
|
|
209
|
+
if (!O(a))
|
|
210
|
+
throw Error("React.Children.only expected to receive a single React element child.");
|
|
211
|
+
return a;
|
|
212
|
+
} };
|
|
213
|
+
exports.Component = E;
|
|
214
|
+
exports.Fragment = p;
|
|
215
|
+
exports.Profiler = r;
|
|
216
|
+
exports.PureComponent = G;
|
|
217
|
+
exports.StrictMode = q;
|
|
218
|
+
exports.Suspense = w;
|
|
219
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
220
|
+
exports.act = X;
|
|
221
|
+
exports.cloneElement = function(a, b, e) {
|
|
222
|
+
if (null === a || void 0 === a)
|
|
223
|
+
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
224
|
+
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
225
|
+
if (null != b) {
|
|
226
|
+
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
227
|
+
void 0 !== b.key && (c = "" + b.key);
|
|
228
|
+
if (a.type && a.type.defaultProps)
|
|
229
|
+
var g = a.type.defaultProps;
|
|
230
|
+
for (f in b)
|
|
231
|
+
J.call(b, f) && !L2.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
232
|
+
}
|
|
233
|
+
var f = arguments.length - 2;
|
|
234
|
+
if (1 === f)
|
|
235
|
+
d.children = e;
|
|
236
|
+
else if (1 < f) {
|
|
237
|
+
g = Array(f);
|
|
238
|
+
for (var m = 0; m < f; m++)
|
|
239
|
+
g[m] = arguments[m + 2];
|
|
240
|
+
d.children = g;
|
|
241
|
+
}
|
|
242
|
+
return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h };
|
|
243
|
+
};
|
|
244
|
+
exports.createContext = function(a) {
|
|
245
|
+
a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
|
|
246
|
+
a.Provider = { $$typeof: t, _context: a };
|
|
247
|
+
return a.Consumer = a;
|
|
248
|
+
};
|
|
249
|
+
exports.createElement = M;
|
|
250
|
+
exports.createFactory = function(a) {
|
|
251
|
+
var b = M.bind(null, a);
|
|
252
|
+
b.type = a;
|
|
253
|
+
return b;
|
|
254
|
+
};
|
|
255
|
+
exports.createRef = function() {
|
|
256
|
+
return { current: null };
|
|
257
|
+
};
|
|
258
|
+
exports.forwardRef = function(a) {
|
|
259
|
+
return { $$typeof: v, render: a };
|
|
260
|
+
};
|
|
261
|
+
exports.isValidElement = O;
|
|
262
|
+
exports.lazy = function(a) {
|
|
263
|
+
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
264
|
+
};
|
|
265
|
+
exports.memo = function(a, b) {
|
|
266
|
+
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
267
|
+
};
|
|
268
|
+
exports.startTransition = function(a) {
|
|
269
|
+
var b = V.transition;
|
|
270
|
+
V.transition = {};
|
|
271
|
+
try {
|
|
272
|
+
a();
|
|
273
|
+
} finally {
|
|
274
|
+
V.transition = b;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
exports.unstable_act = X;
|
|
278
|
+
exports.useCallback = function(a, b) {
|
|
279
|
+
return U.current.useCallback(a, b);
|
|
280
|
+
};
|
|
281
|
+
exports.useContext = function(a) {
|
|
282
|
+
return U.current.useContext(a);
|
|
283
|
+
};
|
|
284
|
+
exports.useDebugValue = function() {
|
|
285
|
+
};
|
|
286
|
+
exports.useDeferredValue = function(a) {
|
|
287
|
+
return U.current.useDeferredValue(a);
|
|
288
|
+
};
|
|
289
|
+
exports.useEffect = function(a, b) {
|
|
290
|
+
return U.current.useEffect(a, b);
|
|
291
|
+
};
|
|
292
|
+
exports.useId = function() {
|
|
293
|
+
return U.current.useId();
|
|
294
|
+
};
|
|
295
|
+
exports.useImperativeHandle = function(a, b, e) {
|
|
296
|
+
return U.current.useImperativeHandle(a, b, e);
|
|
297
|
+
};
|
|
298
|
+
exports.useInsertionEffect = function(a, b) {
|
|
299
|
+
return U.current.useInsertionEffect(a, b);
|
|
300
|
+
};
|
|
301
|
+
exports.useLayoutEffect = function(a, b) {
|
|
302
|
+
return U.current.useLayoutEffect(a, b);
|
|
303
|
+
};
|
|
304
|
+
exports.useMemo = function(a, b) {
|
|
305
|
+
return U.current.useMemo(a, b);
|
|
306
|
+
};
|
|
307
|
+
exports.useReducer = function(a, b, e) {
|
|
308
|
+
return U.current.useReducer(a, b, e);
|
|
309
|
+
};
|
|
310
|
+
exports.useRef = function(a) {
|
|
311
|
+
return U.current.useRef(a);
|
|
312
|
+
};
|
|
313
|
+
exports.useState = function(a) {
|
|
314
|
+
return U.current.useState(a);
|
|
315
|
+
};
|
|
316
|
+
exports.useSyncExternalStore = function(a, b, e) {
|
|
317
|
+
return U.current.useSyncExternalStore(a, b, e);
|
|
318
|
+
};
|
|
319
|
+
exports.useTransition = function() {
|
|
320
|
+
return U.current.useTransition();
|
|
321
|
+
};
|
|
322
|
+
exports.version = "18.3.1";
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js
|
|
327
|
+
var require_react_development = __commonJS({
|
|
328
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
329
|
+
"use strict";
|
|
330
|
+
if (process.env.NODE_ENV !== "production") {
|
|
331
|
+
(function() {
|
|
332
|
+
"use strict";
|
|
333
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
334
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
335
|
+
}
|
|
336
|
+
var ReactVersion = "18.3.1";
|
|
337
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
338
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
339
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
340
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
341
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
342
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
343
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
344
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
345
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
346
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
347
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
348
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
349
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
350
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
351
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
352
|
+
function getIteratorFn(maybeIterable) {
|
|
353
|
+
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
357
|
+
if (typeof maybeIterator === "function") {
|
|
358
|
+
return maybeIterator;
|
|
359
|
+
}
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
var ReactCurrentDispatcher = {
|
|
363
|
+
/**
|
|
364
|
+
* @internal
|
|
365
|
+
* @type {ReactComponent}
|
|
366
|
+
*/
|
|
367
|
+
current: null
|
|
368
|
+
};
|
|
369
|
+
var ReactCurrentBatchConfig = {
|
|
370
|
+
transition: null
|
|
371
|
+
};
|
|
372
|
+
var ReactCurrentActQueue = {
|
|
373
|
+
current: null,
|
|
374
|
+
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
375
|
+
isBatchingLegacy: false,
|
|
376
|
+
didScheduleLegacyUpdate: false
|
|
377
|
+
};
|
|
378
|
+
var ReactCurrentOwner = {
|
|
379
|
+
/**
|
|
380
|
+
* @internal
|
|
381
|
+
* @type {ReactComponent}
|
|
382
|
+
*/
|
|
383
|
+
current: null
|
|
384
|
+
};
|
|
385
|
+
var ReactDebugCurrentFrame = {};
|
|
386
|
+
var currentExtraStackFrame = null;
|
|
387
|
+
function setExtraStackFrame(stack) {
|
|
388
|
+
{
|
|
389
|
+
currentExtraStackFrame = stack;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
{
|
|
393
|
+
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
394
|
+
{
|
|
395
|
+
currentExtraStackFrame = stack;
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
399
|
+
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
400
|
+
var stack = "";
|
|
401
|
+
if (currentExtraStackFrame) {
|
|
402
|
+
stack += currentExtraStackFrame;
|
|
403
|
+
}
|
|
404
|
+
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
405
|
+
if (impl) {
|
|
406
|
+
stack += impl() || "";
|
|
407
|
+
}
|
|
408
|
+
return stack;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
var enableScopeAPI = false;
|
|
412
|
+
var enableCacheElement = false;
|
|
413
|
+
var enableTransitionTracing = false;
|
|
414
|
+
var enableLegacyHidden = false;
|
|
415
|
+
var enableDebugTracing = false;
|
|
416
|
+
var ReactSharedInternals = {
|
|
417
|
+
ReactCurrentDispatcher,
|
|
418
|
+
ReactCurrentBatchConfig,
|
|
419
|
+
ReactCurrentOwner
|
|
420
|
+
};
|
|
421
|
+
{
|
|
422
|
+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
423
|
+
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
424
|
+
}
|
|
425
|
+
function warn(format) {
|
|
426
|
+
{
|
|
427
|
+
{
|
|
428
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
429
|
+
args[_key - 1] = arguments[_key];
|
|
430
|
+
}
|
|
431
|
+
printWarning("warn", format, args);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function error46(format) {
|
|
436
|
+
{
|
|
437
|
+
{
|
|
438
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
439
|
+
args[_key2 - 1] = arguments[_key2];
|
|
440
|
+
}
|
|
441
|
+
printWarning("error", format, args);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function printWarning(level, format, args) {
|
|
446
|
+
{
|
|
447
|
+
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
448
|
+
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
449
|
+
if (stack !== "") {
|
|
450
|
+
format += "%s";
|
|
451
|
+
args = args.concat([stack]);
|
|
452
|
+
}
|
|
453
|
+
var argsWithFormat = args.map(function(item) {
|
|
454
|
+
return String(item);
|
|
455
|
+
});
|
|
456
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
457
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
var didWarnStateUpdateForUnmountedComponent = {};
|
|
461
|
+
function warnNoop(publicInstance, callerName) {
|
|
462
|
+
{
|
|
463
|
+
var _constructor = publicInstance.constructor;
|
|
464
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
|
|
465
|
+
var warningKey = componentName + "." + callerName;
|
|
466
|
+
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
error46("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
|
|
470
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
var ReactNoopUpdateQueue = {
|
|
474
|
+
/**
|
|
475
|
+
* Checks whether or not this composite component is mounted.
|
|
476
|
+
* @param {ReactClass} publicInstance The instance we want to test.
|
|
477
|
+
* @return {boolean} True if mounted, false otherwise.
|
|
478
|
+
* @protected
|
|
479
|
+
* @final
|
|
480
|
+
*/
|
|
481
|
+
isMounted: function(publicInstance) {
|
|
482
|
+
return false;
|
|
483
|
+
},
|
|
484
|
+
/**
|
|
485
|
+
* Forces an update. This should only be invoked when it is known with
|
|
486
|
+
* certainty that we are **not** in a DOM transaction.
|
|
487
|
+
*
|
|
488
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
489
|
+
* component's state has changed but `setState` was not called.
|
|
490
|
+
*
|
|
491
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
492
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
493
|
+
*
|
|
494
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
495
|
+
* @param {?function} callback Called after component is updated.
|
|
496
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
497
|
+
* @internal
|
|
498
|
+
*/
|
|
499
|
+
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
500
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
501
|
+
},
|
|
502
|
+
/**
|
|
503
|
+
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
504
|
+
* You should treat `this.state` as immutable.
|
|
505
|
+
*
|
|
506
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
507
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
508
|
+
*
|
|
509
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
510
|
+
* @param {object} completeState Next state.
|
|
511
|
+
* @param {?function} callback Called after component is updated.
|
|
512
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
513
|
+
* @internal
|
|
514
|
+
*/
|
|
515
|
+
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
516
|
+
warnNoop(publicInstance, "replaceState");
|
|
517
|
+
},
|
|
518
|
+
/**
|
|
519
|
+
* Sets a subset of the state. This only exists because _pendingState is
|
|
520
|
+
* internal. This provides a merging strategy that is not available to deep
|
|
521
|
+
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
522
|
+
* during the merge.
|
|
523
|
+
*
|
|
524
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
525
|
+
* @param {object} partialState Next partial state to be merged with state.
|
|
526
|
+
* @param {?function} callback Called after component is updated.
|
|
527
|
+
* @param {?string} Name of the calling function in the public API.
|
|
528
|
+
* @internal
|
|
529
|
+
*/
|
|
530
|
+
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
531
|
+
warnNoop(publicInstance, "setState");
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
var assign = Object.assign;
|
|
535
|
+
var emptyObject = {};
|
|
536
|
+
{
|
|
537
|
+
Object.freeze(emptyObject);
|
|
538
|
+
}
|
|
539
|
+
function Component(props, context, updater) {
|
|
540
|
+
this.props = props;
|
|
541
|
+
this.context = context;
|
|
542
|
+
this.refs = emptyObject;
|
|
543
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
544
|
+
}
|
|
545
|
+
Component.prototype.isReactComponent = {};
|
|
546
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
547
|
+
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
|
|
548
|
+
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
549
|
+
}
|
|
550
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
551
|
+
};
|
|
552
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
553
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
554
|
+
};
|
|
555
|
+
{
|
|
556
|
+
var deprecatedAPIs = {
|
|
557
|
+
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
|
558
|
+
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
|
559
|
+
};
|
|
560
|
+
var defineDeprecationWarning = function(methodName, info) {
|
|
561
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
562
|
+
get: function() {
|
|
563
|
+
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
564
|
+
return void 0;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
for (var fnName in deprecatedAPIs) {
|
|
569
|
+
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
570
|
+
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function ComponentDummy() {
|
|
575
|
+
}
|
|
576
|
+
ComponentDummy.prototype = Component.prototype;
|
|
577
|
+
function PureComponent(props, context, updater) {
|
|
578
|
+
this.props = props;
|
|
579
|
+
this.context = context;
|
|
580
|
+
this.refs = emptyObject;
|
|
581
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
582
|
+
}
|
|
583
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
584
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
585
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
586
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
587
|
+
function createRef() {
|
|
588
|
+
var refObject = {
|
|
589
|
+
current: null
|
|
590
|
+
};
|
|
591
|
+
{
|
|
592
|
+
Object.seal(refObject);
|
|
593
|
+
}
|
|
594
|
+
return refObject;
|
|
595
|
+
}
|
|
596
|
+
var isArrayImpl = Array.isArray;
|
|
597
|
+
function isArray(a) {
|
|
598
|
+
return isArrayImpl(a);
|
|
599
|
+
}
|
|
600
|
+
function typeName(value) {
|
|
601
|
+
{
|
|
602
|
+
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
603
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
604
|
+
return type;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function willCoercionThrow(value) {
|
|
608
|
+
{
|
|
609
|
+
try {
|
|
610
|
+
testStringCoercion(value);
|
|
611
|
+
return false;
|
|
612
|
+
} catch (e) {
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function testStringCoercion(value) {
|
|
618
|
+
return "" + value;
|
|
619
|
+
}
|
|
620
|
+
function checkKeyStringCoercion(value) {
|
|
621
|
+
{
|
|
622
|
+
if (willCoercionThrow(value)) {
|
|
623
|
+
error46("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
624
|
+
return testStringCoercion(value);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
629
|
+
var displayName = outerType.displayName;
|
|
630
|
+
if (displayName) {
|
|
631
|
+
return displayName;
|
|
632
|
+
}
|
|
633
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
634
|
+
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
635
|
+
}
|
|
636
|
+
function getContextName(type) {
|
|
637
|
+
return type.displayName || "Context";
|
|
638
|
+
}
|
|
639
|
+
function getComponentNameFromType(type) {
|
|
640
|
+
if (type == null) {
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
{
|
|
644
|
+
if (typeof type.tag === "number") {
|
|
645
|
+
error46("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if (typeof type === "function") {
|
|
649
|
+
return type.displayName || type.name || null;
|
|
650
|
+
}
|
|
651
|
+
if (typeof type === "string") {
|
|
652
|
+
return type;
|
|
653
|
+
}
|
|
654
|
+
switch (type) {
|
|
655
|
+
case REACT_FRAGMENT_TYPE:
|
|
656
|
+
return "Fragment";
|
|
657
|
+
case REACT_PORTAL_TYPE:
|
|
658
|
+
return "Portal";
|
|
659
|
+
case REACT_PROFILER_TYPE:
|
|
660
|
+
return "Profiler";
|
|
661
|
+
case REACT_STRICT_MODE_TYPE:
|
|
662
|
+
return "StrictMode";
|
|
663
|
+
case REACT_SUSPENSE_TYPE:
|
|
664
|
+
return "Suspense";
|
|
665
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
666
|
+
return "SuspenseList";
|
|
667
|
+
}
|
|
668
|
+
if (typeof type === "object") {
|
|
669
|
+
switch (type.$$typeof) {
|
|
670
|
+
case REACT_CONTEXT_TYPE:
|
|
671
|
+
var context = type;
|
|
672
|
+
return getContextName(context) + ".Consumer";
|
|
673
|
+
case REACT_PROVIDER_TYPE:
|
|
674
|
+
var provider = type;
|
|
675
|
+
return getContextName(provider._context) + ".Provider";
|
|
676
|
+
case REACT_FORWARD_REF_TYPE:
|
|
677
|
+
return getWrappedName(type, type.render, "ForwardRef");
|
|
678
|
+
case REACT_MEMO_TYPE:
|
|
679
|
+
var outerName = type.displayName || null;
|
|
680
|
+
if (outerName !== null) {
|
|
681
|
+
return outerName;
|
|
682
|
+
}
|
|
683
|
+
return getComponentNameFromType(type.type) || "Memo";
|
|
684
|
+
case REACT_LAZY_TYPE: {
|
|
685
|
+
var lazyComponent = type;
|
|
686
|
+
var payload = lazyComponent._payload;
|
|
687
|
+
var init = lazyComponent._init;
|
|
688
|
+
try {
|
|
689
|
+
return getComponentNameFromType(init(payload));
|
|
690
|
+
} catch (x) {
|
|
691
|
+
return null;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
699
|
+
var RESERVED_PROPS = {
|
|
700
|
+
key: true,
|
|
701
|
+
ref: true,
|
|
702
|
+
__self: true,
|
|
703
|
+
__source: true
|
|
704
|
+
};
|
|
705
|
+
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
706
|
+
{
|
|
707
|
+
didWarnAboutStringRefs = {};
|
|
708
|
+
}
|
|
709
|
+
function hasValidRef(config2) {
|
|
710
|
+
{
|
|
711
|
+
if (hasOwnProperty.call(config2, "ref")) {
|
|
712
|
+
var getter = Object.getOwnPropertyDescriptor(config2, "ref").get;
|
|
713
|
+
if (getter && getter.isReactWarning) {
|
|
714
|
+
return false;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return config2.ref !== void 0;
|
|
719
|
+
}
|
|
720
|
+
function hasValidKey(config2) {
|
|
721
|
+
{
|
|
722
|
+
if (hasOwnProperty.call(config2, "key")) {
|
|
723
|
+
var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
|
|
724
|
+
if (getter && getter.isReactWarning) {
|
|
725
|
+
return false;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return config2.key !== void 0;
|
|
730
|
+
}
|
|
731
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
732
|
+
var warnAboutAccessingKey = function() {
|
|
733
|
+
{
|
|
734
|
+
if (!specialPropKeyWarningShown) {
|
|
735
|
+
specialPropKeyWarningShown = true;
|
|
736
|
+
error46("%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)", displayName);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
741
|
+
Object.defineProperty(props, "key", {
|
|
742
|
+
get: warnAboutAccessingKey,
|
|
743
|
+
configurable: true
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
747
|
+
var warnAboutAccessingRef = function() {
|
|
748
|
+
{
|
|
749
|
+
if (!specialPropRefWarningShown) {
|
|
750
|
+
specialPropRefWarningShown = true;
|
|
751
|
+
error46("%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)", displayName);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
756
|
+
Object.defineProperty(props, "ref", {
|
|
757
|
+
get: warnAboutAccessingRef,
|
|
758
|
+
configurable: true
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
function warnIfStringRefCannotBeAutoConverted(config2) {
|
|
762
|
+
{
|
|
763
|
+
if (typeof config2.ref === "string" && ReactCurrentOwner.current && config2.__self && ReactCurrentOwner.current.stateNode !== config2.__self) {
|
|
764
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
765
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
766
|
+
error46('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', componentName, config2.ref);
|
|
767
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
773
|
+
var element = {
|
|
774
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
775
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
776
|
+
// Built-in properties that belong on the element
|
|
777
|
+
type,
|
|
778
|
+
key,
|
|
779
|
+
ref,
|
|
780
|
+
props,
|
|
781
|
+
// Record the component responsible for creating this element.
|
|
782
|
+
_owner: owner
|
|
783
|
+
};
|
|
784
|
+
{
|
|
785
|
+
element._store = {};
|
|
786
|
+
Object.defineProperty(element._store, "validated", {
|
|
787
|
+
configurable: false,
|
|
788
|
+
enumerable: false,
|
|
789
|
+
writable: true,
|
|
790
|
+
value: false
|
|
791
|
+
});
|
|
792
|
+
Object.defineProperty(element, "_self", {
|
|
793
|
+
configurable: false,
|
|
794
|
+
enumerable: false,
|
|
795
|
+
writable: false,
|
|
796
|
+
value: self2
|
|
797
|
+
});
|
|
798
|
+
Object.defineProperty(element, "_source", {
|
|
799
|
+
configurable: false,
|
|
800
|
+
enumerable: false,
|
|
801
|
+
writable: false,
|
|
802
|
+
value: source
|
|
803
|
+
});
|
|
804
|
+
if (Object.freeze) {
|
|
805
|
+
Object.freeze(element.props);
|
|
806
|
+
Object.freeze(element);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return element;
|
|
810
|
+
};
|
|
811
|
+
function createElement(type, config2, children) {
|
|
812
|
+
var propName;
|
|
813
|
+
var props = {};
|
|
814
|
+
var key = null;
|
|
815
|
+
var ref = null;
|
|
816
|
+
var self2 = null;
|
|
817
|
+
var source = null;
|
|
818
|
+
if (config2 != null) {
|
|
819
|
+
if (hasValidRef(config2)) {
|
|
820
|
+
ref = config2.ref;
|
|
821
|
+
{
|
|
822
|
+
warnIfStringRefCannotBeAutoConverted(config2);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (hasValidKey(config2)) {
|
|
826
|
+
{
|
|
827
|
+
checkKeyStringCoercion(config2.key);
|
|
828
|
+
}
|
|
829
|
+
key = "" + config2.key;
|
|
830
|
+
}
|
|
831
|
+
self2 = config2.__self === void 0 ? null : config2.__self;
|
|
832
|
+
source = config2.__source === void 0 ? null : config2.__source;
|
|
833
|
+
for (propName in config2) {
|
|
834
|
+
if (hasOwnProperty.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
835
|
+
props[propName] = config2[propName];
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
var childrenLength = arguments.length - 2;
|
|
840
|
+
if (childrenLength === 1) {
|
|
841
|
+
props.children = children;
|
|
842
|
+
} else if (childrenLength > 1) {
|
|
843
|
+
var childArray = Array(childrenLength);
|
|
844
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
845
|
+
childArray[i] = arguments[i + 2];
|
|
846
|
+
}
|
|
847
|
+
{
|
|
848
|
+
if (Object.freeze) {
|
|
849
|
+
Object.freeze(childArray);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
props.children = childArray;
|
|
853
|
+
}
|
|
854
|
+
if (type && type.defaultProps) {
|
|
855
|
+
var defaultProps = type.defaultProps;
|
|
856
|
+
for (propName in defaultProps) {
|
|
857
|
+
if (props[propName] === void 0) {
|
|
858
|
+
props[propName] = defaultProps[propName];
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
{
|
|
863
|
+
if (key || ref) {
|
|
864
|
+
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
865
|
+
if (key) {
|
|
866
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
867
|
+
}
|
|
868
|
+
if (ref) {
|
|
869
|
+
defineRefPropWarningGetter(props, displayName);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
874
|
+
}
|
|
875
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
876
|
+
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
877
|
+
return newElement;
|
|
878
|
+
}
|
|
879
|
+
function cloneElement(element, config2, children) {
|
|
880
|
+
if (element === null || element === void 0) {
|
|
881
|
+
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
882
|
+
}
|
|
883
|
+
var propName;
|
|
884
|
+
var props = assign({}, element.props);
|
|
885
|
+
var key = element.key;
|
|
886
|
+
var ref = element.ref;
|
|
887
|
+
var self2 = element._self;
|
|
888
|
+
var source = element._source;
|
|
889
|
+
var owner = element._owner;
|
|
890
|
+
if (config2 != null) {
|
|
891
|
+
if (hasValidRef(config2)) {
|
|
892
|
+
ref = config2.ref;
|
|
893
|
+
owner = ReactCurrentOwner.current;
|
|
894
|
+
}
|
|
895
|
+
if (hasValidKey(config2)) {
|
|
896
|
+
{
|
|
897
|
+
checkKeyStringCoercion(config2.key);
|
|
898
|
+
}
|
|
899
|
+
key = "" + config2.key;
|
|
900
|
+
}
|
|
901
|
+
var defaultProps;
|
|
902
|
+
if (element.type && element.type.defaultProps) {
|
|
903
|
+
defaultProps = element.type.defaultProps;
|
|
904
|
+
}
|
|
905
|
+
for (propName in config2) {
|
|
906
|
+
if (hasOwnProperty.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
907
|
+
if (config2[propName] === void 0 && defaultProps !== void 0) {
|
|
908
|
+
props[propName] = defaultProps[propName];
|
|
909
|
+
} else {
|
|
910
|
+
props[propName] = config2[propName];
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
var childrenLength = arguments.length - 2;
|
|
916
|
+
if (childrenLength === 1) {
|
|
917
|
+
props.children = children;
|
|
918
|
+
} else if (childrenLength > 1) {
|
|
919
|
+
var childArray = Array(childrenLength);
|
|
920
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
921
|
+
childArray[i] = arguments[i + 2];
|
|
922
|
+
}
|
|
923
|
+
props.children = childArray;
|
|
924
|
+
}
|
|
925
|
+
return ReactElement(element.type, key, ref, self2, source, owner, props);
|
|
926
|
+
}
|
|
927
|
+
function isValidElement(object2) {
|
|
928
|
+
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
929
|
+
}
|
|
930
|
+
var SEPARATOR = ".";
|
|
931
|
+
var SUBSEPARATOR = ":";
|
|
932
|
+
function escape(key) {
|
|
933
|
+
var escapeRegex2 = /[=:]/g;
|
|
934
|
+
var escaperLookup = {
|
|
935
|
+
"=": "=0",
|
|
936
|
+
":": "=2"
|
|
937
|
+
};
|
|
938
|
+
var escapedString = key.replace(escapeRegex2, function(match) {
|
|
939
|
+
return escaperLookup[match];
|
|
940
|
+
});
|
|
941
|
+
return "$" + escapedString;
|
|
942
|
+
}
|
|
943
|
+
var didWarnAboutMaps = false;
|
|
944
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
945
|
+
function escapeUserProvidedKey(text) {
|
|
946
|
+
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
|
947
|
+
}
|
|
948
|
+
function getElementKey(element, index) {
|
|
949
|
+
if (typeof element === "object" && element !== null && element.key != null) {
|
|
950
|
+
{
|
|
951
|
+
checkKeyStringCoercion(element.key);
|
|
952
|
+
}
|
|
953
|
+
return escape("" + element.key);
|
|
954
|
+
}
|
|
955
|
+
return index.toString(36);
|
|
956
|
+
}
|
|
957
|
+
function mapIntoArray(children, array2, escapedPrefix, nameSoFar, callback) {
|
|
958
|
+
var type = typeof children;
|
|
959
|
+
if (type === "undefined" || type === "boolean") {
|
|
960
|
+
children = null;
|
|
961
|
+
}
|
|
962
|
+
var invokeCallback = false;
|
|
963
|
+
if (children === null) {
|
|
964
|
+
invokeCallback = true;
|
|
965
|
+
} else {
|
|
966
|
+
switch (type) {
|
|
967
|
+
case "string":
|
|
968
|
+
case "number":
|
|
969
|
+
invokeCallback = true;
|
|
970
|
+
break;
|
|
971
|
+
case "object":
|
|
972
|
+
switch (children.$$typeof) {
|
|
973
|
+
case REACT_ELEMENT_TYPE:
|
|
974
|
+
case REACT_PORTAL_TYPE:
|
|
975
|
+
invokeCallback = true;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
if (invokeCallback) {
|
|
980
|
+
var _child = children;
|
|
981
|
+
var mappedChild = callback(_child);
|
|
982
|
+
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
983
|
+
if (isArray(mappedChild)) {
|
|
984
|
+
var escapedChildKey = "";
|
|
985
|
+
if (childKey != null) {
|
|
986
|
+
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
987
|
+
}
|
|
988
|
+
mapIntoArray(mappedChild, array2, escapedChildKey, "", function(c) {
|
|
989
|
+
return c;
|
|
990
|
+
});
|
|
991
|
+
} else if (mappedChild != null) {
|
|
992
|
+
if (isValidElement(mappedChild)) {
|
|
993
|
+
{
|
|
994
|
+
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
995
|
+
checkKeyStringCoercion(mappedChild.key);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
mappedChild = cloneAndReplaceKey(
|
|
999
|
+
mappedChild,
|
|
1000
|
+
// Keep both the (mapped) and old keys if they differ, just as
|
|
1001
|
+
// traverseAllChildren used to do for objects as children
|
|
1002
|
+
escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1003
|
+
(mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
|
|
1004
|
+
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
1005
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1006
|
+
escapeUserProvidedKey("" + mappedChild.key) + "/"
|
|
1007
|
+
) : "") + childKey
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
array2.push(mappedChild);
|
|
1011
|
+
}
|
|
1012
|
+
return 1;
|
|
1013
|
+
}
|
|
1014
|
+
var child;
|
|
1015
|
+
var nextName;
|
|
1016
|
+
var subtreeCount = 0;
|
|
1017
|
+
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1018
|
+
if (isArray(children)) {
|
|
1019
|
+
for (var i = 0; i < children.length; i++) {
|
|
1020
|
+
child = children[i];
|
|
1021
|
+
nextName = nextNamePrefix + getElementKey(child, i);
|
|
1022
|
+
subtreeCount += mapIntoArray(child, array2, escapedPrefix, nextName, callback);
|
|
1023
|
+
}
|
|
1024
|
+
} else {
|
|
1025
|
+
var iteratorFn = getIteratorFn(children);
|
|
1026
|
+
if (typeof iteratorFn === "function") {
|
|
1027
|
+
var iterableChildren = children;
|
|
1028
|
+
{
|
|
1029
|
+
if (iteratorFn === iterableChildren.entries) {
|
|
1030
|
+
if (!didWarnAboutMaps) {
|
|
1031
|
+
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
1032
|
+
}
|
|
1033
|
+
didWarnAboutMaps = true;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
var iterator = iteratorFn.call(iterableChildren);
|
|
1037
|
+
var step;
|
|
1038
|
+
var ii = 0;
|
|
1039
|
+
while (!(step = iterator.next()).done) {
|
|
1040
|
+
child = step.value;
|
|
1041
|
+
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1042
|
+
subtreeCount += mapIntoArray(child, array2, escapedPrefix, nextName, callback);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (type === "object") {
|
|
1045
|
+
var childrenString = String(children);
|
|
1046
|
+
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return subtreeCount;
|
|
1050
|
+
}
|
|
1051
|
+
function mapChildren(children, func, context) {
|
|
1052
|
+
if (children == null) {
|
|
1053
|
+
return children;
|
|
1054
|
+
}
|
|
1055
|
+
var result = [];
|
|
1056
|
+
var count = 0;
|
|
1057
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
1058
|
+
return func.call(context, child, count++);
|
|
1059
|
+
});
|
|
1060
|
+
return result;
|
|
1061
|
+
}
|
|
1062
|
+
function countChildren(children) {
|
|
1063
|
+
var n = 0;
|
|
1064
|
+
mapChildren(children, function() {
|
|
1065
|
+
n++;
|
|
1066
|
+
});
|
|
1067
|
+
return n;
|
|
1068
|
+
}
|
|
1069
|
+
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1070
|
+
mapChildren(children, function() {
|
|
1071
|
+
forEachFunc.apply(this, arguments);
|
|
1072
|
+
}, forEachContext);
|
|
1073
|
+
}
|
|
1074
|
+
function toArray(children) {
|
|
1075
|
+
return mapChildren(children, function(child) {
|
|
1076
|
+
return child;
|
|
1077
|
+
}) || [];
|
|
1078
|
+
}
|
|
1079
|
+
function onlyChild(children) {
|
|
1080
|
+
if (!isValidElement(children)) {
|
|
1081
|
+
throw new Error("React.Children.only expected to receive a single React element child.");
|
|
1082
|
+
}
|
|
1083
|
+
return children;
|
|
1084
|
+
}
|
|
1085
|
+
function createContext2(defaultValue) {
|
|
1086
|
+
var context = {
|
|
1087
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1088
|
+
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1089
|
+
// some renderers as primary and others as secondary. We only expect
|
|
1090
|
+
// there to be two concurrent renderers at most: React Native (primary) and
|
|
1091
|
+
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
1092
|
+
// Secondary renderers store their context values on separate fields.
|
|
1093
|
+
_currentValue: defaultValue,
|
|
1094
|
+
_currentValue2: defaultValue,
|
|
1095
|
+
// Used to track how many concurrent renderers this context currently
|
|
1096
|
+
// supports within in a single renderer. Such as parallel server rendering.
|
|
1097
|
+
_threadCount: 0,
|
|
1098
|
+
// These are circular
|
|
1099
|
+
Provider: null,
|
|
1100
|
+
Consumer: null,
|
|
1101
|
+
// Add these to use same hidden class in VM as ServerContext
|
|
1102
|
+
_defaultValue: null,
|
|
1103
|
+
_globalName: null
|
|
1104
|
+
};
|
|
1105
|
+
context.Provider = {
|
|
1106
|
+
$$typeof: REACT_PROVIDER_TYPE,
|
|
1107
|
+
_context: context
|
|
1108
|
+
};
|
|
1109
|
+
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1110
|
+
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1111
|
+
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
1112
|
+
{
|
|
1113
|
+
var Consumer = {
|
|
1114
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1115
|
+
_context: context
|
|
1116
|
+
};
|
|
1117
|
+
Object.defineProperties(Consumer, {
|
|
1118
|
+
Provider: {
|
|
1119
|
+
get: function() {
|
|
1120
|
+
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1121
|
+
hasWarnedAboutUsingConsumerProvider = true;
|
|
1122
|
+
error46("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
|
|
1123
|
+
}
|
|
1124
|
+
return context.Provider;
|
|
1125
|
+
},
|
|
1126
|
+
set: function(_Provider) {
|
|
1127
|
+
context.Provider = _Provider;
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
_currentValue: {
|
|
1131
|
+
get: function() {
|
|
1132
|
+
return context._currentValue;
|
|
1133
|
+
},
|
|
1134
|
+
set: function(_currentValue) {
|
|
1135
|
+
context._currentValue = _currentValue;
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
_currentValue2: {
|
|
1139
|
+
get: function() {
|
|
1140
|
+
return context._currentValue2;
|
|
1141
|
+
},
|
|
1142
|
+
set: function(_currentValue2) {
|
|
1143
|
+
context._currentValue2 = _currentValue2;
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
_threadCount: {
|
|
1147
|
+
get: function() {
|
|
1148
|
+
return context._threadCount;
|
|
1149
|
+
},
|
|
1150
|
+
set: function(_threadCount) {
|
|
1151
|
+
context._threadCount = _threadCount;
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
Consumer: {
|
|
1155
|
+
get: function() {
|
|
1156
|
+
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1157
|
+
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1158
|
+
error46("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
1159
|
+
}
|
|
1160
|
+
return context.Consumer;
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
displayName: {
|
|
1164
|
+
get: function() {
|
|
1165
|
+
return context.displayName;
|
|
1166
|
+
},
|
|
1167
|
+
set: function(displayName) {
|
|
1168
|
+
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
1169
|
+
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
1170
|
+
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
context.Consumer = Consumer;
|
|
1176
|
+
}
|
|
1177
|
+
{
|
|
1178
|
+
context._currentRenderer = null;
|
|
1179
|
+
context._currentRenderer2 = null;
|
|
1180
|
+
}
|
|
1181
|
+
return context;
|
|
1182
|
+
}
|
|
1183
|
+
var Uninitialized = -1;
|
|
1184
|
+
var Pending = 0;
|
|
1185
|
+
var Resolved = 1;
|
|
1186
|
+
var Rejected = 2;
|
|
1187
|
+
function lazyInitializer(payload) {
|
|
1188
|
+
if (payload._status === Uninitialized) {
|
|
1189
|
+
var ctor = payload._result;
|
|
1190
|
+
var thenable = ctor();
|
|
1191
|
+
thenable.then(function(moduleObject2) {
|
|
1192
|
+
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1193
|
+
var resolved = payload;
|
|
1194
|
+
resolved._status = Resolved;
|
|
1195
|
+
resolved._result = moduleObject2;
|
|
1196
|
+
}
|
|
1197
|
+
}, function(error47) {
|
|
1198
|
+
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1199
|
+
var rejected = payload;
|
|
1200
|
+
rejected._status = Rejected;
|
|
1201
|
+
rejected._result = error47;
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
if (payload._status === Uninitialized) {
|
|
1205
|
+
var pending = payload;
|
|
1206
|
+
pending._status = Pending;
|
|
1207
|
+
pending._result = thenable;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
if (payload._status === Resolved) {
|
|
1211
|
+
var moduleObject = payload._result;
|
|
1212
|
+
{
|
|
1213
|
+
if (moduleObject === void 0) {
|
|
1214
|
+
error46("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
{
|
|
1218
|
+
if (!("default" in moduleObject)) {
|
|
1219
|
+
error46("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
return moduleObject.default;
|
|
1223
|
+
} else {
|
|
1224
|
+
throw payload._result;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
function lazy2(ctor) {
|
|
1228
|
+
var payload = {
|
|
1229
|
+
// We use these fields to store the result.
|
|
1230
|
+
_status: Uninitialized,
|
|
1231
|
+
_result: ctor
|
|
1232
|
+
};
|
|
1233
|
+
var lazyType = {
|
|
1234
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1235
|
+
_payload: payload,
|
|
1236
|
+
_init: lazyInitializer
|
|
1237
|
+
};
|
|
1238
|
+
{
|
|
1239
|
+
var defaultProps;
|
|
1240
|
+
var propTypes;
|
|
1241
|
+
Object.defineProperties(lazyType, {
|
|
1242
|
+
defaultProps: {
|
|
1243
|
+
configurable: true,
|
|
1244
|
+
get: function() {
|
|
1245
|
+
return defaultProps;
|
|
1246
|
+
},
|
|
1247
|
+
set: function(newDefaultProps) {
|
|
1248
|
+
error46("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
1249
|
+
defaultProps = newDefaultProps;
|
|
1250
|
+
Object.defineProperty(lazyType, "defaultProps", {
|
|
1251
|
+
enumerable: true
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
propTypes: {
|
|
1256
|
+
configurable: true,
|
|
1257
|
+
get: function() {
|
|
1258
|
+
return propTypes;
|
|
1259
|
+
},
|
|
1260
|
+
set: function(newPropTypes) {
|
|
1261
|
+
error46("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
1262
|
+
propTypes = newPropTypes;
|
|
1263
|
+
Object.defineProperty(lazyType, "propTypes", {
|
|
1264
|
+
enumerable: true
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
return lazyType;
|
|
1271
|
+
}
|
|
1272
|
+
function forwardRef(render) {
|
|
1273
|
+
{
|
|
1274
|
+
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1275
|
+
error46("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
1276
|
+
} else if (typeof render !== "function") {
|
|
1277
|
+
error46("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
|
1278
|
+
} else {
|
|
1279
|
+
if (render.length !== 0 && render.length !== 2) {
|
|
1280
|
+
error46("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
if (render != null) {
|
|
1284
|
+
if (render.defaultProps != null || render.propTypes != null) {
|
|
1285
|
+
error46("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
var elementType = {
|
|
1290
|
+
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1291
|
+
render
|
|
1292
|
+
};
|
|
1293
|
+
{
|
|
1294
|
+
var ownName;
|
|
1295
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1296
|
+
enumerable: false,
|
|
1297
|
+
configurable: true,
|
|
1298
|
+
get: function() {
|
|
1299
|
+
return ownName;
|
|
1300
|
+
},
|
|
1301
|
+
set: function(name) {
|
|
1302
|
+
ownName = name;
|
|
1303
|
+
if (!render.name && !render.displayName) {
|
|
1304
|
+
render.displayName = name;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
return elementType;
|
|
1310
|
+
}
|
|
1311
|
+
var REACT_MODULE_REFERENCE;
|
|
1312
|
+
{
|
|
1313
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
1314
|
+
}
|
|
1315
|
+
function isValidElementType(type) {
|
|
1316
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
1317
|
+
return true;
|
|
1318
|
+
}
|
|
1319
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
1320
|
+
return true;
|
|
1321
|
+
}
|
|
1322
|
+
if (typeof type === "object" && type !== null) {
|
|
1323
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
1324
|
+
// types supported by any Flight configuration anywhere since
|
|
1325
|
+
// we don't know which Flight build this will end up being used
|
|
1326
|
+
// with.
|
|
1327
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1328
|
+
return true;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
return false;
|
|
1332
|
+
}
|
|
1333
|
+
function memo(type, compare) {
|
|
1334
|
+
{
|
|
1335
|
+
if (!isValidElementType(type)) {
|
|
1336
|
+
error46("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
var elementType = {
|
|
1340
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1341
|
+
type,
|
|
1342
|
+
compare: compare === void 0 ? null : compare
|
|
1343
|
+
};
|
|
1344
|
+
{
|
|
1345
|
+
var ownName;
|
|
1346
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1347
|
+
enumerable: false,
|
|
1348
|
+
configurable: true,
|
|
1349
|
+
get: function() {
|
|
1350
|
+
return ownName;
|
|
1351
|
+
},
|
|
1352
|
+
set: function(name) {
|
|
1353
|
+
ownName = name;
|
|
1354
|
+
if (!type.name && !type.displayName) {
|
|
1355
|
+
type.displayName = name;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
return elementType;
|
|
1361
|
+
}
|
|
1362
|
+
function resolveDispatcher() {
|
|
1363
|
+
var dispatcher = ReactCurrentDispatcher.current;
|
|
1364
|
+
{
|
|
1365
|
+
if (dispatcher === null) {
|
|
1366
|
+
error46("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return dispatcher;
|
|
1370
|
+
}
|
|
1371
|
+
function useContext2(Context) {
|
|
1372
|
+
var dispatcher = resolveDispatcher();
|
|
1373
|
+
{
|
|
1374
|
+
if (Context._context !== void 0) {
|
|
1375
|
+
var realContext = Context._context;
|
|
1376
|
+
if (realContext.Consumer === Context) {
|
|
1377
|
+
error46("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
1378
|
+
} else if (realContext.Provider === Context) {
|
|
1379
|
+
error46("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return dispatcher.useContext(Context);
|
|
1384
|
+
}
|
|
1385
|
+
function useState4(initialState) {
|
|
1386
|
+
var dispatcher = resolveDispatcher();
|
|
1387
|
+
return dispatcher.useState(initialState);
|
|
1388
|
+
}
|
|
1389
|
+
function useReducer(reducer, initialArg, init) {
|
|
1390
|
+
var dispatcher = resolveDispatcher();
|
|
1391
|
+
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1392
|
+
}
|
|
1393
|
+
function useRef3(initialValue) {
|
|
1394
|
+
var dispatcher = resolveDispatcher();
|
|
1395
|
+
return dispatcher.useRef(initialValue);
|
|
1396
|
+
}
|
|
1397
|
+
function useEffect5(create, deps) {
|
|
1398
|
+
var dispatcher = resolveDispatcher();
|
|
1399
|
+
return dispatcher.useEffect(create, deps);
|
|
1400
|
+
}
|
|
1401
|
+
function useInsertionEffect(create, deps) {
|
|
1402
|
+
var dispatcher = resolveDispatcher();
|
|
1403
|
+
return dispatcher.useInsertionEffect(create, deps);
|
|
1404
|
+
}
|
|
1405
|
+
function useLayoutEffect(create, deps) {
|
|
1406
|
+
var dispatcher = resolveDispatcher();
|
|
1407
|
+
return dispatcher.useLayoutEffect(create, deps);
|
|
1408
|
+
}
|
|
1409
|
+
function useCallback4(callback, deps) {
|
|
1410
|
+
var dispatcher = resolveDispatcher();
|
|
1411
|
+
return dispatcher.useCallback(callback, deps);
|
|
1412
|
+
}
|
|
1413
|
+
function useMemo(create, deps) {
|
|
1414
|
+
var dispatcher = resolveDispatcher();
|
|
1415
|
+
return dispatcher.useMemo(create, deps);
|
|
1416
|
+
}
|
|
1417
|
+
function useImperativeHandle(ref, create, deps) {
|
|
1418
|
+
var dispatcher = resolveDispatcher();
|
|
1419
|
+
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1420
|
+
}
|
|
1421
|
+
function useDebugValue(value, formatterFn) {
|
|
1422
|
+
{
|
|
1423
|
+
var dispatcher = resolveDispatcher();
|
|
1424
|
+
return dispatcher.useDebugValue(value, formatterFn);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
function useTransition() {
|
|
1428
|
+
var dispatcher = resolveDispatcher();
|
|
1429
|
+
return dispatcher.useTransition();
|
|
1430
|
+
}
|
|
1431
|
+
function useDeferredValue(value) {
|
|
1432
|
+
var dispatcher = resolveDispatcher();
|
|
1433
|
+
return dispatcher.useDeferredValue(value);
|
|
1434
|
+
}
|
|
1435
|
+
function useId() {
|
|
1436
|
+
var dispatcher = resolveDispatcher();
|
|
1437
|
+
return dispatcher.useId();
|
|
1438
|
+
}
|
|
1439
|
+
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1440
|
+
var dispatcher = resolveDispatcher();
|
|
1441
|
+
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1442
|
+
}
|
|
1443
|
+
var disabledDepth = 0;
|
|
1444
|
+
var prevLog;
|
|
1445
|
+
var prevInfo;
|
|
1446
|
+
var prevWarn;
|
|
1447
|
+
var prevError;
|
|
1448
|
+
var prevGroup;
|
|
1449
|
+
var prevGroupCollapsed;
|
|
1450
|
+
var prevGroupEnd;
|
|
1451
|
+
function disabledLog() {
|
|
1452
|
+
}
|
|
1453
|
+
disabledLog.__reactDisabledLog = true;
|
|
1454
|
+
function disableLogs() {
|
|
1455
|
+
{
|
|
1456
|
+
if (disabledDepth === 0) {
|
|
1457
|
+
prevLog = console.log;
|
|
1458
|
+
prevInfo = console.info;
|
|
1459
|
+
prevWarn = console.warn;
|
|
1460
|
+
prevError = console.error;
|
|
1461
|
+
prevGroup = console.group;
|
|
1462
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
1463
|
+
prevGroupEnd = console.groupEnd;
|
|
1464
|
+
var props = {
|
|
1465
|
+
configurable: true,
|
|
1466
|
+
enumerable: true,
|
|
1467
|
+
value: disabledLog,
|
|
1468
|
+
writable: true
|
|
1469
|
+
};
|
|
1470
|
+
Object.defineProperties(console, {
|
|
1471
|
+
info: props,
|
|
1472
|
+
log: props,
|
|
1473
|
+
warn: props,
|
|
1474
|
+
error: props,
|
|
1475
|
+
group: props,
|
|
1476
|
+
groupCollapsed: props,
|
|
1477
|
+
groupEnd: props
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
disabledDepth++;
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
function reenableLogs() {
|
|
1484
|
+
{
|
|
1485
|
+
disabledDepth--;
|
|
1486
|
+
if (disabledDepth === 0) {
|
|
1487
|
+
var props = {
|
|
1488
|
+
configurable: true,
|
|
1489
|
+
enumerable: true,
|
|
1490
|
+
writable: true
|
|
1491
|
+
};
|
|
1492
|
+
Object.defineProperties(console, {
|
|
1493
|
+
log: assign({}, props, {
|
|
1494
|
+
value: prevLog
|
|
1495
|
+
}),
|
|
1496
|
+
info: assign({}, props, {
|
|
1497
|
+
value: prevInfo
|
|
1498
|
+
}),
|
|
1499
|
+
warn: assign({}, props, {
|
|
1500
|
+
value: prevWarn
|
|
1501
|
+
}),
|
|
1502
|
+
error: assign({}, props, {
|
|
1503
|
+
value: prevError
|
|
1504
|
+
}),
|
|
1505
|
+
group: assign({}, props, {
|
|
1506
|
+
value: prevGroup
|
|
1507
|
+
}),
|
|
1508
|
+
groupCollapsed: assign({}, props, {
|
|
1509
|
+
value: prevGroupCollapsed
|
|
1510
|
+
}),
|
|
1511
|
+
groupEnd: assign({}, props, {
|
|
1512
|
+
value: prevGroupEnd
|
|
1513
|
+
})
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
if (disabledDepth < 0) {
|
|
1517
|
+
error46("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1522
|
+
var prefix;
|
|
1523
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1524
|
+
{
|
|
1525
|
+
if (prefix === void 0) {
|
|
1526
|
+
try {
|
|
1527
|
+
throw Error();
|
|
1528
|
+
} catch (x) {
|
|
1529
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1530
|
+
prefix = match && match[1] || "";
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
return "\n" + prefix + name;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
var reentry = false;
|
|
1537
|
+
var componentFrameCache;
|
|
1538
|
+
{
|
|
1539
|
+
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
1540
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
1541
|
+
}
|
|
1542
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
1543
|
+
if (!fn || reentry) {
|
|
1544
|
+
return "";
|
|
1545
|
+
}
|
|
1546
|
+
{
|
|
1547
|
+
var frame = componentFrameCache.get(fn);
|
|
1548
|
+
if (frame !== void 0) {
|
|
1549
|
+
return frame;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
var control;
|
|
1553
|
+
reentry = true;
|
|
1554
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1555
|
+
Error.prepareStackTrace = void 0;
|
|
1556
|
+
var previousDispatcher;
|
|
1557
|
+
{
|
|
1558
|
+
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
1559
|
+
ReactCurrentDispatcher$1.current = null;
|
|
1560
|
+
disableLogs();
|
|
1561
|
+
}
|
|
1562
|
+
try {
|
|
1563
|
+
if (construct) {
|
|
1564
|
+
var Fake = function() {
|
|
1565
|
+
throw Error();
|
|
1566
|
+
};
|
|
1567
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
1568
|
+
set: function() {
|
|
1569
|
+
throw Error();
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
1573
|
+
try {
|
|
1574
|
+
Reflect.construct(Fake, []);
|
|
1575
|
+
} catch (x) {
|
|
1576
|
+
control = x;
|
|
1577
|
+
}
|
|
1578
|
+
Reflect.construct(fn, [], Fake);
|
|
1579
|
+
} else {
|
|
1580
|
+
try {
|
|
1581
|
+
Fake.call();
|
|
1582
|
+
} catch (x) {
|
|
1583
|
+
control = x;
|
|
1584
|
+
}
|
|
1585
|
+
fn.call(Fake.prototype);
|
|
1586
|
+
}
|
|
1587
|
+
} else {
|
|
1588
|
+
try {
|
|
1589
|
+
throw Error();
|
|
1590
|
+
} catch (x) {
|
|
1591
|
+
control = x;
|
|
1592
|
+
}
|
|
1593
|
+
fn();
|
|
1594
|
+
}
|
|
1595
|
+
} catch (sample) {
|
|
1596
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
1597
|
+
var sampleLines = sample.stack.split("\n");
|
|
1598
|
+
var controlLines = control.stack.split("\n");
|
|
1599
|
+
var s = sampleLines.length - 1;
|
|
1600
|
+
var c = controlLines.length - 1;
|
|
1601
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1602
|
+
c--;
|
|
1603
|
+
}
|
|
1604
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1605
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
1606
|
+
if (s !== 1 || c !== 1) {
|
|
1607
|
+
do {
|
|
1608
|
+
s--;
|
|
1609
|
+
c--;
|
|
1610
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1611
|
+
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
1612
|
+
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
1613
|
+
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
1614
|
+
}
|
|
1615
|
+
{
|
|
1616
|
+
if (typeof fn === "function") {
|
|
1617
|
+
componentFrameCache.set(fn, _frame);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
return _frame;
|
|
1621
|
+
}
|
|
1622
|
+
} while (s >= 1 && c >= 0);
|
|
1623
|
+
}
|
|
1624
|
+
break;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
} finally {
|
|
1629
|
+
reentry = false;
|
|
1630
|
+
{
|
|
1631
|
+
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1632
|
+
reenableLogs();
|
|
1633
|
+
}
|
|
1634
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1635
|
+
}
|
|
1636
|
+
var name = fn ? fn.displayName || fn.name : "";
|
|
1637
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
1638
|
+
{
|
|
1639
|
+
if (typeof fn === "function") {
|
|
1640
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
return syntheticFrame;
|
|
1644
|
+
}
|
|
1645
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1646
|
+
{
|
|
1647
|
+
return describeNativeComponentFrame(fn, false);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
function shouldConstruct(Component2) {
|
|
1651
|
+
var prototype = Component2.prototype;
|
|
1652
|
+
return !!(prototype && prototype.isReactComponent);
|
|
1653
|
+
}
|
|
1654
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1655
|
+
if (type == null) {
|
|
1656
|
+
return "";
|
|
1657
|
+
}
|
|
1658
|
+
if (typeof type === "function") {
|
|
1659
|
+
{
|
|
1660
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
if (typeof type === "string") {
|
|
1664
|
+
return describeBuiltInComponentFrame(type);
|
|
1665
|
+
}
|
|
1666
|
+
switch (type) {
|
|
1667
|
+
case REACT_SUSPENSE_TYPE:
|
|
1668
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
1669
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1670
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
1671
|
+
}
|
|
1672
|
+
if (typeof type === "object") {
|
|
1673
|
+
switch (type.$$typeof) {
|
|
1674
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1675
|
+
return describeFunctionComponentFrame(type.render);
|
|
1676
|
+
case REACT_MEMO_TYPE:
|
|
1677
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1678
|
+
case REACT_LAZY_TYPE: {
|
|
1679
|
+
var lazyComponent = type;
|
|
1680
|
+
var payload = lazyComponent._payload;
|
|
1681
|
+
var init = lazyComponent._init;
|
|
1682
|
+
try {
|
|
1683
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1684
|
+
} catch (x) {
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return "";
|
|
1690
|
+
}
|
|
1691
|
+
var loggedTypeFailures = {};
|
|
1692
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1693
|
+
function setCurrentlyValidatingElement(element) {
|
|
1694
|
+
{
|
|
1695
|
+
if (element) {
|
|
1696
|
+
var owner = element._owner;
|
|
1697
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1698
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1699
|
+
} else {
|
|
1700
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1705
|
+
{
|
|
1706
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
1707
|
+
for (var typeSpecName in typeSpecs) {
|
|
1708
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
1709
|
+
var error$1 = void 0;
|
|
1710
|
+
try {
|
|
1711
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1712
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1713
|
+
err.name = "Invariant Violation";
|
|
1714
|
+
throw err;
|
|
1715
|
+
}
|
|
1716
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1717
|
+
} catch (ex) {
|
|
1718
|
+
error$1 = ex;
|
|
1719
|
+
}
|
|
1720
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
1721
|
+
setCurrentlyValidatingElement(element);
|
|
1722
|
+
error46("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
1723
|
+
setCurrentlyValidatingElement(null);
|
|
1724
|
+
}
|
|
1725
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1726
|
+
loggedTypeFailures[error$1.message] = true;
|
|
1727
|
+
setCurrentlyValidatingElement(element);
|
|
1728
|
+
error46("Failed %s type: %s", location, error$1.message);
|
|
1729
|
+
setCurrentlyValidatingElement(null);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1736
|
+
{
|
|
1737
|
+
if (element) {
|
|
1738
|
+
var owner = element._owner;
|
|
1739
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1740
|
+
setExtraStackFrame(stack);
|
|
1741
|
+
} else {
|
|
1742
|
+
setExtraStackFrame(null);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
var propTypesMisspellWarningShown;
|
|
1747
|
+
{
|
|
1748
|
+
propTypesMisspellWarningShown = false;
|
|
1749
|
+
}
|
|
1750
|
+
function getDeclarationErrorAddendum() {
|
|
1751
|
+
if (ReactCurrentOwner.current) {
|
|
1752
|
+
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1753
|
+
if (name) {
|
|
1754
|
+
return "\n\nCheck the render method of `" + name + "`.";
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
return "";
|
|
1758
|
+
}
|
|
1759
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1760
|
+
if (source !== void 0) {
|
|
1761
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1762
|
+
var lineNumber = source.lineNumber;
|
|
1763
|
+
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
1764
|
+
}
|
|
1765
|
+
return "";
|
|
1766
|
+
}
|
|
1767
|
+
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1768
|
+
if (elementProps !== null && elementProps !== void 0) {
|
|
1769
|
+
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1770
|
+
}
|
|
1771
|
+
return "";
|
|
1772
|
+
}
|
|
1773
|
+
var ownerHasKeyUseWarning = {};
|
|
1774
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1775
|
+
var info = getDeclarationErrorAddendum();
|
|
1776
|
+
if (!info) {
|
|
1777
|
+
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
1778
|
+
if (parentName) {
|
|
1779
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
return info;
|
|
1783
|
+
}
|
|
1784
|
+
function validateExplicitKey(element, parentType) {
|
|
1785
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1786
|
+
return;
|
|
1787
|
+
}
|
|
1788
|
+
element._store.validated = true;
|
|
1789
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1790
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1794
|
+
var childOwner = "";
|
|
1795
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1796
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1797
|
+
}
|
|
1798
|
+
{
|
|
1799
|
+
setCurrentlyValidatingElement$1(element);
|
|
1800
|
+
error46('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1801
|
+
setCurrentlyValidatingElement$1(null);
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
function validateChildKeys(node, parentType) {
|
|
1805
|
+
if (typeof node !== "object") {
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
if (isArray(node)) {
|
|
1809
|
+
for (var i = 0; i < node.length; i++) {
|
|
1810
|
+
var child = node[i];
|
|
1811
|
+
if (isValidElement(child)) {
|
|
1812
|
+
validateExplicitKey(child, parentType);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
} else if (isValidElement(node)) {
|
|
1816
|
+
if (node._store) {
|
|
1817
|
+
node._store.validated = true;
|
|
1818
|
+
}
|
|
1819
|
+
} else if (node) {
|
|
1820
|
+
var iteratorFn = getIteratorFn(node);
|
|
1821
|
+
if (typeof iteratorFn === "function") {
|
|
1822
|
+
if (iteratorFn !== node.entries) {
|
|
1823
|
+
var iterator = iteratorFn.call(node);
|
|
1824
|
+
var step;
|
|
1825
|
+
while (!(step = iterator.next()).done) {
|
|
1826
|
+
if (isValidElement(step.value)) {
|
|
1827
|
+
validateExplicitKey(step.value, parentType);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
function validatePropTypes(element) {
|
|
1835
|
+
{
|
|
1836
|
+
var type = element.type;
|
|
1837
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
var propTypes;
|
|
1841
|
+
if (typeof type === "function") {
|
|
1842
|
+
propTypes = type.propTypes;
|
|
1843
|
+
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1844
|
+
// Inner props are checked in the reconciler.
|
|
1845
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1846
|
+
propTypes = type.propTypes;
|
|
1847
|
+
} else {
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
if (propTypes) {
|
|
1851
|
+
var name = getComponentNameFromType(type);
|
|
1852
|
+
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1853
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1854
|
+
propTypesMisspellWarningShown = true;
|
|
1855
|
+
var _name = getComponentNameFromType(type);
|
|
1856
|
+
error46("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
1857
|
+
}
|
|
1858
|
+
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
1859
|
+
error46("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
function validateFragmentProps(fragment) {
|
|
1864
|
+
{
|
|
1865
|
+
var keys = Object.keys(fragment.props);
|
|
1866
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1867
|
+
var key = keys[i];
|
|
1868
|
+
if (key !== "children" && key !== "key") {
|
|
1869
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1870
|
+
error46("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
1871
|
+
setCurrentlyValidatingElement$1(null);
|
|
1872
|
+
break;
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
if (fragment.ref !== null) {
|
|
1876
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1877
|
+
error46("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
1878
|
+
setCurrentlyValidatingElement$1(null);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
function createElementWithValidation(type, props, children) {
|
|
1883
|
+
var validType = isValidElementType(type);
|
|
1884
|
+
if (!validType) {
|
|
1885
|
+
var info = "";
|
|
1886
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1887
|
+
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1888
|
+
}
|
|
1889
|
+
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
1890
|
+
if (sourceInfo) {
|
|
1891
|
+
info += sourceInfo;
|
|
1892
|
+
} else {
|
|
1893
|
+
info += getDeclarationErrorAddendum();
|
|
1894
|
+
}
|
|
1895
|
+
var typeString;
|
|
1896
|
+
if (type === null) {
|
|
1897
|
+
typeString = "null";
|
|
1898
|
+
} else if (isArray(type)) {
|
|
1899
|
+
typeString = "array";
|
|
1900
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1901
|
+
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1902
|
+
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1903
|
+
} else {
|
|
1904
|
+
typeString = typeof type;
|
|
1905
|
+
}
|
|
1906
|
+
{
|
|
1907
|
+
error46("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
var element = createElement.apply(this, arguments);
|
|
1911
|
+
if (element == null) {
|
|
1912
|
+
return element;
|
|
1913
|
+
}
|
|
1914
|
+
if (validType) {
|
|
1915
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
1916
|
+
validateChildKeys(arguments[i], type);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1920
|
+
validateFragmentProps(element);
|
|
1921
|
+
} else {
|
|
1922
|
+
validatePropTypes(element);
|
|
1923
|
+
}
|
|
1924
|
+
return element;
|
|
1925
|
+
}
|
|
1926
|
+
var didWarnAboutDeprecatedCreateFactory = false;
|
|
1927
|
+
function createFactoryWithValidation(type) {
|
|
1928
|
+
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1929
|
+
validatedFactory.type = type;
|
|
1930
|
+
{
|
|
1931
|
+
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
1932
|
+
didWarnAboutDeprecatedCreateFactory = true;
|
|
1933
|
+
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
|
1934
|
+
}
|
|
1935
|
+
Object.defineProperty(validatedFactory, "type", {
|
|
1936
|
+
enumerable: false,
|
|
1937
|
+
get: function() {
|
|
1938
|
+
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
|
1939
|
+
Object.defineProperty(this, "type", {
|
|
1940
|
+
value: type
|
|
1941
|
+
});
|
|
1942
|
+
return type;
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
return validatedFactory;
|
|
1947
|
+
}
|
|
1948
|
+
function cloneElementWithValidation(element, props, children) {
|
|
1949
|
+
var newElement = cloneElement.apply(this, arguments);
|
|
1950
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
1951
|
+
validateChildKeys(arguments[i], newElement.type);
|
|
1952
|
+
}
|
|
1953
|
+
validatePropTypes(newElement);
|
|
1954
|
+
return newElement;
|
|
1955
|
+
}
|
|
1956
|
+
function startTransition(scope, options) {
|
|
1957
|
+
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
1958
|
+
ReactCurrentBatchConfig.transition = {};
|
|
1959
|
+
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
1960
|
+
{
|
|
1961
|
+
ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1962
|
+
}
|
|
1963
|
+
try {
|
|
1964
|
+
scope();
|
|
1965
|
+
} finally {
|
|
1966
|
+
ReactCurrentBatchConfig.transition = prevTransition;
|
|
1967
|
+
{
|
|
1968
|
+
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
1969
|
+
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
1970
|
+
if (updatedFibersCount > 10) {
|
|
1971
|
+
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
|
1972
|
+
}
|
|
1973
|
+
currentTransition._updatedFibers.clear();
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
var didWarnAboutMessageChannel = false;
|
|
1979
|
+
var enqueueTaskImpl = null;
|
|
1980
|
+
function enqueueTask(task) {
|
|
1981
|
+
if (enqueueTaskImpl === null) {
|
|
1982
|
+
try {
|
|
1983
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
1984
|
+
var nodeRequire = module && module[requireString];
|
|
1985
|
+
enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
|
|
1986
|
+
} catch (_err) {
|
|
1987
|
+
enqueueTaskImpl = function(callback) {
|
|
1988
|
+
{
|
|
1989
|
+
if (didWarnAboutMessageChannel === false) {
|
|
1990
|
+
didWarnAboutMessageChannel = true;
|
|
1991
|
+
if (typeof MessageChannel === "undefined") {
|
|
1992
|
+
error46("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
var channel = new MessageChannel();
|
|
1997
|
+
channel.port1.onmessage = callback;
|
|
1998
|
+
channel.port2.postMessage(void 0);
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
return enqueueTaskImpl(task);
|
|
2003
|
+
}
|
|
2004
|
+
var actScopeDepth = 0;
|
|
2005
|
+
var didWarnNoAwaitAct = false;
|
|
2006
|
+
function act(callback) {
|
|
2007
|
+
{
|
|
2008
|
+
var prevActScopeDepth = actScopeDepth;
|
|
2009
|
+
actScopeDepth++;
|
|
2010
|
+
if (ReactCurrentActQueue.current === null) {
|
|
2011
|
+
ReactCurrentActQueue.current = [];
|
|
2012
|
+
}
|
|
2013
|
+
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
2014
|
+
var result;
|
|
2015
|
+
try {
|
|
2016
|
+
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
2017
|
+
result = callback();
|
|
2018
|
+
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
2019
|
+
var queue = ReactCurrentActQueue.current;
|
|
2020
|
+
if (queue !== null) {
|
|
2021
|
+
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
2022
|
+
flushActQueue(queue);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
} catch (error47) {
|
|
2026
|
+
popActScope(prevActScopeDepth);
|
|
2027
|
+
throw error47;
|
|
2028
|
+
} finally {
|
|
2029
|
+
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2030
|
+
}
|
|
2031
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
2032
|
+
var thenableResult = result;
|
|
2033
|
+
var wasAwaited = false;
|
|
2034
|
+
var thenable = {
|
|
2035
|
+
then: function(resolve, reject) {
|
|
2036
|
+
wasAwaited = true;
|
|
2037
|
+
thenableResult.then(function(returnValue2) {
|
|
2038
|
+
popActScope(prevActScopeDepth);
|
|
2039
|
+
if (actScopeDepth === 0) {
|
|
2040
|
+
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
|
2041
|
+
} else {
|
|
2042
|
+
resolve(returnValue2);
|
|
2043
|
+
}
|
|
2044
|
+
}, function(error47) {
|
|
2045
|
+
popActScope(prevActScopeDepth);
|
|
2046
|
+
reject(error47);
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
};
|
|
2050
|
+
{
|
|
2051
|
+
if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
|
|
2052
|
+
Promise.resolve().then(function() {
|
|
2053
|
+
}).then(function() {
|
|
2054
|
+
if (!wasAwaited) {
|
|
2055
|
+
didWarnNoAwaitAct = true;
|
|
2056
|
+
error46("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
return thenable;
|
|
2062
|
+
} else {
|
|
2063
|
+
var returnValue = result;
|
|
2064
|
+
popActScope(prevActScopeDepth);
|
|
2065
|
+
if (actScopeDepth === 0) {
|
|
2066
|
+
var _queue = ReactCurrentActQueue.current;
|
|
2067
|
+
if (_queue !== null) {
|
|
2068
|
+
flushActQueue(_queue);
|
|
2069
|
+
ReactCurrentActQueue.current = null;
|
|
2070
|
+
}
|
|
2071
|
+
var _thenable = {
|
|
2072
|
+
then: function(resolve, reject) {
|
|
2073
|
+
if (ReactCurrentActQueue.current === null) {
|
|
2074
|
+
ReactCurrentActQueue.current = [];
|
|
2075
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2076
|
+
} else {
|
|
2077
|
+
resolve(returnValue);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
return _thenable;
|
|
2082
|
+
} else {
|
|
2083
|
+
var _thenable2 = {
|
|
2084
|
+
then: function(resolve, reject) {
|
|
2085
|
+
resolve(returnValue);
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
return _thenable2;
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
function popActScope(prevActScopeDepth) {
|
|
2094
|
+
{
|
|
2095
|
+
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2096
|
+
error46("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
|
2097
|
+
}
|
|
2098
|
+
actScopeDepth = prevActScopeDepth;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2102
|
+
{
|
|
2103
|
+
var queue = ReactCurrentActQueue.current;
|
|
2104
|
+
if (queue !== null) {
|
|
2105
|
+
try {
|
|
2106
|
+
flushActQueue(queue);
|
|
2107
|
+
enqueueTask(function() {
|
|
2108
|
+
if (queue.length === 0) {
|
|
2109
|
+
ReactCurrentActQueue.current = null;
|
|
2110
|
+
resolve(returnValue);
|
|
2111
|
+
} else {
|
|
2112
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
} catch (error47) {
|
|
2116
|
+
reject(error47);
|
|
2117
|
+
}
|
|
2118
|
+
} else {
|
|
2119
|
+
resolve(returnValue);
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
var isFlushing = false;
|
|
2124
|
+
function flushActQueue(queue) {
|
|
2125
|
+
{
|
|
2126
|
+
if (!isFlushing) {
|
|
2127
|
+
isFlushing = true;
|
|
2128
|
+
var i = 0;
|
|
2129
|
+
try {
|
|
2130
|
+
for (; i < queue.length; i++) {
|
|
2131
|
+
var callback = queue[i];
|
|
2132
|
+
do {
|
|
2133
|
+
callback = callback(true);
|
|
2134
|
+
} while (callback !== null);
|
|
2135
|
+
}
|
|
2136
|
+
queue.length = 0;
|
|
2137
|
+
} catch (error47) {
|
|
2138
|
+
queue = queue.slice(i + 1);
|
|
2139
|
+
throw error47;
|
|
2140
|
+
} finally {
|
|
2141
|
+
isFlushing = false;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
var createElement$1 = createElementWithValidation;
|
|
2147
|
+
var cloneElement$1 = cloneElementWithValidation;
|
|
2148
|
+
var createFactory = createFactoryWithValidation;
|
|
2149
|
+
var Children = {
|
|
2150
|
+
map: mapChildren,
|
|
2151
|
+
forEach: forEachChildren,
|
|
2152
|
+
count: countChildren,
|
|
2153
|
+
toArray,
|
|
2154
|
+
only: onlyChild
|
|
2155
|
+
};
|
|
2156
|
+
exports.Children = Children;
|
|
2157
|
+
exports.Component = Component;
|
|
2158
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2159
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2160
|
+
exports.PureComponent = PureComponent;
|
|
2161
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2162
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2163
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2164
|
+
exports.act = act;
|
|
2165
|
+
exports.cloneElement = cloneElement$1;
|
|
2166
|
+
exports.createContext = createContext2;
|
|
2167
|
+
exports.createElement = createElement$1;
|
|
2168
|
+
exports.createFactory = createFactory;
|
|
2169
|
+
exports.createRef = createRef;
|
|
2170
|
+
exports.forwardRef = forwardRef;
|
|
2171
|
+
exports.isValidElement = isValidElement;
|
|
2172
|
+
exports.lazy = lazy2;
|
|
2173
|
+
exports.memo = memo;
|
|
2174
|
+
exports.startTransition = startTransition;
|
|
2175
|
+
exports.unstable_act = act;
|
|
2176
|
+
exports.useCallback = useCallback4;
|
|
2177
|
+
exports.useContext = useContext2;
|
|
2178
|
+
exports.useDebugValue = useDebugValue;
|
|
2179
|
+
exports.useDeferredValue = useDeferredValue;
|
|
2180
|
+
exports.useEffect = useEffect5;
|
|
2181
|
+
exports.useId = useId;
|
|
2182
|
+
exports.useImperativeHandle = useImperativeHandle;
|
|
2183
|
+
exports.useInsertionEffect = useInsertionEffect;
|
|
2184
|
+
exports.useLayoutEffect = useLayoutEffect;
|
|
2185
|
+
exports.useMemo = useMemo;
|
|
2186
|
+
exports.useReducer = useReducer;
|
|
2187
|
+
exports.useRef = useRef3;
|
|
2188
|
+
exports.useState = useState4;
|
|
2189
|
+
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2190
|
+
exports.useTransition = useTransition;
|
|
2191
|
+
exports.version = ReactVersion;
|
|
2192
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
2193
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2194
|
+
}
|
|
2195
|
+
})();
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
|
|
2200
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/index.js
|
|
2201
|
+
var require_react = __commonJS({
|
|
2202
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"(exports, module) {
|
|
2203
|
+
"use strict";
|
|
2204
|
+
if (process.env.NODE_ENV === "production") {
|
|
2205
|
+
module.exports = require_react_production_min();
|
|
2206
|
+
} else {
|
|
2207
|
+
module.exports = require_react_development();
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
});
|
|
2211
|
+
|
|
2212
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js
|
|
2213
|
+
var require_react_jsx_runtime_production_min = __commonJS({
|
|
2214
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports) {
|
|
2215
|
+
"use strict";
|
|
2216
|
+
var f = require_react();
|
|
2217
|
+
var k = Symbol.for("react.element");
|
|
2218
|
+
var l = Symbol.for("react.fragment");
|
|
2219
|
+
var m = Object.prototype.hasOwnProperty;
|
|
2220
|
+
var n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
|
|
2221
|
+
var p = { key: true, ref: true, __self: true, __source: true };
|
|
2222
|
+
function q(c, a, g) {
|
|
2223
|
+
var b, d = {}, e = null, h = null;
|
|
2224
|
+
void 0 !== g && (e = "" + g);
|
|
2225
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
2226
|
+
void 0 !== a.ref && (h = a.ref);
|
|
2227
|
+
for (b in a)
|
|
2228
|
+
m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
2229
|
+
if (c && c.defaultProps)
|
|
2230
|
+
for (b in a = c.defaultProps, a)
|
|
2231
|
+
void 0 === d[b] && (d[b] = a[b]);
|
|
2232
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
2233
|
+
}
|
|
2234
|
+
exports.Fragment = l;
|
|
2235
|
+
exports.jsx = q;
|
|
2236
|
+
exports.jsxs = q;
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
2241
|
+
var require_react_jsx_runtime_development = __commonJS({
|
|
2242
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
2243
|
+
"use strict";
|
|
2244
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2245
|
+
(function() {
|
|
2246
|
+
"use strict";
|
|
2247
|
+
var React2 = require_react();
|
|
2248
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
2249
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
2250
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
2251
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
2252
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
2253
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
2254
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
2255
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
2256
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
2257
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
2258
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
2259
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
2260
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
2261
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
2262
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
2263
|
+
function getIteratorFn(maybeIterable) {
|
|
2264
|
+
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
2265
|
+
return null;
|
|
2266
|
+
}
|
|
2267
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
2268
|
+
if (typeof maybeIterator === "function") {
|
|
2269
|
+
return maybeIterator;
|
|
2270
|
+
}
|
|
2271
|
+
return null;
|
|
2272
|
+
}
|
|
2273
|
+
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2274
|
+
function error46(format) {
|
|
2275
|
+
{
|
|
2276
|
+
{
|
|
2277
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2278
|
+
args[_key2 - 1] = arguments[_key2];
|
|
2279
|
+
}
|
|
2280
|
+
printWarning("error", format, args);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
function printWarning(level, format, args) {
|
|
2285
|
+
{
|
|
2286
|
+
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2287
|
+
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
2288
|
+
if (stack !== "") {
|
|
2289
|
+
format += "%s";
|
|
2290
|
+
args = args.concat([stack]);
|
|
2291
|
+
}
|
|
2292
|
+
var argsWithFormat = args.map(function(item) {
|
|
2293
|
+
return String(item);
|
|
2294
|
+
});
|
|
2295
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
2296
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
var enableScopeAPI = false;
|
|
2300
|
+
var enableCacheElement = false;
|
|
2301
|
+
var enableTransitionTracing = false;
|
|
2302
|
+
var enableLegacyHidden = false;
|
|
2303
|
+
var enableDebugTracing = false;
|
|
2304
|
+
var REACT_MODULE_REFERENCE;
|
|
2305
|
+
{
|
|
2306
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
2307
|
+
}
|
|
2308
|
+
function isValidElementType(type) {
|
|
2309
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
2310
|
+
return true;
|
|
2311
|
+
}
|
|
2312
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
2313
|
+
return true;
|
|
2314
|
+
}
|
|
2315
|
+
if (typeof type === "object" && type !== null) {
|
|
2316
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
2317
|
+
// types supported by any Flight configuration anywhere since
|
|
2318
|
+
// we don't know which Flight build this will end up being used
|
|
2319
|
+
// with.
|
|
2320
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
2321
|
+
return true;
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
return false;
|
|
2325
|
+
}
|
|
2326
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
2327
|
+
var displayName = outerType.displayName;
|
|
2328
|
+
if (displayName) {
|
|
2329
|
+
return displayName;
|
|
2330
|
+
}
|
|
2331
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
2332
|
+
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
2333
|
+
}
|
|
2334
|
+
function getContextName(type) {
|
|
2335
|
+
return type.displayName || "Context";
|
|
2336
|
+
}
|
|
2337
|
+
function getComponentNameFromType(type) {
|
|
2338
|
+
if (type == null) {
|
|
2339
|
+
return null;
|
|
2340
|
+
}
|
|
2341
|
+
{
|
|
2342
|
+
if (typeof type.tag === "number") {
|
|
2343
|
+
error46("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
if (typeof type === "function") {
|
|
2347
|
+
return type.displayName || type.name || null;
|
|
2348
|
+
}
|
|
2349
|
+
if (typeof type === "string") {
|
|
2350
|
+
return type;
|
|
2351
|
+
}
|
|
2352
|
+
switch (type) {
|
|
2353
|
+
case REACT_FRAGMENT_TYPE:
|
|
2354
|
+
return "Fragment";
|
|
2355
|
+
case REACT_PORTAL_TYPE:
|
|
2356
|
+
return "Portal";
|
|
2357
|
+
case REACT_PROFILER_TYPE:
|
|
2358
|
+
return "Profiler";
|
|
2359
|
+
case REACT_STRICT_MODE_TYPE:
|
|
2360
|
+
return "StrictMode";
|
|
2361
|
+
case REACT_SUSPENSE_TYPE:
|
|
2362
|
+
return "Suspense";
|
|
2363
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2364
|
+
return "SuspenseList";
|
|
2365
|
+
}
|
|
2366
|
+
if (typeof type === "object") {
|
|
2367
|
+
switch (type.$$typeof) {
|
|
2368
|
+
case REACT_CONTEXT_TYPE:
|
|
2369
|
+
var context = type;
|
|
2370
|
+
return getContextName(context) + ".Consumer";
|
|
2371
|
+
case REACT_PROVIDER_TYPE:
|
|
2372
|
+
var provider = type;
|
|
2373
|
+
return getContextName(provider._context) + ".Provider";
|
|
2374
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2375
|
+
return getWrappedName(type, type.render, "ForwardRef");
|
|
2376
|
+
case REACT_MEMO_TYPE:
|
|
2377
|
+
var outerName = type.displayName || null;
|
|
2378
|
+
if (outerName !== null) {
|
|
2379
|
+
return outerName;
|
|
2380
|
+
}
|
|
2381
|
+
return getComponentNameFromType(type.type) || "Memo";
|
|
2382
|
+
case REACT_LAZY_TYPE: {
|
|
2383
|
+
var lazyComponent = type;
|
|
2384
|
+
var payload = lazyComponent._payload;
|
|
2385
|
+
var init = lazyComponent._init;
|
|
2386
|
+
try {
|
|
2387
|
+
return getComponentNameFromType(init(payload));
|
|
2388
|
+
} catch (x) {
|
|
2389
|
+
return null;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
return null;
|
|
2395
|
+
}
|
|
2396
|
+
var assign = Object.assign;
|
|
2397
|
+
var disabledDepth = 0;
|
|
2398
|
+
var prevLog;
|
|
2399
|
+
var prevInfo;
|
|
2400
|
+
var prevWarn;
|
|
2401
|
+
var prevError;
|
|
2402
|
+
var prevGroup;
|
|
2403
|
+
var prevGroupCollapsed;
|
|
2404
|
+
var prevGroupEnd;
|
|
2405
|
+
function disabledLog() {
|
|
2406
|
+
}
|
|
2407
|
+
disabledLog.__reactDisabledLog = true;
|
|
2408
|
+
function disableLogs() {
|
|
2409
|
+
{
|
|
2410
|
+
if (disabledDepth === 0) {
|
|
2411
|
+
prevLog = console.log;
|
|
2412
|
+
prevInfo = console.info;
|
|
2413
|
+
prevWarn = console.warn;
|
|
2414
|
+
prevError = console.error;
|
|
2415
|
+
prevGroup = console.group;
|
|
2416
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
2417
|
+
prevGroupEnd = console.groupEnd;
|
|
2418
|
+
var props = {
|
|
2419
|
+
configurable: true,
|
|
2420
|
+
enumerable: true,
|
|
2421
|
+
value: disabledLog,
|
|
2422
|
+
writable: true
|
|
2423
|
+
};
|
|
2424
|
+
Object.defineProperties(console, {
|
|
2425
|
+
info: props,
|
|
2426
|
+
log: props,
|
|
2427
|
+
warn: props,
|
|
2428
|
+
error: props,
|
|
2429
|
+
group: props,
|
|
2430
|
+
groupCollapsed: props,
|
|
2431
|
+
groupEnd: props
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
disabledDepth++;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
function reenableLogs() {
|
|
2438
|
+
{
|
|
2439
|
+
disabledDepth--;
|
|
2440
|
+
if (disabledDepth === 0) {
|
|
2441
|
+
var props = {
|
|
2442
|
+
configurable: true,
|
|
2443
|
+
enumerable: true,
|
|
2444
|
+
writable: true
|
|
2445
|
+
};
|
|
2446
|
+
Object.defineProperties(console, {
|
|
2447
|
+
log: assign({}, props, {
|
|
2448
|
+
value: prevLog
|
|
2449
|
+
}),
|
|
2450
|
+
info: assign({}, props, {
|
|
2451
|
+
value: prevInfo
|
|
2452
|
+
}),
|
|
2453
|
+
warn: assign({}, props, {
|
|
2454
|
+
value: prevWarn
|
|
2455
|
+
}),
|
|
2456
|
+
error: assign({}, props, {
|
|
2457
|
+
value: prevError
|
|
2458
|
+
}),
|
|
2459
|
+
group: assign({}, props, {
|
|
2460
|
+
value: prevGroup
|
|
2461
|
+
}),
|
|
2462
|
+
groupCollapsed: assign({}, props, {
|
|
2463
|
+
value: prevGroupCollapsed
|
|
2464
|
+
}),
|
|
2465
|
+
groupEnd: assign({}, props, {
|
|
2466
|
+
value: prevGroupEnd
|
|
2467
|
+
})
|
|
2468
|
+
});
|
|
2469
|
+
}
|
|
2470
|
+
if (disabledDepth < 0) {
|
|
2471
|
+
error46("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2476
|
+
var prefix;
|
|
2477
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
2478
|
+
{
|
|
2479
|
+
if (prefix === void 0) {
|
|
2480
|
+
try {
|
|
2481
|
+
throw Error();
|
|
2482
|
+
} catch (x) {
|
|
2483
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
2484
|
+
prefix = match && match[1] || "";
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
return "\n" + prefix + name;
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
var reentry = false;
|
|
2491
|
+
var componentFrameCache;
|
|
2492
|
+
{
|
|
2493
|
+
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
2494
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
2495
|
+
}
|
|
2496
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
2497
|
+
if (!fn || reentry) {
|
|
2498
|
+
return "";
|
|
2499
|
+
}
|
|
2500
|
+
{
|
|
2501
|
+
var frame = componentFrameCache.get(fn);
|
|
2502
|
+
if (frame !== void 0) {
|
|
2503
|
+
return frame;
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
var control;
|
|
2507
|
+
reentry = true;
|
|
2508
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
2509
|
+
Error.prepareStackTrace = void 0;
|
|
2510
|
+
var previousDispatcher;
|
|
2511
|
+
{
|
|
2512
|
+
previousDispatcher = ReactCurrentDispatcher.current;
|
|
2513
|
+
ReactCurrentDispatcher.current = null;
|
|
2514
|
+
disableLogs();
|
|
2515
|
+
}
|
|
2516
|
+
try {
|
|
2517
|
+
if (construct) {
|
|
2518
|
+
var Fake = function() {
|
|
2519
|
+
throw Error();
|
|
2520
|
+
};
|
|
2521
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
2522
|
+
set: function() {
|
|
2523
|
+
throw Error();
|
|
2524
|
+
}
|
|
2525
|
+
});
|
|
2526
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2527
|
+
try {
|
|
2528
|
+
Reflect.construct(Fake, []);
|
|
2529
|
+
} catch (x) {
|
|
2530
|
+
control = x;
|
|
2531
|
+
}
|
|
2532
|
+
Reflect.construct(fn, [], Fake);
|
|
2533
|
+
} else {
|
|
2534
|
+
try {
|
|
2535
|
+
Fake.call();
|
|
2536
|
+
} catch (x) {
|
|
2537
|
+
control = x;
|
|
2538
|
+
}
|
|
2539
|
+
fn.call(Fake.prototype);
|
|
2540
|
+
}
|
|
2541
|
+
} else {
|
|
2542
|
+
try {
|
|
2543
|
+
throw Error();
|
|
2544
|
+
} catch (x) {
|
|
2545
|
+
control = x;
|
|
2546
|
+
}
|
|
2547
|
+
fn();
|
|
2548
|
+
}
|
|
2549
|
+
} catch (sample) {
|
|
2550
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
2551
|
+
var sampleLines = sample.stack.split("\n");
|
|
2552
|
+
var controlLines = control.stack.split("\n");
|
|
2553
|
+
var s = sampleLines.length - 1;
|
|
2554
|
+
var c = controlLines.length - 1;
|
|
2555
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
2556
|
+
c--;
|
|
2557
|
+
}
|
|
2558
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
2559
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
2560
|
+
if (s !== 1 || c !== 1) {
|
|
2561
|
+
do {
|
|
2562
|
+
s--;
|
|
2563
|
+
c--;
|
|
2564
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
2565
|
+
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
2566
|
+
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
2567
|
+
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
2568
|
+
}
|
|
2569
|
+
{
|
|
2570
|
+
if (typeof fn === "function") {
|
|
2571
|
+
componentFrameCache.set(fn, _frame);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
return _frame;
|
|
2575
|
+
}
|
|
2576
|
+
} while (s >= 1 && c >= 0);
|
|
2577
|
+
}
|
|
2578
|
+
break;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
} finally {
|
|
2583
|
+
reentry = false;
|
|
2584
|
+
{
|
|
2585
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
2586
|
+
reenableLogs();
|
|
2587
|
+
}
|
|
2588
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2589
|
+
}
|
|
2590
|
+
var name = fn ? fn.displayName || fn.name : "";
|
|
2591
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
2592
|
+
{
|
|
2593
|
+
if (typeof fn === "function") {
|
|
2594
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
return syntheticFrame;
|
|
2598
|
+
}
|
|
2599
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
2600
|
+
{
|
|
2601
|
+
return describeNativeComponentFrame(fn, false);
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
function shouldConstruct(Component) {
|
|
2605
|
+
var prototype = Component.prototype;
|
|
2606
|
+
return !!(prototype && prototype.isReactComponent);
|
|
2607
|
+
}
|
|
2608
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2609
|
+
if (type == null) {
|
|
2610
|
+
return "";
|
|
2611
|
+
}
|
|
2612
|
+
if (typeof type === "function") {
|
|
2613
|
+
{
|
|
2614
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
if (typeof type === "string") {
|
|
2618
|
+
return describeBuiltInComponentFrame(type);
|
|
2619
|
+
}
|
|
2620
|
+
switch (type) {
|
|
2621
|
+
case REACT_SUSPENSE_TYPE:
|
|
2622
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
2623
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2624
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
2625
|
+
}
|
|
2626
|
+
if (typeof type === "object") {
|
|
2627
|
+
switch (type.$$typeof) {
|
|
2628
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2629
|
+
return describeFunctionComponentFrame(type.render);
|
|
2630
|
+
case REACT_MEMO_TYPE:
|
|
2631
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2632
|
+
case REACT_LAZY_TYPE: {
|
|
2633
|
+
var lazyComponent = type;
|
|
2634
|
+
var payload = lazyComponent._payload;
|
|
2635
|
+
var init = lazyComponent._init;
|
|
2636
|
+
try {
|
|
2637
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2638
|
+
} catch (x) {
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
return "";
|
|
2644
|
+
}
|
|
2645
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2646
|
+
var loggedTypeFailures = {};
|
|
2647
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2648
|
+
function setCurrentlyValidatingElement(element) {
|
|
2649
|
+
{
|
|
2650
|
+
if (element) {
|
|
2651
|
+
var owner = element._owner;
|
|
2652
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2653
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
2654
|
+
} else {
|
|
2655
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2660
|
+
{
|
|
2661
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
2662
|
+
for (var typeSpecName in typeSpecs) {
|
|
2663
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
2664
|
+
var error$1 = void 0;
|
|
2665
|
+
try {
|
|
2666
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
2667
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
2668
|
+
err.name = "Invariant Violation";
|
|
2669
|
+
throw err;
|
|
2670
|
+
}
|
|
2671
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
2672
|
+
} catch (ex) {
|
|
2673
|
+
error$1 = ex;
|
|
2674
|
+
}
|
|
2675
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
2676
|
+
setCurrentlyValidatingElement(element);
|
|
2677
|
+
error46("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
2678
|
+
setCurrentlyValidatingElement(null);
|
|
2679
|
+
}
|
|
2680
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
2681
|
+
loggedTypeFailures[error$1.message] = true;
|
|
2682
|
+
setCurrentlyValidatingElement(element);
|
|
2683
|
+
error46("Failed %s type: %s", location, error$1.message);
|
|
2684
|
+
setCurrentlyValidatingElement(null);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
var isArrayImpl = Array.isArray;
|
|
2691
|
+
function isArray(a) {
|
|
2692
|
+
return isArrayImpl(a);
|
|
2693
|
+
}
|
|
2694
|
+
function typeName(value) {
|
|
2695
|
+
{
|
|
2696
|
+
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
2697
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
2698
|
+
return type;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
function willCoercionThrow(value) {
|
|
2702
|
+
{
|
|
2703
|
+
try {
|
|
2704
|
+
testStringCoercion(value);
|
|
2705
|
+
return false;
|
|
2706
|
+
} catch (e) {
|
|
2707
|
+
return true;
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
function testStringCoercion(value) {
|
|
2712
|
+
return "" + value;
|
|
2713
|
+
}
|
|
2714
|
+
function checkKeyStringCoercion(value) {
|
|
2715
|
+
{
|
|
2716
|
+
if (willCoercionThrow(value)) {
|
|
2717
|
+
error46("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
2718
|
+
return testStringCoercion(value);
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
2723
|
+
var RESERVED_PROPS = {
|
|
2724
|
+
key: true,
|
|
2725
|
+
ref: true,
|
|
2726
|
+
__self: true,
|
|
2727
|
+
__source: true
|
|
2728
|
+
};
|
|
2729
|
+
var specialPropKeyWarningShown;
|
|
2730
|
+
var specialPropRefWarningShown;
|
|
2731
|
+
var didWarnAboutStringRefs;
|
|
2732
|
+
{
|
|
2733
|
+
didWarnAboutStringRefs = {};
|
|
2734
|
+
}
|
|
2735
|
+
function hasValidRef(config2) {
|
|
2736
|
+
{
|
|
2737
|
+
if (hasOwnProperty.call(config2, "ref")) {
|
|
2738
|
+
var getter = Object.getOwnPropertyDescriptor(config2, "ref").get;
|
|
2739
|
+
if (getter && getter.isReactWarning) {
|
|
2740
|
+
return false;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
return config2.ref !== void 0;
|
|
2745
|
+
}
|
|
2746
|
+
function hasValidKey(config2) {
|
|
2747
|
+
{
|
|
2748
|
+
if (hasOwnProperty.call(config2, "key")) {
|
|
2749
|
+
var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
|
|
2750
|
+
if (getter && getter.isReactWarning) {
|
|
2751
|
+
return false;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
return config2.key !== void 0;
|
|
2756
|
+
}
|
|
2757
|
+
function warnIfStringRefCannotBeAutoConverted(config2, self2) {
|
|
2758
|
+
{
|
|
2759
|
+
if (typeof config2.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
2760
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
2761
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
2762
|
+
error46('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', getComponentNameFromType(ReactCurrentOwner.current.type), config2.ref);
|
|
2763
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
2769
|
+
{
|
|
2770
|
+
var warnAboutAccessingKey = function() {
|
|
2771
|
+
if (!specialPropKeyWarningShown) {
|
|
2772
|
+
specialPropKeyWarningShown = true;
|
|
2773
|
+
error46("%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)", displayName);
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2776
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
2777
|
+
Object.defineProperty(props, "key", {
|
|
2778
|
+
get: warnAboutAccessingKey,
|
|
2779
|
+
configurable: true
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
2784
|
+
{
|
|
2785
|
+
var warnAboutAccessingRef = function() {
|
|
2786
|
+
if (!specialPropRefWarningShown) {
|
|
2787
|
+
specialPropRefWarningShown = true;
|
|
2788
|
+
error46("%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)", displayName);
|
|
2789
|
+
}
|
|
2790
|
+
};
|
|
2791
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
2792
|
+
Object.defineProperty(props, "ref", {
|
|
2793
|
+
get: warnAboutAccessingRef,
|
|
2794
|
+
configurable: true
|
|
2795
|
+
});
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
2799
|
+
var element = {
|
|
2800
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
2801
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
2802
|
+
// Built-in properties that belong on the element
|
|
2803
|
+
type,
|
|
2804
|
+
key,
|
|
2805
|
+
ref,
|
|
2806
|
+
props,
|
|
2807
|
+
// Record the component responsible for creating this element.
|
|
2808
|
+
_owner: owner
|
|
2809
|
+
};
|
|
2810
|
+
{
|
|
2811
|
+
element._store = {};
|
|
2812
|
+
Object.defineProperty(element._store, "validated", {
|
|
2813
|
+
configurable: false,
|
|
2814
|
+
enumerable: false,
|
|
2815
|
+
writable: true,
|
|
2816
|
+
value: false
|
|
2817
|
+
});
|
|
2818
|
+
Object.defineProperty(element, "_self", {
|
|
2819
|
+
configurable: false,
|
|
2820
|
+
enumerable: false,
|
|
2821
|
+
writable: false,
|
|
2822
|
+
value: self2
|
|
2823
|
+
});
|
|
2824
|
+
Object.defineProperty(element, "_source", {
|
|
2825
|
+
configurable: false,
|
|
2826
|
+
enumerable: false,
|
|
2827
|
+
writable: false,
|
|
2828
|
+
value: source
|
|
2829
|
+
});
|
|
2830
|
+
if (Object.freeze) {
|
|
2831
|
+
Object.freeze(element.props);
|
|
2832
|
+
Object.freeze(element);
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
return element;
|
|
2836
|
+
};
|
|
2837
|
+
function jsxDEV(type, config2, maybeKey, source, self2) {
|
|
2838
|
+
{
|
|
2839
|
+
var propName;
|
|
2840
|
+
var props = {};
|
|
2841
|
+
var key = null;
|
|
2842
|
+
var ref = null;
|
|
2843
|
+
if (maybeKey !== void 0) {
|
|
2844
|
+
{
|
|
2845
|
+
checkKeyStringCoercion(maybeKey);
|
|
2846
|
+
}
|
|
2847
|
+
key = "" + maybeKey;
|
|
2848
|
+
}
|
|
2849
|
+
if (hasValidKey(config2)) {
|
|
2850
|
+
{
|
|
2851
|
+
checkKeyStringCoercion(config2.key);
|
|
2852
|
+
}
|
|
2853
|
+
key = "" + config2.key;
|
|
2854
|
+
}
|
|
2855
|
+
if (hasValidRef(config2)) {
|
|
2856
|
+
ref = config2.ref;
|
|
2857
|
+
warnIfStringRefCannotBeAutoConverted(config2, self2);
|
|
2858
|
+
}
|
|
2859
|
+
for (propName in config2) {
|
|
2860
|
+
if (hasOwnProperty.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
2861
|
+
props[propName] = config2[propName];
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
if (type && type.defaultProps) {
|
|
2865
|
+
var defaultProps = type.defaultProps;
|
|
2866
|
+
for (propName in defaultProps) {
|
|
2867
|
+
if (props[propName] === void 0) {
|
|
2868
|
+
props[propName] = defaultProps[propName];
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
if (key || ref) {
|
|
2873
|
+
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
2874
|
+
if (key) {
|
|
2875
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
2876
|
+
}
|
|
2877
|
+
if (ref) {
|
|
2878
|
+
defineRefPropWarningGetter(props, displayName);
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
2885
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2886
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
2887
|
+
{
|
|
2888
|
+
if (element) {
|
|
2889
|
+
var owner = element._owner;
|
|
2890
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2891
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2892
|
+
} else {
|
|
2893
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
var propTypesMisspellWarningShown;
|
|
2898
|
+
{
|
|
2899
|
+
propTypesMisspellWarningShown = false;
|
|
2900
|
+
}
|
|
2901
|
+
function isValidElement(object2) {
|
|
2902
|
+
{
|
|
2903
|
+
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
function getDeclarationErrorAddendum() {
|
|
2907
|
+
{
|
|
2908
|
+
if (ReactCurrentOwner$1.current) {
|
|
2909
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
2910
|
+
if (name) {
|
|
2911
|
+
return "\n\nCheck the render method of `" + name + "`.";
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
return "";
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
function getSourceInfoErrorAddendum(source) {
|
|
2918
|
+
{
|
|
2919
|
+
if (source !== void 0) {
|
|
2920
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
2921
|
+
var lineNumber = source.lineNumber;
|
|
2922
|
+
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
2923
|
+
}
|
|
2924
|
+
return "";
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
var ownerHasKeyUseWarning = {};
|
|
2928
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
2929
|
+
{
|
|
2930
|
+
var info = getDeclarationErrorAddendum();
|
|
2931
|
+
if (!info) {
|
|
2932
|
+
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
2933
|
+
if (parentName) {
|
|
2934
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
return info;
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
function validateExplicitKey(element, parentType) {
|
|
2941
|
+
{
|
|
2942
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
element._store.validated = true;
|
|
2946
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
2947
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
2951
|
+
var childOwner = "";
|
|
2952
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
2953
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2954
|
+
}
|
|
2955
|
+
setCurrentlyValidatingElement$1(element);
|
|
2956
|
+
error46('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
2957
|
+
setCurrentlyValidatingElement$1(null);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
function validateChildKeys(node, parentType) {
|
|
2961
|
+
{
|
|
2962
|
+
if (typeof node !== "object") {
|
|
2963
|
+
return;
|
|
2964
|
+
}
|
|
2965
|
+
if (isArray(node)) {
|
|
2966
|
+
for (var i = 0; i < node.length; i++) {
|
|
2967
|
+
var child = node[i];
|
|
2968
|
+
if (isValidElement(child)) {
|
|
2969
|
+
validateExplicitKey(child, parentType);
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
} else if (isValidElement(node)) {
|
|
2973
|
+
if (node._store) {
|
|
2974
|
+
node._store.validated = true;
|
|
2975
|
+
}
|
|
2976
|
+
} else if (node) {
|
|
2977
|
+
var iteratorFn = getIteratorFn(node);
|
|
2978
|
+
if (typeof iteratorFn === "function") {
|
|
2979
|
+
if (iteratorFn !== node.entries) {
|
|
2980
|
+
var iterator = iteratorFn.call(node);
|
|
2981
|
+
var step;
|
|
2982
|
+
while (!(step = iterator.next()).done) {
|
|
2983
|
+
if (isValidElement(step.value)) {
|
|
2984
|
+
validateExplicitKey(step.value, parentType);
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
function validatePropTypes(element) {
|
|
2993
|
+
{
|
|
2994
|
+
var type = element.type;
|
|
2995
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
var propTypes;
|
|
2999
|
+
if (typeof type === "function") {
|
|
3000
|
+
propTypes = type.propTypes;
|
|
3001
|
+
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
3002
|
+
// Inner props are checked in the reconciler.
|
|
3003
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
3004
|
+
propTypes = type.propTypes;
|
|
3005
|
+
} else {
|
|
3006
|
+
return;
|
|
3007
|
+
}
|
|
3008
|
+
if (propTypes) {
|
|
3009
|
+
var name = getComponentNameFromType(type);
|
|
3010
|
+
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
3011
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
3012
|
+
propTypesMisspellWarningShown = true;
|
|
3013
|
+
var _name = getComponentNameFromType(type);
|
|
3014
|
+
error46("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
3015
|
+
}
|
|
3016
|
+
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
3017
|
+
error46("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
function validateFragmentProps(fragment) {
|
|
3022
|
+
{
|
|
3023
|
+
var keys = Object.keys(fragment.props);
|
|
3024
|
+
for (var i = 0; i < keys.length; i++) {
|
|
3025
|
+
var key = keys[i];
|
|
3026
|
+
if (key !== "children" && key !== "key") {
|
|
3027
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
3028
|
+
error46("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
3029
|
+
setCurrentlyValidatingElement$1(null);
|
|
3030
|
+
break;
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
if (fragment.ref !== null) {
|
|
3034
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
3035
|
+
error46("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
3036
|
+
setCurrentlyValidatingElement$1(null);
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
var didWarnAboutKeySpread = {};
|
|
3041
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
|
|
3042
|
+
{
|
|
3043
|
+
var validType = isValidElementType(type);
|
|
3044
|
+
if (!validType) {
|
|
3045
|
+
var info = "";
|
|
3046
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
3047
|
+
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
3048
|
+
}
|
|
3049
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
3050
|
+
if (sourceInfo) {
|
|
3051
|
+
info += sourceInfo;
|
|
3052
|
+
} else {
|
|
3053
|
+
info += getDeclarationErrorAddendum();
|
|
3054
|
+
}
|
|
3055
|
+
var typeString;
|
|
3056
|
+
if (type === null) {
|
|
3057
|
+
typeString = "null";
|
|
3058
|
+
} else if (isArray(type)) {
|
|
3059
|
+
typeString = "array";
|
|
3060
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
3061
|
+
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
3062
|
+
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
3063
|
+
} else {
|
|
3064
|
+
typeString = typeof type;
|
|
3065
|
+
}
|
|
3066
|
+
error46("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
3067
|
+
}
|
|
3068
|
+
var element = jsxDEV(type, props, key, source, self2);
|
|
3069
|
+
if (element == null) {
|
|
3070
|
+
return element;
|
|
3071
|
+
}
|
|
3072
|
+
if (validType) {
|
|
3073
|
+
var children = props.children;
|
|
3074
|
+
if (children !== void 0) {
|
|
3075
|
+
if (isStaticChildren) {
|
|
3076
|
+
if (isArray(children)) {
|
|
3077
|
+
for (var i = 0; i < children.length; i++) {
|
|
3078
|
+
validateChildKeys(children[i], type);
|
|
3079
|
+
}
|
|
3080
|
+
if (Object.freeze) {
|
|
3081
|
+
Object.freeze(children);
|
|
3082
|
+
}
|
|
3083
|
+
} else {
|
|
3084
|
+
error46("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
3085
|
+
}
|
|
3086
|
+
} else {
|
|
3087
|
+
validateChildKeys(children, type);
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
{
|
|
3092
|
+
if (hasOwnProperty.call(props, "key")) {
|
|
3093
|
+
var componentName = getComponentNameFromType(type);
|
|
3094
|
+
var keys = Object.keys(props).filter(function(k) {
|
|
3095
|
+
return k !== "key";
|
|
3096
|
+
});
|
|
3097
|
+
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
3098
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
3099
|
+
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
3100
|
+
error46('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
3101
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
3106
|
+
validateFragmentProps(element);
|
|
3107
|
+
} else {
|
|
3108
|
+
validatePropTypes(element);
|
|
3109
|
+
}
|
|
3110
|
+
return element;
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
3114
|
+
{
|
|
3115
|
+
return jsxWithValidation(type, props, key, true);
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
3119
|
+
{
|
|
3120
|
+
return jsxWithValidation(type, props, key, false);
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
var jsx3 = jsxWithValidationDynamic;
|
|
3124
|
+
var jsxs3 = jsxWithValidationStatic;
|
|
3125
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
3126
|
+
exports.jsx = jsx3;
|
|
3127
|
+
exports.jsxs = jsxs3;
|
|
3128
|
+
})();
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
});
|
|
3132
|
+
|
|
3133
|
+
// node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js
|
|
3134
|
+
var require_jsx_runtime = __commonJS({
|
|
3135
|
+
"node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"(exports, module) {
|
|
3136
|
+
"use strict";
|
|
3137
|
+
if (process.env.NODE_ENV === "production") {
|
|
3138
|
+
module.exports = require_react_jsx_runtime_production_min();
|
|
3139
|
+
} else {
|
|
3140
|
+
module.exports = require_react_jsx_runtime_development();
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
3144
|
+
|
|
1
3145
|
// packages/viewer-react/src/lib/viewer-context.tsx
|
|
2
|
-
|
|
3
|
-
createContext,
|
|
4
|
-
useContext,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useState
|
|
8
|
-
} from "react";
|
|
3146
|
+
var import_react = __toESM(require_react(), 1);
|
|
9
3147
|
|
|
10
3148
|
// packages/viewer-js/dist/index.js
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
return mod || (0, cb[
|
|
3149
|
+
var __create2 = Object.create;
|
|
3150
|
+
var __defProp2 = Object.defineProperty;
|
|
3151
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
3152
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
3153
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
3154
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
3155
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
3156
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
3157
|
};
|
|
20
3158
|
var __export = (target, all) => {
|
|
21
3159
|
for (var name in all)
|
|
22
|
-
|
|
3160
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
23
3161
|
};
|
|
24
|
-
var
|
|
3162
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
25
3163
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (let key of
|
|
27
|
-
if (!
|
|
28
|
-
|
|
3164
|
+
for (let key of __getOwnPropNames2(from))
|
|
3165
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
3166
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
29
3167
|
}
|
|
30
3168
|
return to;
|
|
31
3169
|
};
|
|
32
|
-
var
|
|
3170
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
33
3171
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
3172
|
// file that has been converted to a CommonJS file using a Babel-
|
|
35
3173
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
3174
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
3175
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
3176
|
mod
|
|
39
3177
|
));
|
|
40
|
-
var require_leaflet_src =
|
|
3178
|
+
var require_leaflet_src = __commonJS2({
|
|
41
3179
|
"node_modules/.pnpm/leaflet@1.9.4/node_modules/leaflet/dist/leaflet-src.js"(exports, module) {
|
|
42
3180
|
"use strict";
|
|
43
3181
|
(function(global, factory) {
|
|
@@ -9586,29 +12724,8 @@ var require_leaflet_src = __commonJS({
|
|
|
9586
12724
|
});
|
|
9587
12725
|
}
|
|
9588
12726
|
});
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
if (!existingLink) {
|
|
9592
|
-
const link = document.createElement("link");
|
|
9593
|
-
link.rel = "stylesheet";
|
|
9594
|
-
link.type = "text/css";
|
|
9595
|
-
link.setAttribute("data-edgepdf-styles", "true");
|
|
9596
|
-
try {
|
|
9597
|
-
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
9598
|
-
const baseUrl = new URL(import.meta.url);
|
|
9599
|
-
link.href = new URL("./styles.css", baseUrl).href;
|
|
9600
|
-
} else {
|
|
9601
|
-
link.href = "./styles.css";
|
|
9602
|
-
}
|
|
9603
|
-
} catch (e) {
|
|
9604
|
-
console.warn("Error resolving styles.css:", e?.message);
|
|
9605
|
-
link.href = "./styles.css";
|
|
9606
|
-
}
|
|
9607
|
-
document.head.appendChild(link);
|
|
9608
|
-
}
|
|
9609
|
-
}
|
|
9610
|
-
var import_leaflet4 = __toESM(require_leaflet_src(), 1);
|
|
9611
|
-
var import_leaflet = __toESM(require_leaflet_src(), 1);
|
|
12727
|
+
var import_leaflet4 = __toESM2(require_leaflet_src(), 1);
|
|
12728
|
+
var import_leaflet = __toESM2(require_leaflet_src(), 1);
|
|
9612
12729
|
function calculateTileCount(imageSize, tileSize, zoom) {
|
|
9613
12730
|
if (imageSize <= 0 || tileSize <= 0 || zoom < 0) {
|
|
9614
12731
|
return 0;
|
|
@@ -9622,18 +12739,6 @@ function calculateTileGrid(width, height, tileSize, zoom) {
|
|
|
9622
12739
|
tileY: calculateTileCount(height, tileSize, zoom)
|
|
9623
12740
|
};
|
|
9624
12741
|
}
|
|
9625
|
-
function getOriginPreviewPath(documentId) {
|
|
9626
|
-
return `processed/${documentId}/preview/preview.webp`;
|
|
9627
|
-
}
|
|
9628
|
-
function getOriginPreviewThumbnailPath(documentId) {
|
|
9629
|
-
return `processed/${documentId}/preview/thumbnail.webp`;
|
|
9630
|
-
}
|
|
9631
|
-
function getAnnotatedPreviewPath(documentId) {
|
|
9632
|
-
return `processed/${documentId}/annotated/preview/preview.webp`;
|
|
9633
|
-
}
|
|
9634
|
-
function getAnnotatedThumbnailPath(documentId) {
|
|
9635
|
-
return `processed/${documentId}/annotated/preview/thumbnail.webp`;
|
|
9636
|
-
}
|
|
9637
12742
|
function generateTileUrl(template, z, x, y) {
|
|
9638
12743
|
return template.replace("{z}", String(z)).replace("{x}", String(x)).replace("{y}", String(y));
|
|
9639
12744
|
}
|
|
@@ -9821,7 +12926,7 @@ var TileLayerManager = class {
|
|
|
9821
12926
|
return this.config;
|
|
9822
12927
|
}
|
|
9823
12928
|
};
|
|
9824
|
-
var import_leaflet2 =
|
|
12929
|
+
var import_leaflet2 = __toESM2(require_leaflet_src(), 1);
|
|
9825
12930
|
var CoordinateMapper = class {
|
|
9826
12931
|
imageInfo;
|
|
9827
12932
|
/**
|
|
@@ -22575,13 +25680,20 @@ var DocumentSummarySchema = external_exports.object({
|
|
|
22575
25680
|
createdAt: external_exports.iso.datetime(),
|
|
22576
25681
|
updatedAt: external_exports.iso.datetime()
|
|
22577
25682
|
});
|
|
25683
|
+
var DocumentStatus = /* @__PURE__ */ ((DocumentStatus2) => {
|
|
25684
|
+
DocumentStatus2["CREATED"] = "created";
|
|
25685
|
+
DocumentStatus2["PROCESSING"] = "processing";
|
|
25686
|
+
DocumentStatus2["READY"] = "ready";
|
|
25687
|
+
DocumentStatus2["FAILED"] = "failed";
|
|
25688
|
+
return DocumentStatus2;
|
|
25689
|
+
})(DocumentStatus || {});
|
|
22578
25690
|
var DocumentDetailSchema = external_exports.object({
|
|
22579
25691
|
documentId: external_exports.string(),
|
|
22580
25692
|
fileName: external_exports.string(),
|
|
22581
25693
|
originalUrl: external_exports.url(),
|
|
22582
25694
|
previewUrl: external_exports.url().optional(),
|
|
22583
25695
|
thumbnailUrl: external_exports.url().optional(),
|
|
22584
|
-
|
|
25696
|
+
status: external_exports.enum(DocumentStatus),
|
|
22585
25697
|
renderInfo: external_exports.object({
|
|
22586
25698
|
tileUrl: external_exports.url(),
|
|
22587
25699
|
imageInfo: external_exports.object({
|
|
@@ -22627,8 +25739,8 @@ var MarkerAnnotationDataSchema = external_exports.object({
|
|
|
22627
25739
|
x: external_exports.number().min(0).describe("X pixel coordinate"),
|
|
22628
25740
|
y: external_exports.number().min(0).describe("Y pixel coordinate"),
|
|
22629
25741
|
zoom: external_exports.number().int().min(0).max(10).describe("Zoom level"),
|
|
22630
|
-
|
|
22631
|
-
|
|
25742
|
+
label: external_exports.string().min(1).max(255).describe("Marker label").optional(),
|
|
25743
|
+
description: external_exports.string().max(5e3).optional().describe("Marker description text"),
|
|
22632
25744
|
href: external_exports.url().optional().describe("Link URL"),
|
|
22633
25745
|
target: external_exports.enum(["_blank", "_self"]).default("_blank").describe("Link target"),
|
|
22634
25746
|
showLabel: external_exports.boolean().optional().default(true).describe("Show label on marker")
|
|
@@ -22678,8 +25790,8 @@ var CreateAnnotationSchema = external_exports.object({
|
|
|
22678
25790
|
referenceId: external_exports.string().max(255).optional().describe("User-provided reference ID (optional)")
|
|
22679
25791
|
});
|
|
22680
25792
|
var MarkerAnnotationDataUpdateSchema = external_exports.object({
|
|
22681
|
-
|
|
22682
|
-
|
|
25793
|
+
label: external_exports.string().min(1).max(255).optional(),
|
|
25794
|
+
description: external_exports.string().max(5e3).optional(),
|
|
22683
25795
|
href: external_exports.url().optional().nullable(),
|
|
22684
25796
|
target: external_exports.enum(["_blank", "_self"]).default("_blank").optional().nullable(),
|
|
22685
25797
|
showLabel: external_exports.boolean().optional()
|
|
@@ -23002,7 +26114,7 @@ var ZoomController = class {
|
|
|
23002
26114
|
this.removeAllListeners();
|
|
23003
26115
|
}
|
|
23004
26116
|
};
|
|
23005
|
-
var import_leaflet3 =
|
|
26117
|
+
var import_leaflet3 = __toESM2(require_leaflet_src(), 1);
|
|
23006
26118
|
var currentEditPopup = null;
|
|
23007
26119
|
function createEditPopup(options) {
|
|
23008
26120
|
if (currentEditPopup && currentEditPopup.parentElement) {
|
|
@@ -23031,7 +26143,7 @@ function createEditPopup(options) {
|
|
|
23031
26143
|
type="text"
|
|
23032
26144
|
id="marker-edit-title"
|
|
23033
26145
|
class="edgepdf-marker-edit-input"
|
|
23034
|
-
value="${escapeAttr(marker.
|
|
26146
|
+
value="${escapeAttr(marker.label)}"
|
|
23035
26147
|
placeholder="Enter label"
|
|
23036
26148
|
/>
|
|
23037
26149
|
</div>
|
|
@@ -23103,7 +26215,7 @@ function createEditPopup(options) {
|
|
|
23103
26215
|
saveButton.addEventListener("click", (e) => {
|
|
23104
26216
|
e.stopPropagation();
|
|
23105
26217
|
const updates = {
|
|
23106
|
-
|
|
26218
|
+
label: titleInput.value.trim() || void 0,
|
|
23107
26219
|
href: urlInput.value.trim() || void 0
|
|
23108
26220
|
};
|
|
23109
26221
|
onSave(updates);
|
|
@@ -23138,7 +26250,7 @@ function createDeletePopup(options) {
|
|
|
23138
26250
|
div.textContent = text;
|
|
23139
26251
|
return div.innerHTML;
|
|
23140
26252
|
};
|
|
23141
|
-
const markerName = marker.
|
|
26253
|
+
const markerName = marker.label || marker.description || "this marker";
|
|
23142
26254
|
const popup = document.createElement("div");
|
|
23143
26255
|
popup.className = "edgepdf-marker-delete-popup";
|
|
23144
26256
|
popup.innerHTML = `
|
|
@@ -23275,8 +26387,8 @@ var MarkerManager = class {
|
|
|
23275
26387
|
* @param options - Marker creation options
|
|
23276
26388
|
* @param options.position - Leaflet coordinates [lat, lng]
|
|
23277
26389
|
* @param options.imageCoords - Image pixel coordinates {x, y}
|
|
23278
|
-
* @param options.
|
|
23279
|
-
* @param options.
|
|
26390
|
+
* @param options.label - Marker label/tooltip text
|
|
26391
|
+
* @param options.description - Marker description
|
|
23280
26392
|
* @param options.href - Link URL (optional)
|
|
23281
26393
|
* @param options.target - Link target (optional)
|
|
23282
26394
|
* @param options.showLabel - Show label/tooltip
|
|
@@ -23321,8 +26433,8 @@ var MarkerManager = class {
|
|
|
23321
26433
|
x: imageCoords.x,
|
|
23322
26434
|
y: imageCoords.y,
|
|
23323
26435
|
zoom: currentZoom,
|
|
23324
|
-
|
|
23325
|
-
|
|
26436
|
+
label: options.label,
|
|
26437
|
+
description: options.description,
|
|
23326
26438
|
href: options.href,
|
|
23327
26439
|
target: options.target,
|
|
23328
26440
|
showLabel: options.showLabel ?? true,
|
|
@@ -23433,8 +26545,8 @@ var MarkerManager = class {
|
|
|
23433
26545
|
this.createMarker({
|
|
23434
26546
|
id: markerData.id,
|
|
23435
26547
|
imageCoords: { x: markerData.x, y: markerData.y },
|
|
23436
|
-
|
|
23437
|
-
|
|
26548
|
+
label: markerData.label,
|
|
26549
|
+
description: markerData.description,
|
|
23438
26550
|
href: markerData.href,
|
|
23439
26551
|
target: markerData.target,
|
|
23440
26552
|
showLabel: markerData.showLabel,
|
|
@@ -23533,11 +26645,11 @@ var MarkerManager = class {
|
|
|
23533
26645
|
if (!marker || !leafletMarker) {
|
|
23534
26646
|
return false;
|
|
23535
26647
|
}
|
|
23536
|
-
if (updates.
|
|
23537
|
-
marker.
|
|
26648
|
+
if (updates.label !== void 0) {
|
|
26649
|
+
marker.label = updates.label;
|
|
23538
26650
|
}
|
|
23539
|
-
if (updates.
|
|
23540
|
-
marker.
|
|
26651
|
+
if (updates.description !== void 0) {
|
|
26652
|
+
marker.description = updates.description;
|
|
23541
26653
|
}
|
|
23542
26654
|
if (updates.href !== void 0) {
|
|
23543
26655
|
marker.href = updates.href;
|
|
@@ -23904,7 +27016,7 @@ var MarkerManager = class {
|
|
|
23904
27016
|
const iconType = marker.iconType || "pin";
|
|
23905
27017
|
const customIcon = this.createCustomIcon(iconType);
|
|
23906
27018
|
const markerOptions = {
|
|
23907
|
-
title: marker.
|
|
27019
|
+
title: marker.label,
|
|
23908
27020
|
icon: customIcon
|
|
23909
27021
|
};
|
|
23910
27022
|
if (this.interactionConfig.draggable) {
|
|
@@ -23914,8 +27026,8 @@ var MarkerManager = class {
|
|
|
23914
27026
|
[marker.position[0], marker.position[1]],
|
|
23915
27027
|
markerOptions
|
|
23916
27028
|
);
|
|
23917
|
-
if (this.interactionConfig.showTooltips && marker.
|
|
23918
|
-
leafletMarker.bindTooltip(marker.
|
|
27029
|
+
if (this.interactionConfig.showTooltips && marker.label && marker.showLabel) {
|
|
27030
|
+
leafletMarker.bindTooltip(marker.label, {
|
|
23919
27031
|
permanent: false,
|
|
23920
27032
|
direction: "top",
|
|
23921
27033
|
offset: [-13, -10],
|
|
@@ -24106,17 +27218,17 @@ var MarkerManager = class {
|
|
|
24106
27218
|
*/
|
|
24107
27219
|
createPopupContent(marker) {
|
|
24108
27220
|
let content = "";
|
|
24109
|
-
if (marker.
|
|
24110
|
-
const
|
|
27221
|
+
if (marker.description) {
|
|
27222
|
+
const escapedDescription = this.escapeHtml(marker.description);
|
|
24111
27223
|
if (marker.href) {
|
|
24112
27224
|
const escapedHref = this.escapeHtml(marker.href);
|
|
24113
27225
|
const escapedTarget = this.escapeHtml(marker.target || "_self");
|
|
24114
|
-
content = `<a href="${escapedHref}" target="${escapedTarget}">${
|
|
27226
|
+
content = `<a href="${escapedHref}" target="${escapedTarget}">${escapedDescription}</a>`;
|
|
24115
27227
|
} else {
|
|
24116
|
-
content =
|
|
27228
|
+
content = escapedDescription;
|
|
24117
27229
|
}
|
|
24118
|
-
} else if (marker.
|
|
24119
|
-
content = this.escapeHtml(marker.
|
|
27230
|
+
} else if (marker.label) {
|
|
27231
|
+
content = this.escapeHtml(marker.label);
|
|
24120
27232
|
} else {
|
|
24121
27233
|
content = '<span style="color: #666; font-style: italic;">Marker</span>';
|
|
24122
27234
|
}
|
|
@@ -24132,11 +27244,11 @@ var MarkerManager = class {
|
|
|
24132
27244
|
* @param marker - Marker data
|
|
24133
27245
|
*/
|
|
24134
27246
|
updateLeafletMarkerDisplay(leafletMarker, marker) {
|
|
24135
|
-
if (this.interactionConfig.showTooltips && marker.
|
|
27247
|
+
if (this.interactionConfig.showTooltips && marker.label && marker.showLabel) {
|
|
24136
27248
|
if (leafletMarker.getTooltip()) {
|
|
24137
|
-
leafletMarker.setTooltipContent(marker.
|
|
27249
|
+
leafletMarker.setTooltipContent(marker.label);
|
|
24138
27250
|
} else {
|
|
24139
|
-
leafletMarker.bindTooltip(marker.
|
|
27251
|
+
leafletMarker.bindTooltip(marker.label, {
|
|
24140
27252
|
permanent: false,
|
|
24141
27253
|
direction: "top",
|
|
24142
27254
|
offset: [0, -15],
|
|
@@ -24166,9 +27278,9 @@ var MarkerManager = class {
|
|
|
24166
27278
|
);
|
|
24167
27279
|
if (result) {
|
|
24168
27280
|
this.updateMarker(marker.id, {
|
|
24169
|
-
|
|
27281
|
+
label: result.label,
|
|
24170
27282
|
href: result.href,
|
|
24171
|
-
|
|
27283
|
+
description: result.description,
|
|
24172
27284
|
target: result.target
|
|
24173
27285
|
});
|
|
24174
27286
|
this.emitEvent("edit", result, void 0);
|
|
@@ -24292,11 +27404,11 @@ var MarkerManager = class {
|
|
|
24292
27404
|
if (typeof marker.zoom !== "number" || marker.zoom < 0) {
|
|
24293
27405
|
throw new Error("Marker zoom level must be a non-negative number");
|
|
24294
27406
|
}
|
|
24295
|
-
if (marker.
|
|
24296
|
-
throw new Error("Marker
|
|
27407
|
+
if (marker.label !== void 0 && typeof marker.label !== "string") {
|
|
27408
|
+
throw new Error("Marker label must be a string if provided");
|
|
24297
27409
|
}
|
|
24298
|
-
if (marker.
|
|
24299
|
-
throw new Error("Marker
|
|
27410
|
+
if (marker.description !== void 0 && typeof marker.description !== "string") {
|
|
27411
|
+
throw new Error("Marker description must be a string if provided");
|
|
24300
27412
|
}
|
|
24301
27413
|
if (marker.href !== void 0 && typeof marker.href !== "string") {
|
|
24302
27414
|
throw new Error("Marker href must be a string if provided");
|
|
@@ -24958,186 +28070,10 @@ var EdgePdfViewer = class {
|
|
|
24958
28070
|
}
|
|
24959
28071
|
}
|
|
24960
28072
|
};
|
|
24961
|
-
var CDNManager = class {
|
|
24962
|
-
baseUrl;
|
|
24963
|
-
/**
|
|
24964
|
-
* Create a new CDN Manager instance
|
|
24965
|
-
*
|
|
24966
|
-
* @param baseUrl - Base CDN URL (e.g., 'https://cdn.example.com')
|
|
24967
|
-
*
|
|
24968
|
-
* @example
|
|
24969
|
-
* ```typescript
|
|
24970
|
-
* const cdn = new CDNManager('https://cdn.example.com');
|
|
24971
|
-
* ```
|
|
24972
|
-
*/
|
|
24973
|
-
constructor(baseUrl) {
|
|
24974
|
-
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
24975
|
-
}
|
|
24976
|
-
/**
|
|
24977
|
-
* Get the base CDN URL
|
|
24978
|
-
*
|
|
24979
|
-
* @returns The base URL configured for this manager
|
|
24980
|
-
*/
|
|
24981
|
-
getBaseUrl() {
|
|
24982
|
-
return this.baseUrl;
|
|
24983
|
-
}
|
|
24984
|
-
/**
|
|
24985
|
-
* Build a full CDN URL from a path
|
|
24986
|
-
*
|
|
24987
|
-
* @param path - Path to append to base URL (with or without leading slash)
|
|
24988
|
-
* @returns Complete CDN URL
|
|
24989
|
-
*
|
|
24990
|
-
* @example
|
|
24991
|
-
* ```typescript
|
|
24992
|
-
* const cdn = new CDNManager('https://cdn.example.com');
|
|
24993
|
-
* cdn.buildUrl('processed/doc123/preview.webp');
|
|
24994
|
-
* // 'https://cdn.example.com/processed/doc123/preview.webp'
|
|
24995
|
-
* ```
|
|
24996
|
-
*/
|
|
24997
|
-
buildUrl(path) {
|
|
24998
|
-
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
24999
|
-
return `${this.baseUrl}${normalizedPath}`;
|
|
25000
|
-
}
|
|
25001
|
-
/**
|
|
25002
|
-
* Get the origin preview path for a document
|
|
25003
|
-
*
|
|
25004
|
-
* @param documentId - Document ID
|
|
25005
|
-
* @returns S3 path for origin preview
|
|
25006
|
-
*
|
|
25007
|
-
* @example
|
|
25008
|
-
* ```typescript
|
|
25009
|
-
* cdn.getOriginPreviewPath('doc123');
|
|
25010
|
-
* // 'processed/doc123/preview/preview.webp'
|
|
25011
|
-
* ```
|
|
25012
|
-
*/
|
|
25013
|
-
getOriginPreviewPath(documentId) {
|
|
25014
|
-
return getOriginPreviewPath(documentId);
|
|
25015
|
-
}
|
|
25016
|
-
/**
|
|
25017
|
-
* Get the full CDN URL for origin preview
|
|
25018
|
-
*
|
|
25019
|
-
* @param documentId - Document ID
|
|
25020
|
-
* @returns Complete CDN URL for origin preview
|
|
25021
|
-
*
|
|
25022
|
-
* @example
|
|
25023
|
-
* ```typescript
|
|
25024
|
-
* cdn.getOriginPreviewUrl('doc123');
|
|
25025
|
-
* // 'https://cdn.example.com/processed/doc123/preview/preview.webp'
|
|
25026
|
-
* ```
|
|
25027
|
-
*/
|
|
25028
|
-
getOriginPreviewUrl(documentId) {
|
|
25029
|
-
return this.buildUrl(getOriginPreviewPath(documentId));
|
|
25030
|
-
}
|
|
25031
|
-
/**
|
|
25032
|
-
* Get the origin preview thumbnail path for a document
|
|
25033
|
-
*
|
|
25034
|
-
* @param documentId - Document ID
|
|
25035
|
-
* @returns S3 path for origin preview thumbnail
|
|
25036
|
-
*
|
|
25037
|
-
* @example
|
|
25038
|
-
* ```typescript
|
|
25039
|
-
* cdn.getOriginPreviewThumbnailPath('doc123');
|
|
25040
|
-
* // 'processed/doc123/preview/thumbnail.webp'
|
|
25041
|
-
* ```
|
|
25042
|
-
*/
|
|
25043
|
-
getOriginPreviewThumbnailPath(documentId) {
|
|
25044
|
-
return getOriginPreviewThumbnailPath(documentId);
|
|
25045
|
-
}
|
|
25046
|
-
/**
|
|
25047
|
-
* Get the full CDN URL for origin preview thumbnail
|
|
25048
|
-
*
|
|
25049
|
-
* @param documentId - Document ID
|
|
25050
|
-
* @returns Complete CDN URL for origin preview thumbnail
|
|
25051
|
-
*
|
|
25052
|
-
* @example
|
|
25053
|
-
* ```typescript
|
|
25054
|
-
* cdn.getOriginPreviewThumbnailUrl('doc123');
|
|
25055
|
-
* // 'https://cdn.example.com/processed/doc123/preview/thumbnail.webp'
|
|
25056
|
-
* ```
|
|
25057
|
-
*/
|
|
25058
|
-
getOriginPreviewThumbnailUrl(documentId) {
|
|
25059
|
-
return this.buildUrl(getOriginPreviewThumbnailPath(documentId));
|
|
25060
|
-
}
|
|
25061
|
-
/**
|
|
25062
|
-
* Get the annotated preview path for a document
|
|
25063
|
-
*
|
|
25064
|
-
* @param documentId - Document ID
|
|
25065
|
-
* @returns S3 path for annotated preview
|
|
25066
|
-
*
|
|
25067
|
-
* @example
|
|
25068
|
-
* ```typescript
|
|
25069
|
-
* cdn.getAnnotatedPreviewPath('doc123');
|
|
25070
|
-
* // 'processed/doc123/annotated/preview/preview.webp'
|
|
25071
|
-
* ```
|
|
25072
|
-
*/
|
|
25073
|
-
getAnnotatedPreviewPath(documentId) {
|
|
25074
|
-
return getAnnotatedPreviewPath(documentId);
|
|
25075
|
-
}
|
|
25076
|
-
/**
|
|
25077
|
-
* Get the full CDN URL for annotated preview
|
|
25078
|
-
*
|
|
25079
|
-
* @param documentId - Document ID
|
|
25080
|
-
* @returns Complete CDN URL for annotated preview
|
|
25081
|
-
*
|
|
25082
|
-
* @example
|
|
25083
|
-
* ```typescript
|
|
25084
|
-
* cdn.getAnnotatedPreviewUrl('doc123');
|
|
25085
|
-
* // 'https://cdn.example.com/processed/doc123/annotated/preview/preview.webp'
|
|
25086
|
-
* ```
|
|
25087
|
-
*/
|
|
25088
|
-
getAnnotatedPreviewUrl(documentId) {
|
|
25089
|
-
return this.buildUrl(getAnnotatedPreviewPath(documentId));
|
|
25090
|
-
}
|
|
25091
|
-
/**
|
|
25092
|
-
* Get the annotated thumbnail path for a document
|
|
25093
|
-
*
|
|
25094
|
-
* @param documentId - Document ID
|
|
25095
|
-
* @returns S3 path for annotated thumbnail
|
|
25096
|
-
*
|
|
25097
|
-
* @example
|
|
25098
|
-
* ```typescript
|
|
25099
|
-
* cdn.getAnnotatedThumbnailPath('doc123');
|
|
25100
|
-
* // 'processed/doc123/annotated/preview/thumbnail.webp'
|
|
25101
|
-
* ```
|
|
25102
|
-
*/
|
|
25103
|
-
getAnnotatedThumbnailPath(documentId) {
|
|
25104
|
-
return getAnnotatedThumbnailPath(documentId);
|
|
25105
|
-
}
|
|
25106
|
-
/**
|
|
25107
|
-
* Get the full CDN URL for annotated thumbnail
|
|
25108
|
-
*
|
|
25109
|
-
* @param documentId - Document ID
|
|
25110
|
-
* @returns Complete CDN URL for annotated thumbnail
|
|
25111
|
-
*
|
|
25112
|
-
* @example
|
|
25113
|
-
* ```typescript
|
|
25114
|
-
* cdn.getAnnotatedThumbnailUrl('doc123');
|
|
25115
|
-
* // 'https://cdn.example.com/processed/doc123/annotated/preview/thumbnail.webp'
|
|
25116
|
-
* ```
|
|
25117
|
-
*/
|
|
25118
|
-
getAnnotatedThumbnailUrl(documentId) {
|
|
25119
|
-
return this.buildUrl(getAnnotatedThumbnailPath(documentId));
|
|
25120
|
-
}
|
|
25121
|
-
/**
|
|
25122
|
-
* Validate tile URL template
|
|
25123
|
-
*
|
|
25124
|
-
* @param template - URL template to validate
|
|
25125
|
-
* @returns True if template contains required placeholders
|
|
25126
|
-
*
|
|
25127
|
-
* @example
|
|
25128
|
-
* ```typescript
|
|
25129
|
-
* cdn.isValidTileUrl('/tiles/{z}/{x}/{y}.png'); // true
|
|
25130
|
-
* cdn.isValidTileUrl('/tiles/z/x/y.png'); // false
|
|
25131
|
-
* ```
|
|
25132
|
-
*/
|
|
25133
|
-
isValidTileUrl(template) {
|
|
25134
|
-
return isValidTileUrl(template);
|
|
25135
|
-
}
|
|
25136
|
-
};
|
|
25137
28073
|
|
|
25138
28074
|
// packages/viewer-react/src/lib/viewer-context.tsx
|
|
25139
|
-
|
|
25140
|
-
var ViewerContext = createContext(null);
|
|
28075
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
28076
|
+
var ViewerContext = (0, import_react.createContext)(null);
|
|
25141
28077
|
function ViewerProvider({
|
|
25142
28078
|
config: config2,
|
|
25143
28079
|
mapOptions,
|
|
@@ -25149,28 +28085,28 @@ function ViewerProvider({
|
|
|
25149
28085
|
defaultPins,
|
|
25150
28086
|
children
|
|
25151
28087
|
}) {
|
|
25152
|
-
const [viewer, setViewer] = useState(null);
|
|
25153
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
25154
|
-
const [markers, setMarkers] = useState([]);
|
|
25155
|
-
const [zoomState, setZoomState] = useState(null);
|
|
25156
|
-
const containerRef = useRef(null);
|
|
25157
|
-
const onPinsUpdateRef = useRef(onPinsUpdate);
|
|
25158
|
-
const onMarkerClickRef = useRef(onMarkerClick);
|
|
25159
|
-
const onMarkerUpdateRef = useRef(onMarkerUpdate);
|
|
25160
|
-
const onMarkerDeleteRef = useRef(onMarkerDelete);
|
|
25161
|
-
useEffect(() => {
|
|
28088
|
+
const [viewer, setViewer] = (0, import_react.useState)(null);
|
|
28089
|
+
const [isInitialized, setIsInitialized] = (0, import_react.useState)(false);
|
|
28090
|
+
const [markers, setMarkers] = (0, import_react.useState)([]);
|
|
28091
|
+
const [zoomState, setZoomState] = (0, import_react.useState)(null);
|
|
28092
|
+
const containerRef = (0, import_react.useRef)(null);
|
|
28093
|
+
const onPinsUpdateRef = (0, import_react.useRef)(onPinsUpdate);
|
|
28094
|
+
const onMarkerClickRef = (0, import_react.useRef)(onMarkerClick);
|
|
28095
|
+
const onMarkerUpdateRef = (0, import_react.useRef)(onMarkerUpdate);
|
|
28096
|
+
const onMarkerDeleteRef = (0, import_react.useRef)(onMarkerDelete);
|
|
28097
|
+
(0, import_react.useEffect)(() => {
|
|
25162
28098
|
onPinsUpdateRef.current = onPinsUpdate;
|
|
25163
28099
|
}, [onPinsUpdate]);
|
|
25164
|
-
useEffect(() => {
|
|
28100
|
+
(0, import_react.useEffect)(() => {
|
|
25165
28101
|
onMarkerClickRef.current = onMarkerClick;
|
|
25166
28102
|
}, [onMarkerClick]);
|
|
25167
|
-
useEffect(() => {
|
|
28103
|
+
(0, import_react.useEffect)(() => {
|
|
25168
28104
|
onMarkerUpdateRef.current = onMarkerUpdate;
|
|
25169
28105
|
}, [onMarkerUpdate]);
|
|
25170
|
-
useEffect(() => {
|
|
28106
|
+
(0, import_react.useEffect)(() => {
|
|
25171
28107
|
onMarkerDeleteRef.current = onMarkerDelete;
|
|
25172
28108
|
}, [onMarkerDelete]);
|
|
25173
|
-
useEffect(() => {
|
|
28109
|
+
(0, import_react.useEffect)(() => {
|
|
25174
28110
|
if (!containerRef.current || viewer) {
|
|
25175
28111
|
return;
|
|
25176
28112
|
}
|
|
@@ -25235,7 +28171,7 @@ function ViewerProvider({
|
|
|
25235
28171
|
}
|
|
25236
28172
|
};
|
|
25237
28173
|
}, []);
|
|
25238
|
-
useEffect(() => {
|
|
28174
|
+
(0, import_react.useEffect)(() => {
|
|
25239
28175
|
if (!viewer || !isInitialized) {
|
|
25240
28176
|
return;
|
|
25241
28177
|
}
|
|
@@ -25254,7 +28190,7 @@ function ViewerProvider({
|
|
|
25254
28190
|
});
|
|
25255
28191
|
}
|
|
25256
28192
|
}, [viewer, isInitialized, enableAnnotation]);
|
|
25257
|
-
useEffect(() => {
|
|
28193
|
+
(0, import_react.useEffect)(() => {
|
|
25258
28194
|
if (!viewer || !isInitialized) {
|
|
25259
28195
|
return;
|
|
25260
28196
|
}
|
|
@@ -25274,7 +28210,7 @@ function ViewerProvider({
|
|
|
25274
28210
|
const leafletCoords = [e.latlng.lat, e.latlng.lng];
|
|
25275
28211
|
markerManager.createMarker({
|
|
25276
28212
|
position: leafletCoords,
|
|
25277
|
-
|
|
28213
|
+
label: `Marker ${markerManager.getMarkerCount() + 1}`
|
|
25278
28214
|
});
|
|
25279
28215
|
const allMarkers = markerManager.getAllMarkers();
|
|
25280
28216
|
setMarkers(allMarkers);
|
|
@@ -25291,7 +28227,7 @@ function ViewerProvider({
|
|
|
25291
28227
|
map2.off("click", handleMapClick);
|
|
25292
28228
|
};
|
|
25293
28229
|
}, [viewer, isInitialized, enableAnnotation]);
|
|
25294
|
-
useEffect(() => {
|
|
28230
|
+
(0, import_react.useEffect)(() => {
|
|
25295
28231
|
if (!viewer || !isInitialized) {
|
|
25296
28232
|
return;
|
|
25297
28233
|
}
|
|
@@ -25308,7 +28244,7 @@ function ViewerProvider({
|
|
|
25308
28244
|
unsubscribeClick();
|
|
25309
28245
|
};
|
|
25310
28246
|
}, [viewer, isInitialized]);
|
|
25311
|
-
useEffect(() => {
|
|
28247
|
+
(0, import_react.useEffect)(() => {
|
|
25312
28248
|
if (!viewer || !isInitialized) {
|
|
25313
28249
|
return;
|
|
25314
28250
|
}
|
|
@@ -25325,7 +28261,7 @@ function ViewerProvider({
|
|
|
25325
28261
|
unsubscribeEdit();
|
|
25326
28262
|
};
|
|
25327
28263
|
}, [viewer, isInitialized]);
|
|
25328
|
-
useEffect(() => {
|
|
28264
|
+
(0, import_react.useEffect)(() => {
|
|
25329
28265
|
if (!viewer || !isInitialized) {
|
|
25330
28266
|
return;
|
|
25331
28267
|
}
|
|
@@ -25342,7 +28278,7 @@ function ViewerProvider({
|
|
|
25342
28278
|
unsubscribeDelete();
|
|
25343
28279
|
};
|
|
25344
28280
|
}, [viewer, isInitialized]);
|
|
25345
|
-
useEffect(() => {
|
|
28281
|
+
(0, import_react.useEffect)(() => {
|
|
25346
28282
|
if (!viewer || !isInitialized) {
|
|
25347
28283
|
return;
|
|
25348
28284
|
}
|
|
@@ -25379,13 +28315,13 @@ function ViewerProvider({
|
|
|
25379
28315
|
markers,
|
|
25380
28316
|
zoomState
|
|
25381
28317
|
};
|
|
25382
|
-
return /* @__PURE__ */ jsx(ViewerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
|
|
25383
|
-
/* @__PURE__ */ jsx("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
|
|
28318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ViewerContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
|
|
28319
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
|
|
25384
28320
|
children
|
|
25385
28321
|
] }) });
|
|
25386
28322
|
}
|
|
25387
28323
|
function useViewerContext() {
|
|
25388
|
-
const context = useContext(ViewerContext);
|
|
28324
|
+
const context = (0, import_react.useContext)(ViewerContext);
|
|
25389
28325
|
if (!context) {
|
|
25390
28326
|
throw new Error("useViewerContext must be used within ViewerProvider");
|
|
25391
28327
|
}
|
|
@@ -25393,7 +28329,7 @@ function useViewerContext() {
|
|
|
25393
28329
|
}
|
|
25394
28330
|
|
|
25395
28331
|
// packages/viewer-react/src/lib/zoom-controls.tsx
|
|
25396
|
-
|
|
28332
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
25397
28333
|
function ZoomControls({
|
|
25398
28334
|
className,
|
|
25399
28335
|
style,
|
|
@@ -25401,8 +28337,8 @@ function ZoomControls({
|
|
|
25401
28337
|
showZoomLevel = true
|
|
25402
28338
|
}) {
|
|
25403
28339
|
const { viewer, isInitialized } = useViewerContext();
|
|
25404
|
-
const controlsRef =
|
|
25405
|
-
|
|
28340
|
+
const controlsRef = (0, import_react2.useRef)(null);
|
|
28341
|
+
(0, import_react2.useEffect)(() => {
|
|
25406
28342
|
if (!viewer || !isInitialized) {
|
|
25407
28343
|
return;
|
|
25408
28344
|
}
|
|
@@ -25433,7 +28369,7 @@ function ZoomControls({
|
|
|
25433
28369
|
}
|
|
25434
28370
|
|
|
25435
28371
|
// packages/viewer-react/src/lib/pdf-viewer.tsx
|
|
25436
|
-
|
|
28372
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
25437
28373
|
function EdgePDFViewer({
|
|
25438
28374
|
config: config2,
|
|
25439
28375
|
mapOptions,
|
|
@@ -25457,7 +28393,7 @@ function EdgePDFViewer({
|
|
|
25457
28393
|
onPinsUpdate: void 0
|
|
25458
28394
|
};
|
|
25459
28395
|
const finalMapOptions = defaultZoomLevel ? { ...mapOptions, zoom: defaultZoomLevel } : mapOptions;
|
|
25460
|
-
return /* @__PURE__ */
|
|
28396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
25461
28397
|
"div",
|
|
25462
28398
|
{
|
|
25463
28399
|
className,
|
|
@@ -25467,7 +28403,7 @@ function EdgePDFViewer({
|
|
|
25467
28403
|
position: "relative",
|
|
25468
28404
|
...style
|
|
25469
28405
|
},
|
|
25470
|
-
children: /* @__PURE__ */
|
|
28406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
25471
28407
|
ViewerProvider,
|
|
25472
28408
|
{
|
|
25473
28409
|
config: finalConfig,
|
|
@@ -25479,7 +28415,7 @@ function EdgePDFViewer({
|
|
|
25479
28415
|
onMarkerDelete,
|
|
25480
28416
|
defaultPins,
|
|
25481
28417
|
children: [
|
|
25482
|
-
showZoomControls && /* @__PURE__ */
|
|
28418
|
+
showZoomControls && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
25483
28419
|
ZoomControls,
|
|
25484
28420
|
{
|
|
25485
28421
|
position: zoomControlsPosition,
|
|
@@ -25495,13 +28431,13 @@ function EdgePDFViewer({
|
|
|
25495
28431
|
}
|
|
25496
28432
|
|
|
25497
28433
|
// packages/viewer-react/src/lib/use-viewer.ts
|
|
25498
|
-
|
|
28434
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
25499
28435
|
function useViewer() {
|
|
25500
28436
|
const { viewer, isInitialized } = useViewerContext();
|
|
25501
|
-
const getMap = useCallback(() => {
|
|
28437
|
+
const getMap = (0, import_react3.useCallback)(() => {
|
|
25502
28438
|
return viewer?.getMap() ?? null;
|
|
25503
28439
|
}, [viewer]);
|
|
25504
|
-
const checkInitialized = useCallback(() => {
|
|
28440
|
+
const checkInitialized = (0, import_react3.useCallback)(() => {
|
|
25505
28441
|
return viewer?.isInitialized() ?? false;
|
|
25506
28442
|
}, [viewer]);
|
|
25507
28443
|
return {
|
|
@@ -25513,14 +28449,14 @@ function useViewer() {
|
|
|
25513
28449
|
}
|
|
25514
28450
|
|
|
25515
28451
|
// packages/viewer-react/src/lib/use-markers.ts
|
|
25516
|
-
|
|
28452
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
25517
28453
|
function useMarkers() {
|
|
25518
28454
|
const { viewer, isInitialized, markers: contextMarkers } = useViewerContext();
|
|
25519
|
-
const [markers, setMarkers] =
|
|
25520
|
-
|
|
28455
|
+
const [markers, setMarkers] = (0, import_react4.useState)(contextMarkers);
|
|
28456
|
+
(0, import_react4.useEffect)(() => {
|
|
25521
28457
|
setMarkers(contextMarkers);
|
|
25522
28458
|
}, [contextMarkers]);
|
|
25523
|
-
|
|
28459
|
+
(0, import_react4.useEffect)(() => {
|
|
25524
28460
|
if (!viewer || !isInitialized) {
|
|
25525
28461
|
return;
|
|
25526
28462
|
}
|
|
@@ -25530,7 +28466,7 @@ function useMarkers() {
|
|
|
25530
28466
|
setMarkers(allMarkers);
|
|
25531
28467
|
}
|
|
25532
28468
|
}, [viewer, isInitialized]);
|
|
25533
|
-
const addMarker =
|
|
28469
|
+
const addMarker = (0, import_react4.useCallback)(
|
|
25534
28470
|
(options) => {
|
|
25535
28471
|
if (!viewer || !isInitialized) {
|
|
25536
28472
|
console.warn("Viewer not initialized");
|
|
@@ -25553,7 +28489,7 @@ function useMarkers() {
|
|
|
25553
28489
|
},
|
|
25554
28490
|
[viewer, isInitialized]
|
|
25555
28491
|
);
|
|
25556
|
-
const removeMarker =
|
|
28492
|
+
const removeMarker = (0, import_react4.useCallback)(
|
|
25557
28493
|
(id) => {
|
|
25558
28494
|
if (!viewer || !isInitialized) {
|
|
25559
28495
|
console.warn("Viewer not initialized");
|
|
@@ -25578,7 +28514,7 @@ function useMarkers() {
|
|
|
25578
28514
|
},
|
|
25579
28515
|
[viewer, isInitialized]
|
|
25580
28516
|
);
|
|
25581
|
-
const updateMarker =
|
|
28517
|
+
const updateMarker = (0, import_react4.useCallback)(
|
|
25582
28518
|
(id, updates) => {
|
|
25583
28519
|
if (!viewer || !isInitialized) {
|
|
25584
28520
|
console.warn("Viewer not initialized");
|
|
@@ -25608,7 +28544,7 @@ function useMarkers() {
|
|
|
25608
28544
|
},
|
|
25609
28545
|
[viewer, isInitialized]
|
|
25610
28546
|
);
|
|
25611
|
-
const getMarker =
|
|
28547
|
+
const getMarker = (0, import_react4.useCallback)(
|
|
25612
28548
|
(id) => {
|
|
25613
28549
|
if (!viewer || !isInitialized) {
|
|
25614
28550
|
return null;
|
|
@@ -25621,10 +28557,10 @@ function useMarkers() {
|
|
|
25621
28557
|
},
|
|
25622
28558
|
[viewer, isInitialized]
|
|
25623
28559
|
);
|
|
25624
|
-
const getAllMarkers =
|
|
28560
|
+
const getAllMarkers = (0, import_react4.useCallback)(() => {
|
|
25625
28561
|
return markers;
|
|
25626
28562
|
}, [markers]);
|
|
25627
|
-
const exportMarkers =
|
|
28563
|
+
const exportMarkers = (0, import_react4.useCallback)(() => {
|
|
25628
28564
|
if (!viewer || !isInitialized) {
|
|
25629
28565
|
return { markers: [], version: "1.0" };
|
|
25630
28566
|
}
|
|
@@ -25639,7 +28575,7 @@ function useMarkers() {
|
|
|
25639
28575
|
return { markers: [], version: "1.0" };
|
|
25640
28576
|
}
|
|
25641
28577
|
}, [viewer, isInitialized]);
|
|
25642
|
-
const importMarkers =
|
|
28578
|
+
const importMarkers = (0, import_react4.useCallback)(
|
|
25643
28579
|
(data) => {
|
|
25644
28580
|
if (!viewer || !isInitialized) {
|
|
25645
28581
|
console.warn("Viewer not initialized");
|
|
@@ -25664,7 +28600,7 @@ function useMarkers() {
|
|
|
25664
28600
|
},
|
|
25665
28601
|
[viewer, isInitialized]
|
|
25666
28602
|
);
|
|
25667
|
-
const clearMarkers =
|
|
28603
|
+
const clearMarkers = (0, import_react4.useCallback)(() => {
|
|
25668
28604
|
if (!viewer || !isInitialized) {
|
|
25669
28605
|
console.warn("Viewer not initialized");
|
|
25670
28606
|
return;
|
|
@@ -25698,14 +28634,14 @@ function useMarkers() {
|
|
|
25698
28634
|
}
|
|
25699
28635
|
|
|
25700
28636
|
// packages/viewer-react/src/lib/use-zoom.ts
|
|
25701
|
-
|
|
28637
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
25702
28638
|
function useZoom() {
|
|
25703
28639
|
const { viewer, isInitialized, zoomState: contextZoomState } = useViewerContext();
|
|
25704
|
-
const [zoomState, setZoomState] =
|
|
25705
|
-
|
|
28640
|
+
const [zoomState, setZoomState] = (0, import_react5.useState)(contextZoomState);
|
|
28641
|
+
(0, import_react5.useEffect)(() => {
|
|
25706
28642
|
setZoomState(contextZoomState);
|
|
25707
28643
|
}, [contextZoomState]);
|
|
25708
|
-
|
|
28644
|
+
(0, import_react5.useEffect)(() => {
|
|
25709
28645
|
if (!viewer || !isInitialized) {
|
|
25710
28646
|
return;
|
|
25711
28647
|
}
|
|
@@ -25715,7 +28651,7 @@ function useZoom() {
|
|
|
25715
28651
|
setZoomState(state);
|
|
25716
28652
|
}
|
|
25717
28653
|
}, [viewer, isInitialized]);
|
|
25718
|
-
|
|
28654
|
+
(0, import_react5.useEffect)(() => {
|
|
25719
28655
|
if (!viewer || !isInitialized) {
|
|
25720
28656
|
return;
|
|
25721
28657
|
}
|
|
@@ -25735,7 +28671,7 @@ function useZoom() {
|
|
|
25735
28671
|
map2.off("zoomend", updateZoomState);
|
|
25736
28672
|
};
|
|
25737
28673
|
}, [viewer, isInitialized]);
|
|
25738
|
-
const zoomIn =
|
|
28674
|
+
const zoomIn = (0, import_react5.useCallback)(() => {
|
|
25739
28675
|
if (!viewer || !isInitialized) {
|
|
25740
28676
|
console.warn("Viewer not initialized");
|
|
25741
28677
|
return;
|
|
@@ -25753,7 +28689,7 @@ function useZoom() {
|
|
|
25753
28689
|
console.error("Failed to zoom in:", error46);
|
|
25754
28690
|
}
|
|
25755
28691
|
}, [viewer, isInitialized]);
|
|
25756
|
-
const zoomOut =
|
|
28692
|
+
const zoomOut = (0, import_react5.useCallback)(() => {
|
|
25757
28693
|
if (!viewer || !isInitialized) {
|
|
25758
28694
|
console.warn("Viewer not initialized");
|
|
25759
28695
|
return;
|
|
@@ -25771,7 +28707,7 @@ function useZoom() {
|
|
|
25771
28707
|
console.error("Failed to zoom out:", error46);
|
|
25772
28708
|
}
|
|
25773
28709
|
}, [viewer, isInitialized]);
|
|
25774
|
-
const setZoom =
|
|
28710
|
+
const setZoom = (0, import_react5.useCallback)(
|
|
25775
28711
|
(zoom) => {
|
|
25776
28712
|
if (!viewer || !isInitialized) {
|
|
25777
28713
|
console.warn("Viewer not initialized");
|
|
@@ -25792,13 +28728,13 @@ function useZoom() {
|
|
|
25792
28728
|
},
|
|
25793
28729
|
[viewer, isInitialized]
|
|
25794
28730
|
);
|
|
25795
|
-
const canZoomIn =
|
|
28731
|
+
const canZoomIn = (0, import_react5.useCallback)(() => {
|
|
25796
28732
|
if (!zoomState) {
|
|
25797
28733
|
return false;
|
|
25798
28734
|
}
|
|
25799
28735
|
return zoomState.currentZoom < zoomState.maxZoom;
|
|
25800
28736
|
}, [zoomState]);
|
|
25801
|
-
const canZoomOut =
|
|
28737
|
+
const canZoomOut = (0, import_react5.useCallback)(() => {
|
|
25802
28738
|
if (!zoomState) {
|
|
25803
28739
|
return false;
|
|
25804
28740
|
}
|
|
@@ -25817,7 +28753,6 @@ function useZoom() {
|
|
|
25817
28753
|
};
|
|
25818
28754
|
}
|
|
25819
28755
|
export {
|
|
25820
|
-
CDNManager,
|
|
25821
28756
|
EdgePDFViewer,
|
|
25822
28757
|
ViewerProvider,
|
|
25823
28758
|
ZoomControls,
|
|
@@ -25834,3 +28769,49 @@ leaflet/dist/leaflet-src.js:
|
|
|
25834
28769
|
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
25835
28770
|
*)
|
|
25836
28771
|
*/
|
|
28772
|
+
/*! Bundled license information:
|
|
28773
|
+
|
|
28774
|
+
react/cjs/react.production.min.js:
|
|
28775
|
+
(**
|
|
28776
|
+
* @license React
|
|
28777
|
+
* react.production.min.js
|
|
28778
|
+
*
|
|
28779
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28780
|
+
*
|
|
28781
|
+
* This source code is licensed under the MIT license found in the
|
|
28782
|
+
* LICENSE file in the root directory of this source tree.
|
|
28783
|
+
*)
|
|
28784
|
+
|
|
28785
|
+
react/cjs/react.development.js:
|
|
28786
|
+
(**
|
|
28787
|
+
* @license React
|
|
28788
|
+
* react.development.js
|
|
28789
|
+
*
|
|
28790
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28791
|
+
*
|
|
28792
|
+
* This source code is licensed under the MIT license found in the
|
|
28793
|
+
* LICENSE file in the root directory of this source tree.
|
|
28794
|
+
*)
|
|
28795
|
+
|
|
28796
|
+
react/cjs/react-jsx-runtime.production.min.js:
|
|
28797
|
+
(**
|
|
28798
|
+
* @license React
|
|
28799
|
+
* react-jsx-runtime.production.min.js
|
|
28800
|
+
*
|
|
28801
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28802
|
+
*
|
|
28803
|
+
* This source code is licensed under the MIT license found in the
|
|
28804
|
+
* LICENSE file in the root directory of this source tree.
|
|
28805
|
+
*)
|
|
28806
|
+
|
|
28807
|
+
react/cjs/react-jsx-runtime.development.js:
|
|
28808
|
+
(**
|
|
28809
|
+
* @license React
|
|
28810
|
+
* react-jsx-runtime.development.js
|
|
28811
|
+
*
|
|
28812
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28813
|
+
*
|
|
28814
|
+
* This source code is licensed under the MIT license found in the
|
|
28815
|
+
* LICENSE file in the root directory of this source tree.
|
|
28816
|
+
*)
|
|
28817
|
+
*/
|