Initial commit
This commit is contained in:
commit
afed023152
8152 files changed
+2086461
No files matched your search
+66
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"hash": "976b9c3d",
|
||||
"configHash": "89e67727",
|
||||
"lockfileHash": "0d4791a3",
|
||||
"browserHash": "4b2fbac7",
|
||||
"optimized": {
|
||||
"lucide-react": {
|
||||
"src": "../../lucide-react/dist/esm/lucide-react.mjs",
|
||||
"file": "lucide-react.js",
|
||||
"fileHash": "6c3cfb80",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-dom": {
|
||||
"src": "../../react-dom/index.js",
|
||||
"file": "react-dom.js",
|
||||
"fileHash": "25030b7a",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-dom/client": {
|
||||
"src": "../../react-dom/client.js",
|
||||
"file": "react-dom_client.js",
|
||||
"fileHash": "de15c997",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react": {
|
||||
"src": "../../react/index.js",
|
||||
"file": "react.js",
|
||||
"fileHash": "e97c5b5e",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-dev-runtime": {
|
||||
"src": "../../react/jsx-dev-runtime.js",
|
||||
"file": "react_jsx-dev-runtime.js",
|
||||
"fileHash": "15b8f65b",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-runtime": {
|
||||
"src": "../../react/jsx-runtime.js",
|
||||
"file": "react_jsx-runtime.js",
|
||||
"fileHash": "6d9e10ca",
|
||||
"needsInterop": true
|
||||
},
|
||||
"swr": {
|
||||
"src": "../../swr/dist/index/index.mjs",
|
||||
"file": "swr.js",
|
||||
"fileHash": "5dedc4fa",
|
||||
"needsInterop": false
|
||||
},
|
||||
"wouter": {
|
||||
"src": "../../wouter/src/index.js",
|
||||
"file": "wouter.js",
|
||||
"fileHash": "9e6a9f9c",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"rolldown-runtime-DC62tzP2": {
|
||||
"file": "rolldown-runtime-DC62tzP2.js",
|
||||
"isDynamicEntry": false
|
||||
},
|
||||
"shim-BX6a9SD7": {
|
||||
"file": "shim-BX6a9SD7.js",
|
||||
"isDynamicEntry": false
|
||||
}
|
||||
}
|
||||
}
|
||||
+63820
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"lucide-react.js","names":["createContext","useMemo","createElement","useContext","forwardRef","createElement","forwardRef","createElement","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__Line truncated
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
//#region node_modules/react-dom/cjs/react-dom.development.js
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var require_react_dom_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
(function() {
|
||||
function noop() {}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function createPortal$1(children, containerInfo, implementation) {
|
||||
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
||||
if (null == key) key = null;
|
||||
else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY;
|
||||
else {
|
||||
try {
|
||||
testStringCoercion(key);
|
||||
var JSCompiler_inline_result = !1;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = !0;
|
||||
}
|
||||
JSCompiler_inline_result && (console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"), testStringCoercion(key));
|
||||
key = "" + key;
|
||||
}
|
||||
return {
|
||||
$$typeof: REACT_PORTAL_TYPE,
|
||||
key,
|
||||
children,
|
||||
containerInfo,
|
||||
implementation
|
||||
};
|
||||
}
|
||||
function getCrossOriginStringAs(as, input) {
|
||||
if ("font" === as) return "";
|
||||
if ("string" === typeof input) return "use-credentials" === input ? input : "";
|
||||
}
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "something with type \"" + typeof thing + "\"";
|
||||
}
|
||||
function getValueDescriptorExpectingEnumForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : "something with type \"" + typeof thing + "\"";
|
||||
}
|
||||
function resolveDispatcher() {
|
||||
var dispatcher = ReactSharedInternals.H;
|
||||
null === dispatcher && console.error("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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
||||
return dispatcher;
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var React = require_react(), Internals = {
|
||||
d: {
|
||||
f: noop,
|
||||
r: function() {
|
||||
throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.");
|
||||
},
|
||||
D: noop,
|
||||
C: noop,
|
||||
L: noop,
|
||||
m: noop,
|
||||
X: noop,
|
||||
S: noop,
|
||||
M: noop
|
||||
},
|
||||
p: 0,
|
||||
findDOMNode: null
|
||||
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_RECOVERABLE_TYPE = Symbol.for("react.recoverable"), REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
||||
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
|
||||
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
||||
exports.browser = function(reason) {
|
||||
return {
|
||||
$$typeof: REACT_RECOVERABLE_TYPE,
|
||||
_reason: reason
|
||||
};
|
||||
};
|
||||
exports.createPortal = function(children, container) {
|
||||
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
||||
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error("Target container is not a DOM element.");
|
||||
return createPortal$1(children, container, null, key);
|
||||
};
|
||||
exports.flushSync = function(fn) {
|
||||
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
||||
try {
|
||||
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
||||
} finally {
|
||||
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
|
||||
}
|
||||
};
|
||||
exports.preconnect = function(href, options) {
|
||||
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", getValueDescriptorExpectingEnumForWarning(options)) : null != options && "string" !== typeof options.crossOrigin && console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", getValueDescriptorExpectingObjectForWarning(options.crossOrigin)) : console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
||||
};
|
||||
exports.prefetchDNS = function(href) {
|
||||
if ("string" !== typeof href || !href) console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||
else if (1 < arguments.length) {
|
||||
var options = arguments[1];
|
||||
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options)) : console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options));
|
||||
}
|
||||
"string" === typeof href && Internals.d.D(href);
|
||||
};
|
||||
exports.preinit = function(href, options) {
|
||||
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", getValueDescriptorExpectingEnumForWarning(options)) : "style" !== options.as && "script" !== options.as && console.error("ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".", getValueDescriptorExpectingEnumForWarning(options.as)) : console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||
if ("string" === typeof href && options && "string" === typeof options.as) {
|
||||
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
||||
"style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority
|
||||
}) : "script" === as && Internals.d.X(href, {
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preinitModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
||||
if (encountered) console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", encountered);
|
||||
else switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
||||
case "script": break;
|
||||
default: encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error("ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)", encountered, href);
|
||||
}
|
||||
if ("string" === typeof href) if ("object" === typeof options && null !== options) {
|
||||
if (null == options.as || "script" === options.as) encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.M(href, {
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
|
||||
});
|
||||
} else options ?? Internals.d.M(href);
|
||||
};
|
||||
exports.preload = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error("ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s", encountered);
|
||||
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
||||
encountered = options.as;
|
||||
var crossOrigin = getCrossOriginStringAs(encountered, options.crossOrigin);
|
||||
Internals.d.L(href, encountered, {
|
||||
crossOrigin,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||
type: "string" === typeof options.type ? options.type : void 0,
|
||||
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
||||
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
||||
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
||||
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
||||
media: "string" === typeof options.media ? options.media : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preloadModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error("ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s", encountered);
|
||||
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.m(href, {
|
||||
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
|
||||
})) : Internals.d.m(href));
|
||||
};
|
||||
exports.requestFormReset = function(form) {
|
||||
Internals.d.r(form);
|
||||
};
|
||||
exports.unstable_batchedUpdates = function(fn, a) {
|
||||
return fn(a);
|
||||
};
|
||||
exports.useFormState = function(action, initialState, permalink) {
|
||||
return resolveDispatcher().useFormState(action, initialState, permalink);
|
||||
};
|
||||
exports.useFormStatus = function() {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}));
|
||||
//#endregion
|
||||
//#region node_modules/react-dom/index.js
|
||||
var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = require_react_dom_development();
|
||||
}));
|
||||
//#endregion
|
||||
export default require_react_dom();
|
||||
export { require_react_dom as t };
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react-dom.js","names":[],"sources":["../../react-dom/cjs/react-dom.development.js","../../react-dom/index.js"],"sourcesContent":["/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n if (null == key) key = null;\n else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY;\n else {\n try {\n testStringCoercion(key);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n JSCompiler_inline_result &&\n (console.error(\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n key[Symbol.toStringTag]) ||\n key.constructor.name ||\n \"Object\"\n ),\n testStringCoercion(key));\n key = \"\" + key;\n }\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n }\n function getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n }\n function getValueDescriptorExpectingObjectForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function getValueDescriptorExpectingEnumForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : \"string\" === typeof thing\n ? JSON.stringify(thing)\n : \"number\" === typeof thing\n ? \"`\" + thing + \"`\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n (\"function\" === typeof Map &&\n null != Map.prototype &&\n \"function\" === typeof Map.prototype.forEach &&\n \"function\" === typeof Set &&\n null != Set.prototype &&\n \"function\" === typeof Set.prototype.clear &&\n \"function\" === typeof Set.prototype.forEach) ||\n console.error(\n \"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"\n );\n exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\n exports.browser = function (reason) {\n retLine truncated
|
||||
+15850
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react-dom_client.js","names":[],"sources":["../../scheduler/cjs/scheduler.development.js","../../scheduler/index.js","../../react-dom/cjs/react-dom-client.development.js","../../react-dom/client.js"],"sourcesContent":["/**\n * @license React\n * scheduler.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime &&\n shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n }\n function push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node),\n (heap[index] = parent),\n (index = parentIndex);\n else break a;\n }\n }\n function peek(heap) {\n return 0 === heap.length ? null : heap[0];\n }\n function pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex);\n else break a;\n }\n }\n return first;\n }\n function compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n Line truncated
|
||||
+788
@@ -0,0 +1,788 @@
|
||||
import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
||||
//#region node_modules/react/cjs/react.development.js
|
||||
/**
|
||||
* @license React
|
||||
* react.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var require_react_development = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
(function() {
|
||||
function defineDeprecationWarning(methodName, info) {
|
||||
Object.defineProperty(Component.prototype, methodName, { get: function() {
|
||||
console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
||||
} });
|
||||
}
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
||||
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
||||
return "function" === typeof maybeIterable ? maybeIterable : null;
|
||||
}
|
||||
function warnNoop(publicInstance, callerName) {
|
||||
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
||||
var warningKey = publicInstance + "." + callerName;
|
||||
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error("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, publicInstance), didWarnStateUpdateForUnmountedComponent[warningKey] = !0);
|
||||
}
|
||||
function Component(props, context, updater) {
|
||||
this.props = props;
|
||||
this.context = context;
|
||||
this.refs = emptyObject;
|
||||
this.updater = updater || ReactNoopUpdateQueue;
|
||||
}
|
||||
function ComponentDummy() {}
|
||||
function PureComponent(props, context, updater) {
|
||||
this.props = props;
|
||||
this.context = context;
|
||||
this.refs = emptyObject;
|
||||
this.updater = updater || ReactNoopUpdateQueue;
|
||||
}
|
||||
function noop() {}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = !1;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = !0;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||
case REACT_PROFILER_TYPE: return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||
case REACT_VIEW_TRANSITION_TYPE: return "ViewTransition";
|
||||
}
|
||||
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE: return "Portal";
|
||||
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return !1;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = !0;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: !0
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||
var refProp = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
value: null
|
||||
});
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function cloneAndReplaceKey(oldElement, newKey) {
|
||||
newKey = ReactElement(oldElement.type, newKey, oldElement.props, oldElement._owner, oldElement._debugStack, oldElement._debugTask);
|
||||
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
||||
return newKey;
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
function escape(key) {
|
||||
var escaperLookup = {
|
||||
"=": "=0",
|
||||
":": "=2"
|
||||
};
|
||||
return "$" + key.replace(/[=:]/g, function(match) {
|
||||
return escaperLookup[match];
|
||||
});
|
||||
}
|
||||
function getElementKey(element, index) {
|
||||
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
||||
}
|
||||
function resolveThenable(thenable) {
|
||||
switch (thenable.status) {
|
||||
case "fulfilled": return thenable.value;
|
||||
case "rejected": throw thenable.reason;
|
||||
default: switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
|
||||
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
||||
}, function(error) {
|
||||
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||
})), thenable.status) {
|
||||
case "fulfilled": return thenable.value;
|
||||
case "rejected": throw thenable.reason;
|
||||
}
|
||||
}
|
||||
throw thenable;
|
||||
}
|
||||
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
||||
var type = typeof children;
|
||||
if ("undefined" === type || "boolean" === type) children = null;
|
||||
var invokeCallback = !1;
|
||||
if (null === children) invokeCallback = !0;
|
||||
else switch (type) {
|
||||
case "bigint":
|
||||
case "string":
|
||||
case "number":
|
||||
invokeCallback = !0;
|
||||
break;
|
||||
case "object": switch (children.$$typeof) {
|
||||
case REACT_ELEMENT_TYPE:
|
||||
case REACT_PORTAL_TYPE:
|
||||
invokeCallback = !0;
|
||||
break;
|
||||
case REACT_LAZY_TYPE: return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
|
||||
}
|
||||
}
|
||||
if (invokeCallback) {
|
||||
invokeCallback = children;
|
||||
callback = callback(invokeCallback);
|
||||
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
||||
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
||||
return c;
|
||||
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(callback, escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + childKey), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
||||
return 1;
|
||||
}
|
||||
invokeCallback = 0;
|
||||
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
||||
if (isArrayImpl(children)) for (var i = 0; i < children.length; i++) nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
||||
else if (i = getIteratorFn(children), "function" === typeof i) for (i === children.entries && (didWarnAboutMaps || console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), didWarnAboutMaps = !0), children = i.call(children), i = 0; !(nameSoFar = children.next()).done;) nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
||||
else if ("object" === type) {
|
||||
if ("function" === typeof children.then) return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
||||
array = String(children);
|
||||
throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead.");
|
||||
}
|
||||
return invokeCallback;
|
||||
}
|
||||
function mapChildren(children, func, context) {
|
||||
if (null == children) return children;
|
||||
var result = [], count = 0;
|
||||
mapIntoArray(children, result, "", "", function(child) {
|
||||
return func.call(context, child, count++);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function lazyInitializer(payload) {
|
||||
if (-1 === payload._status) {
|
||||
var resolveDebugValue = null, rejectDebugValue = null, ioInfo = payload._ioInfo;
|
||||
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now(), ioInfo.value = new Promise(function(resolve, reject) {
|
||||
resolveDebugValue = resolve;
|
||||
rejectDebugValue = reject;
|
||||
}));
|
||||
ioInfo = payload._result;
|
||||
var thenable = ioInfo();
|
||||
thenable.then(function(moduleObject) {
|
||||
if (0 === payload._status || -1 === payload._status) {
|
||||
payload._status = 1;
|
||||
payload._result = moduleObject;
|
||||
var _ioInfo = payload._ioInfo;
|
||||
if (null != _ioInfo) {
|
||||
_ioInfo.end = performance.now();
|
||||
var debugValue = null == moduleObject ? void 0 : moduleObject.default;
|
||||
resolveDebugValue(debugValue);
|
||||
_ioInfo.value.status = "fulfilled";
|
||||
_ioInfo.value.value = debugValue;
|
||||
}
|
||||
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
||||
}
|
||||
}, function(error) {
|
||||
if (0 === payload._status || -1 === payload._status) {
|
||||
payload._status = 2;
|
||||
payload._result = error;
|
||||
var _ioInfo2 = payload._ioInfo;
|
||||
null != _ioInfo2 && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop, noop), rejectDebugValue(error), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error);
|
||||
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||
}
|
||||
});
|
||||
ioInfo = payload._ioInfo;
|
||||
if (null != ioInfo) {
|
||||
var displayName = thenable.displayName;
|
||||
"string" === typeof displayName && (ioInfo.name = displayName);
|
||||
}
|
||||
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
||||
}
|
||||
if (1 === payload._status) return ioInfo = payload._result, void 0 === ioInfo && console.error("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?", ioInfo), "default" in ioInfo || console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", ioInfo), ioInfo.default;
|
||||
throw payload._result;
|
||||
}
|
||||
function resolveDispatcher() {
|
||||
var dispatcher = ReactSharedInternals.H;
|
||||
null === dispatcher && console.error("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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
||||
return dispatcher;
|
||||
}
|
||||
function releaseAsyncTransition() {
|
||||
ReactSharedInternals.asyncTransitions--;
|
||||
}
|
||||
function startTransition(scope) {
|
||||
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
||||
currentTransition.types = null !== prevTransition ? prevTransition.types : null;
|
||||
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
try {
|
||||
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
||||
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
||||
} catch (error) {
|
||||
reportGlobalError(error);
|
||||
} finally {
|
||||
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.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.")), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
}
|
||||
function addTransitionType(type) {
|
||||
var transition = ReactSharedInternals.T;
|
||||
if (null !== transition) {
|
||||
var transitionTypes = transition.types;
|
||||
null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
|
||||
} else 0 === ReactSharedInternals.asyncTransitions && console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."), startTransition(addTransitionType.bind(null, type));
|
||||
}
|
||||
function enqueueTask(task) {
|
||||
if (null === enqueueTaskImpl) try {
|
||||
var requireString = ("require" + Math.random()).slice(0, 7);
|
||||
enqueueTaskImpl = (module && module[requireString]).call(module, "timers").setImmediate;
|
||||
} catch (_err) {
|
||||
enqueueTaskImpl = function(callback) {
|
||||
!1 === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = !0, "undefined" === typeof MessageChannel && console.error("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."));
|
||||
var channel = new MessageChannel();
|
||||
channel.port1.onmessage = callback;
|
||||
channel.port2.postMessage(void 0);
|
||||
};
|
||||
}
|
||||
return enqueueTaskImpl(task);
|
||||
}
|
||||
function aggregateErrors(errors) {
|
||||
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
||||
}
|
||||
function popActScope(prevActQueue, prevActScopeDepth) {
|
||||
prevActScopeDepth !== actScopeDepth - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
||||
actScopeDepth = prevActScopeDepth;
|
||||
}
|
||||
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
||||
var queue = ReactSharedInternals.actQueue;
|
||||
if (null !== queue) if (0 !== queue.length) try {
|
||||
flushActQueue(queue);
|
||||
enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||
});
|
||||
return;
|
||||
} catch (error) {
|
||||
ReactSharedInternals.thrownErrors.push(error);
|
||||
}
|
||||
else ReactSharedInternals.actQueue = null;
|
||||
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
||||
}
|
||||
function flushActQueue(queue) {
|
||||
if (!isFlushing) {
|
||||
isFlushing = !0;
|
||||
var i = 0;
|
||||
try {
|
||||
for (; i < queue.length; i++) {
|
||||
var callback = queue[i];
|
||||
do {
|
||||
ReactSharedInternals.didUsePromise = !1;
|
||||
var continuation = callback(!1);
|
||||
if (null !== continuation) {
|
||||
if (ReactSharedInternals.didUsePromise) {
|
||||
queue[i] = callback;
|
||||
queue.splice(0, i);
|
||||
return;
|
||||
}
|
||||
callback = continuation;
|
||||
} else break;
|
||||
} while (1);
|
||||
}
|
||||
queue.length = 0;
|
||||
} catch (error) {
|
||||
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
||||
} finally {
|
||||
isFlushing = !1;
|
||||
}
|
||||
}
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
||||
isMounted: function() {
|
||||
return !1;
|
||||
},
|
||||
enqueueForceUpdate: function(publicInstance) {
|
||||
warnNoop(publicInstance, "forceUpdate");
|
||||
},
|
||||
enqueueReplaceState: function(publicInstance) {
|
||||
warnNoop(publicInstance, "replaceState");
|
||||
},
|
||||
enqueueSetState: function(publicInstance) {
|
||||
warnNoop(publicInstance, "setState");
|
||||
}
|
||||
}, assign = Object.assign, emptyObject = {};
|
||||
Object.freeze(emptyObject);
|
||||
Component.prototype.isReactComponent = {};
|
||||
Component.prototype.setState = function(partialState, callback) {
|
||||
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
||||
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
||||
};
|
||||
Component.prototype.forceUpdate = function(callback) {
|
||||
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
||||
};
|
||||
var deprecatedAPIs = {
|
||||
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
||||
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
||||
};
|
||||
for (fnName in deprecatedAPIs) deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
||||
ComponentDummy.prototype = Component.prototype;
|
||||
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
||||
deprecatedAPIs.constructor = PureComponent;
|
||||
assign(deprecatedAPIs, Component.prototype);
|
||||
deprecatedAPIs.isPureReactComponent = !0;
|
||||
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
||||
H: null,
|
||||
A: null,
|
||||
T: null,
|
||||
S: null,
|
||||
actQueue: null,
|
||||
asyncTransitions: 0,
|
||||
isBatchingLegacy: !1,
|
||||
didScheduleLegacyUpdate: !1,
|
||||
didUsePromise: !1,
|
||||
thrownErrors: [],
|
||||
getCurrentStack: null,
|
||||
recentlyCreatedOwnerStacks: 0
|
||||
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
deprecatedAPIs = { react_stack_bottom_frame: function(callStackForError) {
|
||||
return callStackForError();
|
||||
} };
|
||||
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(deprecatedAPIs, UnknownOwner)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
||||
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
||||
var event = new window.ErrorEvent("error", {
|
||||
bubbles: !0,
|
||||
cancelable: !0,
|
||||
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
||||
error
|
||||
});
|
||||
if (!window.dispatchEvent(event)) return;
|
||||
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
||||
process.emit("uncaughtException", error);
|
||||
return;
|
||||
}
|
||||
console.error(error);
|
||||
}, didWarnAboutMessageChannel = !1, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = !1, isFlushing = !1, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
||||
queueMicrotask(function() {
|
||||
return queueMicrotask(callback);
|
||||
});
|
||||
} : enqueueTask;
|
||||
deprecatedAPIs = Object.freeze({
|
||||
__proto__: null,
|
||||
c: function(size) {
|
||||
return resolveDispatcher().useMemoCache(size);
|
||||
}
|
||||
});
|
||||
var fnName = {
|
||||
map: mapChildren,
|
||||
forEach: function(children, forEachFunc, forEachContext) {
|
||||
mapChildren(children, function() {
|
||||
forEachFunc.apply(this, arguments);
|
||||
}, forEachContext);
|
||||
},
|
||||
count: function(children) {
|
||||
var n = 0;
|
||||
mapChildren(children, function() {
|
||||
n++;
|
||||
});
|
||||
return n;
|
||||
},
|
||||
toArray: function(children) {
|
||||
return mapChildren(children, function(child) {
|
||||
return child;
|
||||
}) || [];
|
||||
},
|
||||
only: function(children) {
|
||||
if (!isValidElement(children)) throw Error("React.Children.only expected to receive a single React element child.");
|
||||
return children;
|
||||
}
|
||||
};
|
||||
exports.Activity = REACT_ACTIVITY_TYPE;
|
||||
exports.Children = fnName;
|
||||
exports.Component = Component;
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.Profiler = REACT_PROFILER_TYPE;
|
||||
exports.PureComponent = PureComponent;
|
||||
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
||||
exports.Suspense = REACT_SUSPENSE_TYPE;
|
||||
exports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
|
||||
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
||||
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
||||
exports.act = function(callback) {
|
||||
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
||||
actScopeDepth++;
|
||||
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = !1;
|
||||
try {
|
||||
var result = callback();
|
||||
} catch (error) {
|
||||
ReactSharedInternals.thrownErrors.push(error);
|
||||
}
|
||||
if (0 < ReactSharedInternals.thrownErrors.length) throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
||||
var thenable = result;
|
||||
queueSeveralMicrotasks(function() {
|
||||
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = !0, console.error("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 () => ...);"));
|
||||
});
|
||||
return { then: function(resolve, reject) {
|
||||
didAwaitActCall = !0;
|
||||
thenable.then(function(returnValue) {
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
if (0 === prevActScopeDepth) {
|
||||
try {
|
||||
flushActQueue(queue), enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||
});
|
||||
} catch (error$0) {
|
||||
ReactSharedInternals.thrownErrors.push(error$0);
|
||||
}
|
||||
if (0 < ReactSharedInternals.thrownErrors.length) {
|
||||
var _thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
|
||||
ReactSharedInternals.thrownErrors.length = 0;
|
||||
reject(_thrownError);
|
||||
}
|
||||
} else resolve(returnValue);
|
||||
}, function(error) {
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
||||
});
|
||||
} };
|
||||
}
|
||||
var returnValue$jscomp$0 = result;
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
||||
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = !0, console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"));
|
||||
}), ReactSharedInternals.actQueue = null);
|
||||
if (0 < ReactSharedInternals.thrownErrors.length) throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||
return { then: function(resolve, reject) {
|
||||
didAwaitActCall = !0;
|
||||
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve, reject);
|
||||
})) : resolve(returnValue$jscomp$0);
|
||||
} };
|
||||
};
|
||||
exports.addTransitionType = addTransitionType;
|
||||
exports.cache = function(fn) {
|
||||
return function() {
|
||||
return fn.apply(null, arguments);
|
||||
};
|
||||
};
|
||||
exports.cacheSignal = function() {
|
||||
return null;
|
||||
};
|
||||
exports.captureOwnerStack = function() {
|
||||
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
||||
return null === getCurrentStack ? null : getCurrentStack();
|
||||
};
|
||||
exports.cloneElement = function(element, config, children) {
|
||||
if (null === element || void 0 === element) throw Error("The argument must be a React element, but you passed " + element + ".");
|
||||
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
||||
if (null != config) {
|
||||
var JSCompiler_inline_result;
|
||||
a: {
|
||||
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(config, "ref").get) && JSCompiler_inline_result.isReactWarning) {
|
||||
JSCompiler_inline_result = !1;
|
||||
break a;
|
||||
}
|
||||
JSCompiler_inline_result = void 0 !== config.ref;
|
||||
}
|
||||
JSCompiler_inline_result && (owner = getOwner());
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
||||
for (propName in config) !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
||||
}
|
||||
var propName = arguments.length - 2;
|
||||
if (1 === propName) props.children = children;
|
||||
else if (1 < propName) {
|
||||
JSCompiler_inline_result = Array(propName);
|
||||
for (var i = 0; i < propName; i++) JSCompiler_inline_result[i] = arguments[i + 2];
|
||||
props.children = JSCompiler_inline_result;
|
||||
}
|
||||
props = ReactElement(element.type, key, props, owner, element._debugStack, element._debugTask);
|
||||
for (key = 2; key < arguments.length; key++) validateChildKeys(arguments[key]);
|
||||
return props;
|
||||
};
|
||||
exports.createContext = function(defaultValue) {
|
||||
defaultValue = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: defaultValue,
|
||||
_currentValue2: defaultValue,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null
|
||||
};
|
||||
defaultValue.Provider = defaultValue;
|
||||
defaultValue.Consumer = {
|
||||
$$typeof: REACT_CONSUMER_TYPE,
|
||||
_context: defaultValue
|
||||
};
|
||||
defaultValue._currentRenderer = null;
|
||||
defaultValue._currentRenderer2 = null;
|
||||
return defaultValue;
|
||||
};
|
||||
exports.createElement = function(type, config, children) {
|
||||
for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i]);
|
||||
var propName;
|
||||
i = {};
|
||||
var key = null;
|
||||
if (null != config) for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = !0, console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config) hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
||||
var childrenLength = arguments.length - 2;
|
||||
if (1 === childrenLength) i.children = children;
|
||||
else if (1 < childrenLength) {
|
||||
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++) childArray[_i] = arguments[_i + 2];
|
||||
Object.freeze && Object.freeze(childArray);
|
||||
i.children = childArray;
|
||||
}
|
||||
if (type && type.defaultProps) for (propName in childrenLength = type.defaultProps, childrenLength) void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
||||
key && defineKeyPropWarningGetter(i, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||
(propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++) ? (childArray = Error.stackTraceLimit, Error.stackTraceLimit = 10, childrenLength = Error("react-stack-top-frame"), Error.stackTraceLimit = childArray) : childrenLength = unknownOwnerDebugStack;
|
||||
return ReactElement(type, key, i, getOwner(), childrenLength, propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||
};
|
||||
exports.createRef = function() {
|
||||
var refObject = { current: null };
|
||||
Object.seal(refObject);
|
||||
return refObject;
|
||||
};
|
||||
exports.forwardRef = function(render) {
|
||||
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : "function" !== typeof render ? console.error("forwardRef requires a render function but was given %s.", null === render ? "null" : typeof render) : 0 !== render.length && 2 !== render.length && console.error("forwardRef render functions accept exactly two parameters: props and ref. %s", 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
||||
null != render && null != render.defaultProps && console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");
|
||||
var elementType = {
|
||||
$$typeof: REACT_FORWARD_REF_TYPE,
|
||||
render
|
||||
}, ownName;
|
||||
Object.defineProperty(elementType, "displayName", {
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
get: function() {
|
||||
return ownName;
|
||||
},
|
||||
set: function(name) {
|
||||
ownName = name;
|
||||
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
||||
}
|
||||
});
|
||||
return elementType;
|
||||
};
|
||||
exports.isValidElement = isValidElement;
|
||||
exports.lazy = function(ctor) {
|
||||
ctor = {
|
||||
_status: -1,
|
||||
_result: ctor
|
||||
};
|
||||
var lazyType = {
|
||||
$$typeof: REACT_LAZY_TYPE,
|
||||
_payload: ctor,
|
||||
_init: lazyInitializer
|
||||
}, ioInfo = {
|
||||
name: "lazy",
|
||||
start: -1,
|
||||
end: -1,
|
||||
value: null,
|
||||
owner: null,
|
||||
debugStack: Error("react-stack-top-frame"),
|
||||
debugTask: console.createTask ? console.createTask("lazy()") : null
|
||||
};
|
||||
ctor._ioInfo = ioInfo;
|
||||
lazyType._debugInfo = [{ awaited: ioInfo }];
|
||||
return lazyType;
|
||||
};
|
||||
exports.memo = function(type, compare) {
|
||||
type ?? console.error("memo: The first argument must be a component. Instead received: %s", null === type ? "null" : typeof type);
|
||||
compare = {
|
||||
$$typeof: REACT_MEMO_TYPE,
|
||||
type,
|
||||
compare: void 0 === compare ? null : compare
|
||||
};
|
||||
var ownName;
|
||||
Object.defineProperty(compare, "displayName", {
|
||||
enumerable: !1,
|
||||
configurable: !0,
|
||||
get: function() {
|
||||
return ownName;
|
||||
},
|
||||
set: function(name) {
|
||||
ownName = name;
|
||||
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
||||
}
|
||||
});
|
||||
return compare;
|
||||
};
|
||||
exports.startTransition = startTransition;
|
||||
exports.unstable_useCacheRefresh = function() {
|
||||
return resolveDispatcher().useCacheRefresh();
|
||||
};
|
||||
exports.use = function(usable) {
|
||||
return resolveDispatcher().use(usable);
|
||||
};
|
||||
exports.useActionState = function(action, initialState, permalink) {
|
||||
return resolveDispatcher().useActionState(action, initialState, permalink);
|
||||
};
|
||||
exports.useCallback = function(callback, deps) {
|
||||
return resolveDispatcher().useCallback(callback, deps);
|
||||
};
|
||||
exports.useContext = function(Context) {
|
||||
var dispatcher = resolveDispatcher();
|
||||
Context.$$typeof === REACT_CONSUMER_TYPE && console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?");
|
||||
return dispatcher.useContext(Context);
|
||||
};
|
||||
exports.useDebugValue = function(value, formatterFn) {
|
||||
return resolveDispatcher().useDebugValue(value, formatterFn);
|
||||
};
|
||||
exports.useDeferredValue = function(value, initialValue) {
|
||||
return resolveDispatcher().useDeferredValue(value, initialValue);
|
||||
};
|
||||
exports.useEffect = function(create, deps) {
|
||||
create ?? console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||
return resolveDispatcher().useEffect(create, deps);
|
||||
};
|
||||
exports.useEffectEvent = function(callback) {
|
||||
return resolveDispatcher().useEffectEvent(callback);
|
||||
};
|
||||
exports.useId = function() {
|
||||
return resolveDispatcher().useId();
|
||||
};
|
||||
exports.useImperativeHandle = function(ref, create, deps) {
|
||||
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
||||
};
|
||||
exports.useInsertionEffect = function(create, deps) {
|
||||
create ?? console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||
return resolveDispatcher().useInsertionEffect(create, deps);
|
||||
};
|
||||
exports.useLayoutEffect = function(create, deps) {
|
||||
create ?? console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||
return resolveDispatcher().useLayoutEffect(create, deps);
|
||||
};
|
||||
exports.useMemo = function(create, deps) {
|
||||
return resolveDispatcher().useMemo(create, deps);
|
||||
};
|
||||
exports.useOptimistic = function(passthrough, reducer) {
|
||||
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
||||
};
|
||||
exports.useReducer = function(reducer, initialArg, init) {
|
||||
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
||||
};
|
||||
exports.useRef = function(initialValue) {
|
||||
return resolveDispatcher().useRef(initialValue);
|
||||
};
|
||||
exports.useState = function(initialState) {
|
||||
return resolveDispatcher().useState(initialState);
|
||||
};
|
||||
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
||||
return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||
};
|
||||
exports.useTransition = function() {
|
||||
return resolveDispatcher().useTransition();
|
||||
};
|
||||
exports.version = "19.3.0";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}));
|
||||
//#endregion
|
||||
//#region node_modules/react/index.js
|
||||
var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = require_react_development();
|
||||
}));
|
||||
//#endregion
|
||||
export default require_react();
|
||||
export { require_react as t };
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react.js","names":[],"sources":["../../react/cjs/react.development.js","../../react/index.js"],"sourcesContent":["/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function defineDeprecationWarning(methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n console.warn(\n \"%s(...) is deprecated in plain JavaScript React classes. %s\",\n info[0],\n info[1]\n );\n }\n });\n }\n function getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable)\n return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n }\n function warnNoop(publicInstance, callerName) {\n publicInstance =\n ((publicInstance = publicInstance.constructor) &&\n (publicInstance.displayName || publicInstance.name)) ||\n \"ReactClass\";\n var warningKey = publicInstance + \".\" + callerName;\n didWarnStateUpdateForUnmountedComponent[warningKey] ||\n (console.error(\n \"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.\",\n callerName,\n publicInstance\n ),\n (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));\n }\n function Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function ComponentDummy() {}\n function PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayNaLine truncated
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
//#region node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-dev-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var require_react_jsx_dev_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||
case REACT_PROFILER_TYPE: return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||
case REACT_VIEW_TRANSITION_TYPE: return "ViewTransition";
|
||||
}
|
||||
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE: return "Portal";
|
||||
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = !1;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = !0;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return !1;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = !0;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: !0
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||
var refProp = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
value: null
|
||||
});
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("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} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||
return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = { react_stack_bottom_frame: function(callStackForError) {
|
||||
return callStackForError();
|
||||
} };
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsxDEV = function(type, config, maybeKey, isStaticChildren) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
if (trackActualOwner) {
|
||||
var previousStackTraceLimit = Error.stackTraceLimit;
|
||||
Error.stackTraceLimit = 10;
|
||||
var debugStackDEV = Error("react-stack-top-frame");
|
||||
Error.stackTraceLimit = previousStackTraceLimit;
|
||||
} else debugStackDEV = unknownOwnerDebugStack;
|
||||
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStackDEV, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||
};
|
||||
})();
|
||||
}));
|
||||
//#endregion
|
||||
//#region node_modules/react/jsx-dev-runtime.js
|
||||
var require_jsx_dev_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = require_react_jsx_dev_runtime_development();
|
||||
}));
|
||||
//#endregion
|
||||
export default require_jsx_dev_runtime();
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react_jsx-dev-runtime.js","names":[],"sources":["../../react/cjs/react-jsx-dev-runtime.development.js","../../react/jsx-dev-runtime.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in Line truncated
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
//#region node_modules/react/cjs/react-jsx-runtime.development.js
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||
case REACT_PROFILER_TYPE: return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||
case REACT_VIEW_TRANSITION_TYPE: return "ViewTransition";
|
||||
}
|
||||
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE: return "Portal";
|
||||
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = !1;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = !0;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return !1;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = !0;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: !0
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||
var refProp = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", {
|
||||
enumerable: !1,
|
||||
value: null
|
||||
});
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("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} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||
return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = { react_stack_bottom_frame: function(callStackForError) {
|
||||
return callStackForError();
|
||||
} };
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsx = function(type, config, maybeKey) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
if (trackActualOwner) {
|
||||
var previousStackTraceLimit = Error.stackTraceLimit;
|
||||
Error.stackTraceLimit = 10;
|
||||
var debugStackDEV = Error("react-stack-top-frame");
|
||||
Error.stackTraceLimit = previousStackTraceLimit;
|
||||
} else debugStackDEV = unknownOwnerDebugStack;
|
||||
return jsxDEVImpl(type, config, maybeKey, !1, debugStackDEV, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||
};
|
||||
exports.jsxs = function(type, config, maybeKey) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
if (trackActualOwner) {
|
||||
var previousStackTraceLimit = Error.stackTraceLimit;
|
||||
Error.stackTraceLimit = 10;
|
||||
var debugStackDEV = Error("react-stack-top-frame");
|
||||
Error.stackTraceLimit = previousStackTraceLimit;
|
||||
} else debugStackDEV = unknownOwnerDebugStack;
|
||||
return jsxDEVImpl(type, config, maybeKey, !0, debugStackDEV, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||
};
|
||||
})();
|
||||
}));
|
||||
//#endregion
|
||||
//#region node_modules/react/jsx-runtime.js
|
||||
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = require_react_jsx_runtime_development();
|
||||
}));
|
||||
//#endregion
|
||||
export default require_jsx_runtime();
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"react_jsx-runtime.js","names":[],"sources":["../../react/cjs/react-jsx-runtime.development.js","../../react/jsx-runtime.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` beinLine truncated
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
//#region \0rolldown/runtime.js
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
||||
var __exportAll = (all, no_symbols) => {
|
||||
let target = {};
|
||||
for (var name in all) __defProp(target, name, {
|
||||
get: all[name],
|
||||
enumerable: true
|
||||
});
|
||||
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
||||
return target;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||||
key = keys[i];
|
||||
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||||
get: ((k) => from[k]).bind(null, key),
|
||||
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||||
});
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
||||
value: mod,
|
||||
enumerable: true
|
||||
}) : target, mod));
|
||||
//#endregion
|
||||
export { __exportAll as n, __toESM as r, __commonJSMin as t };
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
import { t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
(function() {
|
||||
function is(x, y) {
|
||||
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
||||
}
|
||||
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
||||
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
||||
var value = getSnapshot();
|
||||
if (!didWarnUncachedGetSnapshot) {
|
||||
var cachedValue = getSnapshot();
|
||||
objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
|
||||
}
|
||||
cachedValue = useState({ inst: {
|
||||
value,
|
||||
getSnapshot
|
||||
} });
|
||||
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
||||
useLayoutEffect(function() {
|
||||
inst.value = value;
|
||||
inst.getSnapshot = getSnapshot;
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
||||
}, [
|
||||
subscribe,
|
||||
value,
|
||||
getSnapshot
|
||||
]);
|
||||
useEffect(function() {
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
||||
return subscribe(function() {
|
||||
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
||||
});
|
||||
}, [subscribe]);
|
||||
useDebugValue(value);
|
||||
return value;
|
||||
}
|
||||
function checkIfSnapshotChanged(inst) {
|
||||
var latestGetSnapshot = inst.getSnapshot;
|
||||
inst = inst.value;
|
||||
try {
|
||||
var nextValue = latestGetSnapshot();
|
||||
return !objectIs(inst, nextValue);
|
||||
} catch (error) {
|
||||
return !0;
|
||||
}
|
||||
}
|
||||
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
||||
return getSnapshot();
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var React = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = !1, didWarnUncachedGetSnapshot = !1, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
||||
exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}));
|
||||
//#endregion
|
||||
//#region node_modules/use-sync-external-store/shim/index.js
|
||||
var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = require_use_sync_external_store_shim_development();
|
||||
}));
|
||||
//#endregion
|
||||
export { require_shim as t };
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"shim-BX6a9SD7.js","names":[],"sources":["../../use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../use-sync-external-store/shim/index.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n"],"mappings":";;;;;;;;;;;;;CAWA,CACG,WAAY;EACX,SAAS,GAAG,GAAG,GAAG;GAChB,OAAQ,MAAM,MAAM,MAAM,KAAK,IAAI,MAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;EACxE;EACA,SAAS,uBAAuB,WAAW,aAAa;GACtD,qBACE,KAAK,MAAM,MAAM,oBACf,oBAAoB,CAAC,GACvB,QAAQ,MACN,gMACF;GACF,IAAI,QAAQ,YAAY;GACxB,IAAI,CAAC,4BAA4B;IAC/B,IAAI,cAAc,YAAY;IAC9B,SAAS,OAAO,WAAW,MACxB,QAAQ,MACP,sEACF,GACC,6BAA6B,CAAC;GACnC;GACA,cAAc,SAAS,EACrB,MAAM;IAAS;IAAoB;GAAY,EACjD,CAAC;GACD,IAAI,OAAO,YAAY,EAAE,CAAC,MACxB,cAAc,YAAY;GAC5B,gBACE,WAAY;IACV,KAAK,QAAQ;IACb,KAAK,cAAc;IACnB,uBAAuB,IAAI,KAAK,YAAY,EAAQ,KAAK,CAAC;GAC5D,GACA;IAAC;IAAW;IAAO;GAAW,CAChC;GACA,UACE,WAAY;IACV,uBAAuB,IAAI,KAAK,YAAY,EAAQ,KAAK,CAAC;IAC1D,OAAO,UAAU,WAAY;KAC3B,uBAAuB,IAAI,KAAK,YAAY,EAAQ,KAAK,CAAC;IAC5D,CAAC;GACH,GACA,CAAC,SAAS,CACZ;GACA,cAAc,KAAK;GACnB,OAAO;EACT;EACA,SAAS,uBAAuB,MAAM;GACpC,IAAI,oBAAoB,KAAK;GAC7B,OAAO,KAAK;GACZ,IAAI;IACF,IAAI,YAAY,kBAAkB;IAClC,OAAO,CAAC,SAAS,MAAM,SAAS;GAClC,SAAS,OAAO;IACd,OAAO,CAAC;GACV;EACF;EACA,SAAS,uBAAuB,WAAW,aAAa;Line truncated
|
||||
+923
@@ -0,0 +1,923 @@
|
||||
import { r as __toESM } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
import { t as require_shim } from "./shim-BX6a9SD7.js";
|
||||
//#region node_modules/dequal/lite/index.mjs
|
||||
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
||||
var import_shim = require_shim();
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
function dequal(foo, bar) {
|
||||
var ctor, len;
|
||||
if (foo === bar) return true;
|
||||
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
||||
if (ctor === Date) return foo.getTime() === bar.getTime();
|
||||
if (ctor === RegExp) return foo.toString() === bar.toString();
|
||||
if (ctor === Array) {
|
||||
if ((len = foo.length) === bar.length) while (len-- && dequal(foo[len], bar[len]));
|
||||
return len === -1;
|
||||
}
|
||||
if (!ctor || typeof foo === "object") {
|
||||
len = 0;
|
||||
for (ctor in foo) {
|
||||
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
||||
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
||||
}
|
||||
return Object.keys(bar).length === len;
|
||||
}
|
||||
}
|
||||
return foo !== foo && bar !== bar;
|
||||
}
|
||||
var SWRGlobalState = /* @__PURE__ */ new WeakMap();
|
||||
var noop = () => {};
|
||||
var OBJECT = Object;
|
||||
var isUndefined = (v) => v === void 0;
|
||||
var isFunction = (v) => typeof v == "function";
|
||||
var mergeObjects = (a, b) => ({
|
||||
...a,
|
||||
...b
|
||||
});
|
||||
var isPromiseLike = (x) => isFunction(x.then);
|
||||
var EMPTY_CACHE = {};
|
||||
var INITIAL_CACHE = {};
|
||||
var STR_UNDEFINED = "undefined";
|
||||
var isWindowDefined = typeof window != STR_UNDEFINED;
|
||||
var isDocumentDefined = typeof document != STR_UNDEFINED;
|
||||
var isLegacyDeno = isWindowDefined && "Deno" in window;
|
||||
var hasRequestAnimationFrame = () => isWindowDefined && typeof window["requestAnimationFrame"] != STR_UNDEFINED;
|
||||
var createCacheHelper = (cache, key) => {
|
||||
const state = SWRGlobalState.get(cache);
|
||||
return [
|
||||
() => !isUndefined(key) && cache.get(key) || EMPTY_CACHE,
|
||||
(info) => {
|
||||
if (!isUndefined(key)) {
|
||||
const prev = cache.get(key);
|
||||
if (!(key in INITIAL_CACHE)) INITIAL_CACHE[key] = prev;
|
||||
state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);
|
||||
}
|
||||
},
|
||||
state[6],
|
||||
() => {
|
||||
if (!isUndefined(key)) {
|
||||
if (key in INITIAL_CACHE) return INITIAL_CACHE[key];
|
||||
}
|
||||
return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;
|
||||
}
|
||||
];
|
||||
};
|
||||
/**
|
||||
* Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
||||
* it's not reliable to detect if the browser is currently online or offline
|
||||
* based on `navigator.onLine`.
|
||||
* As a workaround, we always assume it's online on the first load, and change
|
||||
* the status upon `online` or `offline` events.
|
||||
*/ var online = true;
|
||||
var isOnline = () => online;
|
||||
var [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [window.addEventListener.bind(window), window.removeEventListener.bind(window)] : [noop, noop];
|
||||
var isVisible = () => {
|
||||
const visibilityState = isDocumentDefined && document.visibilityState;
|
||||
return isUndefined(visibilityState) || visibilityState !== "hidden";
|
||||
};
|
||||
var initFocus = (callback) => {
|
||||
if (isDocumentDefined) document.addEventListener("visibilitychange", callback);
|
||||
onWindowEvent("focus", callback);
|
||||
return () => {
|
||||
if (isDocumentDefined) document.removeEventListener("visibilitychange", callback);
|
||||
offWindowEvent("focus", callback);
|
||||
};
|
||||
};
|
||||
var initReconnect = (callback) => {
|
||||
const onOnline = () => {
|
||||
online = true;
|
||||
callback();
|
||||
};
|
||||
const onOffline = () => {
|
||||
online = false;
|
||||
};
|
||||
onWindowEvent("online", onOnline);
|
||||
onWindowEvent("offline", onOffline);
|
||||
return () => {
|
||||
offWindowEvent("online", onOnline);
|
||||
offWindowEvent("offline", onOffline);
|
||||
};
|
||||
};
|
||||
var preset = {
|
||||
isOnline,
|
||||
isVisible
|
||||
};
|
||||
var defaultConfigOptions = {
|
||||
initFocus,
|
||||
initReconnect
|
||||
};
|
||||
var IS_REACT_LEGACY = !import_react.useId;
|
||||
var IS_SERVER = !isWindowDefined || isLegacyDeno;
|
||||
var rAF = (f) => hasRequestAnimationFrame() ? window["requestAnimationFrame"](f) : setTimeout(f, 1);
|
||||
var useIsomorphicLayoutEffect = IS_SERVER ? import_react.useEffect : import_react.useLayoutEffect;
|
||||
var navigatorConnection = typeof navigator !== "undefined" && navigator.connection;
|
||||
var slowConnection = !IS_SERVER && navigatorConnection && (["slow-2g", "2g"].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);
|
||||
var table = /* @__PURE__ */ new WeakMap();
|
||||
var getTypeName = (value) => OBJECT.prototype.toString.call(value);
|
||||
var isObjectTypeName = (typeName, type) => typeName === `[object ${type}]`;
|
||||
var counter = 0;
|
||||
var stableHash = (arg) => {
|
||||
const type = typeof arg;
|
||||
const typeName = getTypeName(arg);
|
||||
const isDate = isObjectTypeName(typeName, "Date");
|
||||
const isRegex = isObjectTypeName(typeName, "RegExp");
|
||||
const isPlainObject = isObjectTypeName(typeName, "Object");
|
||||
let result;
|
||||
let index;
|
||||
if (OBJECT(arg) === arg && !isDate && !isRegex) {
|
||||
result = table.get(arg);
|
||||
if (result) return result;
|
||||
result = ++counter + "~";
|
||||
table.set(arg, result);
|
||||
if (Array.isArray(arg)) {
|
||||
result = "@";
|
||||
for (index = 0; index < arg.length; index++) result += stableHash(arg[index]) + ",";
|
||||
table.set(arg, result);
|
||||
}
|
||||
if (isPlainObject) {
|
||||
result = "#";
|
||||
const keys = OBJECT.keys(arg).sort();
|
||||
while (!isUndefined(index = keys.pop())) if (!isUndefined(arg[index])) result += index + ":" + stableHash(arg[index]) + ",";
|
||||
table.set(arg, result);
|
||||
}
|
||||
} else result = isDate ? arg.toJSON() : type == "symbol" ? arg.toString() : type == "string" ? JSON.stringify(arg) : "" + arg;
|
||||
return result;
|
||||
};
|
||||
var serialize = (key) => {
|
||||
if (isFunction(key)) try {
|
||||
key = key();
|
||||
} catch (err) {
|
||||
key = "";
|
||||
}
|
||||
const args = key;
|
||||
key = typeof key == "string" ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : "";
|
||||
return [key, args];
|
||||
};
|
||||
var __timestamp = 0;
|
||||
var getTimestamp = () => ++__timestamp;
|
||||
async function internalMutate(...args) {
|
||||
const [cache, _key, _data, _opts] = args;
|
||||
const options = mergeObjects({
|
||||
populateCache: true,
|
||||
throwOnError: true
|
||||
}, typeof _opts === "boolean" ? { revalidate: _opts } : _opts || {});
|
||||
let populateCache = options.populateCache;
|
||||
const rollbackOnErrorOption = options.rollbackOnError;
|
||||
let optimisticData = options.optimisticData;
|
||||
const rollbackOnError = (error) => {
|
||||
return typeof rollbackOnErrorOption === "function" ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;
|
||||
};
|
||||
const throwOnError = options.throwOnError;
|
||||
if (isFunction(_key)) {
|
||||
const keyFilter = _key;
|
||||
const matchedKeys = [];
|
||||
const it = cache.keys();
|
||||
for (const key of it) if (!/^\$(inf|sub)\$/.test(key) && keyFilter(cache.get(key)._k)) matchedKeys.push(key);
|
||||
return Promise.all(matchedKeys.map(mutateByKey));
|
||||
}
|
||||
return mutateByKey(_key);
|
||||
async function mutateByKey(_k) {
|
||||
const [key] = serialize(_k);
|
||||
if (!key) return;
|
||||
const [get, set] = createCacheHelper(cache, key);
|
||||
const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);
|
||||
const startRevalidate = () => {
|
||||
const revalidators = EVENT_REVALIDATORS[key];
|
||||
if (isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false) {
|
||||
delete FETCH[key];
|
||||
delete PRELOAD[key];
|
||||
if (revalidators && revalidators[0]) return revalidators[0](2).then(() => get().data);
|
||||
}
|
||||
return get().data;
|
||||
};
|
||||
if (args.length < 3) return startRevalidate();
|
||||
let data = _data;
|
||||
let error;
|
||||
let isError = false;
|
||||
const beforeMutationTs = getTimestamp();
|
||||
MUTATION[key] = [beforeMutationTs, 0];
|
||||
const hasOptimisticData = !isUndefined(optimisticData);
|
||||
const state = get();
|
||||
const displayedData = state.data;
|
||||
const currentData = state._c;
|
||||
const committedData = isUndefined(currentData) ? displayedData : currentData;
|
||||
if (hasOptimisticData) {
|
||||
optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;
|
||||
set({
|
||||
data: optimisticData,
|
||||
_c: committedData
|
||||
});
|
||||
}
|
||||
if (isFunction(data)) try {
|
||||
data = data(committedData);
|
||||
} catch (err) {
|
||||
error = err;
|
||||
isError = true;
|
||||
}
|
||||
if (data && isPromiseLike(data)) {
|
||||
data = await data.catch((err) => {
|
||||
error = err;
|
||||
isError = true;
|
||||
});
|
||||
if (beforeMutationTs !== MUTATION[key][0]) {
|
||||
if (isError) throw error;
|
||||
return data;
|
||||
} else if (isError && hasOptimisticData && rollbackOnError(error)) {
|
||||
populateCache = true;
|
||||
set({
|
||||
data: committedData,
|
||||
_c: void 0
|
||||
});
|
||||
}
|
||||
}
|
||||
if (populateCache) {
|
||||
if (!isError) {
|
||||
if (isFunction(populateCache)) set({
|
||||
data: populateCache(data, committedData),
|
||||
error: void 0,
|
||||
_c: void 0
|
||||
});
|
||||
else set({
|
||||
data,
|
||||
error: void 0,
|
||||
_c: void 0
|
||||
});
|
||||
}
|
||||
}
|
||||
MUTATION[key][1] = getTimestamp();
|
||||
Promise.resolve(startRevalidate()).then(() => {
|
||||
set({ _c: void 0 });
|
||||
});
|
||||
if (isError) {
|
||||
if (throwOnError) throw error;
|
||||
return;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
var revalidateAllKeys = (revalidators, type) => {
|
||||
for (const key in revalidators) if (revalidators[key][0]) revalidators[key][0](type);
|
||||
};
|
||||
var initCache = (provider, options) => {
|
||||
if (!SWRGlobalState.has(provider)) {
|
||||
const opts = mergeObjects(defaultConfigOptions, options);
|
||||
const EVENT_REVALIDATORS = Object.create(null);
|
||||
const mutate = internalMutate.bind(void 0, provider);
|
||||
let unmount = noop;
|
||||
const subscriptions = Object.create(null);
|
||||
const subscribe = (key, callback) => {
|
||||
const subs = subscriptions[key] || [];
|
||||
subscriptions[key] = subs;
|
||||
subs.push(callback);
|
||||
return () => {
|
||||
const index = subs.indexOf(callback);
|
||||
if (index >= 0) {
|
||||
subs[index] = subs[subs.length - 1];
|
||||
subs.pop();
|
||||
}
|
||||
};
|
||||
};
|
||||
const setter = (key, value, prev) => {
|
||||
provider.set(key, value);
|
||||
const subs = subscriptions[key];
|
||||
if (subs) for (const fn of subs) fn(value, prev);
|
||||
};
|
||||
const unload = (unloadOptions) => {
|
||||
const state = SWRGlobalState.get(provider);
|
||||
const [, MUTATION, FETCH, PRELOAD] = state;
|
||||
const ts = getTimestamp();
|
||||
state[8]++;
|
||||
for (const key in FETCH) delete FETCH[key];
|
||||
for (const key in PRELOAD) delete PRELOAD[key];
|
||||
for (const key in MUTATION) MUTATION[key] = [ts, ts];
|
||||
const emptyState = {};
|
||||
for (const key of [...provider.keys()]) {
|
||||
const prev = provider.get(key);
|
||||
provider.delete(key);
|
||||
const subs = subscriptions[key];
|
||||
if (subs) for (const fn of subs) fn(emptyState, prev);
|
||||
}
|
||||
const revalidate = !unloadOptions || unloadOptions.revalidate !== false;
|
||||
for (const key in EVENT_REVALIDATORS) {
|
||||
const revalidators = EVENT_REVALIDATORS[key];
|
||||
for (let i = 0; i < revalidators.length; i++) revalidators[i](4, { revalidate: revalidate && !i });
|
||||
}
|
||||
};
|
||||
const initProvider = () => {
|
||||
if (!SWRGlobalState.has(provider)) {
|
||||
SWRGlobalState.set(provider, [
|
||||
EVENT_REVALIDATORS,
|
||||
Object.create(null),
|
||||
Object.create(null),
|
||||
Object.create(null),
|
||||
mutate,
|
||||
setter,
|
||||
subscribe,
|
||||
unload,
|
||||
0
|
||||
]);
|
||||
if (!IS_SERVER) {
|
||||
const releaseFocus = opts.initFocus(setTimeout.bind(void 0, revalidateAllKeys.bind(void 0, EVENT_REVALIDATORS, 0)));
|
||||
const releaseReconnect = opts.initReconnect(setTimeout.bind(void 0, revalidateAllKeys.bind(void 0, EVENT_REVALIDATORS, 1)));
|
||||
unmount = () => {
|
||||
releaseFocus && releaseFocus();
|
||||
releaseReconnect && releaseReconnect();
|
||||
SWRGlobalState.delete(provider);
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
initProvider();
|
||||
return [
|
||||
provider,
|
||||
mutate,
|
||||
initProvider,
|
||||
unmount,
|
||||
unload
|
||||
];
|
||||
}
|
||||
const state = SWRGlobalState.get(provider);
|
||||
return [
|
||||
provider,
|
||||
state[4],
|
||||
void 0,
|
||||
void 0,
|
||||
state[7]
|
||||
];
|
||||
};
|
||||
var onErrorRetry = (_, __, config, revalidate, opts) => {
|
||||
const maxRetryCount = config.errorRetryCount;
|
||||
const currentRetryCount = opts.retryCount;
|
||||
const timeout = ~~((Math.random() + .5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
|
||||
if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) return;
|
||||
setTimeout(revalidate, timeout, opts);
|
||||
};
|
||||
var compare = dequal;
|
||||
var [cache, mutate, , , unload] = initCache(/* @__PURE__ */ new Map());
|
||||
var defaultConfig = mergeObjects({
|
||||
onLoadingSlow: noop,
|
||||
onSuccess: noop,
|
||||
onError: noop,
|
||||
onErrorRetry,
|
||||
onDiscarded: noop,
|
||||
revalidateOnFocus: true,
|
||||
revalidateOnReconnect: true,
|
||||
revalidateIfStale: true,
|
||||
shouldRetryOnError: true,
|
||||
errorRetryInterval: slowConnection ? 1e4 : 5e3,
|
||||
focusThrottleInterval: 5e3,
|
||||
dedupingInterval: 2e3,
|
||||
loadingTimeout: slowConnection ? 5e3 : 3e3,
|
||||
compare,
|
||||
isPaused: () => false,
|
||||
cache,
|
||||
mutate,
|
||||
unload,
|
||||
fallback: {}
|
||||
}, preset);
|
||||
var mergeConfigs = (a, b) => {
|
||||
const v = mergeObjects(a, b);
|
||||
if (b) {
|
||||
const { use: u1, fallback: f1, cacheData: c1 } = a;
|
||||
const { use: u2, fallback: f2, cacheData: c2 } = b;
|
||||
if (u1 && u2) v.use = u1.concat(u2);
|
||||
if (f1 && f2) v.fallback = mergeObjects(f1, f2);
|
||||
if (c1 && c2) v.cacheData = mergeObjects(c1, c2);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
var SWRConfigContext = (0, import_react.createContext)({});
|
||||
var SWRConfig$1 = (props) => {
|
||||
const { value } = props;
|
||||
const parentConfig = (0, import_react.useContext)(SWRConfigContext);
|
||||
const isFunctionalConfig = isFunction(value);
|
||||
const config = (0, import_react.useMemo)(() => isFunctionalConfig ? value(parentConfig) : value, [
|
||||
isFunctionalConfig,
|
||||
parentConfig,
|
||||
value
|
||||
]);
|
||||
const extendedConfig = (0, import_react.useMemo)(() => isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [
|
||||
isFunctionalConfig,
|
||||
parentConfig,
|
||||
config
|
||||
]);
|
||||
const provider = config && config.provider;
|
||||
const cacheContextRef = (0, import_react.useRef)(void 0);
|
||||
if (provider && !cacheContextRef.current) cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);
|
||||
const cacheContext = cacheContextRef.current;
|
||||
if (cacheContext) {
|
||||
extendedConfig.cache = cacheContext[0];
|
||||
extendedConfig.mutate = cacheContext[1];
|
||||
extendedConfig.unload = cacheContext[4];
|
||||
}
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
if (cacheContext) {
|
||||
cacheContext[2] && cacheContext[2]();
|
||||
return cacheContext[3];
|
||||
}
|
||||
}, []);
|
||||
return (0, import_react.createElement)(SWRConfigContext.Provider, mergeObjects(props, { value: extendedConfig }));
|
||||
};
|
||||
//#endregion
|
||||
//#region node_modules/swr/dist/_internal/index.mjs
|
||||
var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
|
||||
var use$1 = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
|
||||
var setupDevTools = () => {
|
||||
if (enableDevtools) window.__SWR_DEVTOOLS_REACT__ = import_react.default;
|
||||
};
|
||||
var normalize = (args) => {
|
||||
return isFunction(args[1]) ? [
|
||||
args[0],
|
||||
args[1],
|
||||
args[2] || {}
|
||||
] : [
|
||||
args[0],
|
||||
null,
|
||||
(args[1] === null ? args[2] : args[1]) || {}
|
||||
];
|
||||
};
|
||||
var useSWRConfig = () => {
|
||||
const parentConfig = (0, import_react.useContext)(SWRConfigContext);
|
||||
return (0, import_react.useMemo)(() => mergeObjects(defaultConfig, parentConfig), [parentConfig]);
|
||||
};
|
||||
var preload = (key_, fetcher) => {
|
||||
if (IS_SERVER) return;
|
||||
const [key, fnArg] = serialize(key_);
|
||||
const [, , , PRELOAD] = SWRGlobalState.get(cache);
|
||||
if (PRELOAD[key]) return PRELOAD[key];
|
||||
const req = fetcher(fnArg);
|
||||
PRELOAD[key] = req;
|
||||
return req;
|
||||
};
|
||||
var middleware = (useSWRNext) => (key_, fetcher_, config) => {
|
||||
return useSWRNext(key_, fetcher_ && ((...args) => {
|
||||
const [key] = serialize(key_);
|
||||
const [, , , PRELOAD] = SWRGlobalState.get(cache);
|
||||
if (key.startsWith("$inf$")) return fetcher_(...args);
|
||||
const req = PRELOAD[key];
|
||||
if (isUndefined(req)) return fetcher_(...args);
|
||||
delete PRELOAD[key];
|
||||
return req;
|
||||
}), config);
|
||||
};
|
||||
var BUILT_IN_MIDDLEWARE = use$1.concat(middleware);
|
||||
var withArgs = (hook) => {
|
||||
return function useSWRArgs(...args) {
|
||||
const fallbackConfig = useSWRConfig();
|
||||
const [key, fn, _config] = normalize(args);
|
||||
const config = mergeConfigs(fallbackConfig, _config);
|
||||
let next = hook;
|
||||
const { use } = config;
|
||||
const middleware = (use || []).concat(BUILT_IN_MIDDLEWARE);
|
||||
for (let i = middleware.length; i--;) next = middleware[i](next);
|
||||
return next(key, fn || config.fetcher || null, config);
|
||||
};
|
||||
};
|
||||
var subscribeCallback = (key, callbacks, callback) => {
|
||||
const keyedRevalidators = callbacks[key] || (callbacks[key] = []);
|
||||
keyedRevalidators.push(callback);
|
||||
return () => {
|
||||
const index = keyedRevalidators.indexOf(callback);
|
||||
if (index >= 0) {
|
||||
keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];
|
||||
keyedRevalidators.pop();
|
||||
}
|
||||
};
|
||||
};
|
||||
setupDevTools();
|
||||
//#endregion
|
||||
//#region node_modules/swr/dist/use-swr-emll9s78.mjs
|
||||
var use = import_react.use || ((thenable) => {
|
||||
switch (thenable.status) {
|
||||
case "pending": throw thenable;
|
||||
case "fulfilled": return thenable.value;
|
||||
case "rejected": throw thenable.reason;
|
||||
default:
|
||||
thenable.status = "pending";
|
||||
thenable.then((v) => {
|
||||
thenable.status = "fulfilled";
|
||||
thenable.value = v;
|
||||
}, (e) => {
|
||||
thenable.status = "rejected";
|
||||
thenable.reason = e;
|
||||
});
|
||||
throw thenable;
|
||||
}
|
||||
});
|
||||
var WITH_DEDUPE = { dedupe: true };
|
||||
var isCacheDataConsumed = (consumedCacheData, cacheData, key) => {
|
||||
var _consumedCacheData_get;
|
||||
return cacheData ? ((_consumedCacheData_get = consumedCacheData.get(cacheData)) == null ? void 0 : _consumedCacheData_get.has(key)) === true : false;
|
||||
};
|
||||
var markCacheDataConsumed = (consumedCacheData, cacheData, key) => {
|
||||
if (!cacheData) return;
|
||||
let consumedKeys = consumedCacheData.get(cacheData);
|
||||
if (!consumedKeys) {
|
||||
consumedKeys = /* @__PURE__ */ new Set();
|
||||
consumedCacheData.set(cacheData, consumedKeys);
|
||||
}
|
||||
consumedKeys.add(key);
|
||||
};
|
||||
var commitCacheData = ({ value, getCacheData, canCommit, setCache }) => {
|
||||
const commit = (state) => {
|
||||
if (canCommit() && isUndefined(getCacheData())) setCache(state);
|
||||
};
|
||||
Promise.resolve(value).then((data) => {
|
||||
commit({
|
||||
data,
|
||||
error: void 0
|
||||
});
|
||||
}, (error) => {
|
||||
commit({ error });
|
||||
});
|
||||
};
|
||||
var resolvedUndef = Promise.resolve(void 0);
|
||||
resolvedUndef.status = "fulfilled";
|
||||
resolvedUndef.value = void 0;
|
||||
var sub = () => noop;
|
||||
/**
|
||||
* The core implementation of the useSWR hook.
|
||||
*
|
||||
* This is the main handler function that implements all SWR functionality including
|
||||
* data fetching, caching, revalidation, error handling, and state management.
|
||||
* It manages the complete lifecycle of SWR requests from initialization through
|
||||
* cleanup.
|
||||
*
|
||||
* Key responsibilities:
|
||||
* - Key serialization and normalization
|
||||
* - Cache state management and synchronization
|
||||
* - Automatic and manual revalidation
|
||||
* - Error handling and retry logic
|
||||
* - Suspense integration
|
||||
* - Loading state management
|
||||
* - Effect cleanup and memory management
|
||||
*
|
||||
* @template Data - The type of data returned by the fetcher
|
||||
* @template Error - The type of error that can be thrown
|
||||
*
|
||||
* @param _key - The SWR key (string, array, object, function, or falsy)
|
||||
* @param fetcher - The fetcher function to retrieve data, or null to disable fetching
|
||||
* @param config - Complete SWR configuration object with both public and internal options
|
||||
*
|
||||
* @returns SWRResponse object containing data, error, mutate function, and loading states
|
||||
*
|
||||
* @internal This is the internal implementation. Use `useSWR` instead.
|
||||
*/ var useSWRHandler = (_key, fetcher, config) => {
|
||||
const { cache, compare, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData, strictServerPrefetchWarning } = config;
|
||||
const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);
|
||||
const [key, fnArg] = serialize(_key);
|
||||
const initialMountedRef = (0, import_react.useRef)(false);
|
||||
const unmountedRef = (0, import_react.useRef)(false);
|
||||
const keyRef = (0, import_react.useRef)(key);
|
||||
const fetcherRef = (0, import_react.useRef)(fetcher);
|
||||
const configRef = (0, import_react.useRef)(config);
|
||||
const getConfig = () => configRef.current;
|
||||
const isActive = () => getConfig().isVisible() && getConfig().isOnline();
|
||||
const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache, key);
|
||||
const stateDependencies = (0, import_react.useRef)({}).current;
|
||||
const fallback = isUndefined(fallbackData) ? isUndefined(config.fallback) ? void 0 : config.fallback[key] : fallbackData;
|
||||
const serverCacheData = config.cacheData;
|
||||
const configCacheData = !key ? void 0 : serverCacheData == null ? void 0 : serverCacheData[key];
|
||||
const req = key ? PRELOAD[key] : void 0;
|
||||
const hasCacheData = isUndefined(req) && !isUndefined(configCacheData);
|
||||
const preloadedData = hasCacheData ? configCacheData : req;
|
||||
const isEqual = (prev, current) => {
|
||||
for (const _ in stateDependencies) {
|
||||
const t = _;
|
||||
if (t === "data") {
|
||||
if (!compare(prev[t], current[t])) {
|
||||
if (!isUndefined(prev[t])) return false;
|
||||
if (!compare(returnedData, current[t])) return false;
|
||||
}
|
||||
} else if (current[t] !== prev[t]) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const isInitialMount = !initialMountedRef.current;
|
||||
const getSnapshot = (0, import_react.useMemo)(() => {
|
||||
const cachedData = getCache();
|
||||
const initialData = getInitialCache();
|
||||
const getSelectedCache = (state) => {
|
||||
const snapshot = mergeObjects(state);
|
||||
delete snapshot._k;
|
||||
if (!(() => {
|
||||
if (!key) return false;
|
||||
if (!fetcher) return false;
|
||||
if (getConfig().isPaused()) return false;
|
||||
if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;
|
||||
const data = !isUndefined(fallback) ? fallback : snapshot.data;
|
||||
if (suspense && hasCacheData && isUndefined(data)) return false;
|
||||
if (suspense) return isUndefined(data) || revalidateIfStale;
|
||||
return isUndefined(data) || revalidateIfStale;
|
||||
})()) return snapshot;
|
||||
return {
|
||||
isValidating: true,
|
||||
isLoading: true,
|
||||
...snapshot
|
||||
};
|
||||
};
|
||||
const clientSnapshot = getSelectedCache(cachedData);
|
||||
const serverSnapshot = cachedData === initialData ? clientSnapshot : getSelectedCache(initialData);
|
||||
let memorizedSnapshot = clientSnapshot;
|
||||
return [() => {
|
||||
const newSnapshot = getSelectedCache(getCache());
|
||||
if (isEqual(newSnapshot, memorizedSnapshot)) {
|
||||
memorizedSnapshot.data = newSnapshot.data;
|
||||
memorizedSnapshot.isLoading = newSnapshot.isLoading;
|
||||
memorizedSnapshot.isValidating = newSnapshot.isValidating;
|
||||
memorizedSnapshot.error = newSnapshot.error;
|
||||
return memorizedSnapshot;
|
||||
} else {
|
||||
memorizedSnapshot = newSnapshot;
|
||||
return newSnapshot;
|
||||
}
|
||||
}, () => serverSnapshot];
|
||||
}, [cache, key]);
|
||||
const cached = (0, import_shim.useSyncExternalStore)((0, import_react.useCallback)((callback) => subscribeCache(key, (current, prev) => {
|
||||
if (!isEqual(prev, current)) callback();
|
||||
}), [cache, key]), getSnapshot[0], getSnapshot[1]);
|
||||
const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
|
||||
const cachedData = cached.data;
|
||||
let data = isUndefined(cachedData) ? fallback && isPromiseLike(fallback) ? use(fallback) : fallback : cachedData;
|
||||
const error = cached.error;
|
||||
const laggyDataRef = (0, import_react.useRef)(data);
|
||||
const consumedCacheDataRef = (0, import_react.useRef)(void 0);
|
||||
let consumedCacheData = consumedCacheDataRef.current;
|
||||
if (!consumedCacheData) {
|
||||
consumedCacheData = /* @__PURE__ */ new WeakMap();
|
||||
consumedCacheDataRef.current = consumedCacheData;
|
||||
}
|
||||
const preloadCacheRef = (0, import_react.useRef)(null);
|
||||
let returnedData = keepPreviousData ? isUndefined(cachedData) ? isUndefined(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;
|
||||
const hasKeyButNoData = key && isUndefined(data);
|
||||
const hydrationRef = (0, import_react.useRef)(null);
|
||||
!IS_SERVER && (0, import_shim.useSyncExternalStore)(sub, () => {
|
||||
hydrationRef.current = false;
|
||||
return hydrationRef;
|
||||
}, () => {
|
||||
hydrationRef.current = true;
|
||||
return hydrationRef;
|
||||
});
|
||||
const isHydration = hydrationRef.current;
|
||||
if (strictServerPrefetchWarning && isHydration && !suspense && hasKeyButNoData) console.warn(`Missing pre-initiated data for serialized key "${key}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
|
||||
const shouldDoInitialRevalidation = (() => {
|
||||
if (!key || !fetcher) return false;
|
||||
if (getConfig().isPaused()) return false;
|
||||
if (hasRevalidator && !isUndefined(error)) return false;
|
||||
if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;
|
||||
if (suspense && hasCacheData && hasKeyButNoData) return false;
|
||||
if (suspense) return isUndefined(data) ? false : revalidateIfStale;
|
||||
return isUndefined(data) || revalidateIfStale;
|
||||
})();
|
||||
const defaultValidatingState = isInitialMount && shouldDoInitialRevalidation;
|
||||
const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;
|
||||
const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;
|
||||
const revalidate = (0, import_react.useCallback)(async (revalidateOpts) => {
|
||||
const currentFetcher = fetcherRef.current;
|
||||
if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) return false;
|
||||
let newData;
|
||||
let startAt;
|
||||
let loading = true;
|
||||
const opts = revalidateOpts || {};
|
||||
const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;
|
||||
const shouldUseRSCPreload = hasCacheData && !isCacheDataConsumed(consumedCacheData, serverCacheData, key) && !isUndefined(preloadedData) && isUndefined(getCache().data);
|
||||
const callbackSafeguard = () => {
|
||||
if (IS_REACT_LEGACY) return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;
|
||||
return key === keyRef.current;
|
||||
};
|
||||
const finalState = {
|
||||
isValidating: false,
|
||||
isLoading: false
|
||||
};
|
||||
const finishRequestAndUpdateState = () => {
|
||||
setCache(finalState);
|
||||
};
|
||||
const cleanupState = () => {
|
||||
const requestInfo = FETCH[key];
|
||||
if (requestInfo && requestInfo[1] === startAt) delete FETCH[key];
|
||||
};
|
||||
const initialState = { isValidating: true };
|
||||
if (isUndefined(getCache().data)) initialState.isLoading = true;
|
||||
try {
|
||||
if (shouldStartNewRequest) {
|
||||
setCache(initialState);
|
||||
if (config.loadingTimeout && isUndefined(getCache().data)) setTimeout(() => {
|
||||
if (loading && callbackSafeguard()) getConfig().onLoadingSlow(key, config);
|
||||
}, config.loadingTimeout);
|
||||
if (shouldUseRSCPreload) markCacheDataConsumed(consumedCacheData, serverCacheData, key);
|
||||
FETCH[key] = [shouldUseRSCPreload ? preloadedData : currentFetcher(fnArg), getTimestamp()];
|
||||
if (shouldUseRSCPreload && PRELOAD[key]) delete PRELOAD[key];
|
||||
}
|
||||
[newData, startAt] = FETCH[key];
|
||||
newData = await newData;
|
||||
if (shouldStartNewRequest) setTimeout(cleanupState, config.dedupingInterval);
|
||||
if (!FETCH[key] || FETCH[key][1] !== startAt) {
|
||||
if (shouldStartNewRequest) {
|
||||
if (callbackSafeguard()) getConfig().onDiscarded(key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
finalState.error = void 0;
|
||||
const mutationInfo = MUTATION[key];
|
||||
if (!isUndefined(mutationInfo) && (startAt <= mutationInfo[0] || startAt <= mutationInfo[1] || mutationInfo[1] === 0)) {
|
||||
finishRequestAndUpdateState();
|
||||
if (shouldStartNewRequest) {
|
||||
if (callbackSafeguard()) getConfig().onDiscarded(key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const cacheData = getCache().data;
|
||||
finalState.data = compare(cacheData, newData) ? cacheData : newData;
|
||||
if (shouldStartNewRequest) {
|
||||
if (callbackSafeguard()) getConfig().onSuccess(newData, key, config);
|
||||
}
|
||||
} catch (err) {
|
||||
cleanupState();
|
||||
const currentConfig = getConfig();
|
||||
const { shouldRetryOnError } = currentConfig;
|
||||
if (!currentConfig.isPaused()) {
|
||||
finalState.error = err;
|
||||
if (shouldStartNewRequest && callbackSafeguard()) {
|
||||
currentConfig.onError(err, key, currentConfig);
|
||||
if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {
|
||||
if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) currentConfig.onErrorRetry(err, key, currentConfig, (_opts) => {
|
||||
const revalidators = EVENT_REVALIDATORS[key];
|
||||
if (revalidators && revalidators[0]) revalidators[0](3, _opts);
|
||||
}, {
|
||||
retryCount: (opts.retryCount || 0) + 1,
|
||||
dedupe: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
loading = false;
|
||||
finishRequestAndUpdateState();
|
||||
return true;
|
||||
}, [key, cache]);
|
||||
const boundMutate = (0, import_react.useCallback)((...args) => {
|
||||
return internalMutate(cache, keyRef.current, ...args);
|
||||
}, []);
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
const preloaded = preloadCacheRef.current;
|
||||
if (!preloaded) return;
|
||||
preloadCacheRef.current = null;
|
||||
markCacheDataConsumed(consumedCacheData, preloaded.cacheData, preloaded.key);
|
||||
if (isUndefined(getCache().data)) setCache({
|
||||
data: preloaded.data,
|
||||
error: void 0,
|
||||
_k: preloaded._k
|
||||
});
|
||||
if (PRELOAD[preloaded.key]) delete PRELOAD[preloaded.key];
|
||||
});
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
fetcherRef.current = fetcher;
|
||||
configRef.current = config;
|
||||
if (!isUndefined(cachedData)) laggyDataRef.current = cachedData;
|
||||
});
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
if (fetcher || !hasCacheData || isUndefined(preloadedData) || isCacheDataConsumed(consumedCacheData, serverCacheData, key) || !isUndefined(getCache().data)) return;
|
||||
markCacheDataConsumed(consumedCacheData, serverCacheData, key);
|
||||
const mutation = MUTATION[key];
|
||||
commitCacheData({
|
||||
value: preloadedData,
|
||||
getCacheData: () => getCache().data,
|
||||
canCommit: () => !unmountedRef.current && key === keyRef.current && MUTATION[key] === mutation,
|
||||
setCache: (state) => setCache({
|
||||
...state,
|
||||
_k: fnArg
|
||||
})
|
||||
});
|
||||
});
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
if (!key) return;
|
||||
const softRevalidate = revalidate.bind(void 0, WITH_DEDUPE);
|
||||
let nextFocusRevalidatedAt = 0;
|
||||
if (getConfig().revalidateOnFocus) nextFocusRevalidatedAt = Date.now() + getConfig().focusThrottleInterval;
|
||||
const onRevalidate = (type, opts = {}) => {
|
||||
if (type == 0) {
|
||||
const now = Date.now();
|
||||
if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {
|
||||
nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;
|
||||
softRevalidate();
|
||||
}
|
||||
} else if (type == 1) {
|
||||
if (getConfig().revalidateOnReconnect && isActive()) softRevalidate();
|
||||
} else if (type == 2) return revalidate();
|
||||
else if (type == 3) return revalidate(opts);
|
||||
else if (type == 4) {
|
||||
laggyDataRef.current = void 0;
|
||||
if (opts.revalidate) return revalidate();
|
||||
}
|
||||
};
|
||||
const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);
|
||||
unmountedRef.current = false;
|
||||
keyRef.current = key;
|
||||
initialMountedRef.current = true;
|
||||
setCache({ _k: fnArg });
|
||||
if (shouldDoInitialRevalidation) {
|
||||
if (!FETCH[key]) {
|
||||
if (isUndefined(data) || IS_SERVER) softRevalidate();
|
||||
else rAF(softRevalidate);
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
unmountedRef.current = true;
|
||||
unsubEvents();
|
||||
};
|
||||
}, [key]);
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
let timer;
|
||||
function next() {
|
||||
const interval = isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;
|
||||
if (interval && timer !== -1) timer = setTimeout(execute, interval);
|
||||
}
|
||||
function execute() {
|
||||
if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) revalidate(WITH_DEDUPE).then(next);
|
||||
else next();
|
||||
}
|
||||
next();
|
||||
return () => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = -1;
|
||||
}
|
||||
};
|
||||
}, [
|
||||
refreshInterval,
|
||||
refreshWhenHidden,
|
||||
refreshWhenOffline,
|
||||
key
|
||||
]);
|
||||
(0, import_react.useDebugValue)(returnedData);
|
||||
if (suspense) {
|
||||
if (!IS_REACT_LEGACY && IS_SERVER && hasKeyButNoData && isUndefined(preloadedData)) throw new Error("Fallback data is required when using Suspense in SSR.");
|
||||
if (hasKeyButNoData) {
|
||||
fetcherRef.current = fetcher;
|
||||
configRef.current = config;
|
||||
unmountedRef.current = false;
|
||||
}
|
||||
const shouldConsumePreload = !isUndefined(preloadedData) && hasKeyButNoData;
|
||||
let preloadData = void 0;
|
||||
if (shouldConsumePreload && hasCacheData) {
|
||||
preloadData = preloadedData && isPromiseLike(preloadedData) ? use(preloadedData) : preloadedData;
|
||||
data = preloadData;
|
||||
returnedData = preloadData;
|
||||
if (!IS_SERVER) preloadCacheRef.current = {
|
||||
data: preloadData,
|
||||
_k: fnArg,
|
||||
key,
|
||||
cacheData: serverCacheData
|
||||
};
|
||||
} else use(shouldConsumePreload ? boundMutate(preloadedData) : resolvedUndef);
|
||||
if (!isUndefined(error) && hasKeyButNoData) throw error;
|
||||
const revalidation = hasKeyButNoData && isUndefined(preloadData) ? revalidate(WITH_DEDUPE) : resolvedUndef;
|
||||
if (!isUndefined(returnedData) && hasKeyButNoData) {
|
||||
revalidation.status = "fulfilled";
|
||||
revalidation.value = true;
|
||||
}
|
||||
use(revalidation);
|
||||
}
|
||||
return {
|
||||
mutate: boundMutate,
|
||||
get data() {
|
||||
stateDependencies.data = true;
|
||||
return returnedData;
|
||||
},
|
||||
get error() {
|
||||
stateDependencies.error = true;
|
||||
return error;
|
||||
},
|
||||
get isValidating() {
|
||||
stateDependencies.isValidating = true;
|
||||
return isValidating;
|
||||
},
|
||||
get isLoading() {
|
||||
stateDependencies.isLoading = true;
|
||||
return isLoading;
|
||||
}
|
||||
};
|
||||
};
|
||||
var SWRConfig = OBJECT.defineProperty(SWRConfig$1, "defaultValue", { value: defaultConfig });
|
||||
/**
|
||||
* A hook to fetch data.
|
||||
*
|
||||
* @see {@link https://swr.vercel.app}
|
||||
*
|
||||
* @example
|
||||
* ```jsx
|
||||
* import useSWR from 'swr'
|
||||
* function Profile() {
|
||||
* const { data, error, isLoading } = useSWR('/api/user', fetcher)
|
||||
* if (error) return <div>failed to load</div>
|
||||
* if (isLoading) return <div>loading...</div>
|
||||
* return <div>hello {data.name}!</div>
|
||||
* }
|
||||
* ```
|
||||
*/ var useSWR = withArgs(useSWRHandler);
|
||||
//#endregion
|
||||
//#region node_modules/swr/dist/index/index.mjs
|
||||
var unstable_serialize = (key) => serialize(key)[0];
|
||||
//#endregion
|
||||
export { SWRConfig, useSWR as default, mutate, preload, unload, unstable_serialize, useSWRConfig };
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"swr.js","names":["useEffect","useLayoutEffect","createContext","SWRConfig","useContext","useMemo","useRef","createElement","use","React","useContext","useMemo","useRef","useMemo","useSyncExternalStore","useCallback"],"sources":["../../dequal/lite/index.mjs","../../swr/dist/config-context-ext53wcz.mjs","../../swr/dist/_internal/constants.mjs","../../swr/dist/_internal/index.mjs","../../swr/dist/use-swr-emll9s78.mjs","../../swr/dist/index/index.mjs"],"sourcesContent":["var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","'use client';\nimport React, { useEffect, useLayoutEffect, createContext, useContext, useMemo, useRef, createElement } from 'react';\nimport { dequal } from 'dequal/lite';\n\nconst FOCUS_EVENT = 0;\nconst RECONNECT_EVENT = 1;\nconst MUTATE_EVENT = 2;\nconst ERROR_REVALIDATE_EVENT = 3;\nconst UNLOAD_EVENT = 4;\n\nvar events = {\n __proto__: null,\n ERROR_REVALIDATE_EVENT: ERROR_REVALIDATE_EVENT,\n FOCUS_EVENT: FOCUS_EVENT,\n MUTATE_EVENT: MUTATE_EVENT,\n RECONNECT_EVENT: RECONNECT_EVENT,\n UNLOAD_EVENT: UNLOAD_EVENT\n};\n\n// Global state used to deduplicate requests and store listeners\nconst SWRGlobalState = new WeakMap();\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\nconst mergeObjects = (a, b)=>({\n ...a,\n ...b\n });\nconst isPromiseLike = (x)=>isFunction(x.then);\n\nconst EMPTY_CACHE = {};\nconst INITIAL_CACHE = {};\nconst STR_UNDEFINED = 'undefined';\n// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nconst isWindowDefined = typeof window != STR_UNDEFINED;\nconst isDocumentDefined = typeof document != STR_UNDEFINED;\nconst isLegacyDeno = isWindowDefined && 'Deno' in window;\nconst hasRequestAnimationFrame = ()=>isWindowDefined && typeof window['requestAnimationFrame'] != STR_UNDEFINED;\nconst createCacheHelper = (cache, key)=>{\n const state = SWRGlobalState.get(cache);\n return [\n // Getter\n ()=>!isUndefined(key) && cache.get(key) || EMPTY_CACHE,\n // Setter\n (info)=>{\n if (!isUndefined(key)) {\n const prev = cache.get(key);\n // Before writing to the store, we keep the value in the initial cache\n // if it's not there yet.\n if (!(key in INITIAL_CACHE)) {\n INITIAL_CACHE[key] = prev;\n }\n state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);\n }\n },\n // Subscriber\n state[6],\n // Get server cache snapshot\n ()=>{\n if (!isUndefined(key)) {\n // If the cache was updated on the client, we return the stored initial value.\n if (key in INITIAL_CACHE) return INITIAL_CACHE[key];\n }\n // If we haven't done any client-side updates, we return the current value.\n return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;\n }\n ];\n} // export { UNDEFINED, OBJECT, isUndefined, isFunction, mergeObjects, isPromiseLike }\n;\n\n/**\n * Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,\n * it's not reliable to detect if the browser is currently online or offline\n * based on `navigator.onLine`.\n * As a workaround, we always assume it's online on the first load, and change\n * the status upon `online` or `offline` events.\n */ let online = true;\nconst isOnline = ()=>online;\n// For node and React Native, `add/removeEventListener` doesn't exist on window.\nconst [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [\n window.addEventListener.bind(window),\n window.removeEventListener.bind(window)\n] : [\n noop,\n noop\n];Line truncated
|
||||
+259
@@ -0,0 +1,259 @@
|
||||
import { r as __toESM } from "./rolldown-runtime-DC62tzP2.js";
|
||||
import { t as require_react } from "./react.js";
|
||||
import { t as require_shim } from "./shim-BX6a9SD7.js";
|
||||
//#region node_modules/regexparam/dist/index.mjs
|
||||
/**
|
||||
* @param {string|RegExp} input The route pattern
|
||||
* @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
|
||||
*/
|
||||
function parse(input, loose) {
|
||||
if (input instanceof RegExp) return {
|
||||
keys: false,
|
||||
pattern: input
|
||||
};
|
||||
var c, o, tmp, ext, keys = [], pattern = "", arr = input.split("/");
|
||||
arr[0] || arr.shift();
|
||||
while (tmp = arr.shift()) {
|
||||
c = tmp[0];
|
||||
if (c === "*") {
|
||||
keys.push(c);
|
||||
pattern += tmp[1] === "?" ? "(?:/(.*))?" : "/(.*)";
|
||||
} else if (c === ":") {
|
||||
o = tmp.indexOf("?", 1);
|
||||
ext = tmp.indexOf(".", 1);
|
||||
keys.push(tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length));
|
||||
pattern += !!~o && !~ext ? "(?:/([^/]+?))?" : "/([^/]+?)";
|
||||
if (!!~ext) pattern += (!!~o ? "?" : "") + "\\" + tmp.substring(ext);
|
||||
} else pattern += "/" + tmp;
|
||||
}
|
||||
return {
|
||||
keys,
|
||||
pattern: new RegExp("^" + pattern + (loose ? "(?=$|/)" : "/?$"), "i")
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region node_modules/wouter/src/use-sync-external-store.js
|
||||
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
||||
var import_shim = require_shim();
|
||||
//#endregion
|
||||
//#region node_modules/wouter/src/react-deps.js
|
||||
var useBuiltinInsertionEffect = import_react.useInsertionEffect;
|
||||
var useIsomorphicLayoutEffect = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined") ? import_react.useLayoutEffect : import_react.useEffect;
|
||||
var useInsertionEffect = useBuiltinInsertionEffect || useIsomorphicLayoutEffect;
|
||||
var useEvent = (fn) => {
|
||||
const ref = import_react.useRef([fn, (...args) => ref[0](...args)]).current;
|
||||
useInsertionEffect(() => {
|
||||
ref[0] = fn;
|
||||
});
|
||||
return ref[1];
|
||||
};
|
||||
//#endregion
|
||||
//#region node_modules/wouter/src/use-browser-location.js
|
||||
/**
|
||||
* History API docs @see https://developer.mozilla.org/en-US/docs/Web/API/History
|
||||
*/
|
||||
var events = [
|
||||
"popstate",
|
||||
"pushState",
|
||||
"replaceState",
|
||||
"hashchange"
|
||||
];
|
||||
var listeners = [];
|
||||
var onLocationChange = () => listeners.forEach((callback) => callback());
|
||||
var subscribeToLocationUpdates = (callback) => {
|
||||
if (listeners.push(callback) === 1) events.forEach((event) => addEventListener(event, onLocationChange));
|
||||
return () => {
|
||||
listeners = listeners.filter((listener) => listener !== callback);
|
||||
if (!listeners.length) events.forEach((event) => removeEventListener(event, onLocationChange));
|
||||
};
|
||||
};
|
||||
var useLocationProperty = (fn, ssrFn) => (0, import_shim.useSyncExternalStore)(subscribeToLocationUpdates, fn, ssrFn);
|
||||
var currentSearch = () => location.search;
|
||||
var useSearch$1 = ({ ssrSearch } = {}) => useLocationProperty(currentSearch, ssrSearch != null ? () => ssrSearch : currentSearch);
|
||||
var currentPathname = () => location.pathname;
|
||||
var usePathname = ({ ssrPath } = {}) => useLocationProperty(currentPathname, ssrPath != null ? () => ssrPath : currentPathname);
|
||||
var navigate = (to, { replace = false, state = null } = {}) => history[replace ? "replaceState" : "pushState"](state, "", to);
|
||||
var useBrowserLocation = (opts) => [usePathname(opts), navigate];
|
||||
var patchKey = Symbol.for("wouter_v3");
|
||||
if (typeof history !== "undefined" && typeof window[patchKey] === "undefined") {
|
||||
for (const type of ["pushState", "replaceState"]) {
|
||||
const original = history[type];
|
||||
history[type] = function() {
|
||||
const result = original.apply(this, arguments);
|
||||
const event = new Event(type);
|
||||
event.arguments = arguments;
|
||||
dispatchEvent(event);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
Object.defineProperty(window, patchKey, { value: true });
|
||||
}
|
||||
//#endregion
|
||||
//#region node_modules/wouter/src/paths.js
|
||||
/**
|
||||
* When basepath is `undefined` or '/' it is ignored (we assume it's empty string)
|
||||
*/
|
||||
var baseDefaults = (base = "") => base === "/" ? "" : base;
|
||||
var absolutePath = (to, base) => to[0] === "~" ? to.slice(1) : baseDefaults(base) + to;
|
||||
var relativePath = (base, path) => {
|
||||
base = unescape(baseDefaults(base));
|
||||
path = unescape(path);
|
||||
return !base || !path.toLowerCase().indexOf(base.toLowerCase()) ? path.slice(base.length) || "/" : "~" + path;
|
||||
};
|
||||
var unescape = (str) => {
|
||||
try {
|
||||
return str.includes("%") ? decodeURI(str) : str;
|
||||
} catch (_e) {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
var sanitizeSearch = (search) => unescape(search[0] === "?" ? search.slice(1) : search);
|
||||
//#endregion
|
||||
//#region node_modules/wouter/src/index.js
|
||||
var defaultRouter = {
|
||||
hook: useBrowserLocation,
|
||||
searchHook: useSearch$1,
|
||||
parser: parse,
|
||||
base: "",
|
||||
ssrPath: void 0,
|
||||
ssrSearch: void 0,
|
||||
ssrContext: void 0,
|
||||
hrefs: (x) => x,
|
||||
aroundNav: (n, t, o) => n(t, o)
|
||||
};
|
||||
var RouterCtx = (0, import_react.createContext)(defaultRouter);
|
||||
var useRouter = () => (0, import_react.useContext)(RouterCtx);
|
||||
/**
|
||||
* Parameters context. Used by `useParams()` to get the
|
||||
* matched params from the innermost `Route` component.
|
||||
*/
|
||||
var Params0 = {};
|
||||
var ParamsCtx = (0, import_react.createContext)(Params0);
|
||||
var useParams = () => (0, import_react.useContext)(ParamsCtx);
|
||||
var usePathnameFromRouter = (router, base = router.base) => relativePath(base, router.hook(router)[0]);
|
||||
var useLocationFromRouter = (router) => {
|
||||
const [location, navigate] = router.hook(router);
|
||||
return [relativePath(router.base, location), useEvent((to, opts) => router.aroundNav(navigate, absolutePath(to, router.base), opts))];
|
||||
};
|
||||
var useLocation = () => useLocationFromRouter(useRouter());
|
||||
var useSearch = () => {
|
||||
const router = useRouter();
|
||||
return sanitizeSearch(router.searchHook(router));
|
||||
};
|
||||
var matchRoute = (parser, route, path, loose) => {
|
||||
const { pattern, keys } = route instanceof RegExp ? { pattern: route } : parser(route || "*", loose);
|
||||
const result = pattern.exec(path);
|
||||
if (!result) return [false, null];
|
||||
const params = {};
|
||||
for (let i = 1; i < result.length; i++) params[i - 1] = result[i];
|
||||
if (keys) for (let i = 0; i < keys.length; i++) params[keys[i]] = result[i + 1];
|
||||
else Object.assign(params, result.groups);
|
||||
return loose ? [
|
||||
true,
|
||||
params,
|
||||
result[0]
|
||||
] : [true, params];
|
||||
};
|
||||
var useRoute = (pattern) => {
|
||||
const router = useRouter();
|
||||
const absolute = /^~\//.test(pattern);
|
||||
return matchRoute(router.parser, absolute ? pattern.slice(1) : pattern, usePathnameFromRouter(router, absolute ? "" : router.base));
|
||||
};
|
||||
var Router = ({ children, ...props }) => {
|
||||
const parent_ = useRouter();
|
||||
const parent = props.hook ? defaultRouter : parent_;
|
||||
let value = parent;
|
||||
if (props.ssrPath) {
|
||||
const [path, search = props.ssrSearch ?? ""] = props.ssrPath.split("?");
|
||||
if (path) props.ssrSearch = search, props.ssrPath = path;
|
||||
}
|
||||
props.hrefs = props.hrefs ?? props.hook?.hrefs;
|
||||
props.searchHook = props.searchHook ?? props.hook?.searchHook;
|
||||
let ref = (0, import_react.useRef)(parent), prev = ref.current, next = prev;
|
||||
for (let k in parent) {
|
||||
const option = k === "base" ? parent[k] + (props[k] ?? "") : props[k] ?? parent[k];
|
||||
if (option !== next[k]) {
|
||||
if (prev === next) ref.current = next = { ...next };
|
||||
next[k] = option;
|
||||
}
|
||||
if (option !== parent[k] || option !== value[k]) value = next;
|
||||
}
|
||||
return (0, import_react.createElement)(RouterCtx.Provider, { value }, children);
|
||||
};
|
||||
var h_route = ({ children, component }, params) => {
|
||||
if (component) return (0, import_react.createElement)(component, { params });
|
||||
return typeof children === "function" ? children(params) : children;
|
||||
};
|
||||
var useCachedParams = (value) => {
|
||||
let prev = (0, import_react.useRef)(Params0);
|
||||
const curr = prev.current, keys = Object.keys(value);
|
||||
return prev.current = keys.length !== Object.keys(curr).length || keys.some((k) => value[k] !== curr[k]) ? value : curr;
|
||||
};
|
||||
function useSearchParams() {
|
||||
const [location, navigate] = useLocation();
|
||||
const search = useSearch();
|
||||
const searchParams = (0, import_react.useMemo)(() => new URLSearchParams(search), [search]);
|
||||
let tempSearchParams = searchParams;
|
||||
return [searchParams, useEvent((nextInit, options) => {
|
||||
tempSearchParams = new URLSearchParams(typeof nextInit === "function" ? nextInit(tempSearchParams) : nextInit);
|
||||
const paramsStr = tempSearchParams.toString();
|
||||
navigate(location + (paramsStr ? "?" + paramsStr : ""), options);
|
||||
})];
|
||||
}
|
||||
var Route = ({ path, nest, match, ...renderProps }) => {
|
||||
const router = useRouter();
|
||||
const location = usePathnameFromRouter(router);
|
||||
const [matches, routeParams, base] = match ?? matchRoute(router.parser, path, location, nest);
|
||||
const params = useCachedParams({
|
||||
...useParams(),
|
||||
...routeParams
|
||||
});
|
||||
if (!matches) return null;
|
||||
const children = h_route(renderProps, params);
|
||||
return (0, import_react.createElement)(ParamsCtx.Provider, { value: params }, base ? (0, import_react.createElement)(Router, { base }, children) : children);
|
||||
};
|
||||
var Link = (0, import_react.forwardRef)((props, ref) => {
|
||||
const router = useRouter();
|
||||
const [currentPath, navigate] = useLocationFromRouter(router);
|
||||
const { to = "", href: targetPath = to, onClick: _onClick, asChild, children, className: cls, replace, state, transition, ...linkProps } = props;
|
||||
linkProps.onClick = useEvent((event) => {
|
||||
if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey || event.button !== 0) return;
|
||||
_onClick?.(event);
|
||||
if (!event.defaultPrevented) {
|
||||
event.preventDefault();
|
||||
navigate(targetPath, props);
|
||||
}
|
||||
});
|
||||
linkProps.href = router.hrefs(targetPath[0] === "~" ? targetPath.slice(1) : router.base + targetPath, router);
|
||||
if (cls !== void 0) linkProps.className = cls?.call ? cls(currentPath === targetPath) : cls;
|
||||
if (ref) linkProps.ref = ref;
|
||||
return asChild && (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(children, linkProps) : (0, import_react.createElement)("a", linkProps, children);
|
||||
});
|
||||
var flattenChildren = (children, result = []) => {
|
||||
if (Array.isArray(children)) for (const c of children) flattenChildren(c && c.type === import_react.Fragment ? c.props.children : c, result);
|
||||
else result.push(children);
|
||||
return result;
|
||||
};
|
||||
var Switch = ({ children, location }) => {
|
||||
const router = useRouter();
|
||||
const originalLocation = usePathnameFromRouter(router);
|
||||
for (const element of flattenChildren(children)) {
|
||||
let match = 0;
|
||||
if ((0, import_react.isValidElement)(element) && (match = matchRoute(router.parser, element.props.path, location || originalLocation, element.props.nest))[0]) return (0, import_react.cloneElement)(element, { match });
|
||||
}
|
||||
return null;
|
||||
};
|
||||
var Redirect = (props) => {
|
||||
const { to, href = to } = props;
|
||||
const router = useRouter();
|
||||
const [, navigate] = useLocationFromRouter(router);
|
||||
const redirect = useEvent(() => navigate(to || href, props));
|
||||
const { ssrContext } = router;
|
||||
useIsomorphicLayoutEffect(() => {
|
||||
redirect();
|
||||
}, []);
|
||||
if (ssrContext) ssrContext.redirectTo = to;
|
||||
return null;
|
||||
};
|
||||
//#endregion
|
||||
export { Link, Redirect, Route, Router, Switch, matchRoute, useLocation, useParams, useRoute, useRouter, useSearch, useSearchParams };
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"wouter.js","names":["\"useInsertion\" + \"Effect\"","useSyncExternalStore","useSearch","useBrowserSearch","parsePattern","createContext","useContext","useRef","h","useMemo","forwardRef","isValidElement","cloneElement","Fragment"],"sources":["../../regexparam/dist/index.mjs","../../wouter/src/use-sync-external-store.js","../../wouter/src/react-deps.js","../../wouter/src/use-browser-location.js","../../wouter/src/paths.js","../../wouter/src/index.js"],"sourcesContent":["/**\n * @param {string|RegExp} input The route pattern\n * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.\n */\nexport function parse(input, loose) {\n\tif (input instanceof RegExp) return { keys:false, pattern:input };\n\tvar c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');\n\tarr[0] || arr.shift();\n\n\twhile (tmp = arr.shift()) {\n\t\tc = tmp[0];\n\t\tif (c === '*') {\n\t\t\tkeys.push(c);\n\t\t\tpattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';\n\t\t} else if (c === ':') {\n\t\t\to = tmp.indexOf('?', 1);\n\t\t\text = tmp.indexOf('.', 1);\n\t\t\tkeys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );\n\t\t\tpattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';\n\t\t\tif (!!~ext) pattern += (!!~o ? '?' : '') + '\\\\' + tmp.substring(ext);\n\t\t} else {\n\t\t\tpattern += '/' + tmp;\n\t\t}\n\t}\n\n\treturn {\n\t\tkeys: keys,\n\t\tpattern: new RegExp('^' + pattern + (loose ? '(?=$|\\/)' : '\\/?$'), 'i')\n\t};\n}\n\nvar RGX = /(\\/|^)([:*][^/]*?)(\\?)?(?=[/.]|$)/g;\n\n// error if key missing?\nexport function inject(route, values) {\n\treturn route.replace(RGX, (x, lead, key, optional) => {\n\t\tx = values[key=='*' ? key : key.substring(1)];\n\t\treturn x ? '/'+x : (optional || key=='*') ? '' : '/' + key;\n\t});\n}\n","export { useSyncExternalStore } from \"use-sync-external-store/shim/index.js\";\n","import * as React from \"react\";\n\n// React.useInsertionEffect is not available in React <18\n// This hack fixes a transpilation issue on some apps\nconst useBuiltinInsertionEffect = React[\"useInsertion\" + \"Effect\"];\n\nexport {\n useMemo,\n useRef,\n useState,\n useContext,\n createContext,\n isValidElement,\n cloneElement,\n createElement,\n Fragment,\n forwardRef,\n} from \"react\";\n\n// To resolve webpack 5 errors, while not presenting problems for native,\n// we copy the approaches from https://github.com/TanStack/query/pull/3561\n// and https://github.com/TanStack/query/pull/3601\n// ~ Show this aging PR some love to remove the need for this hack:\n// https://github.com/facebook/react/pull/25231 ~\nexport { useSyncExternalStore } from \"./use-sync-external-store.js\";\n\n// Copied from:\n// https://github.com/facebook/react/blob/main/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = !!(\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\"\n);\n\n// Copied from:\n// https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.ts\n// \"React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\"\nexport const useIsomorphicLayoutEffect = canUseDOM\n ? React.useLayoutEffect\n : React.useEffect;\n\n// useInsertionEffect is already a noop on the server.\n// See: https://github.com/facebook/react/blob/main/packages/react-server/src/ReactFizzHooks.js\nexport const useInsertionEffect =\n useBuiltinInsertionEffect || useIsomorphicLayoutEffect;\n\n// Userland polyfill while we wait for the forthcoming\n// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md\n// Note: \"A high-fidelity polyfill for useEvent is not possible because\n// there is no lifecycle or Hook in React that we can use to switch\n// .current at the right timing.\"\n// So we will have to make do with this \"close enough\" approach for now.\nexport const useEvent = (fn) => {\n const ref = React.useRef([fn, (...args) => ref[0](...args)]).current;\n // Per Dan Abramov: useInsertionEffect executes marginally closer to the\n // correct timing for ref synchronization than useLayoutEffect on React 18.\n // See: https://github.com/facebook/react/pull/25881#issuecomment-1356244360\n useInsertionEffect(() => {\n ref[0] = fn;\n });\n return ref[1];\n};\n","import { useSyncExternalStore } from \"./react-deps.js\";\n\n/**\n * History API docs @see https://developer.mozilla.org/en-US/docs/Web/API/History\n */\nconst events = [\"popstate\", \"pushState\", \"replaceState\", \"hashchange\"];\n\nlet listeners = [];\nconst onLocationChange = () => listeners.forEach((callback) => callback());\n\n// Native events can run microtasks between listeners. Notify all subscribers\n// together so React can process parent and child updates in the same batch.\nconst subscribeToLocationUpdates = (callback) => {\n if (listeners.push(cLine truncated
|
||||
Reference in new issue
Block a user