You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60044 lines
2.4 MiB
60044 lines
2.4 MiB
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
__markAsModule(target);
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __reExport = (target, module2, desc) => {
|
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
for (let key of __getOwnPropNames(module2))
|
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
}
|
|
return target;
|
|
};
|
|
var __toModule = (module2) => {
|
|
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
// node_modules/object-assign/index.js
|
|
var require_object_assign = __commonJS({
|
|
"node_modules/object-assign/index.js"(exports, module2) {
|
|
"use strict";
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
function toObject(val) {
|
|
if (val === null || val === void 0) {
|
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
}
|
|
return Object(val);
|
|
}
|
|
function shouldUseNative() {
|
|
try {
|
|
if (!Object.assign) {
|
|
return false;
|
|
}
|
|
var test1 = new String("abc");
|
|
test1[5] = "de";
|
|
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
return false;
|
|
}
|
|
var test2 = {};
|
|
for (var i = 0; i < 10; i++) {
|
|
test2["_" + String.fromCharCode(i)] = i;
|
|
}
|
|
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
return test2[n];
|
|
});
|
|
if (order2.join("") !== "0123456789") {
|
|
return false;
|
|
}
|
|
var test3 = {};
|
|
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
test3[letter] = letter;
|
|
});
|
|
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
return false;
|
|
}
|
|
return true;
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|
|
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
var from;
|
|
var to = toObject(target);
|
|
var symbols;
|
|
for (var s = 1; s < arguments.length; s++) {
|
|
from = Object(arguments[s]);
|
|
for (var key in from) {
|
|
if (hasOwnProperty.call(from, key)) {
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
if (getOwnPropertySymbols) {
|
|
symbols = getOwnPropertySymbols(from);
|
|
for (var i = 0; i < symbols.length; i++) {
|
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
to[symbols[i]] = from[symbols[i]];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return to;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react/cjs/react.development.js
|
|
var require_react_development = __commonJS({
|
|
"node_modules/react/cjs/react.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var _assign = require_object_assign();
|
|
var ReactVersion = "17.0.2";
|
|
var REACT_ELEMENT_TYPE = 60103;
|
|
var REACT_PORTAL_TYPE = 60106;
|
|
exports.Fragment = 60107;
|
|
exports.StrictMode = 60108;
|
|
exports.Profiler = 60114;
|
|
var REACT_PROVIDER_TYPE = 60109;
|
|
var REACT_CONTEXT_TYPE = 60110;
|
|
var REACT_FORWARD_REF_TYPE = 60112;
|
|
exports.Suspense = 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
var REACT_MEMO_TYPE = 60115;
|
|
var REACT_LAZY_TYPE = 60116;
|
|
var REACT_BLOCK_TYPE = 60121;
|
|
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
var REACT_SCOPE_TYPE = 60119;
|
|
var REACT_OPAQUE_ID_TYPE = 60128;
|
|
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
var REACT_OFFSCREEN_TYPE = 60130;
|
|
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
exports.Fragment = symbolFor("react.fragment");
|
|
exports.StrictMode = symbolFor("react.strict_mode");
|
|
exports.Profiler = symbolFor("react.profiler");
|
|
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
exports.Suspense = symbolFor("react.suspense");
|
|
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
}
|
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
return null;
|
|
}
|
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
if (typeof maybeIterator === "function") {
|
|
return maybeIterator;
|
|
}
|
|
return null;
|
|
}
|
|
var ReactCurrentDispatcher = {
|
|
current: null
|
|
};
|
|
var ReactCurrentBatchConfig = {
|
|
transition: 0
|
|
};
|
|
var ReactCurrentOwner = {
|
|
current: null
|
|
};
|
|
var ReactDebugCurrentFrame = {};
|
|
var currentExtraStackFrame = null;
|
|
function setExtraStackFrame(stack) {
|
|
{
|
|
currentExtraStackFrame = stack;
|
|
}
|
|
}
|
|
{
|
|
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
{
|
|
currentExtraStackFrame = stack;
|
|
}
|
|
};
|
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
var stack = "";
|
|
if (currentExtraStackFrame) {
|
|
stack += currentExtraStackFrame;
|
|
}
|
|
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
if (impl) {
|
|
stack += impl() || "";
|
|
}
|
|
return stack;
|
|
};
|
|
}
|
|
var IsSomeRendererActing = {
|
|
current: false
|
|
};
|
|
var ReactSharedInternals = {
|
|
ReactCurrentDispatcher,
|
|
ReactCurrentBatchConfig,
|
|
ReactCurrentOwner,
|
|
IsSomeRendererActing,
|
|
assign: _assign
|
|
};
|
|
{
|
|
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
}
|
|
function warn(format) {
|
|
{
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
printWarning("warn", format, args);
|
|
}
|
|
}
|
|
function error(format) {
|
|
{
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
args[_key2 - 1] = arguments[_key2];
|
|
}
|
|
printWarning("error", format, args);
|
|
}
|
|
}
|
|
function printWarning(level, format, args) {
|
|
{
|
|
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
if (stack !== "") {
|
|
format += "%s";
|
|
args = args.concat([stack]);
|
|
}
|
|
var argsWithFormat = args.map(function(item) {
|
|
return "" + item;
|
|
});
|
|
argsWithFormat.unshift("Warning: " + format);
|
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
}
|
|
}
|
|
var didWarnStateUpdateForUnmountedComponent = {};
|
|
function warnNoop(publicInstance, callerName) {
|
|
{
|
|
var _constructor = publicInstance.constructor;
|
|
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
|
|
var warningKey = componentName + "." + callerName;
|
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
return;
|
|
}
|
|
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, componentName);
|
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
}
|
|
}
|
|
var ReactNoopUpdateQueue = {
|
|
isMounted: function(publicInstance) {
|
|
return false;
|
|
},
|
|
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
warnNoop(publicInstance, "forceUpdate");
|
|
},
|
|
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
warnNoop(publicInstance, "replaceState");
|
|
},
|
|
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
warnNoop(publicInstance, "setState");
|
|
}
|
|
};
|
|
var emptyObject = {};
|
|
{
|
|
Object.freeze(emptyObject);
|
|
}
|
|
function Component(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
Component.prototype.isReactComponent = {};
|
|
Component.prototype.setState = function(partialState, callback) {
|
|
if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) {
|
|
{
|
|
throw Error("setState(...): 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)."]
|
|
};
|
|
var defineDeprecationWarning = function(methodName, info) {
|
|
Object.defineProperty(Component.prototype, methodName, {
|
|
get: function() {
|
|
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
return void 0;
|
|
}
|
|
});
|
|
};
|
|
for (var fnName in deprecatedAPIs) {
|
|
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
}
|
|
}
|
|
}
|
|
function ComponentDummy() {
|
|
}
|
|
ComponentDummy.prototype = Component.prototype;
|
|
function PureComponent(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
pureComponentPrototype.constructor = PureComponent;
|
|
_assign(pureComponentPrototype, Component.prototype);
|
|
pureComponentPrototype.isPureReactComponent = true;
|
|
function createRef() {
|
|
var refObject = {
|
|
current: null
|
|
};
|
|
{
|
|
Object.seal(refObject);
|
|
}
|
|
return refObject;
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || "";
|
|
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
}
|
|
function getContextName(type) {
|
|
return type.displayName || "Context";
|
|
}
|
|
function getComponentName(type) {
|
|
if (type == null) {
|
|
return null;
|
|
}
|
|
{
|
|
if (typeof type.tag === "number") {
|
|
error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (typeof type === "function") {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
if (typeof type === "string") {
|
|
return type;
|
|
}
|
|
switch (type) {
|
|
case exports.Fragment:
|
|
return "Fragment";
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
case exports.Profiler:
|
|
return "Profiler";
|
|
case exports.StrictMode:
|
|
return "StrictMode";
|
|
case exports.Suspense:
|
|
return "Suspense";
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return "SuspenseList";
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
var context = type;
|
|
return getContextName(context) + ".Consumer";
|
|
case REACT_PROVIDER_TYPE:
|
|
var provider = type;
|
|
return getContextName(provider._context) + ".Provider";
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return getWrappedName(type, type.render, "ForwardRef");
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
case REACT_BLOCK_TYPE:
|
|
return getComponentName(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return getComponentName(init(payload));
|
|
} catch (x) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
{
|
|
didWarnAboutStringRefs = {};
|
|
}
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, "ref")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.ref !== void 0;
|
|
}
|
|
function hasValidKey(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, "key")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.key !== void 0;
|
|
}
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingKey = function() {
|
|
{
|
|
if (!specialPropKeyWarningShown) {
|
|
specialPropKeyWarningShown = true;
|
|
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://reactjs.org/link/special-props)", displayName);
|
|
}
|
|
}
|
|
};
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, "key", {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
function defineRefPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingRef = function() {
|
|
{
|
|
if (!specialPropRefWarningShown) {
|
|
specialPropRefWarningShown = true;
|
|
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
}
|
|
}
|
|
};
|
|
warnAboutAccessingRef.isReactWarning = true;
|
|
Object.defineProperty(props, "ref", {
|
|
get: warnAboutAccessingRef,
|
|
configurable: true
|
|
});
|
|
}
|
|
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
{
|
|
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
|
didWarnAboutStringRefs[componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
var element = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
ref,
|
|
props,
|
|
_owner: owner
|
|
};
|
|
{
|
|
element._store = {};
|
|
Object.defineProperty(element._store, "validated", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: false
|
|
});
|
|
Object.defineProperty(element, "_self", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: self2
|
|
});
|
|
Object.defineProperty(element, "_source", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: source
|
|
});
|
|
if (Object.freeze) {
|
|
Object.freeze(element.props);
|
|
Object.freeze(element);
|
|
}
|
|
}
|
|
return element;
|
|
};
|
|
function createElement(type, config, children) {
|
|
var propName;
|
|
var props = {};
|
|
var key = null;
|
|
var ref = null;
|
|
var self2 = null;
|
|
var source = null;
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
{
|
|
warnIfStringRefCannotBeAutoConverted(config);
|
|
}
|
|
}
|
|
if (hasValidKey(config)) {
|
|
key = "" + config.key;
|
|
}
|
|
self2 = config.__self === void 0 ? null : config.__self;
|
|
source = config.__source === void 0 ? null : config.__source;
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
{
|
|
if (Object.freeze) {
|
|
Object.freeze(childArray);
|
|
}
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
for (propName in defaultProps) {
|
|
if (props[propName] === void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (key || ref) {
|
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
}
|
|
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
}
|
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
return newElement;
|
|
}
|
|
function cloneElement(element, config, children) {
|
|
if (!!(element === null || element === void 0)) {
|
|
{
|
|
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
}
|
|
}
|
|
var propName;
|
|
var props = _assign({}, element.props);
|
|
var key = element.key;
|
|
var ref = element.ref;
|
|
var self2 = element._self;
|
|
var source = element._source;
|
|
var owner = element._owner;
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
owner = ReactCurrentOwner.current;
|
|
}
|
|
if (hasValidKey(config)) {
|
|
key = "" + config.key;
|
|
}
|
|
var defaultProps;
|
|
if (element.type && element.type.defaultProps) {
|
|
defaultProps = element.type.defaultProps;
|
|
}
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
} else {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
return ReactElement(element.type, key, ref, self2, source, owner, props);
|
|
}
|
|
function isValidElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
var SEPARATOR = ".";
|
|
var SUBSEPARATOR = ":";
|
|
function escape(key) {
|
|
var escapeRegex = /[=:]/g;
|
|
var escaperLookup = {
|
|
"=": "=0",
|
|
":": "=2"
|
|
};
|
|
var escapedString = key.replace(escapeRegex, function(match) {
|
|
return escaperLookup[match];
|
|
});
|
|
return "$" + escapedString;
|
|
}
|
|
var didWarnAboutMaps = false;
|
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
function escapeUserProvidedKey(text) {
|
|
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
|
}
|
|
function getElementKey(element, index) {
|
|
if (typeof element === "object" && element !== null && element.key != null) {
|
|
return escape("" + element.key);
|
|
}
|
|
return index.toString(36);
|
|
}
|
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
var type = typeof children;
|
|
if (type === "undefined" || type === "boolean") {
|
|
children = null;
|
|
}
|
|
var invokeCallback = false;
|
|
if (children === null) {
|
|
invokeCallback = true;
|
|
} else {
|
|
switch (type) {
|
|
case "string":
|
|
case "number":
|
|
invokeCallback = true;
|
|
break;
|
|
case "object":
|
|
switch (children.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
invokeCallback = true;
|
|
}
|
|
}
|
|
}
|
|
if (invokeCallback) {
|
|
var _child = children;
|
|
var mappedChild = callback(_child);
|
|
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
if (Array.isArray(mappedChild)) {
|
|
var escapedChildKey = "";
|
|
if (childKey != null) {
|
|
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
}
|
|
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
|
|
return c;
|
|
});
|
|
} else if (mappedChild != null) {
|
|
if (isValidElement(mappedChild)) {
|
|
mappedChild = cloneAndReplaceKey(mappedChild, escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey);
|
|
}
|
|
array.push(mappedChild);
|
|
}
|
|
return 1;
|
|
}
|
|
var child;
|
|
var nextName;
|
|
var subtreeCount = 0;
|
|
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
child = children[i];
|
|
nextName = nextNamePrefix + getElementKey(child, i);
|
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
if (typeof iteratorFn === "function") {
|
|
var iterableChildren = children;
|
|
{
|
|
if (iteratorFn === iterableChildren.entries) {
|
|
if (!didWarnAboutMaps) {
|
|
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
}
|
|
didWarnAboutMaps = true;
|
|
}
|
|
}
|
|
var iterator = iteratorFn.call(iterableChildren);
|
|
var step;
|
|
var ii = 0;
|
|
while (!(step = iterator.next()).done) {
|
|
child = step.value;
|
|
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
}
|
|
} else if (type === "object") {
|
|
var childrenString = "" + children;
|
|
{
|
|
{
|
|
throw Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return subtreeCount;
|
|
}
|
|
function mapChildren(children, func, context) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var result = [];
|
|
var count = 0;
|
|
mapIntoArray(children, result, "", "", function(child) {
|
|
return func.call(context, child, count++);
|
|
});
|
|
return result;
|
|
}
|
|
function countChildren(children) {
|
|
var n = 0;
|
|
mapChildren(children, function() {
|
|
n++;
|
|
});
|
|
return n;
|
|
}
|
|
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
mapChildren(children, function() {
|
|
forEachFunc.apply(this, arguments);
|
|
}, forEachContext);
|
|
}
|
|
function toArray(children) {
|
|
return mapChildren(children, function(child) {
|
|
return child;
|
|
}) || [];
|
|
}
|
|
function onlyChild(children) {
|
|
if (!isValidElement(children)) {
|
|
{
|
|
throw Error("React.Children.only expected to receive a single React element child.");
|
|
}
|
|
}
|
|
return children;
|
|
}
|
|
function createContext(defaultValue, calculateChangedBits) {
|
|
if (calculateChangedBits === void 0) {
|
|
calculateChangedBits = null;
|
|
} else {
|
|
{
|
|
if (calculateChangedBits !== null && typeof calculateChangedBits !== "function") {
|
|
error("createContext: Expected the optional second argument to be a function. Instead received: %s", calculateChangedBits);
|
|
}
|
|
}
|
|
}
|
|
var context = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_calculateChangedBits: calculateChangedBits,
|
|
_currentValue: defaultValue,
|
|
_currentValue2: defaultValue,
|
|
_threadCount: 0,
|
|
Provider: null,
|
|
Consumer: null
|
|
};
|
|
context.Provider = {
|
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
_context: context
|
|
};
|
|
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
var hasWarnedAboutUsingConsumerProvider = false;
|
|
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
{
|
|
var Consumer = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_context: context,
|
|
_calculateChangedBits: context._calculateChangedBits
|
|
};
|
|
Object.defineProperties(Consumer, {
|
|
Provider: {
|
|
get: function() {
|
|
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
|
|
}
|
|
return context.Provider;
|
|
},
|
|
set: function(_Provider) {
|
|
context.Provider = _Provider;
|
|
}
|
|
},
|
|
_currentValue: {
|
|
get: function() {
|
|
return context._currentValue;
|
|
},
|
|
set: function(_currentValue) {
|
|
context._currentValue = _currentValue;
|
|
}
|
|
},
|
|
_currentValue2: {
|
|
get: function() {
|
|
return context._currentValue2;
|
|
},
|
|
set: function(_currentValue2) {
|
|
context._currentValue2 = _currentValue2;
|
|
}
|
|
},
|
|
_threadCount: {
|
|
get: function() {
|
|
return context._threadCount;
|
|
},
|
|
set: function(_threadCount) {
|
|
context._threadCount = _threadCount;
|
|
}
|
|
},
|
|
Consumer: {
|
|
get: function() {
|
|
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
}
|
|
return context.Consumer;
|
|
}
|
|
},
|
|
displayName: {
|
|
get: function() {
|
|
return context.displayName;
|
|
},
|
|
set: function(displayName) {
|
|
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
context.Consumer = Consumer;
|
|
}
|
|
{
|
|
context._currentRenderer = null;
|
|
context._currentRenderer2 = null;
|
|
}
|
|
return context;
|
|
}
|
|
var Uninitialized = -1;
|
|
var Pending = 0;
|
|
var Resolved = 1;
|
|
var Rejected = 2;
|
|
function lazyInitializer(payload) {
|
|
if (payload._status === Uninitialized) {
|
|
var ctor = payload._result;
|
|
var thenable = ctor();
|
|
var pending = payload;
|
|
pending._status = Pending;
|
|
pending._result = thenable;
|
|
thenable.then(function(moduleObject) {
|
|
if (payload._status === Pending) {
|
|
var defaultExport = moduleObject.default;
|
|
{
|
|
if (defaultExport === void 0) {
|
|
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'))", moduleObject);
|
|
}
|
|
}
|
|
var resolved = payload;
|
|
resolved._status = Resolved;
|
|
resolved._result = defaultExport;
|
|
}
|
|
}, function(error2) {
|
|
if (payload._status === Pending) {
|
|
var rejected = payload;
|
|
rejected._status = Rejected;
|
|
rejected._result = error2;
|
|
}
|
|
});
|
|
}
|
|
if (payload._status === Resolved) {
|
|
return payload._result;
|
|
} else {
|
|
throw payload._result;
|
|
}
|
|
}
|
|
function lazy(ctor) {
|
|
var payload = {
|
|
_status: -1,
|
|
_result: ctor
|
|
};
|
|
var lazyType = {
|
|
$$typeof: REACT_LAZY_TYPE,
|
|
_payload: payload,
|
|
_init: lazyInitializer
|
|
};
|
|
{
|
|
var defaultProps;
|
|
var propTypes;
|
|
Object.defineProperties(lazyType, {
|
|
defaultProps: {
|
|
configurable: true,
|
|
get: function() {
|
|
return defaultProps;
|
|
},
|
|
set: function(newDefaultProps) {
|
|
error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
defaultProps = newDefaultProps;
|
|
Object.defineProperty(lazyType, "defaultProps", {
|
|
enumerable: true
|
|
});
|
|
}
|
|
},
|
|
propTypes: {
|
|
configurable: true,
|
|
get: function() {
|
|
return propTypes;
|
|
},
|
|
set: function(newPropTypes) {
|
|
error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
propTypes = newPropTypes;
|
|
Object.defineProperty(lazyType, "propTypes", {
|
|
enumerable: true
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return lazyType;
|
|
}
|
|
function forwardRef2(render) {
|
|
{
|
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
} else if (typeof render !== "function") {
|
|
error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
|
} else {
|
|
if (render.length !== 0 && render.length !== 2) {
|
|
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
|
}
|
|
}
|
|
if (render != null) {
|
|
if (render.defaultProps != null || render.propTypes != null) {
|
|
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
}
|
|
}
|
|
}
|
|
var elementType = {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render
|
|
};
|
|
{
|
|
var ownName;
|
|
Object.defineProperty(elementType, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
if (render.displayName == null) {
|
|
render.displayName = name;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return elementType;
|
|
}
|
|
var enableScopeAPI = false;
|
|
function isValidElementType(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function memo(type, compare) {
|
|
{
|
|
if (!isValidElementType(type)) {
|
|
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
}
|
|
}
|
|
var elementType = {
|
|
$$typeof: REACT_MEMO_TYPE,
|
|
type,
|
|
compare: compare === void 0 ? null : compare
|
|
};
|
|
{
|
|
var ownName;
|
|
Object.defineProperty(elementType, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
if (type.displayName == null) {
|
|
type.displayName = name;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return elementType;
|
|
}
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
if (!(dispatcher !== null)) {
|
|
{
|
|
throw 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
}
|
|
}
|
|
return dispatcher;
|
|
}
|
|
function useContext3(Context, unstable_observedBits) {
|
|
var dispatcher = resolveDispatcher();
|
|
{
|
|
if (unstable_observedBits !== void 0) {
|
|
error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks" : "");
|
|
}
|
|
if (Context._context !== void 0) {
|
|
var realContext = Context._context;
|
|
if (realContext.Consumer === Context) {
|
|
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
} else if (realContext.Provider === Context) {
|
|
error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
}
|
|
}
|
|
}
|
|
return dispatcher.useContext(Context, unstable_observedBits);
|
|
}
|
|
function useState9(initialState) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useState(initialState);
|
|
}
|
|
function useReducer(reducer, initialArg, init) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useReducer(reducer, initialArg, init);
|
|
}
|
|
function useRef4(initialValue) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useRef(initialValue);
|
|
}
|
|
function useEffect10(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useEffect(create, deps);
|
|
}
|
|
function useLayoutEffect(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useLayoutEffect(create, deps);
|
|
}
|
|
function useCallback3(callback, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useCallback(callback, deps);
|
|
}
|
|
function useMemo(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useMemo(create, deps);
|
|
}
|
|
function useImperativeHandle(ref, create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
}
|
|
function useDebugValue(value, formatterFn) {
|
|
{
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
}
|
|
}
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: _assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: _assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: _assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: _assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: _assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: _assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: _assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
prefix = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn, construct) {
|
|
if (!fn || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
Reflect.construct(fn, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s = sampleLines.length - 1;
|
|
var c = controlLines.length - 1;
|
|
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
c--;
|
|
}
|
|
for (; s >= 1 && c >= 0; s--, c--) {
|
|
if (sampleLines[s] !== controlLines[c]) {
|
|
if (s !== 1 || c !== 1) {
|
|
do {
|
|
s--;
|
|
c--;
|
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s >= 1 && c >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn ? fn.displayName || fn.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component2) {
|
|
var prototype = Component2.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case exports.Suspense:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_BLOCK_TYPE:
|
|
return describeFunctionComponentFrame(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
{
|
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function setCurrentlyValidatingElement$1(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
setExtraStackFrame(stack);
|
|
} else {
|
|
setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
var propTypesMisspellWarningShown;
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
if (ReactCurrentOwner.current) {
|
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
if (name) {
|
|
return "\n\nCheck the render method of `" + name + "`.";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function getSourceInfoErrorAddendum(source) {
|
|
if (source !== void 0) {
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
var lineNumber = source.lineNumber;
|
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
}
|
|
return "";
|
|
}
|
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
if (elementProps !== null && elementProps !== void 0) {
|
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
}
|
|
return "";
|
|
}
|
|
var ownerHasKeyUseWarning = {};
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
var info = getDeclarationErrorAddendum();
|
|
if (!info) {
|
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
function validateExplicitKey(element, parentType) {
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
var childOwner = "";
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
}
|
|
{
|
|
setCurrentlyValidatingElement$1(element);
|
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
function validateChildKeys(node, parentType) {
|
|
if (typeof node !== "object") {
|
|
return;
|
|
}
|
|
if (Array.isArray(node)) {
|
|
for (var i = 0; i < node.length; i++) {
|
|
var child = node[i];
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
if (typeof iteratorFn === "function") {
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validatePropTypes(element) {
|
|
{
|
|
var type = element.type;
|
|
if (type === null || type === void 0 || typeof type === "string") {
|
|
return;
|
|
}
|
|
var propTypes;
|
|
if (typeof type === "function") {
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
if (propTypes) {
|
|
var name = getComponentName(type);
|
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
var _name = getComponentName(type);
|
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
}
|
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
}
|
|
}
|
|
}
|
|
function validateFragmentProps(fragment) {
|
|
{
|
|
var keys = Object.keys(fragment.props);
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if (key !== "children" && key !== "key") {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
setCurrentlyValidatingElement$1(null);
|
|
break;
|
|
}
|
|
}
|
|
if (fragment.ref !== null) {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
}
|
|
function createElementWithValidation(type, props, children) {
|
|
var validType = isValidElementType(type);
|
|
if (!validType) {
|
|
var info = "";
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
}
|
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
var typeString;
|
|
if (type === null) {
|
|
typeString = "null";
|
|
} else if (Array.isArray(type)) {
|
|
typeString = "array";
|
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = "<" + (getComponentName(type.type) || "Unknown") + " />";
|
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
{
|
|
error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
}
|
|
}
|
|
var element = createElement.apply(this, arguments);
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
if (validType) {
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], type);
|
|
}
|
|
}
|
|
if (type === exports.Fragment) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
return element;
|
|
}
|
|
var didWarnAboutDeprecatedCreateFactory = false;
|
|
function createFactoryWithValidation(type) {
|
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
validatedFactory.type = type;
|
|
{
|
|
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
didWarnAboutDeprecatedCreateFactory = true;
|
|
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
|
}
|
|
Object.defineProperty(validatedFactory, "type", {
|
|
enumerable: false,
|
|
get: function() {
|
|
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
|
Object.defineProperty(this, "type", {
|
|
value: type
|
|
});
|
|
return type;
|
|
}
|
|
});
|
|
}
|
|
return validatedFactory;
|
|
}
|
|
function cloneElementWithValidation(element, props, children) {
|
|
var newElement = cloneElement.apply(this, arguments);
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], newElement.type);
|
|
}
|
|
validatePropTypes(newElement);
|
|
return newElement;
|
|
}
|
|
{
|
|
try {
|
|
var frozenObject = Object.freeze({});
|
|
new Map([[frozenObject, null]]);
|
|
new Set([frozenObject]);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
var createElement$1 = createElementWithValidation;
|
|
var cloneElement$1 = cloneElementWithValidation;
|
|
var createFactory = createFactoryWithValidation;
|
|
var Children = {
|
|
map: mapChildren,
|
|
forEach: forEachChildren,
|
|
count: countChildren,
|
|
toArray,
|
|
only: onlyChild
|
|
};
|
|
exports.Children = Children;
|
|
exports.Component = Component;
|
|
exports.PureComponent = PureComponent;
|
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
exports.cloneElement = cloneElement$1;
|
|
exports.createContext = createContext;
|
|
exports.createElement = createElement$1;
|
|
exports.createFactory = createFactory;
|
|
exports.createRef = createRef;
|
|
exports.forwardRef = forwardRef2;
|
|
exports.isValidElement = isValidElement;
|
|
exports.lazy = lazy;
|
|
exports.memo = memo;
|
|
exports.useCallback = useCallback3;
|
|
exports.useContext = useContext3;
|
|
exports.useDebugValue = useDebugValue;
|
|
exports.useEffect = useEffect10;
|
|
exports.useImperativeHandle = useImperativeHandle;
|
|
exports.useLayoutEffect = useLayoutEffect;
|
|
exports.useMemo = useMemo;
|
|
exports.useReducer = useReducer;
|
|
exports.useRef = useRef4;
|
|
exports.useState = useState9;
|
|
exports.version = ReactVersion;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react/index.js
|
|
var require_react = __commonJS({
|
|
"node_modules/react/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/cjs/scheduler.development.js
|
|
var require_scheduler_development = __commonJS({
|
|
"node_modules/scheduler/cjs/scheduler.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var enableSchedulerDebugging = false;
|
|
var enableProfiling = false;
|
|
var requestHostCallback;
|
|
var requestHostTimeout;
|
|
var cancelHostTimeout;
|
|
var requestPaint;
|
|
var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
|
|
if (hasPerformanceNow) {
|
|
var localPerformance = performance;
|
|
exports.unstable_now = function() {
|
|
return localPerformance.now();
|
|
};
|
|
} else {
|
|
var localDate = Date;
|
|
var initialTime = localDate.now();
|
|
exports.unstable_now = function() {
|
|
return localDate.now() - initialTime;
|
|
};
|
|
}
|
|
if (typeof window === "undefined" || typeof MessageChannel !== "function") {
|
|
var _callback = null;
|
|
var _timeoutID = null;
|
|
var _flushCallback = function() {
|
|
if (_callback !== null) {
|
|
try {
|
|
var currentTime = exports.unstable_now();
|
|
var hasRemainingTime = true;
|
|
_callback(hasRemainingTime, currentTime);
|
|
_callback = null;
|
|
} catch (e) {
|
|
setTimeout(_flushCallback, 0);
|
|
throw e;
|
|
}
|
|
}
|
|
};
|
|
requestHostCallback = function(cb) {
|
|
if (_callback !== null) {
|
|
setTimeout(requestHostCallback, 0, cb);
|
|
} else {
|
|
_callback = cb;
|
|
setTimeout(_flushCallback, 0);
|
|
}
|
|
};
|
|
requestHostTimeout = function(cb, ms) {
|
|
_timeoutID = setTimeout(cb, ms);
|
|
};
|
|
cancelHostTimeout = function() {
|
|
clearTimeout(_timeoutID);
|
|
};
|
|
exports.unstable_shouldYield = function() {
|
|
return false;
|
|
};
|
|
requestPaint = exports.unstable_forceFrameRate = function() {
|
|
};
|
|
} else {
|
|
var _setTimeout = window.setTimeout;
|
|
var _clearTimeout = window.clearTimeout;
|
|
if (typeof console !== "undefined") {
|
|
var requestAnimationFrame = window.requestAnimationFrame;
|
|
var cancelAnimationFrame = window.cancelAnimationFrame;
|
|
if (typeof requestAnimationFrame !== "function") {
|
|
console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
|
|
}
|
|
if (typeof cancelAnimationFrame !== "function") {
|
|
console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
|
|
}
|
|
}
|
|
var isMessageLoopRunning = false;
|
|
var scheduledHostCallback = null;
|
|
var taskTimeoutID = -1;
|
|
var yieldInterval = 5;
|
|
var deadline = 0;
|
|
{
|
|
exports.unstable_shouldYield = function() {
|
|
return exports.unstable_now() >= deadline;
|
|
};
|
|
requestPaint = function() {
|
|
};
|
|
}
|
|
exports.unstable_forceFrameRate = function(fps) {
|
|
if (fps < 0 || fps > 125) {
|
|
console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
|
|
return;
|
|
}
|
|
if (fps > 0) {
|
|
yieldInterval = Math.floor(1e3 / fps);
|
|
} else {
|
|
yieldInterval = 5;
|
|
}
|
|
};
|
|
var performWorkUntilDeadline = function() {
|
|
if (scheduledHostCallback !== null) {
|
|
var currentTime = exports.unstable_now();
|
|
deadline = currentTime + yieldInterval;
|
|
var hasTimeRemaining = true;
|
|
try {
|
|
var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
|
if (!hasMoreWork) {
|
|
isMessageLoopRunning = false;
|
|
scheduledHostCallback = null;
|
|
} else {
|
|
port.postMessage(null);
|
|
}
|
|
} catch (error) {
|
|
port.postMessage(null);
|
|
throw error;
|
|
}
|
|
} else {
|
|
isMessageLoopRunning = false;
|
|
}
|
|
};
|
|
var channel = new MessageChannel();
|
|
var port = channel.port2;
|
|
channel.port1.onmessage = performWorkUntilDeadline;
|
|
requestHostCallback = function(callback) {
|
|
scheduledHostCallback = callback;
|
|
if (!isMessageLoopRunning) {
|
|
isMessageLoopRunning = true;
|
|
port.postMessage(null);
|
|
}
|
|
};
|
|
requestHostTimeout = function(callback, ms) {
|
|
taskTimeoutID = _setTimeout(function() {
|
|
callback(exports.unstable_now());
|
|
}, ms);
|
|
};
|
|
cancelHostTimeout = function() {
|
|
_clearTimeout(taskTimeoutID);
|
|
taskTimeoutID = -1;
|
|
};
|
|
}
|
|
function push(heap, node) {
|
|
var index = heap.length;
|
|
heap.push(node);
|
|
siftUp(heap, node, index);
|
|
}
|
|
function peek(heap) {
|
|
var first = heap[0];
|
|
return first === void 0 ? null : first;
|
|
}
|
|
function pop(heap) {
|
|
var first = heap[0];
|
|
if (first !== void 0) {
|
|
var last = heap.pop();
|
|
if (last !== first) {
|
|
heap[0] = last;
|
|
siftDown(heap, last, 0);
|
|
}
|
|
return first;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
function siftUp(heap, node, i) {
|
|
var index = i;
|
|
while (true) {
|
|
var parentIndex = index - 1 >>> 1;
|
|
var parent = heap[parentIndex];
|
|
if (parent !== void 0 && compare(parent, node) > 0) {
|
|
heap[parentIndex] = node;
|
|
heap[index] = parent;
|
|
index = parentIndex;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function siftDown(heap, node, i) {
|
|
var index = i;
|
|
var length = heap.length;
|
|
while (index < length) {
|
|
var leftIndex = (index + 1) * 2 - 1;
|
|
var left = heap[leftIndex];
|
|
var rightIndex = leftIndex + 1;
|
|
var right = heap[rightIndex];
|
|
if (left !== void 0 && compare(left, node) < 0) {
|
|
if (right !== void 0 && compare(right, left) < 0) {
|
|
heap[index] = right;
|
|
heap[rightIndex] = node;
|
|
index = rightIndex;
|
|
} else {
|
|
heap[index] = left;
|
|
heap[leftIndex] = node;
|
|
index = leftIndex;
|
|
}
|
|
} else if (right !== void 0 && compare(right, node) < 0) {
|
|
heap[index] = right;
|
|
heap[rightIndex] = node;
|
|
index = rightIndex;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function compare(a, b) {
|
|
var diff = a.sortIndex - b.sortIndex;
|
|
return diff !== 0 ? diff : a.id - b.id;
|
|
}
|
|
var ImmediatePriority = 1;
|
|
var UserBlockingPriority = 2;
|
|
var NormalPriority = 3;
|
|
var LowPriority = 4;
|
|
var IdlePriority = 5;
|
|
function markTaskErrored(task, ms) {
|
|
}
|
|
var maxSigned31BitInt = 1073741823;
|
|
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
|
|
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
|
var NORMAL_PRIORITY_TIMEOUT = 5e3;
|
|
var LOW_PRIORITY_TIMEOUT = 1e4;
|
|
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
|
|
var taskQueue = [];
|
|
var timerQueue = [];
|
|
var taskIdCounter = 1;
|
|
var currentTask = null;
|
|
var currentPriorityLevel = NormalPriority;
|
|
var isPerformingWork = false;
|
|
var isHostCallbackScheduled = false;
|
|
var isHostTimeoutScheduled = false;
|
|
function advanceTimers(currentTime) {
|
|
var timer = peek(timerQueue);
|
|
while (timer !== null) {
|
|
if (timer.callback === null) {
|
|
pop(timerQueue);
|
|
} else if (timer.startTime <= currentTime) {
|
|
pop(timerQueue);
|
|
timer.sortIndex = timer.expirationTime;
|
|
push(taskQueue, timer);
|
|
} else {
|
|
return;
|
|
}
|
|
timer = peek(timerQueue);
|
|
}
|
|
}
|
|
function handleTimeout(currentTime) {
|
|
isHostTimeoutScheduled = false;
|
|
advanceTimers(currentTime);
|
|
if (!isHostCallbackScheduled) {
|
|
if (peek(taskQueue) !== null) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
} else {
|
|
var firstTimer = peek(timerQueue);
|
|
if (firstTimer !== null) {
|
|
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function flushWork(hasTimeRemaining, initialTime2) {
|
|
isHostCallbackScheduled = false;
|
|
if (isHostTimeoutScheduled) {
|
|
isHostTimeoutScheduled = false;
|
|
cancelHostTimeout();
|
|
}
|
|
isPerformingWork = true;
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
try {
|
|
if (enableProfiling) {
|
|
try {
|
|
return workLoop(hasTimeRemaining, initialTime2);
|
|
} catch (error) {
|
|
if (currentTask !== null) {
|
|
var currentTime = exports.unstable_now();
|
|
markTaskErrored(currentTask, currentTime);
|
|
currentTask.isQueued = false;
|
|
}
|
|
throw error;
|
|
}
|
|
} else {
|
|
return workLoop(hasTimeRemaining, initialTime2);
|
|
}
|
|
} finally {
|
|
currentTask = null;
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
isPerformingWork = false;
|
|
}
|
|
}
|
|
function workLoop(hasTimeRemaining, initialTime2) {
|
|
var currentTime = initialTime2;
|
|
advanceTimers(currentTime);
|
|
currentTask = peek(taskQueue);
|
|
while (currentTask !== null && !enableSchedulerDebugging) {
|
|
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {
|
|
break;
|
|
}
|
|
var callback = currentTask.callback;
|
|
if (typeof callback === "function") {
|
|
currentTask.callback = null;
|
|
currentPriorityLevel = currentTask.priorityLevel;
|
|
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
|
var continuationCallback = callback(didUserCallbackTimeout);
|
|
currentTime = exports.unstable_now();
|
|
if (typeof continuationCallback === "function") {
|
|
currentTask.callback = continuationCallback;
|
|
} else {
|
|
if (currentTask === peek(taskQueue)) {
|
|
pop(taskQueue);
|
|
}
|
|
}
|
|
advanceTimers(currentTime);
|
|
} else {
|
|
pop(taskQueue);
|
|
}
|
|
currentTask = peek(taskQueue);
|
|
}
|
|
if (currentTask !== null) {
|
|
return true;
|
|
} else {
|
|
var firstTimer = peek(timerQueue);
|
|
if (firstTimer !== null) {
|
|
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
function unstable_runWithPriority(priorityLevel, eventHandler) {
|
|
switch (priorityLevel) {
|
|
case ImmediatePriority:
|
|
case UserBlockingPriority:
|
|
case NormalPriority:
|
|
case LowPriority:
|
|
case IdlePriority:
|
|
break;
|
|
default:
|
|
priorityLevel = NormalPriority;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
}
|
|
function unstable_next(eventHandler) {
|
|
var priorityLevel;
|
|
switch (currentPriorityLevel) {
|
|
case ImmediatePriority:
|
|
case UserBlockingPriority:
|
|
case NormalPriority:
|
|
priorityLevel = NormalPriority;
|
|
break;
|
|
default:
|
|
priorityLevel = currentPriorityLevel;
|
|
break;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
}
|
|
function unstable_wrapCallback(callback) {
|
|
var parentPriorityLevel = currentPriorityLevel;
|
|
return function() {
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = parentPriorityLevel;
|
|
try {
|
|
return callback.apply(this, arguments);
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
};
|
|
}
|
|
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
var currentTime = exports.unstable_now();
|
|
var startTime;
|
|
if (typeof options === "object" && options !== null) {
|
|
var delay = options.delay;
|
|
if (typeof delay === "number" && delay > 0) {
|
|
startTime = currentTime + delay;
|
|
} else {
|
|
startTime = currentTime;
|
|
}
|
|
} else {
|
|
startTime = currentTime;
|
|
}
|
|
var timeout;
|
|
switch (priorityLevel) {
|
|
case ImmediatePriority:
|
|
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
|
|
break;
|
|
case UserBlockingPriority:
|
|
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
|
|
break;
|
|
case IdlePriority:
|
|
timeout = IDLE_PRIORITY_TIMEOUT;
|
|
break;
|
|
case LowPriority:
|
|
timeout = LOW_PRIORITY_TIMEOUT;
|
|
break;
|
|
case NormalPriority:
|
|
default:
|
|
timeout = NORMAL_PRIORITY_TIMEOUT;
|
|
break;
|
|
}
|
|
var expirationTime = startTime + timeout;
|
|
var newTask = {
|
|
id: taskIdCounter++,
|
|
callback,
|
|
priorityLevel,
|
|
startTime,
|
|
expirationTime,
|
|
sortIndex: -1
|
|
};
|
|
if (startTime > currentTime) {
|
|
newTask.sortIndex = startTime;
|
|
push(timerQueue, newTask);
|
|
if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
|
|
if (isHostTimeoutScheduled) {
|
|
cancelHostTimeout();
|
|
} else {
|
|
isHostTimeoutScheduled = true;
|
|
}
|
|
requestHostTimeout(handleTimeout, startTime - currentTime);
|
|
}
|
|
} else {
|
|
newTask.sortIndex = expirationTime;
|
|
push(taskQueue, newTask);
|
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
}
|
|
}
|
|
return newTask;
|
|
}
|
|
function unstable_pauseExecution() {
|
|
}
|
|
function unstable_continueExecution() {
|
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
}
|
|
}
|
|
function unstable_getFirstCallbackNode() {
|
|
return peek(taskQueue);
|
|
}
|
|
function unstable_cancelCallback(task) {
|
|
task.callback = null;
|
|
}
|
|
function unstable_getCurrentPriorityLevel() {
|
|
return currentPriorityLevel;
|
|
}
|
|
var unstable_requestPaint = requestPaint;
|
|
var unstable_Profiling = null;
|
|
exports.unstable_IdlePriority = IdlePriority;
|
|
exports.unstable_ImmediatePriority = ImmediatePriority;
|
|
exports.unstable_LowPriority = LowPriority;
|
|
exports.unstable_NormalPriority = NormalPriority;
|
|
exports.unstable_Profiling = unstable_Profiling;
|
|
exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
|
exports.unstable_cancelCallback = unstable_cancelCallback;
|
|
exports.unstable_continueExecution = unstable_continueExecution;
|
|
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
|
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
|
exports.unstable_next = unstable_next;
|
|
exports.unstable_pauseExecution = unstable_pauseExecution;
|
|
exports.unstable_requestPaint = unstable_requestPaint;
|
|
exports.unstable_runWithPriority = unstable_runWithPriority;
|
|
exports.unstable_scheduleCallback = unstable_scheduleCallback;
|
|
exports.unstable_wrapCallback = unstable_wrapCallback;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/index.js
|
|
var require_scheduler = __commonJS({
|
|
"node_modules/scheduler/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_scheduler_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/cjs/scheduler-tracing.development.js
|
|
var require_scheduler_tracing_development = __commonJS({
|
|
"node_modules/scheduler/cjs/scheduler-tracing.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var DEFAULT_THREAD_ID = 0;
|
|
var interactionIDCounter = 0;
|
|
var threadIDCounter = 0;
|
|
exports.__interactionsRef = null;
|
|
exports.__subscriberRef = null;
|
|
{
|
|
exports.__interactionsRef = {
|
|
current: new Set()
|
|
};
|
|
exports.__subscriberRef = {
|
|
current: null
|
|
};
|
|
}
|
|
function unstable_clear(callback) {
|
|
var prevInteractions = exports.__interactionsRef.current;
|
|
exports.__interactionsRef.current = new Set();
|
|
try {
|
|
return callback();
|
|
} finally {
|
|
exports.__interactionsRef.current = prevInteractions;
|
|
}
|
|
}
|
|
function unstable_getCurrent() {
|
|
{
|
|
return exports.__interactionsRef.current;
|
|
}
|
|
}
|
|
function unstable_getThreadID() {
|
|
return ++threadIDCounter;
|
|
}
|
|
function unstable_trace(name, timestamp, callback) {
|
|
var threadID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : DEFAULT_THREAD_ID;
|
|
var interaction = {
|
|
__count: 1,
|
|
id: interactionIDCounter++,
|
|
name,
|
|
timestamp
|
|
};
|
|
var prevInteractions = exports.__interactionsRef.current;
|
|
var interactions = new Set(prevInteractions);
|
|
interactions.add(interaction);
|
|
exports.__interactionsRef.current = interactions;
|
|
var subscriber = exports.__subscriberRef.current;
|
|
var returnValue;
|
|
try {
|
|
if (subscriber !== null) {
|
|
subscriber.onInteractionTraced(interaction);
|
|
}
|
|
} finally {
|
|
try {
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkStarted(interactions, threadID);
|
|
}
|
|
} finally {
|
|
try {
|
|
returnValue = callback();
|
|
} finally {
|
|
exports.__interactionsRef.current = prevInteractions;
|
|
try {
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkStopped(interactions, threadID);
|
|
}
|
|
} finally {
|
|
interaction.__count--;
|
|
if (subscriber !== null && interaction.__count === 0) {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return returnValue;
|
|
}
|
|
function unstable_wrap(callback) {
|
|
var threadID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_THREAD_ID;
|
|
var wrappedInteractions = exports.__interactionsRef.current;
|
|
var subscriber = exports.__subscriberRef.current;
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkScheduled(wrappedInteractions, threadID);
|
|
}
|
|
wrappedInteractions.forEach(function(interaction) {
|
|
interaction.__count++;
|
|
});
|
|
var hasRun = false;
|
|
function wrapped() {
|
|
var prevInteractions = exports.__interactionsRef.current;
|
|
exports.__interactionsRef.current = wrappedInteractions;
|
|
subscriber = exports.__subscriberRef.current;
|
|
try {
|
|
var returnValue;
|
|
try {
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkStarted(wrappedInteractions, threadID);
|
|
}
|
|
} finally {
|
|
try {
|
|
returnValue = callback.apply(void 0, arguments);
|
|
} finally {
|
|
exports.__interactionsRef.current = prevInteractions;
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkStopped(wrappedInteractions, threadID);
|
|
}
|
|
}
|
|
}
|
|
return returnValue;
|
|
} finally {
|
|
if (!hasRun) {
|
|
hasRun = true;
|
|
wrappedInteractions.forEach(function(interaction) {
|
|
interaction.__count--;
|
|
if (subscriber !== null && interaction.__count === 0) {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
wrapped.cancel = function cancel() {
|
|
subscriber = exports.__subscriberRef.current;
|
|
try {
|
|
if (subscriber !== null) {
|
|
subscriber.onWorkCanceled(wrappedInteractions, threadID);
|
|
}
|
|
} finally {
|
|
wrappedInteractions.forEach(function(interaction) {
|
|
interaction.__count--;
|
|
if (subscriber && interaction.__count === 0) {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
return wrapped;
|
|
}
|
|
var subscribers = null;
|
|
{
|
|
subscribers = new Set();
|
|
}
|
|
function unstable_subscribe(subscriber) {
|
|
{
|
|
subscribers.add(subscriber);
|
|
if (subscribers.size === 1) {
|
|
exports.__subscriberRef.current = {
|
|
onInteractionScheduledWorkCompleted,
|
|
onInteractionTraced,
|
|
onWorkCanceled,
|
|
onWorkScheduled,
|
|
onWorkStarted,
|
|
onWorkStopped
|
|
};
|
|
}
|
|
}
|
|
}
|
|
function unstable_unsubscribe(subscriber) {
|
|
{
|
|
subscribers.delete(subscriber);
|
|
if (subscribers.size === 0) {
|
|
exports.__subscriberRef.current = null;
|
|
}
|
|
}
|
|
}
|
|
function onInteractionTraced(interaction) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onInteractionTraced(interaction);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
function onInteractionScheduledWorkCompleted(interaction) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
function onWorkScheduled(interactions, threadID) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onWorkScheduled(interactions, threadID);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
function onWorkStarted(interactions, threadID) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onWorkStarted(interactions, threadID);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
function onWorkStopped(interactions, threadID) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onWorkStopped(interactions, threadID);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
function onWorkCanceled(interactions, threadID) {
|
|
var didCatchError = false;
|
|
var caughtError = null;
|
|
subscribers.forEach(function(subscriber) {
|
|
try {
|
|
subscriber.onWorkCanceled(interactions, threadID);
|
|
} catch (error) {
|
|
if (!didCatchError) {
|
|
didCatchError = true;
|
|
caughtError = error;
|
|
}
|
|
}
|
|
});
|
|
if (didCatchError) {
|
|
throw caughtError;
|
|
}
|
|
}
|
|
exports.unstable_clear = unstable_clear;
|
|
exports.unstable_getCurrent = unstable_getCurrent;
|
|
exports.unstable_getThreadID = unstable_getThreadID;
|
|
exports.unstable_subscribe = unstable_subscribe;
|
|
exports.unstable_trace = unstable_trace;
|
|
exports.unstable_unsubscribe = unstable_unsubscribe;
|
|
exports.unstable_wrap = unstable_wrap;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/tracing.js
|
|
var require_tracing = __commonJS({
|
|
"node_modules/scheduler/tracing.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_scheduler_tracing_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/cjs/react-dom.development.js
|
|
var require_react_dom_development = __commonJS({
|
|
"node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var React31 = require_react();
|
|
var _assign = require_object_assign();
|
|
var Scheduler = require_scheduler();
|
|
var tracing = require_tracing();
|
|
var ReactSharedInternals = React31.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
function warn(format) {
|
|
{
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
printWarning("warn", format, args);
|
|
}
|
|
}
|
|
function error(format) {
|
|
{
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
args[_key2 - 1] = arguments[_key2];
|
|
}
|
|
printWarning("error", format, args);
|
|
}
|
|
}
|
|
function printWarning(level, format, args) {
|
|
{
|
|
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
if (stack !== "") {
|
|
format += "%s";
|
|
args = args.concat([stack]);
|
|
}
|
|
var argsWithFormat = args.map(function(item) {
|
|
return "" + item;
|
|
});
|
|
argsWithFormat.unshift("Warning: " + format);
|
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
}
|
|
}
|
|
if (!React31) {
|
|
{
|
|
throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
|
|
}
|
|
}
|
|
var FunctionComponent = 0;
|
|
var ClassComponent = 1;
|
|
var IndeterminateComponent = 2;
|
|
var HostRoot = 3;
|
|
var HostPortal = 4;
|
|
var HostComponent = 5;
|
|
var HostText = 6;
|
|
var Fragment = 7;
|
|
var Mode = 8;
|
|
var ContextConsumer = 9;
|
|
var ContextProvider = 10;
|
|
var ForwardRef = 11;
|
|
var Profiler = 12;
|
|
var SuspenseComponent = 13;
|
|
var MemoComponent = 14;
|
|
var SimpleMemoComponent = 15;
|
|
var LazyComponent = 16;
|
|
var IncompleteClassComponent = 17;
|
|
var DehydratedFragment = 18;
|
|
var SuspenseListComponent = 19;
|
|
var FundamentalComponent = 20;
|
|
var ScopeComponent = 21;
|
|
var Block = 22;
|
|
var OffscreenComponent = 23;
|
|
var LegacyHiddenComponent = 24;
|
|
var enableProfilerTimer = true;
|
|
var enableFundamentalAPI = false;
|
|
var enableNewReconciler = false;
|
|
var warnAboutStringRefs = false;
|
|
var allNativeEvents = new Set();
|
|
var registrationNameDependencies = {};
|
|
var possibleRegistrationNames = {};
|
|
function registerTwoPhaseEvent(registrationName, dependencies) {
|
|
registerDirectEvent(registrationName, dependencies);
|
|
registerDirectEvent(registrationName + "Capture", dependencies);
|
|
}
|
|
function registerDirectEvent(registrationName, dependencies) {
|
|
{
|
|
if (registrationNameDependencies[registrationName]) {
|
|
error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
|
|
}
|
|
}
|
|
registrationNameDependencies[registrationName] = dependencies;
|
|
{
|
|
var lowerCasedName = registrationName.toLowerCase();
|
|
possibleRegistrationNames[lowerCasedName] = registrationName;
|
|
if (registrationName === "onDoubleClick") {
|
|
possibleRegistrationNames.ondblclick = registrationName;
|
|
}
|
|
}
|
|
for (var i = 0; i < dependencies.length; i++) {
|
|
allNativeEvents.add(dependencies[i]);
|
|
}
|
|
}
|
|
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
var RESERVED = 0;
|
|
var STRING = 1;
|
|
var BOOLEANISH_STRING = 2;
|
|
var BOOLEAN = 3;
|
|
var OVERLOADED_BOOLEAN = 4;
|
|
var NUMERIC = 5;
|
|
var POSITIVE_NUMERIC = 6;
|
|
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var ROOT_ATTRIBUTE_NAME = "data-reactroot";
|
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var illegalAttributeNameCache = {};
|
|
var validatedAttributeNameCache = {};
|
|
function isAttributeNameSafe(attributeName) {
|
|
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
|
return true;
|
|
}
|
|
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
|
return false;
|
|
}
|
|
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
|
validatedAttributeNameCache[attributeName] = true;
|
|
return true;
|
|
}
|
|
illegalAttributeNameCache[attributeName] = true;
|
|
{
|
|
error("Invalid attribute name: `%s`", attributeName);
|
|
}
|
|
return false;
|
|
}
|
|
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
|
if (propertyInfo !== null) {
|
|
return propertyInfo.type === RESERVED;
|
|
}
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
|
if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
|
return false;
|
|
}
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
return true;
|
|
case "boolean": {
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (propertyInfo !== null) {
|
|
return !propertyInfo.acceptsBooleans;
|
|
} else {
|
|
var prefix2 = name.toLowerCase().slice(0, 5);
|
|
return prefix2 !== "data-" && prefix2 !== "aria-";
|
|
}
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
|
if (value === null || typeof value === "undefined") {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
|
return true;
|
|
}
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (propertyInfo !== null) {
|
|
switch (propertyInfo.type) {
|
|
case BOOLEAN:
|
|
return !value;
|
|
case OVERLOADED_BOOLEAN:
|
|
return value === false;
|
|
case NUMERIC:
|
|
return isNaN(value);
|
|
case POSITIVE_NUMERIC:
|
|
return isNaN(value) || value < 1;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function getPropertyInfo(name) {
|
|
return properties.hasOwnProperty(name) ? properties[name] : null;
|
|
}
|
|
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
|
|
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
this.attributeName = attributeName;
|
|
this.attributeNamespace = attributeNamespace;
|
|
this.mustUseProperty = mustUseProperty;
|
|
this.propertyName = name;
|
|
this.type = type;
|
|
this.sanitizeURL = sanitizeURL2;
|
|
this.removeEmptyString = removeEmptyString;
|
|
}
|
|
var properties = {};
|
|
var reservedProps = [
|
|
"children",
|
|
"dangerouslySetInnerHTML",
|
|
"defaultValue",
|
|
"defaultChecked",
|
|
"innerHTML",
|
|
"suppressContentEditableWarning",
|
|
"suppressHydrationWarning",
|
|
"style"
|
|
];
|
|
reservedProps.forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, name, null, false, false);
|
|
});
|
|
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
|
|
var name = _ref[0], attributeName = _ref[1];
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false);
|
|
});
|
|
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null, false, false);
|
|
});
|
|
[
|
|
"allowFullScreen",
|
|
"async",
|
|
"autoFocus",
|
|
"autoPlay",
|
|
"controls",
|
|
"default",
|
|
"defer",
|
|
"disabled",
|
|
"disablePictureInPicture",
|
|
"disableRemotePlayback",
|
|
"formNoValidate",
|
|
"hidden",
|
|
"loop",
|
|
"noModule",
|
|
"noValidate",
|
|
"open",
|
|
"playsInline",
|
|
"readOnly",
|
|
"required",
|
|
"reversed",
|
|
"scoped",
|
|
"seamless",
|
|
"itemScope"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
[
|
|
"checked",
|
|
"multiple",
|
|
"muted",
|
|
"selected"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name, null, false, false);
|
|
});
|
|
[
|
|
"capture",
|
|
"download"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name, null, false, false);
|
|
});
|
|
[
|
|
"cols",
|
|
"rows",
|
|
"size",
|
|
"span"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name, null, false, false);
|
|
});
|
|
["rowSpan", "start"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
var capitalize = function(token) {
|
|
return token[1].toUpperCase();
|
|
};
|
|
[
|
|
"accent-height",
|
|
"alignment-baseline",
|
|
"arabic-form",
|
|
"baseline-shift",
|
|
"cap-height",
|
|
"clip-path",
|
|
"clip-rule",
|
|
"color-interpolation",
|
|
"color-interpolation-filters",
|
|
"color-profile",
|
|
"color-rendering",
|
|
"dominant-baseline",
|
|
"enable-background",
|
|
"fill-opacity",
|
|
"fill-rule",
|
|
"flood-color",
|
|
"flood-opacity",
|
|
"font-family",
|
|
"font-size",
|
|
"font-size-adjust",
|
|
"font-stretch",
|
|
"font-style",
|
|
"font-variant",
|
|
"font-weight",
|
|
"glyph-name",
|
|
"glyph-orientation-horizontal",
|
|
"glyph-orientation-vertical",
|
|
"horiz-adv-x",
|
|
"horiz-origin-x",
|
|
"image-rendering",
|
|
"letter-spacing",
|
|
"lighting-color",
|
|
"marker-end",
|
|
"marker-mid",
|
|
"marker-start",
|
|
"overline-position",
|
|
"overline-thickness",
|
|
"paint-order",
|
|
"panose-1",
|
|
"pointer-events",
|
|
"rendering-intent",
|
|
"shape-rendering",
|
|
"stop-color",
|
|
"stop-opacity",
|
|
"strikethrough-position",
|
|
"strikethrough-thickness",
|
|
"stroke-dasharray",
|
|
"stroke-dashoffset",
|
|
"stroke-linecap",
|
|
"stroke-linejoin",
|
|
"stroke-miterlimit",
|
|
"stroke-opacity",
|
|
"stroke-width",
|
|
"text-anchor",
|
|
"text-decoration",
|
|
"text-rendering",
|
|
"underline-position",
|
|
"underline-thickness",
|
|
"unicode-bidi",
|
|
"unicode-range",
|
|
"units-per-em",
|
|
"v-alphabetic",
|
|
"v-hanging",
|
|
"v-ideographic",
|
|
"v-mathematical",
|
|
"vector-effect",
|
|
"vert-adv-y",
|
|
"vert-origin-x",
|
|
"vert-origin-y",
|
|
"word-spacing",
|
|
"writing-mode",
|
|
"xmlns:xlink",
|
|
"x-height"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false);
|
|
});
|
|
[
|
|
"xlink:actuate",
|
|
"xlink:arcrole",
|
|
"xlink:role",
|
|
"xlink:show",
|
|
"xlink:title",
|
|
"xlink:type"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/1999/xlink", false, false);
|
|
});
|
|
[
|
|
"xml:base",
|
|
"xml:lang",
|
|
"xml:space"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/XML/1998/namespace", false, false);
|
|
});
|
|
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
|
|
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false, false);
|
|
});
|
|
var xlinkHref = "xlinkHref";
|
|
properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false);
|
|
["src", "href", "action", "formAction"].forEach(function(attributeName) {
|
|
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true, true);
|
|
});
|
|
var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
|
|
var didWarn = false;
|
|
function sanitizeURL(url) {
|
|
{
|
|
if (!didWarn && isJavaScriptProtocol.test(url)) {
|
|
didWarn = true;
|
|
error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
|
|
}
|
|
}
|
|
}
|
|
function getValueForProperty(node, name, expected, propertyInfo) {
|
|
{
|
|
if (propertyInfo.mustUseProperty) {
|
|
var propertyName = propertyInfo.propertyName;
|
|
return node[propertyName];
|
|
} else {
|
|
if (propertyInfo.sanitizeURL) {
|
|
sanitizeURL("" + expected);
|
|
}
|
|
var attributeName = propertyInfo.attributeName;
|
|
var stringValue = null;
|
|
if (propertyInfo.type === OVERLOADED_BOOLEAN) {
|
|
if (node.hasAttribute(attributeName)) {
|
|
var value = node.getAttribute(attributeName);
|
|
if (value === "") {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return value;
|
|
}
|
|
if (value === "" + expected) {
|
|
return expected;
|
|
}
|
|
return value;
|
|
}
|
|
} else if (node.hasAttribute(attributeName)) {
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return node.getAttribute(attributeName);
|
|
}
|
|
if (propertyInfo.type === BOOLEAN) {
|
|
return expected;
|
|
}
|
|
stringValue = node.getAttribute(attributeName);
|
|
}
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return stringValue === null ? expected : stringValue;
|
|
} else if (stringValue === "" + expected) {
|
|
return expected;
|
|
} else {
|
|
return stringValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getValueForAttribute(node, name, expected) {
|
|
{
|
|
if (!isAttributeNameSafe(name)) {
|
|
return;
|
|
}
|
|
if (isOpaqueHydratingObject(expected)) {
|
|
return expected;
|
|
}
|
|
if (!node.hasAttribute(name)) {
|
|
return expected === void 0 ? void 0 : null;
|
|
}
|
|
var value = node.getAttribute(name);
|
|
if (value === "" + expected) {
|
|
return expected;
|
|
}
|
|
return value;
|
|
}
|
|
}
|
|
function setValueForProperty(node, name, value, isCustomComponentTag) {
|
|
var propertyInfo = getPropertyInfo(name);
|
|
if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
|
|
return;
|
|
}
|
|
if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
|
|
value = null;
|
|
}
|
|
if (isCustomComponentTag || propertyInfo === null) {
|
|
if (isAttributeNameSafe(name)) {
|
|
var _attributeName = name;
|
|
if (value === null) {
|
|
node.removeAttribute(_attributeName);
|
|
} else {
|
|
node.setAttribute(_attributeName, "" + value);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
var mustUseProperty = propertyInfo.mustUseProperty;
|
|
if (mustUseProperty) {
|
|
var propertyName = propertyInfo.propertyName;
|
|
if (value === null) {
|
|
var type = propertyInfo.type;
|
|
node[propertyName] = type === BOOLEAN ? false : "";
|
|
} else {
|
|
node[propertyName] = value;
|
|
}
|
|
return;
|
|
}
|
|
var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
|
|
if (value === null) {
|
|
node.removeAttribute(attributeName);
|
|
} else {
|
|
var _type = propertyInfo.type;
|
|
var attributeValue;
|
|
if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
|
|
attributeValue = "";
|
|
} else {
|
|
{
|
|
attributeValue = "" + value;
|
|
}
|
|
if (propertyInfo.sanitizeURL) {
|
|
sanitizeURL(attributeValue.toString());
|
|
}
|
|
}
|
|
if (attributeNamespace) {
|
|
node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
|
|
} else {
|
|
node.setAttribute(attributeName, attributeValue);
|
|
}
|
|
}
|
|
}
|
|
var REACT_ELEMENT_TYPE = 60103;
|
|
var REACT_PORTAL_TYPE = 60106;
|
|
var REACT_FRAGMENT_TYPE = 60107;
|
|
var REACT_STRICT_MODE_TYPE = 60108;
|
|
var REACT_PROFILER_TYPE = 60114;
|
|
var REACT_PROVIDER_TYPE = 60109;
|
|
var REACT_CONTEXT_TYPE = 60110;
|
|
var REACT_FORWARD_REF_TYPE = 60112;
|
|
var REACT_SUSPENSE_TYPE = 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
var REACT_MEMO_TYPE = 60115;
|
|
var REACT_LAZY_TYPE = 60116;
|
|
var REACT_BLOCK_TYPE = 60121;
|
|
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
var REACT_SCOPE_TYPE = 60119;
|
|
var REACT_OPAQUE_ID_TYPE = 60128;
|
|
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
var REACT_OFFSCREEN_TYPE = 60130;
|
|
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
|
|
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
}
|
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
return null;
|
|
}
|
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
if (typeof maybeIterator === "function") {
|
|
return maybeIterator;
|
|
}
|
|
return null;
|
|
}
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: _assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: _assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: _assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: _assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: _assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: _assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: _assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
prefix = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn, construct) {
|
|
if (!fn || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher.current;
|
|
ReactCurrentDispatcher.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
Reflect.construct(fn, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s = sampleLines.length - 1;
|
|
var c = controlLines.length - 1;
|
|
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
c--;
|
|
}
|
|
for (; s >= 1 && c >= 0; s--, c--) {
|
|
if (sampleLines[s] !== controlLines[c]) {
|
|
if (s !== 1 || c !== 1) {
|
|
do {
|
|
s--;
|
|
c--;
|
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s >= 1 && c >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn ? fn.displayName || fn.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeClassComponentFrame(ctor, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(ctor, true);
|
|
}
|
|
}
|
|
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case REACT_SUSPENSE_TYPE:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_BLOCK_TYPE:
|
|
return describeFunctionComponentFrame(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function describeFiber(fiber) {
|
|
var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
|
|
var source = fiber._debugSource;
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
return describeBuiltInComponentFrame(fiber.type);
|
|
case LazyComponent:
|
|
return describeBuiltInComponentFrame("Lazy");
|
|
case SuspenseComponent:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case SuspenseListComponent:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
case FunctionComponent:
|
|
case IndeterminateComponent:
|
|
case SimpleMemoComponent:
|
|
return describeFunctionComponentFrame(fiber.type);
|
|
case ForwardRef:
|
|
return describeFunctionComponentFrame(fiber.type.render);
|
|
case Block:
|
|
return describeFunctionComponentFrame(fiber.type._render);
|
|
case ClassComponent:
|
|
return describeClassComponentFrame(fiber.type);
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
function getStackByFiberInDevAndProd(workInProgress2) {
|
|
try {
|
|
var info = "";
|
|
var node = workInProgress2;
|
|
do {
|
|
info += describeFiber(node);
|
|
node = node.return;
|
|
} while (node);
|
|
return info;
|
|
} catch (x) {
|
|
return "\nError generating stack: " + x.message + "\n" + x.stack;
|
|
}
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || "";
|
|
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
}
|
|
function getContextName(type) {
|
|
return type.displayName || "Context";
|
|
}
|
|
function getComponentName(type) {
|
|
if (type == null) {
|
|
return null;
|
|
}
|
|
{
|
|
if (typeof type.tag === "number") {
|
|
error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (typeof type === "function") {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
if (typeof type === "string") {
|
|
return type;
|
|
}
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return "Fragment";
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
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";
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
var context = type;
|
|
return getContextName(context) + ".Consumer";
|
|
case REACT_PROVIDER_TYPE:
|
|
var provider = type;
|
|
return getContextName(provider._context) + ".Provider";
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return getWrappedName(type, type.render, "ForwardRef");
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
case REACT_BLOCK_TYPE:
|
|
return getComponentName(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return getComponentName(init(payload));
|
|
} catch (x) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var current = null;
|
|
var isRendering = false;
|
|
function getCurrentFiberOwnerNameInDevOrNull() {
|
|
{
|
|
if (current === null) {
|
|
return null;
|
|
}
|
|
var owner = current._debugOwner;
|
|
if (owner !== null && typeof owner !== "undefined") {
|
|
return getComponentName(owner.type);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getCurrentFiberStackInDev() {
|
|
{
|
|
if (current === null) {
|
|
return "";
|
|
}
|
|
return getStackByFiberInDevAndProd(current);
|
|
}
|
|
}
|
|
function resetCurrentFiber() {
|
|
{
|
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
current = null;
|
|
isRendering = false;
|
|
}
|
|
}
|
|
function setCurrentFiber(fiber) {
|
|
{
|
|
ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
|
|
current = fiber;
|
|
isRendering = false;
|
|
}
|
|
}
|
|
function setIsRendering(rendering) {
|
|
{
|
|
isRendering = rendering;
|
|
}
|
|
}
|
|
function getIsRendering() {
|
|
{
|
|
return isRendering;
|
|
}
|
|
}
|
|
function toString(value) {
|
|
return "" + value;
|
|
}
|
|
function getToStringValue(value) {
|
|
switch (typeof value) {
|
|
case "boolean":
|
|
case "number":
|
|
case "object":
|
|
case "string":
|
|
case "undefined":
|
|
return value;
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
var hasReadOnlyValue = {
|
|
button: true,
|
|
checkbox: true,
|
|
image: true,
|
|
hidden: true,
|
|
radio: true,
|
|
reset: true,
|
|
submit: true
|
|
};
|
|
function checkControlledValueProps(tagName, props) {
|
|
{
|
|
if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
|
|
error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
|
|
}
|
|
if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
|
|
error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
|
|
}
|
|
}
|
|
}
|
|
function isCheckable(elem) {
|
|
var type = elem.type;
|
|
var nodeName = elem.nodeName;
|
|
return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
|
|
}
|
|
function getTracker(node) {
|
|
return node._valueTracker;
|
|
}
|
|
function detachTracker(node) {
|
|
node._valueTracker = null;
|
|
}
|
|
function getValueFromNode(node) {
|
|
var value = "";
|
|
if (!node) {
|
|
return value;
|
|
}
|
|
if (isCheckable(node)) {
|
|
value = node.checked ? "true" : "false";
|
|
} else {
|
|
value = node.value;
|
|
}
|
|
return value;
|
|
}
|
|
function trackValueOnNode(node) {
|
|
var valueField = isCheckable(node) ? "checked" : "value";
|
|
var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
|
|
var currentValue = "" + node[valueField];
|
|
if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
|
|
return;
|
|
}
|
|
var get2 = descriptor.get, set2 = descriptor.set;
|
|
Object.defineProperty(node, valueField, {
|
|
configurable: true,
|
|
get: function() {
|
|
return get2.call(this);
|
|
},
|
|
set: function(value) {
|
|
currentValue = "" + value;
|
|
set2.call(this, value);
|
|
}
|
|
});
|
|
Object.defineProperty(node, valueField, {
|
|
enumerable: descriptor.enumerable
|
|
});
|
|
var tracker = {
|
|
getValue: function() {
|
|
return currentValue;
|
|
},
|
|
setValue: function(value) {
|
|
currentValue = "" + value;
|
|
},
|
|
stopTracking: function() {
|
|
detachTracker(node);
|
|
delete node[valueField];
|
|
}
|
|
};
|
|
return tracker;
|
|
}
|
|
function track(node) {
|
|
if (getTracker(node)) {
|
|
return;
|
|
}
|
|
node._valueTracker = trackValueOnNode(node);
|
|
}
|
|
function updateValueIfChanged(node) {
|
|
if (!node) {
|
|
return false;
|
|
}
|
|
var tracker = getTracker(node);
|
|
if (!tracker) {
|
|
return true;
|
|
}
|
|
var lastValue = tracker.getValue();
|
|
var nextValue = getValueFromNode(node);
|
|
if (nextValue !== lastValue) {
|
|
tracker.setValue(nextValue);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function getActiveElement(doc) {
|
|
doc = doc || (typeof document !== "undefined" ? document : void 0);
|
|
if (typeof doc === "undefined") {
|
|
return null;
|
|
}
|
|
try {
|
|
return doc.activeElement || doc.body;
|
|
} catch (e) {
|
|
return doc.body;
|
|
}
|
|
}
|
|
var didWarnValueDefaultValue = false;
|
|
var didWarnCheckedDefaultChecked = false;
|
|
var didWarnControlledToUncontrolled = false;
|
|
var didWarnUncontrolledToControlled = false;
|
|
function isControlled(props) {
|
|
var usesChecked = props.type === "checkbox" || props.type === "radio";
|
|
return usesChecked ? props.checked != null : props.value != null;
|
|
}
|
|
function getHostProps(element, props) {
|
|
var node = element;
|
|
var checked = props.checked;
|
|
var hostProps = _assign({}, props, {
|
|
defaultChecked: void 0,
|
|
defaultValue: void 0,
|
|
value: void 0,
|
|
checked: checked != null ? checked : node._wrapperState.initialChecked
|
|
});
|
|
return hostProps;
|
|
}
|
|
function initWrapperState(element, props) {
|
|
{
|
|
checkControlledValueProps("input", props);
|
|
if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
|
|
error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
|
|
didWarnCheckedDefaultChecked = true;
|
|
}
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
|
|
error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
|
|
didWarnValueDefaultValue = true;
|
|
}
|
|
}
|
|
var node = element;
|
|
var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
|
|
node._wrapperState = {
|
|
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
|
|
initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
|
|
controlled: isControlled(props)
|
|
};
|
|
}
|
|
function updateChecked(element, props) {
|
|
var node = element;
|
|
var checked = props.checked;
|
|
if (checked != null) {
|
|
setValueForProperty(node, "checked", checked, false);
|
|
}
|
|
}
|
|
function updateWrapper(element, props) {
|
|
var node = element;
|
|
{
|
|
var controlled = isControlled(props);
|
|
if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
|
|
error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnUncontrolledToControlled = true;
|
|
}
|
|
if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
|
|
error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnControlledToUncontrolled = true;
|
|
}
|
|
}
|
|
updateChecked(element, props);
|
|
var value = getToStringValue(props.value);
|
|
var type = props.type;
|
|
if (value != null) {
|
|
if (type === "number") {
|
|
if (value === 0 && node.value === "" || node.value != value) {
|
|
node.value = toString(value);
|
|
}
|
|
} else if (node.value !== toString(value)) {
|
|
node.value = toString(value);
|
|
}
|
|
} else if (type === "submit" || type === "reset") {
|
|
node.removeAttribute("value");
|
|
return;
|
|
}
|
|
{
|
|
if (props.hasOwnProperty("value")) {
|
|
setDefaultValue(node, props.type, value);
|
|
} else if (props.hasOwnProperty("defaultValue")) {
|
|
setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
|
|
}
|
|
}
|
|
{
|
|
if (props.checked == null && props.defaultChecked != null) {
|
|
node.defaultChecked = !!props.defaultChecked;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper(element, props, isHydrating2) {
|
|
var node = element;
|
|
if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
|
|
var type = props.type;
|
|
var isButton = type === "submit" || type === "reset";
|
|
if (isButton && (props.value === void 0 || props.value === null)) {
|
|
return;
|
|
}
|
|
var initialValue = toString(node._wrapperState.initialValue);
|
|
if (!isHydrating2) {
|
|
{
|
|
if (initialValue !== node.value) {
|
|
node.value = initialValue;
|
|
}
|
|
}
|
|
}
|
|
{
|
|
node.defaultValue = initialValue;
|
|
}
|
|
}
|
|
var name = node.name;
|
|
if (name !== "") {
|
|
node.name = "";
|
|
}
|
|
{
|
|
node.defaultChecked = !node.defaultChecked;
|
|
node.defaultChecked = !!node._wrapperState.initialChecked;
|
|
}
|
|
if (name !== "") {
|
|
node.name = name;
|
|
}
|
|
}
|
|
function restoreControlledState(element, props) {
|
|
var node = element;
|
|
updateWrapper(node, props);
|
|
updateNamedCousins(node, props);
|
|
}
|
|
function updateNamedCousins(rootNode, props) {
|
|
var name = props.name;
|
|
if (props.type === "radio" && name != null) {
|
|
var queryRoot = rootNode;
|
|
while (queryRoot.parentNode) {
|
|
queryRoot = queryRoot.parentNode;
|
|
}
|
|
var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
|
|
for (var i = 0; i < group.length; i++) {
|
|
var otherNode = group[i];
|
|
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
|
continue;
|
|
}
|
|
var otherProps = getFiberCurrentPropsFromNode(otherNode);
|
|
if (!otherProps) {
|
|
{
|
|
throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
|
|
}
|
|
}
|
|
updateValueIfChanged(otherNode);
|
|
updateWrapper(otherNode, otherProps);
|
|
}
|
|
}
|
|
}
|
|
function setDefaultValue(node, type, value) {
|
|
if (type !== "number" || getActiveElement(node.ownerDocument) !== node) {
|
|
if (value == null) {
|
|
node.defaultValue = toString(node._wrapperState.initialValue);
|
|
} else if (node.defaultValue !== toString(value)) {
|
|
node.defaultValue = toString(value);
|
|
}
|
|
}
|
|
}
|
|
var didWarnSelectedSetOnOption = false;
|
|
var didWarnInvalidChild = false;
|
|
function flattenChildren(children) {
|
|
var content = "";
|
|
React31.Children.forEach(children, function(child) {
|
|
if (child == null) {
|
|
return;
|
|
}
|
|
content += child;
|
|
});
|
|
return content;
|
|
}
|
|
function validateProps(element, props) {
|
|
{
|
|
if (typeof props.children === "object" && props.children !== null) {
|
|
React31.Children.forEach(props.children, function(child) {
|
|
if (child == null) {
|
|
return;
|
|
}
|
|
if (typeof child === "string" || typeof child === "number") {
|
|
return;
|
|
}
|
|
if (typeof child.type !== "string") {
|
|
return;
|
|
}
|
|
if (!didWarnInvalidChild) {
|
|
didWarnInvalidChild = true;
|
|
error("Only strings and numbers are supported as <option> children.");
|
|
}
|
|
});
|
|
}
|
|
if (props.selected != null && !didWarnSelectedSetOnOption) {
|
|
error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
|
|
didWarnSelectedSetOnOption = true;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper$1(element, props) {
|
|
if (props.value != null) {
|
|
element.setAttribute("value", toString(getToStringValue(props.value)));
|
|
}
|
|
}
|
|
function getHostProps$1(element, props) {
|
|
var hostProps = _assign({
|
|
children: void 0
|
|
}, props);
|
|
var content = flattenChildren(props.children);
|
|
if (content) {
|
|
hostProps.children = content;
|
|
}
|
|
return hostProps;
|
|
}
|
|
var didWarnValueDefaultValue$1;
|
|
{
|
|
didWarnValueDefaultValue$1 = false;
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
|
if (ownerName) {
|
|
return "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
return "";
|
|
}
|
|
var valuePropNames = ["value", "defaultValue"];
|
|
function checkSelectPropTypes(props) {
|
|
{
|
|
checkControlledValueProps("select", props);
|
|
for (var i = 0; i < valuePropNames.length; i++) {
|
|
var propName = valuePropNames[i];
|
|
if (props[propName] == null) {
|
|
continue;
|
|
}
|
|
var isArray2 = Array.isArray(props[propName]);
|
|
if (props.multiple && !isArray2) {
|
|
error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
|
|
} else if (!props.multiple && isArray2) {
|
|
error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function updateOptions(node, multiple, propValue, setDefaultSelected) {
|
|
var options2 = node.options;
|
|
if (multiple) {
|
|
var selectedValues = propValue;
|
|
var selectedValue = {};
|
|
for (var i = 0; i < selectedValues.length; i++) {
|
|
selectedValue["$" + selectedValues[i]] = true;
|
|
}
|
|
for (var _i = 0; _i < options2.length; _i++) {
|
|
var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
|
|
if (options2[_i].selected !== selected) {
|
|
options2[_i].selected = selected;
|
|
}
|
|
if (selected && setDefaultSelected) {
|
|
options2[_i].defaultSelected = true;
|
|
}
|
|
}
|
|
} else {
|
|
var _selectedValue = toString(getToStringValue(propValue));
|
|
var defaultSelected = null;
|
|
for (var _i2 = 0; _i2 < options2.length; _i2++) {
|
|
if (options2[_i2].value === _selectedValue) {
|
|
options2[_i2].selected = true;
|
|
if (setDefaultSelected) {
|
|
options2[_i2].defaultSelected = true;
|
|
}
|
|
return;
|
|
}
|
|
if (defaultSelected === null && !options2[_i2].disabled) {
|
|
defaultSelected = options2[_i2];
|
|
}
|
|
}
|
|
if (defaultSelected !== null) {
|
|
defaultSelected.selected = true;
|
|
}
|
|
}
|
|
}
|
|
function getHostProps$2(element, props) {
|
|
return _assign({}, props, {
|
|
value: void 0
|
|
});
|
|
}
|
|
function initWrapperState$1(element, props) {
|
|
var node = element;
|
|
{
|
|
checkSelectPropTypes(props);
|
|
}
|
|
node._wrapperState = {
|
|
wasMultiple: !!props.multiple
|
|
};
|
|
{
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
|
|
error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnValueDefaultValue$1 = true;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper$2(element, props) {
|
|
var node = element;
|
|
node.multiple = !!props.multiple;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
} else if (props.defaultValue != null) {
|
|
updateOptions(node, !!props.multiple, props.defaultValue, true);
|
|
}
|
|
}
|
|
function postUpdateWrapper(element, props) {
|
|
var node = element;
|
|
var wasMultiple = node._wrapperState.wasMultiple;
|
|
node._wrapperState.wasMultiple = !!props.multiple;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
} else if (wasMultiple !== !!props.multiple) {
|
|
if (props.defaultValue != null) {
|
|
updateOptions(node, !!props.multiple, props.defaultValue, true);
|
|
} else {
|
|
updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
|
|
}
|
|
}
|
|
}
|
|
function restoreControlledState$1(element, props) {
|
|
var node = element;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
}
|
|
}
|
|
var didWarnValDefaultVal = false;
|
|
function getHostProps$3(element, props) {
|
|
var node = element;
|
|
if (!(props.dangerouslySetInnerHTML == null)) {
|
|
{
|
|
throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
|
|
}
|
|
}
|
|
var hostProps = _assign({}, props, {
|
|
value: void 0,
|
|
defaultValue: void 0,
|
|
children: toString(node._wrapperState.initialValue)
|
|
});
|
|
return hostProps;
|
|
}
|
|
function initWrapperState$2(element, props) {
|
|
var node = element;
|
|
{
|
|
checkControlledValueProps("textarea", props);
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
|
|
error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
|
|
didWarnValDefaultVal = true;
|
|
}
|
|
}
|
|
var initialValue = props.value;
|
|
if (initialValue == null) {
|
|
var children = props.children, defaultValue = props.defaultValue;
|
|
if (children != null) {
|
|
{
|
|
error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
|
|
}
|
|
{
|
|
if (!(defaultValue == null)) {
|
|
{
|
|
throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
|
|
}
|
|
}
|
|
if (Array.isArray(children)) {
|
|
if (!(children.length <= 1)) {
|
|
{
|
|
throw Error("<textarea> can only have at most one child.");
|
|
}
|
|
}
|
|
children = children[0];
|
|
}
|
|
defaultValue = children;
|
|
}
|
|
}
|
|
if (defaultValue == null) {
|
|
defaultValue = "";
|
|
}
|
|
initialValue = defaultValue;
|
|
}
|
|
node._wrapperState = {
|
|
initialValue: getToStringValue(initialValue)
|
|
};
|
|
}
|
|
function updateWrapper$1(element, props) {
|
|
var node = element;
|
|
var value = getToStringValue(props.value);
|
|
var defaultValue = getToStringValue(props.defaultValue);
|
|
if (value != null) {
|
|
var newValue = toString(value);
|
|
if (newValue !== node.value) {
|
|
node.value = newValue;
|
|
}
|
|
if (props.defaultValue == null && node.defaultValue !== newValue) {
|
|
node.defaultValue = newValue;
|
|
}
|
|
}
|
|
if (defaultValue != null) {
|
|
node.defaultValue = toString(defaultValue);
|
|
}
|
|
}
|
|
function postMountWrapper$3(element, props) {
|
|
var node = element;
|
|
var textContent = node.textContent;
|
|
if (textContent === node._wrapperState.initialValue) {
|
|
if (textContent !== "" && textContent !== null) {
|
|
node.value = textContent;
|
|
}
|
|
}
|
|
}
|
|
function restoreControlledState$2(element, props) {
|
|
updateWrapper$1(element, props);
|
|
}
|
|
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
var Namespaces = {
|
|
html: HTML_NAMESPACE,
|
|
mathml: MATH_NAMESPACE,
|
|
svg: SVG_NAMESPACE
|
|
};
|
|
function getIntrinsicNamespace(type) {
|
|
switch (type) {
|
|
case "svg":
|
|
return SVG_NAMESPACE;
|
|
case "math":
|
|
return MATH_NAMESPACE;
|
|
default:
|
|
return HTML_NAMESPACE;
|
|
}
|
|
}
|
|
function getChildNamespace(parentNamespace, type) {
|
|
if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
|
|
return getIntrinsicNamespace(type);
|
|
}
|
|
if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
|
|
return HTML_NAMESPACE;
|
|
}
|
|
return parentNamespace;
|
|
}
|
|
var createMicrosoftUnsafeLocalFunction = function(func) {
|
|
if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
|
|
return function(arg0, arg1, arg2, arg3) {
|
|
MSApp.execUnsafeLocalFunction(function() {
|
|
return func(arg0, arg1, arg2, arg3);
|
|
});
|
|
};
|
|
} else {
|
|
return func;
|
|
}
|
|
};
|
|
var reusableSVGContainer;
|
|
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
|
|
if (node.namespaceURI === Namespaces.svg) {
|
|
if (!("innerHTML" in node)) {
|
|
reusableSVGContainer = reusableSVGContainer || document.createElement("div");
|
|
reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
|
|
var svgNode = reusableSVGContainer.firstChild;
|
|
while (node.firstChild) {
|
|
node.removeChild(node.firstChild);
|
|
}
|
|
while (svgNode.firstChild) {
|
|
node.appendChild(svgNode.firstChild);
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
node.innerHTML = html;
|
|
});
|
|
var ELEMENT_NODE = 1;
|
|
var TEXT_NODE = 3;
|
|
var COMMENT_NODE = 8;
|
|
var DOCUMENT_NODE = 9;
|
|
var DOCUMENT_FRAGMENT_NODE = 11;
|
|
var setTextContent = function(node, text) {
|
|
if (text) {
|
|
var firstChild = node.firstChild;
|
|
if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
|
|
firstChild.nodeValue = text;
|
|
return;
|
|
}
|
|
}
|
|
node.textContent = text;
|
|
};
|
|
var shorthandToLonghand = {
|
|
animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
|
|
background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
|
|
backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
|
|
border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
|
|
borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
|
|
borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
|
|
borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
|
|
borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
|
|
borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
|
|
borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
|
|
borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
|
|
borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
|
|
borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
|
|
borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
|
|
borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
|
|
borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
|
|
borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
|
|
columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
|
|
columns: ["columnCount", "columnWidth"],
|
|
flex: ["flexBasis", "flexGrow", "flexShrink"],
|
|
flexFlow: ["flexDirection", "flexWrap"],
|
|
font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
|
|
fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
|
|
gap: ["columnGap", "rowGap"],
|
|
grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
|
|
gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
|
|
gridColumn: ["gridColumnEnd", "gridColumnStart"],
|
|
gridColumnGap: ["columnGap"],
|
|
gridGap: ["columnGap", "rowGap"],
|
|
gridRow: ["gridRowEnd", "gridRowStart"],
|
|
gridRowGap: ["rowGap"],
|
|
gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
|
|
listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
|
|
margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
|
|
marker: ["markerEnd", "markerMid", "markerStart"],
|
|
mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
|
|
maskPosition: ["maskPositionX", "maskPositionY"],
|
|
outline: ["outlineColor", "outlineStyle", "outlineWidth"],
|
|
overflow: ["overflowX", "overflowY"],
|
|
padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
|
|
placeContent: ["alignContent", "justifyContent"],
|
|
placeItems: ["alignItems", "justifyItems"],
|
|
placeSelf: ["alignSelf", "justifySelf"],
|
|
textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
|
|
textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
|
|
transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
|
|
wordWrap: ["overflowWrap"]
|
|
};
|
|
var isUnitlessNumber = {
|
|
animationIterationCount: true,
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
boxFlex: true,
|
|
boxFlexGroup: true,
|
|
boxOrdinalGroup: true,
|
|
columnCount: true,
|
|
columns: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
flexOrder: true,
|
|
gridArea: true,
|
|
gridRow: true,
|
|
gridRowEnd: true,
|
|
gridRowSpan: true,
|
|
gridRowStart: true,
|
|
gridColumn: true,
|
|
gridColumnEnd: true,
|
|
gridColumnSpan: true,
|
|
gridColumnStart: true,
|
|
fontWeight: true,
|
|
lineClamp: true,
|
|
lineHeight: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
fillOpacity: true,
|
|
floodOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDasharray: true,
|
|
strokeDashoffset: true,
|
|
strokeMiterlimit: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true
|
|
};
|
|
function prefixKey(prefix2, key) {
|
|
return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
|
|
}
|
|
var prefixes = ["Webkit", "ms", "Moz", "O"];
|
|
Object.keys(isUnitlessNumber).forEach(function(prop) {
|
|
prefixes.forEach(function(prefix2) {
|
|
isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
|
|
});
|
|
});
|
|
function dangerousStyleValue(name, value, isCustomProperty) {
|
|
var isEmpty = value == null || typeof value === "boolean" || value === "";
|
|
if (isEmpty) {
|
|
return "";
|
|
}
|
|
if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
|
|
return value + "px";
|
|
}
|
|
return ("" + value).trim();
|
|
}
|
|
var uppercasePattern = /([A-Z])/g;
|
|
var msPattern = /^ms-/;
|
|
function hyphenateStyleName(name) {
|
|
return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
|
|
}
|
|
var warnValidStyle = function() {
|
|
};
|
|
{
|
|
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
var msPattern$1 = /^-ms-/;
|
|
var hyphenPattern = /-(.)/g;
|
|
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
var warnedStyleNames = {};
|
|
var warnedStyleValues = {};
|
|
var warnedForNaNValue = false;
|
|
var warnedForInfinityValue = false;
|
|
var camelize = function(string) {
|
|
return string.replace(hyphenPattern, function(_, character) {
|
|
return character.toUpperCase();
|
|
});
|
|
};
|
|
var warnHyphenatedStyleName = function(name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
warnedStyleNames[name] = true;
|
|
error("Unsupported style property %s. Did you mean %s?", name, camelize(name.replace(msPattern$1, "ms-")));
|
|
};
|
|
var warnBadVendoredStyleName = function(name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
warnedStyleNames[name] = true;
|
|
error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
};
|
|
var warnStyleValueWithSemicolon = function(name, value) {
|
|
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
return;
|
|
}
|
|
warnedStyleValues[value] = true;
|
|
error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
|
|
};
|
|
var warnStyleValueIsNaN = function(name, value) {
|
|
if (warnedForNaNValue) {
|
|
return;
|
|
}
|
|
warnedForNaNValue = true;
|
|
error("`NaN` is an invalid value for the `%s` css style property.", name);
|
|
};
|
|
var warnStyleValueIsInfinity = function(name, value) {
|
|
if (warnedForInfinityValue) {
|
|
return;
|
|
}
|
|
warnedForInfinityValue = true;
|
|
error("`Infinity` is an invalid value for the `%s` css style property.", name);
|
|
};
|
|
warnValidStyle = function(name, value) {
|
|
if (name.indexOf("-") > -1) {
|
|
warnHyphenatedStyleName(name);
|
|
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
warnBadVendoredStyleName(name);
|
|
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
warnStyleValueWithSemicolon(name, value);
|
|
}
|
|
if (typeof value === "number") {
|
|
if (isNaN(value)) {
|
|
warnStyleValueIsNaN(name, value);
|
|
} else if (!isFinite(value)) {
|
|
warnStyleValueIsInfinity(name, value);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var warnValidStyle$1 = warnValidStyle;
|
|
function createDangerousStringForStyles(styles) {
|
|
{
|
|
var serialized = "";
|
|
var delimiter = "";
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var styleValue = styles[styleName];
|
|
if (styleValue != null) {
|
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
|
|
serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
|
|
delimiter = ";";
|
|
}
|
|
}
|
|
return serialized || null;
|
|
}
|
|
}
|
|
function setValueForStyles(node, styles) {
|
|
var style2 = node.style;
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
{
|
|
if (!isCustomProperty) {
|
|
warnValidStyle$1(styleName, styles[styleName]);
|
|
}
|
|
}
|
|
var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
|
|
if (styleName === "float") {
|
|
styleName = "cssFloat";
|
|
}
|
|
if (isCustomProperty) {
|
|
style2.setProperty(styleName, styleValue);
|
|
} else {
|
|
style2[styleName] = styleValue;
|
|
}
|
|
}
|
|
}
|
|
function isValueEmpty(value) {
|
|
return value == null || typeof value === "boolean" || value === "";
|
|
}
|
|
function expandShorthandMap(styles) {
|
|
var expanded = {};
|
|
for (var key in styles) {
|
|
var longhands = shorthandToLonghand[key] || [key];
|
|
for (var i = 0; i < longhands.length; i++) {
|
|
expanded[longhands[i]] = key;
|
|
}
|
|
}
|
|
return expanded;
|
|
}
|
|
function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
|
|
{
|
|
if (!nextStyles) {
|
|
return;
|
|
}
|
|
var expandedUpdates = expandShorthandMap(styleUpdates);
|
|
var expandedStyles = expandShorthandMap(nextStyles);
|
|
var warnedAbout = {};
|
|
for (var key in expandedUpdates) {
|
|
var originalKey = expandedUpdates[key];
|
|
var correctOriginalKey = expandedStyles[key];
|
|
if (correctOriginalKey && originalKey !== correctOriginalKey) {
|
|
var warningKey = originalKey + "," + correctOriginalKey;
|
|
if (warnedAbout[warningKey]) {
|
|
continue;
|
|
}
|
|
warnedAbout[warningKey] = true;
|
|
error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var omittedCloseTags = {
|
|
area: true,
|
|
base: true,
|
|
br: true,
|
|
col: true,
|
|
embed: true,
|
|
hr: true,
|
|
img: true,
|
|
input: true,
|
|
keygen: true,
|
|
link: true,
|
|
meta: true,
|
|
param: true,
|
|
source: true,
|
|
track: true,
|
|
wbr: true
|
|
};
|
|
var voidElementTags = _assign({
|
|
menuitem: true
|
|
}, omittedCloseTags);
|
|
var HTML = "__html";
|
|
function assertValidProps(tag, props) {
|
|
if (!props) {
|
|
return;
|
|
}
|
|
if (voidElementTags[tag]) {
|
|
if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
|
|
{
|
|
throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
|
|
}
|
|
}
|
|
}
|
|
if (props.dangerouslySetInnerHTML != null) {
|
|
if (!(props.children == null)) {
|
|
{
|
|
throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
|
|
}
|
|
}
|
|
if (!(typeof props.dangerouslySetInnerHTML === "object" && HTML in props.dangerouslySetInnerHTML)) {
|
|
{
|
|
throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
|
|
error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
|
|
}
|
|
}
|
|
if (!(props.style == null || typeof props.style === "object")) {
|
|
{
|
|
throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
|
|
}
|
|
}
|
|
}
|
|
function isCustomComponent(tagName, props) {
|
|
if (tagName.indexOf("-") === -1) {
|
|
return typeof props.is === "string";
|
|
}
|
|
switch (tagName) {
|
|
case "annotation-xml":
|
|
case "color-profile":
|
|
case "font-face":
|
|
case "font-face-src":
|
|
case "font-face-uri":
|
|
case "font-face-format":
|
|
case "font-face-name":
|
|
case "missing-glyph":
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
var possibleStandardNames = {
|
|
accept: "accept",
|
|
acceptcharset: "acceptCharset",
|
|
"accept-charset": "acceptCharset",
|
|
accesskey: "accessKey",
|
|
action: "action",
|
|
allowfullscreen: "allowFullScreen",
|
|
alt: "alt",
|
|
as: "as",
|
|
async: "async",
|
|
autocapitalize: "autoCapitalize",
|
|
autocomplete: "autoComplete",
|
|
autocorrect: "autoCorrect",
|
|
autofocus: "autoFocus",
|
|
autoplay: "autoPlay",
|
|
autosave: "autoSave",
|
|
capture: "capture",
|
|
cellpadding: "cellPadding",
|
|
cellspacing: "cellSpacing",
|
|
challenge: "challenge",
|
|
charset: "charSet",
|
|
checked: "checked",
|
|
children: "children",
|
|
cite: "cite",
|
|
class: "className",
|
|
classid: "classID",
|
|
classname: "className",
|
|
cols: "cols",
|
|
colspan: "colSpan",
|
|
content: "content",
|
|
contenteditable: "contentEditable",
|
|
contextmenu: "contextMenu",
|
|
controls: "controls",
|
|
controlslist: "controlsList",
|
|
coords: "coords",
|
|
crossorigin: "crossOrigin",
|
|
dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
|
|
data: "data",
|
|
datetime: "dateTime",
|
|
default: "default",
|
|
defaultchecked: "defaultChecked",
|
|
defaultvalue: "defaultValue",
|
|
defer: "defer",
|
|
dir: "dir",
|
|
disabled: "disabled",
|
|
disablepictureinpicture: "disablePictureInPicture",
|
|
disableremoteplayback: "disableRemotePlayback",
|
|
download: "download",
|
|
draggable: "draggable",
|
|
enctype: "encType",
|
|
enterkeyhint: "enterKeyHint",
|
|
for: "htmlFor",
|
|
form: "form",
|
|
formmethod: "formMethod",
|
|
formaction: "formAction",
|
|
formenctype: "formEncType",
|
|
formnovalidate: "formNoValidate",
|
|
formtarget: "formTarget",
|
|
frameborder: "frameBorder",
|
|
headers: "headers",
|
|
height: "height",
|
|
hidden: "hidden",
|
|
high: "high",
|
|
href: "href",
|
|
hreflang: "hrefLang",
|
|
htmlfor: "htmlFor",
|
|
httpequiv: "httpEquiv",
|
|
"http-equiv": "httpEquiv",
|
|
icon: "icon",
|
|
id: "id",
|
|
innerhtml: "innerHTML",
|
|
inputmode: "inputMode",
|
|
integrity: "integrity",
|
|
is: "is",
|
|
itemid: "itemID",
|
|
itemprop: "itemProp",
|
|
itemref: "itemRef",
|
|
itemscope: "itemScope",
|
|
itemtype: "itemType",
|
|
keyparams: "keyParams",
|
|
keytype: "keyType",
|
|
kind: "kind",
|
|
label: "label",
|
|
lang: "lang",
|
|
list: "list",
|
|
loop: "loop",
|
|
low: "low",
|
|
manifest: "manifest",
|
|
marginwidth: "marginWidth",
|
|
marginheight: "marginHeight",
|
|
max: "max",
|
|
maxlength: "maxLength",
|
|
media: "media",
|
|
mediagroup: "mediaGroup",
|
|
method: "method",
|
|
min: "min",
|
|
minlength: "minLength",
|
|
multiple: "multiple",
|
|
muted: "muted",
|
|
name: "name",
|
|
nomodule: "noModule",
|
|
nonce: "nonce",
|
|
novalidate: "noValidate",
|
|
open: "open",
|
|
optimum: "optimum",
|
|
pattern: "pattern",
|
|
placeholder: "placeholder",
|
|
playsinline: "playsInline",
|
|
poster: "poster",
|
|
preload: "preload",
|
|
profile: "profile",
|
|
radiogroup: "radioGroup",
|
|
readonly: "readOnly",
|
|
referrerpolicy: "referrerPolicy",
|
|
rel: "rel",
|
|
required: "required",
|
|
reversed: "reversed",
|
|
role: "role",
|
|
rows: "rows",
|
|
rowspan: "rowSpan",
|
|
sandbox: "sandbox",
|
|
scope: "scope",
|
|
scoped: "scoped",
|
|
scrolling: "scrolling",
|
|
seamless: "seamless",
|
|
selected: "selected",
|
|
shape: "shape",
|
|
size: "size",
|
|
sizes: "sizes",
|
|
span: "span",
|
|
spellcheck: "spellCheck",
|
|
src: "src",
|
|
srcdoc: "srcDoc",
|
|
srclang: "srcLang",
|
|
srcset: "srcSet",
|
|
start: "start",
|
|
step: "step",
|
|
style: "style",
|
|
summary: "summary",
|
|
tabindex: "tabIndex",
|
|
target: "target",
|
|
title: "title",
|
|
type: "type",
|
|
usemap: "useMap",
|
|
value: "value",
|
|
width: "width",
|
|
wmode: "wmode",
|
|
wrap: "wrap",
|
|
about: "about",
|
|
accentheight: "accentHeight",
|
|
"accent-height": "accentHeight",
|
|
accumulate: "accumulate",
|
|
additive: "additive",
|
|
alignmentbaseline: "alignmentBaseline",
|
|
"alignment-baseline": "alignmentBaseline",
|
|
allowreorder: "allowReorder",
|
|
alphabetic: "alphabetic",
|
|
amplitude: "amplitude",
|
|
arabicform: "arabicForm",
|
|
"arabic-form": "arabicForm",
|
|
ascent: "ascent",
|
|
attributename: "attributeName",
|
|
attributetype: "attributeType",
|
|
autoreverse: "autoReverse",
|
|
azimuth: "azimuth",
|
|
basefrequency: "baseFrequency",
|
|
baselineshift: "baselineShift",
|
|
"baseline-shift": "baselineShift",
|
|
baseprofile: "baseProfile",
|
|
bbox: "bbox",
|
|
begin: "begin",
|
|
bias: "bias",
|
|
by: "by",
|
|
calcmode: "calcMode",
|
|
capheight: "capHeight",
|
|
"cap-height": "capHeight",
|
|
clip: "clip",
|
|
clippath: "clipPath",
|
|
"clip-path": "clipPath",
|
|
clippathunits: "clipPathUnits",
|
|
cliprule: "clipRule",
|
|
"clip-rule": "clipRule",
|
|
color: "color",
|
|
colorinterpolation: "colorInterpolation",
|
|
"color-interpolation": "colorInterpolation",
|
|
colorinterpolationfilters: "colorInterpolationFilters",
|
|
"color-interpolation-filters": "colorInterpolationFilters",
|
|
colorprofile: "colorProfile",
|
|
"color-profile": "colorProfile",
|
|
colorrendering: "colorRendering",
|
|
"color-rendering": "colorRendering",
|
|
contentscripttype: "contentScriptType",
|
|
contentstyletype: "contentStyleType",
|
|
cursor: "cursor",
|
|
cx: "cx",
|
|
cy: "cy",
|
|
d: "d",
|
|
datatype: "datatype",
|
|
decelerate: "decelerate",
|
|
descent: "descent",
|
|
diffuseconstant: "diffuseConstant",
|
|
direction: "direction",
|
|
display: "display",
|
|
divisor: "divisor",
|
|
dominantbaseline: "dominantBaseline",
|
|
"dominant-baseline": "dominantBaseline",
|
|
dur: "dur",
|
|
dx: "dx",
|
|
dy: "dy",
|
|
edgemode: "edgeMode",
|
|
elevation: "elevation",
|
|
enablebackground: "enableBackground",
|
|
"enable-background": "enableBackground",
|
|
end: "end",
|
|
exponent: "exponent",
|
|
externalresourcesrequired: "externalResourcesRequired",
|
|
fill: "fill",
|
|
fillopacity: "fillOpacity",
|
|
"fill-opacity": "fillOpacity",
|
|
fillrule: "fillRule",
|
|
"fill-rule": "fillRule",
|
|
filter: "filter",
|
|
filterres: "filterRes",
|
|
filterunits: "filterUnits",
|
|
floodopacity: "floodOpacity",
|
|
"flood-opacity": "floodOpacity",
|
|
floodcolor: "floodColor",
|
|
"flood-color": "floodColor",
|
|
focusable: "focusable",
|
|
fontfamily: "fontFamily",
|
|
"font-family": "fontFamily",
|
|
fontsize: "fontSize",
|
|
"font-size": "fontSize",
|
|
fontsizeadjust: "fontSizeAdjust",
|
|
"font-size-adjust": "fontSizeAdjust",
|
|
fontstretch: "fontStretch",
|
|
"font-stretch": "fontStretch",
|
|
fontstyle: "fontStyle",
|
|
"font-style": "fontStyle",
|
|
fontvariant: "fontVariant",
|
|
"font-variant": "fontVariant",
|
|
fontweight: "fontWeight",
|
|
"font-weight": "fontWeight",
|
|
format: "format",
|
|
from: "from",
|
|
fx: "fx",
|
|
fy: "fy",
|
|
g1: "g1",
|
|
g2: "g2",
|
|
glyphname: "glyphName",
|
|
"glyph-name": "glyphName",
|
|
glyphorientationhorizontal: "glyphOrientationHorizontal",
|
|
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
glyphorientationvertical: "glyphOrientationVertical",
|
|
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
glyphref: "glyphRef",
|
|
gradienttransform: "gradientTransform",
|
|
gradientunits: "gradientUnits",
|
|
hanging: "hanging",
|
|
horizadvx: "horizAdvX",
|
|
"horiz-adv-x": "horizAdvX",
|
|
horizoriginx: "horizOriginX",
|
|
"horiz-origin-x": "horizOriginX",
|
|
ideographic: "ideographic",
|
|
imagerendering: "imageRendering",
|
|
"image-rendering": "imageRendering",
|
|
in2: "in2",
|
|
in: "in",
|
|
inlist: "inlist",
|
|
intercept: "intercept",
|
|
k1: "k1",
|
|
k2: "k2",
|
|
k3: "k3",
|
|
k4: "k4",
|
|
k: "k",
|
|
kernelmatrix: "kernelMatrix",
|
|
kernelunitlength: "kernelUnitLength",
|
|
kerning: "kerning",
|
|
keypoints: "keyPoints",
|
|
keysplines: "keySplines",
|
|
keytimes: "keyTimes",
|
|
lengthadjust: "lengthAdjust",
|
|
letterspacing: "letterSpacing",
|
|
"letter-spacing": "letterSpacing",
|
|
lightingcolor: "lightingColor",
|
|
"lighting-color": "lightingColor",
|
|
limitingconeangle: "limitingConeAngle",
|
|
local: "local",
|
|
markerend: "markerEnd",
|
|
"marker-end": "markerEnd",
|
|
markerheight: "markerHeight",
|
|
markermid: "markerMid",
|
|
"marker-mid": "markerMid",
|
|
markerstart: "markerStart",
|
|
"marker-start": "markerStart",
|
|
markerunits: "markerUnits",
|
|
markerwidth: "markerWidth",
|
|
mask: "mask",
|
|
maskcontentunits: "maskContentUnits",
|
|
maskunits: "maskUnits",
|
|
mathematical: "mathematical",
|
|
mode: "mode",
|
|
numoctaves: "numOctaves",
|
|
offset: "offset",
|
|
opacity: "opacity",
|
|
operator: "operator",
|
|
order: "order",
|
|
orient: "orient",
|
|
orientation: "orientation",
|
|
origin: "origin",
|
|
overflow: "overflow",
|
|
overlineposition: "overlinePosition",
|
|
"overline-position": "overlinePosition",
|
|
overlinethickness: "overlineThickness",
|
|
"overline-thickness": "overlineThickness",
|
|
paintorder: "paintOrder",
|
|
"paint-order": "paintOrder",
|
|
panose1: "panose1",
|
|
"panose-1": "panose1",
|
|
pathlength: "pathLength",
|
|
patterncontentunits: "patternContentUnits",
|
|
patterntransform: "patternTransform",
|
|
patternunits: "patternUnits",
|
|
pointerevents: "pointerEvents",
|
|
"pointer-events": "pointerEvents",
|
|
points: "points",
|
|
pointsatx: "pointsAtX",
|
|
pointsaty: "pointsAtY",
|
|
pointsatz: "pointsAtZ",
|
|
prefix: "prefix",
|
|
preservealpha: "preserveAlpha",
|
|
preserveaspectratio: "preserveAspectRatio",
|
|
primitiveunits: "primitiveUnits",
|
|
property: "property",
|
|
r: "r",
|
|
radius: "radius",
|
|
refx: "refX",
|
|
refy: "refY",
|
|
renderingintent: "renderingIntent",
|
|
"rendering-intent": "renderingIntent",
|
|
repeatcount: "repeatCount",
|
|
repeatdur: "repeatDur",
|
|
requiredextensions: "requiredExtensions",
|
|
requiredfeatures: "requiredFeatures",
|
|
resource: "resource",
|
|
restart: "restart",
|
|
result: "result",
|
|
results: "results",
|
|
rotate: "rotate",
|
|
rx: "rx",
|
|
ry: "ry",
|
|
scale: "scale",
|
|
security: "security",
|
|
seed: "seed",
|
|
shaperendering: "shapeRendering",
|
|
"shape-rendering": "shapeRendering",
|
|
slope: "slope",
|
|
spacing: "spacing",
|
|
specularconstant: "specularConstant",
|
|
specularexponent: "specularExponent",
|
|
speed: "speed",
|
|
spreadmethod: "spreadMethod",
|
|
startoffset: "startOffset",
|
|
stddeviation: "stdDeviation",
|
|
stemh: "stemh",
|
|
stemv: "stemv",
|
|
stitchtiles: "stitchTiles",
|
|
stopcolor: "stopColor",
|
|
"stop-color": "stopColor",
|
|
stopopacity: "stopOpacity",
|
|
"stop-opacity": "stopOpacity",
|
|
strikethroughposition: "strikethroughPosition",
|
|
"strikethrough-position": "strikethroughPosition",
|
|
strikethroughthickness: "strikethroughThickness",
|
|
"strikethrough-thickness": "strikethroughThickness",
|
|
string: "string",
|
|
stroke: "stroke",
|
|
strokedasharray: "strokeDasharray",
|
|
"stroke-dasharray": "strokeDasharray",
|
|
strokedashoffset: "strokeDashoffset",
|
|
"stroke-dashoffset": "strokeDashoffset",
|
|
strokelinecap: "strokeLinecap",
|
|
"stroke-linecap": "strokeLinecap",
|
|
strokelinejoin: "strokeLinejoin",
|
|
"stroke-linejoin": "strokeLinejoin",
|
|
strokemiterlimit: "strokeMiterlimit",
|
|
"stroke-miterlimit": "strokeMiterlimit",
|
|
strokewidth: "strokeWidth",
|
|
"stroke-width": "strokeWidth",
|
|
strokeopacity: "strokeOpacity",
|
|
"stroke-opacity": "strokeOpacity",
|
|
suppresscontenteditablewarning: "suppressContentEditableWarning",
|
|
suppresshydrationwarning: "suppressHydrationWarning",
|
|
surfacescale: "surfaceScale",
|
|
systemlanguage: "systemLanguage",
|
|
tablevalues: "tableValues",
|
|
targetx: "targetX",
|
|
targety: "targetY",
|
|
textanchor: "textAnchor",
|
|
"text-anchor": "textAnchor",
|
|
textdecoration: "textDecoration",
|
|
"text-decoration": "textDecoration",
|
|
textlength: "textLength",
|
|
textrendering: "textRendering",
|
|
"text-rendering": "textRendering",
|
|
to: "to",
|
|
transform: "transform",
|
|
typeof: "typeof",
|
|
u1: "u1",
|
|
u2: "u2",
|
|
underlineposition: "underlinePosition",
|
|
"underline-position": "underlinePosition",
|
|
underlinethickness: "underlineThickness",
|
|
"underline-thickness": "underlineThickness",
|
|
unicode: "unicode",
|
|
unicodebidi: "unicodeBidi",
|
|
"unicode-bidi": "unicodeBidi",
|
|
unicoderange: "unicodeRange",
|
|
"unicode-range": "unicodeRange",
|
|
unitsperem: "unitsPerEm",
|
|
"units-per-em": "unitsPerEm",
|
|
unselectable: "unselectable",
|
|
valphabetic: "vAlphabetic",
|
|
"v-alphabetic": "vAlphabetic",
|
|
values: "values",
|
|
vectoreffect: "vectorEffect",
|
|
"vector-effect": "vectorEffect",
|
|
version: "version",
|
|
vertadvy: "vertAdvY",
|
|
"vert-adv-y": "vertAdvY",
|
|
vertoriginx: "vertOriginX",
|
|
"vert-origin-x": "vertOriginX",
|
|
vertoriginy: "vertOriginY",
|
|
"vert-origin-y": "vertOriginY",
|
|
vhanging: "vHanging",
|
|
"v-hanging": "vHanging",
|
|
videographic: "vIdeographic",
|
|
"v-ideographic": "vIdeographic",
|
|
viewbox: "viewBox",
|
|
viewtarget: "viewTarget",
|
|
visibility: "visibility",
|
|
vmathematical: "vMathematical",
|
|
"v-mathematical": "vMathematical",
|
|
vocab: "vocab",
|
|
widths: "widths",
|
|
wordspacing: "wordSpacing",
|
|
"word-spacing": "wordSpacing",
|
|
writingmode: "writingMode",
|
|
"writing-mode": "writingMode",
|
|
x1: "x1",
|
|
x2: "x2",
|
|
x: "x",
|
|
xchannelselector: "xChannelSelector",
|
|
xheight: "xHeight",
|
|
"x-height": "xHeight",
|
|
xlinkactuate: "xlinkActuate",
|
|
"xlink:actuate": "xlinkActuate",
|
|
xlinkarcrole: "xlinkArcrole",
|
|
"xlink:arcrole": "xlinkArcrole",
|
|
xlinkhref: "xlinkHref",
|
|
"xlink:href": "xlinkHref",
|
|
xlinkrole: "xlinkRole",
|
|
"xlink:role": "xlinkRole",
|
|
xlinkshow: "xlinkShow",
|
|
"xlink:show": "xlinkShow",
|
|
xlinktitle: "xlinkTitle",
|
|
"xlink:title": "xlinkTitle",
|
|
xlinktype: "xlinkType",
|
|
"xlink:type": "xlinkType",
|
|
xmlbase: "xmlBase",
|
|
"xml:base": "xmlBase",
|
|
xmllang: "xmlLang",
|
|
"xml:lang": "xmlLang",
|
|
xmlns: "xmlns",
|
|
"xml:space": "xmlSpace",
|
|
xmlnsxlink: "xmlnsXlink",
|
|
"xmlns:xlink": "xmlnsXlink",
|
|
xmlspace: "xmlSpace",
|
|
y1: "y1",
|
|
y2: "y2",
|
|
y: "y",
|
|
ychannelselector: "yChannelSelector",
|
|
z: "z",
|
|
zoomandpan: "zoomAndPan"
|
|
};
|
|
var ariaProperties = {
|
|
"aria-current": 0,
|
|
"aria-details": 0,
|
|
"aria-disabled": 0,
|
|
"aria-hidden": 0,
|
|
"aria-invalid": 0,
|
|
"aria-keyshortcuts": 0,
|
|
"aria-label": 0,
|
|
"aria-roledescription": 0,
|
|
"aria-autocomplete": 0,
|
|
"aria-checked": 0,
|
|
"aria-expanded": 0,
|
|
"aria-haspopup": 0,
|
|
"aria-level": 0,
|
|
"aria-modal": 0,
|
|
"aria-multiline": 0,
|
|
"aria-multiselectable": 0,
|
|
"aria-orientation": 0,
|
|
"aria-placeholder": 0,
|
|
"aria-pressed": 0,
|
|
"aria-readonly": 0,
|
|
"aria-required": 0,
|
|
"aria-selected": 0,
|
|
"aria-sort": 0,
|
|
"aria-valuemax": 0,
|
|
"aria-valuemin": 0,
|
|
"aria-valuenow": 0,
|
|
"aria-valuetext": 0,
|
|
"aria-atomic": 0,
|
|
"aria-busy": 0,
|
|
"aria-live": 0,
|
|
"aria-relevant": 0,
|
|
"aria-dropeffect": 0,
|
|
"aria-grabbed": 0,
|
|
"aria-activedescendant": 0,
|
|
"aria-colcount": 0,
|
|
"aria-colindex": 0,
|
|
"aria-colspan": 0,
|
|
"aria-controls": 0,
|
|
"aria-describedby": 0,
|
|
"aria-errormessage": 0,
|
|
"aria-flowto": 0,
|
|
"aria-labelledby": 0,
|
|
"aria-owns": 0,
|
|
"aria-posinset": 0,
|
|
"aria-rowcount": 0,
|
|
"aria-rowindex": 0,
|
|
"aria-rowspan": 0,
|
|
"aria-setsize": 0
|
|
};
|
|
var warnedProperties = {};
|
|
var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
function validateProperty(tagName, name) {
|
|
{
|
|
if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
|
|
return true;
|
|
}
|
|
if (rARIACamel.test(name)) {
|
|
var ariaName = "aria-" + name.slice(4).toLowerCase();
|
|
var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
|
|
if (correctName == null) {
|
|
error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
if (name !== correctName) {
|
|
error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
}
|
|
if (rARIA.test(name)) {
|
|
var lowerCasedName = name.toLowerCase();
|
|
var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
|
|
if (standardName == null) {
|
|
warnedProperties[name] = true;
|
|
return false;
|
|
}
|
|
if (name !== standardName) {
|
|
error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function warnInvalidARIAProps(type, props) {
|
|
{
|
|
var invalidProps = [];
|
|
for (var key in props) {
|
|
var isValid = validateProperty(type, key);
|
|
if (!isValid) {
|
|
invalidProps.push(key);
|
|
}
|
|
}
|
|
var unknownPropString = invalidProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
if (invalidProps.length === 1) {
|
|
error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
|
|
} else if (invalidProps.length > 1) {
|
|
error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
|
|
}
|
|
}
|
|
}
|
|
function validateProperties(type, props) {
|
|
if (isCustomComponent(type, props)) {
|
|
return;
|
|
}
|
|
warnInvalidARIAProps(type, props);
|
|
}
|
|
var didWarnValueNull = false;
|
|
function validateProperties$1(type, props) {
|
|
{
|
|
if (type !== "input" && type !== "textarea" && type !== "select") {
|
|
return;
|
|
}
|
|
if (props != null && props.value === null && !didWarnValueNull) {
|
|
didWarnValueNull = true;
|
|
if (type === "select" && props.multiple) {
|
|
error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
|
|
} else {
|
|
error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var validateProperty$1 = function() {
|
|
};
|
|
{
|
|
var warnedProperties$1 = {};
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var EVENT_NAME_REGEX = /^on./;
|
|
var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
|
var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
validateProperty$1 = function(tagName, name, value, eventRegistry) {
|
|
if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
|
return true;
|
|
}
|
|
var lowerCasedName = name.toLowerCase();
|
|
if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
|
|
error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (eventRegistry != null) {
|
|
var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
|
|
if (registrationNameDependencies2.hasOwnProperty(name)) {
|
|
return true;
|
|
}
|
|
var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
|
|
if (registrationName != null) {
|
|
error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
error("Unknown event handler property `%s`. It will be ignored.", name);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
} else if (EVENT_NAME_REGEX.test(name)) {
|
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
|
|
}
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "innerhtml") {
|
|
error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "aria") {
|
|
error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
|
|
error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (typeof value === "number" && isNaN(value)) {
|
|
error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
var propertyInfo = getPropertyInfo(name);
|
|
var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
if (standardName !== name) {
|
|
error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
if (value) {
|
|
error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name, name, value, name);
|
|
} else {
|
|
error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
|
|
}
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (isReserved) {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
warnedProperties$1[name] = true;
|
|
return false;
|
|
}
|
|
if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
return true;
|
|
};
|
|
}
|
|
var warnUnknownProperties = function(type, props, eventRegistry) {
|
|
{
|
|
var unknownProps = [];
|
|
for (var key in props) {
|
|
var isValid = validateProperty$1(type, key, props[key], eventRegistry);
|
|
if (!isValid) {
|
|
unknownProps.push(key);
|
|
}
|
|
}
|
|
var unknownPropString = unknownProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
if (unknownProps.length === 1) {
|
|
error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
|
|
} else if (unknownProps.length > 1) {
|
|
error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
|
|
}
|
|
}
|
|
};
|
|
function validateProperties$2(type, props, eventRegistry) {
|
|
if (isCustomComponent(type, props)) {
|
|
return;
|
|
}
|
|
warnUnknownProperties(type, props, eventRegistry);
|
|
}
|
|
var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
|
|
var IS_NON_DELEGATED = 1 << 1;
|
|
var IS_CAPTURE_PHASE = 1 << 2;
|
|
var IS_REPLAYED = 1 << 4;
|
|
var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
|
|
function getEventTarget(nativeEvent) {
|
|
var target = nativeEvent.target || nativeEvent.srcElement || window;
|
|
if (target.correspondingUseElement) {
|
|
target = target.correspondingUseElement;
|
|
}
|
|
return target.nodeType === TEXT_NODE ? target.parentNode : target;
|
|
}
|
|
var restoreImpl = null;
|
|
var restoreTarget = null;
|
|
var restoreQueue = null;
|
|
function restoreStateOfTarget(target) {
|
|
var internalInstance = getInstanceFromNode(target);
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
if (!(typeof restoreImpl === "function")) {
|
|
{
|
|
throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var stateNode = internalInstance.stateNode;
|
|
if (stateNode) {
|
|
var _props = getFiberCurrentPropsFromNode(stateNode);
|
|
restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
|
|
}
|
|
}
|
|
function setRestoreImplementation(impl) {
|
|
restoreImpl = impl;
|
|
}
|
|
function enqueueStateRestore(target) {
|
|
if (restoreTarget) {
|
|
if (restoreQueue) {
|
|
restoreQueue.push(target);
|
|
} else {
|
|
restoreQueue = [target];
|
|
}
|
|
} else {
|
|
restoreTarget = target;
|
|
}
|
|
}
|
|
function needsStateRestore() {
|
|
return restoreTarget !== null || restoreQueue !== null;
|
|
}
|
|
function restoreStateIfNeeded() {
|
|
if (!restoreTarget) {
|
|
return;
|
|
}
|
|
var target = restoreTarget;
|
|
var queuedTargets = restoreQueue;
|
|
restoreTarget = null;
|
|
restoreQueue = null;
|
|
restoreStateOfTarget(target);
|
|
if (queuedTargets) {
|
|
for (var i = 0; i < queuedTargets.length; i++) {
|
|
restoreStateOfTarget(queuedTargets[i]);
|
|
}
|
|
}
|
|
}
|
|
var batchedUpdatesImpl = function(fn, bookkeeping) {
|
|
return fn(bookkeeping);
|
|
};
|
|
var discreteUpdatesImpl = function(fn, a, b, c, d) {
|
|
return fn(a, b, c, d);
|
|
};
|
|
var flushDiscreteUpdatesImpl = function() {
|
|
};
|
|
var batchedEventUpdatesImpl = batchedUpdatesImpl;
|
|
var isInsideEventHandler = false;
|
|
var isBatchingEventUpdates = false;
|
|
function finishEventHandler() {
|
|
var controlledComponentsHavePendingUpdates = needsStateRestore();
|
|
if (controlledComponentsHavePendingUpdates) {
|
|
flushDiscreteUpdatesImpl();
|
|
restoreStateIfNeeded();
|
|
}
|
|
}
|
|
function batchedUpdates(fn, bookkeeping) {
|
|
if (isInsideEventHandler) {
|
|
return fn(bookkeeping);
|
|
}
|
|
isInsideEventHandler = true;
|
|
try {
|
|
return batchedUpdatesImpl(fn, bookkeeping);
|
|
} finally {
|
|
isInsideEventHandler = false;
|
|
finishEventHandler();
|
|
}
|
|
}
|
|
function batchedEventUpdates(fn, a, b) {
|
|
if (isBatchingEventUpdates) {
|
|
return fn(a, b);
|
|
}
|
|
isBatchingEventUpdates = true;
|
|
try {
|
|
return batchedEventUpdatesImpl(fn, a, b);
|
|
} finally {
|
|
isBatchingEventUpdates = false;
|
|
finishEventHandler();
|
|
}
|
|
}
|
|
function discreteUpdates(fn, a, b, c, d) {
|
|
var prevIsInsideEventHandler = isInsideEventHandler;
|
|
isInsideEventHandler = true;
|
|
try {
|
|
return discreteUpdatesImpl(fn, a, b, c, d);
|
|
} finally {
|
|
isInsideEventHandler = prevIsInsideEventHandler;
|
|
if (!isInsideEventHandler) {
|
|
finishEventHandler();
|
|
}
|
|
}
|
|
}
|
|
function flushDiscreteUpdatesIfNeeded(timeStamp) {
|
|
{
|
|
if (!isInsideEventHandler) {
|
|
flushDiscreteUpdatesImpl();
|
|
}
|
|
}
|
|
}
|
|
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
|
|
batchedUpdatesImpl = _batchedUpdatesImpl;
|
|
discreteUpdatesImpl = _discreteUpdatesImpl;
|
|
flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
|
|
batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
|
|
}
|
|
function isInteractive(tag) {
|
|
return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
|
|
}
|
|
function shouldPreventMouseEvent(name, type, props) {
|
|
switch (name) {
|
|
case "onClick":
|
|
case "onClickCapture":
|
|
case "onDoubleClick":
|
|
case "onDoubleClickCapture":
|
|
case "onMouseDown":
|
|
case "onMouseDownCapture":
|
|
case "onMouseMove":
|
|
case "onMouseMoveCapture":
|
|
case "onMouseUp":
|
|
case "onMouseUpCapture":
|
|
case "onMouseEnter":
|
|
return !!(props.disabled && isInteractive(type));
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function getListener(inst, registrationName) {
|
|
var stateNode = inst.stateNode;
|
|
if (stateNode === null) {
|
|
return null;
|
|
}
|
|
var props = getFiberCurrentPropsFromNode(stateNode);
|
|
if (props === null) {
|
|
return null;
|
|
}
|
|
var listener = props[registrationName];
|
|
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
|
|
return null;
|
|
}
|
|
if (!(!listener || typeof listener === "function")) {
|
|
{
|
|
throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
|
|
}
|
|
}
|
|
return listener;
|
|
}
|
|
var passiveBrowserEventsSupported = false;
|
|
if (canUseDOM) {
|
|
try {
|
|
var options = {};
|
|
Object.defineProperty(options, "passive", {
|
|
get: function() {
|
|
passiveBrowserEventsSupported = true;
|
|
}
|
|
});
|
|
window.addEventListener("test", options, options);
|
|
window.removeEventListener("test", options, options);
|
|
} catch (e) {
|
|
passiveBrowserEventsSupported = false;
|
|
}
|
|
}
|
|
function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
|
|
var funcArgs = Array.prototype.slice.call(arguments, 3);
|
|
try {
|
|
func.apply(context, funcArgs);
|
|
} catch (error2) {
|
|
this.onError(error2);
|
|
}
|
|
}
|
|
var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
{
|
|
if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
|
|
var fakeNode = document.createElement("react");
|
|
invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
|
|
if (!(typeof document !== "undefined")) {
|
|
{
|
|
throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
|
|
}
|
|
}
|
|
var evt = document.createEvent("Event");
|
|
var didCall = false;
|
|
var didError = true;
|
|
var windowEvent = window.event;
|
|
var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
|
|
function restoreAfterDispatch() {
|
|
fakeNode.removeEventListener(evtType, callCallback2, false);
|
|
if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
|
|
window.event = windowEvent;
|
|
}
|
|
}
|
|
var funcArgs = Array.prototype.slice.call(arguments, 3);
|
|
function callCallback2() {
|
|
didCall = true;
|
|
restoreAfterDispatch();
|
|
func.apply(context, funcArgs);
|
|
didError = false;
|
|
}
|
|
var error2;
|
|
var didSetError = false;
|
|
var isCrossOriginError = false;
|
|
function handleWindowError(event) {
|
|
error2 = event.error;
|
|
didSetError = true;
|
|
if (error2 === null && event.colno === 0 && event.lineno === 0) {
|
|
isCrossOriginError = true;
|
|
}
|
|
if (event.defaultPrevented) {
|
|
if (error2 != null && typeof error2 === "object") {
|
|
try {
|
|
error2._suppressLogging = true;
|
|
} catch (inner) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var evtType = "react-" + (name ? name : "invokeguardedcallback");
|
|
window.addEventListener("error", handleWindowError);
|
|
fakeNode.addEventListener(evtType, callCallback2, false);
|
|
evt.initEvent(evtType, false, false);
|
|
fakeNode.dispatchEvent(evt);
|
|
if (windowEventDescriptor) {
|
|
Object.defineProperty(window, "event", windowEventDescriptor);
|
|
}
|
|
if (didCall && didError) {
|
|
if (!didSetError) {
|
|
error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
|
|
} else if (isCrossOriginError) {
|
|
error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
|
|
}
|
|
this.onError(error2);
|
|
}
|
|
window.removeEventListener("error", handleWindowError);
|
|
if (!didCall) {
|
|
restoreAfterDispatch();
|
|
return invokeGuardedCallbackProd.apply(this, arguments);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
|
|
var hasError = false;
|
|
var caughtError = null;
|
|
var hasRethrowError = false;
|
|
var rethrowError = null;
|
|
var reporter = {
|
|
onError: function(error2) {
|
|
hasError = true;
|
|
caughtError = error2;
|
|
}
|
|
};
|
|
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
|
|
hasError = false;
|
|
caughtError = null;
|
|
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
|
|
}
|
|
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
|
|
invokeGuardedCallback.apply(this, arguments);
|
|
if (hasError) {
|
|
var error2 = clearCaughtError();
|
|
if (!hasRethrowError) {
|
|
hasRethrowError = true;
|
|
rethrowError = error2;
|
|
}
|
|
}
|
|
}
|
|
function rethrowCaughtError() {
|
|
if (hasRethrowError) {
|
|
var error2 = rethrowError;
|
|
hasRethrowError = false;
|
|
rethrowError = null;
|
|
throw error2;
|
|
}
|
|
}
|
|
function hasCaughtError() {
|
|
return hasError;
|
|
}
|
|
function clearCaughtError() {
|
|
if (hasError) {
|
|
var error2 = caughtError;
|
|
hasError = false;
|
|
caughtError = null;
|
|
return error2;
|
|
} else {
|
|
{
|
|
{
|
|
throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function get(key) {
|
|
return key._reactInternals;
|
|
}
|
|
function has(key) {
|
|
return key._reactInternals !== void 0;
|
|
}
|
|
function set(key, value) {
|
|
key._reactInternals = value;
|
|
}
|
|
var NoFlags = 0;
|
|
var PerformedWork = 1;
|
|
var Placement = 2;
|
|
var Update = 4;
|
|
var PlacementAndUpdate = 6;
|
|
var Deletion = 8;
|
|
var ContentReset = 16;
|
|
var Callback = 32;
|
|
var DidCapture = 64;
|
|
var Ref = 128;
|
|
var Snapshot = 256;
|
|
var Passive = 512;
|
|
var PassiveUnmountPendingDev = 8192;
|
|
var Hydrating = 1024;
|
|
var HydratingAndUpdate = 1028;
|
|
var LifecycleEffectMask = 932;
|
|
var HostEffectMask = 2047;
|
|
var Incomplete = 2048;
|
|
var ShouldCapture = 4096;
|
|
var ForceUpdateForLegacySuspense = 16384;
|
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
function getNearestMountedFiber(fiber) {
|
|
var node = fiber;
|
|
var nearestMounted = fiber;
|
|
if (!fiber.alternate) {
|
|
var nextNode = node;
|
|
do {
|
|
node = nextNode;
|
|
if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
nearestMounted = node.return;
|
|
}
|
|
nextNode = node.return;
|
|
} while (nextNode);
|
|
} else {
|
|
while (node.return) {
|
|
node = node.return;
|
|
}
|
|
}
|
|
if (node.tag === HostRoot) {
|
|
return nearestMounted;
|
|
}
|
|
return null;
|
|
}
|
|
function getSuspenseInstanceFromFiber(fiber) {
|
|
if (fiber.tag === SuspenseComponent) {
|
|
var suspenseState = fiber.memoizedState;
|
|
if (suspenseState === null) {
|
|
var current2 = fiber.alternate;
|
|
if (current2 !== null) {
|
|
suspenseState = current2.memoizedState;
|
|
}
|
|
}
|
|
if (suspenseState !== null) {
|
|
return suspenseState.dehydrated;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getContainerFromFiber(fiber) {
|
|
return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
|
|
}
|
|
function isFiberMounted(fiber) {
|
|
return getNearestMountedFiber(fiber) === fiber;
|
|
}
|
|
function isMounted(component) {
|
|
{
|
|
var owner = ReactCurrentOwner.current;
|
|
if (owner !== null && owner.tag === ClassComponent) {
|
|
var ownerFiber = owner;
|
|
var instance = ownerFiber.stateNode;
|
|
if (!instance._warnedAboutRefsInRender) {
|
|
error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(ownerFiber.type) || "A component");
|
|
}
|
|
instance._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
var fiber = get(component);
|
|
if (!fiber) {
|
|
return false;
|
|
}
|
|
return getNearestMountedFiber(fiber) === fiber;
|
|
}
|
|
function assertIsMounted(fiber) {
|
|
if (!(getNearestMountedFiber(fiber) === fiber)) {
|
|
{
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
}
|
|
function findCurrentFiberUsingSlowPath(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (!alternate) {
|
|
var nearestMounted = getNearestMountedFiber(fiber);
|
|
if (!(nearestMounted !== null)) {
|
|
{
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
if (nearestMounted !== fiber) {
|
|
return null;
|
|
}
|
|
return fiber;
|
|
}
|
|
var a = fiber;
|
|
var b = alternate;
|
|
while (true) {
|
|
var parentA = a.return;
|
|
if (parentA === null) {
|
|
break;
|
|
}
|
|
var parentB = parentA.alternate;
|
|
if (parentB === null) {
|
|
var nextParent = parentA.return;
|
|
if (nextParent !== null) {
|
|
a = b = nextParent;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
if (parentA.child === parentB.child) {
|
|
var child = parentA.child;
|
|
while (child) {
|
|
if (child === a) {
|
|
assertIsMounted(parentA);
|
|
return fiber;
|
|
}
|
|
if (child === b) {
|
|
assertIsMounted(parentA);
|
|
return alternate;
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
{
|
|
{
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
}
|
|
if (a.return !== b.return) {
|
|
a = parentA;
|
|
b = parentB;
|
|
} else {
|
|
var didFindChild = false;
|
|
var _child = parentA.child;
|
|
while (_child) {
|
|
if (_child === a) {
|
|
didFindChild = true;
|
|
a = parentA;
|
|
b = parentB;
|
|
break;
|
|
}
|
|
if (_child === b) {
|
|
didFindChild = true;
|
|
b = parentA;
|
|
a = parentB;
|
|
break;
|
|
}
|
|
_child = _child.sibling;
|
|
}
|
|
if (!didFindChild) {
|
|
_child = parentB.child;
|
|
while (_child) {
|
|
if (_child === a) {
|
|
didFindChild = true;
|
|
a = parentB;
|
|
b = parentA;
|
|
break;
|
|
}
|
|
if (_child === b) {
|
|
didFindChild = true;
|
|
b = parentB;
|
|
a = parentA;
|
|
break;
|
|
}
|
|
_child = _child.sibling;
|
|
}
|
|
if (!didFindChild) {
|
|
{
|
|
throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!(a.alternate === b)) {
|
|
{
|
|
throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
if (!(a.tag === HostRoot)) {
|
|
{
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
if (a.stateNode.current === a) {
|
|
return fiber;
|
|
}
|
|
return alternate;
|
|
}
|
|
function findCurrentHostFiber(parent) {
|
|
var currentParent = findCurrentFiberUsingSlowPath(parent);
|
|
if (!currentParent) {
|
|
return null;
|
|
}
|
|
var node = currentParent;
|
|
while (true) {
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
return node;
|
|
} else if (node.child) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === currentParent) {
|
|
return null;
|
|
}
|
|
while (!node.sibling) {
|
|
if (!node.return || node.return === currentParent) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function findCurrentHostFiberWithNoPortals(parent) {
|
|
var currentParent = findCurrentFiberUsingSlowPath(parent);
|
|
if (!currentParent) {
|
|
return null;
|
|
}
|
|
var node = currentParent;
|
|
while (true) {
|
|
if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI) {
|
|
return node;
|
|
} else if (node.child && node.tag !== HostPortal) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === currentParent) {
|
|
return null;
|
|
}
|
|
while (!node.sibling) {
|
|
if (!node.return || node.return === currentParent) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function doesFiberContain(parentFiber, childFiber) {
|
|
var node = childFiber;
|
|
var parentFiberAlternate = parentFiber.alternate;
|
|
while (node !== null) {
|
|
if (node === parentFiber || node === parentFiberAlternate) {
|
|
return true;
|
|
}
|
|
node = node.return;
|
|
}
|
|
return false;
|
|
}
|
|
var attemptUserBlockingHydration;
|
|
function setAttemptUserBlockingHydration(fn) {
|
|
attemptUserBlockingHydration = fn;
|
|
}
|
|
var attemptContinuousHydration;
|
|
function setAttemptContinuousHydration(fn) {
|
|
attemptContinuousHydration = fn;
|
|
}
|
|
var attemptHydrationAtCurrentPriority;
|
|
function setAttemptHydrationAtCurrentPriority(fn) {
|
|
attemptHydrationAtCurrentPriority = fn;
|
|
}
|
|
var attemptHydrationAtPriority;
|
|
function setAttemptHydrationAtPriority(fn) {
|
|
attemptHydrationAtPriority = fn;
|
|
}
|
|
var hasScheduledReplayAttempt = false;
|
|
var queuedDiscreteEvents = [];
|
|
var queuedFocus = null;
|
|
var queuedDrag = null;
|
|
var queuedMouse = null;
|
|
var queuedPointers = new Map();
|
|
var queuedPointerCaptures = new Map();
|
|
var queuedExplicitHydrationTargets = [];
|
|
function hasQueuedDiscreteEvents() {
|
|
return queuedDiscreteEvents.length > 0;
|
|
}
|
|
var discreteReplayableEvents = [
|
|
"mousedown",
|
|
"mouseup",
|
|
"touchcancel",
|
|
"touchend",
|
|
"touchstart",
|
|
"auxclick",
|
|
"dblclick",
|
|
"pointercancel",
|
|
"pointerdown",
|
|
"pointerup",
|
|
"dragend",
|
|
"dragstart",
|
|
"drop",
|
|
"compositionend",
|
|
"compositionstart",
|
|
"keydown",
|
|
"keypress",
|
|
"keyup",
|
|
"input",
|
|
"textInput",
|
|
"copy",
|
|
"cut",
|
|
"paste",
|
|
"click",
|
|
"change",
|
|
"contextmenu",
|
|
"reset",
|
|
"submit"
|
|
];
|
|
function isReplayableDiscreteEvent(eventType) {
|
|
return discreteReplayableEvents.indexOf(eventType) > -1;
|
|
}
|
|
function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
return {
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags: eventSystemFlags | IS_REPLAYED,
|
|
nativeEvent,
|
|
targetContainers: [targetContainer]
|
|
};
|
|
}
|
|
function queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
queuedDiscreteEvents.push(queuedEvent);
|
|
}
|
|
function clearIfContinuousEvent(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
case "focusout":
|
|
queuedFocus = null;
|
|
break;
|
|
case "dragenter":
|
|
case "dragleave":
|
|
queuedDrag = null;
|
|
break;
|
|
case "mouseover":
|
|
case "mouseout":
|
|
queuedMouse = null;
|
|
break;
|
|
case "pointerover":
|
|
case "pointerout": {
|
|
var pointerId = nativeEvent.pointerId;
|
|
queuedPointers.delete(pointerId);
|
|
break;
|
|
}
|
|
case "gotpointercapture":
|
|
case "lostpointercapture": {
|
|
var _pointerId = nativeEvent.pointerId;
|
|
queuedPointerCaptures.delete(_pointerId);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
|
|
var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
if (blockedOn !== null) {
|
|
var _fiber2 = getInstanceFromNode(blockedOn);
|
|
if (_fiber2 !== null) {
|
|
attemptContinuousHydration(_fiber2);
|
|
}
|
|
}
|
|
return queuedEvent;
|
|
}
|
|
existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
|
|
var targetContainers = existingQueuedEvent.targetContainers;
|
|
if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
|
|
targetContainers.push(targetContainer);
|
|
}
|
|
return existingQueuedEvent;
|
|
}
|
|
function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin": {
|
|
var focusEvent = nativeEvent;
|
|
queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
|
|
return true;
|
|
}
|
|
case "dragenter": {
|
|
var dragEvent = nativeEvent;
|
|
queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
|
|
return true;
|
|
}
|
|
case "mouseover": {
|
|
var mouseEvent = nativeEvent;
|
|
queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
|
|
return true;
|
|
}
|
|
case "pointerover": {
|
|
var pointerEvent = nativeEvent;
|
|
var pointerId = pointerEvent.pointerId;
|
|
queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
|
|
return true;
|
|
}
|
|
case "gotpointercapture": {
|
|
var _pointerEvent = nativeEvent;
|
|
var _pointerId2 = _pointerEvent.pointerId;
|
|
queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function attemptExplicitHydrationTarget(queuedTarget) {
|
|
var targetInst = getClosestInstanceFromNode(queuedTarget.target);
|
|
if (targetInst !== null) {
|
|
var nearestMounted = getNearestMountedFiber(targetInst);
|
|
if (nearestMounted !== null) {
|
|
var tag = nearestMounted.tag;
|
|
if (tag === SuspenseComponent) {
|
|
var instance = getSuspenseInstanceFromFiber(nearestMounted);
|
|
if (instance !== null) {
|
|
queuedTarget.blockedOn = instance;
|
|
attemptHydrationAtPriority(queuedTarget.lanePriority, function() {
|
|
Scheduler.unstable_runWithPriority(queuedTarget.priority, function() {
|
|
attemptHydrationAtCurrentPriority(nearestMounted);
|
|
});
|
|
});
|
|
return;
|
|
}
|
|
} else if (tag === HostRoot) {
|
|
var root2 = nearestMounted.stateNode;
|
|
if (root2.hydrate) {
|
|
queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
queuedTarget.blockedOn = null;
|
|
}
|
|
function attemptReplayContinuousQueuedEvent(queuedEvent) {
|
|
if (queuedEvent.blockedOn !== null) {
|
|
return false;
|
|
}
|
|
var targetContainers = queuedEvent.targetContainers;
|
|
while (targetContainers.length > 0) {
|
|
var targetContainer = targetContainers[0];
|
|
var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
|
|
if (nextBlockedOn !== null) {
|
|
var _fiber3 = getInstanceFromNode(nextBlockedOn);
|
|
if (_fiber3 !== null) {
|
|
attemptContinuousHydration(_fiber3);
|
|
}
|
|
queuedEvent.blockedOn = nextBlockedOn;
|
|
return false;
|
|
}
|
|
targetContainers.shift();
|
|
}
|
|
return true;
|
|
}
|
|
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
|
|
if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
|
|
map.delete(key);
|
|
}
|
|
}
|
|
function replayUnblockedEvents() {
|
|
hasScheduledReplayAttempt = false;
|
|
while (queuedDiscreteEvents.length > 0) {
|
|
var nextDiscreteEvent = queuedDiscreteEvents[0];
|
|
if (nextDiscreteEvent.blockedOn !== null) {
|
|
var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);
|
|
if (_fiber4 !== null) {
|
|
attemptUserBlockingHydration(_fiber4);
|
|
}
|
|
break;
|
|
}
|
|
var targetContainers = nextDiscreteEvent.targetContainers;
|
|
while (targetContainers.length > 0) {
|
|
var targetContainer = targetContainers[0];
|
|
var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);
|
|
if (nextBlockedOn !== null) {
|
|
nextDiscreteEvent.blockedOn = nextBlockedOn;
|
|
break;
|
|
}
|
|
targetContainers.shift();
|
|
}
|
|
if (nextDiscreteEvent.blockedOn === null) {
|
|
queuedDiscreteEvents.shift();
|
|
}
|
|
}
|
|
if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
|
|
queuedFocus = null;
|
|
}
|
|
if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
|
|
queuedDrag = null;
|
|
}
|
|
if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
|
|
queuedMouse = null;
|
|
}
|
|
queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
}
|
|
function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
|
|
if (queuedEvent.blockedOn === unblocked) {
|
|
queuedEvent.blockedOn = null;
|
|
if (!hasScheduledReplayAttempt) {
|
|
hasScheduledReplayAttempt = true;
|
|
Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
|
|
}
|
|
}
|
|
}
|
|
function retryIfBlockedOn(unblocked) {
|
|
if (queuedDiscreteEvents.length > 0) {
|
|
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
|
|
for (var i = 1; i < queuedDiscreteEvents.length; i++) {
|
|
var queuedEvent = queuedDiscreteEvents[i];
|
|
if (queuedEvent.blockedOn === unblocked) {
|
|
queuedEvent.blockedOn = null;
|
|
}
|
|
}
|
|
}
|
|
if (queuedFocus !== null) {
|
|
scheduleCallbackIfUnblocked(queuedFocus, unblocked);
|
|
}
|
|
if (queuedDrag !== null) {
|
|
scheduleCallbackIfUnblocked(queuedDrag, unblocked);
|
|
}
|
|
if (queuedMouse !== null) {
|
|
scheduleCallbackIfUnblocked(queuedMouse, unblocked);
|
|
}
|
|
var unblock = function(queuedEvent2) {
|
|
return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
|
|
};
|
|
queuedPointers.forEach(unblock);
|
|
queuedPointerCaptures.forEach(unblock);
|
|
for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
|
|
var queuedTarget = queuedExplicitHydrationTargets[_i];
|
|
if (queuedTarget.blockedOn === unblocked) {
|
|
queuedTarget.blockedOn = null;
|
|
}
|
|
}
|
|
while (queuedExplicitHydrationTargets.length > 0) {
|
|
var nextExplicitTarget = queuedExplicitHydrationTargets[0];
|
|
if (nextExplicitTarget.blockedOn !== null) {
|
|
break;
|
|
} else {
|
|
attemptExplicitHydrationTarget(nextExplicitTarget);
|
|
if (nextExplicitTarget.blockedOn === null) {
|
|
queuedExplicitHydrationTargets.shift();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var DiscreteEvent = 0;
|
|
var UserBlockingEvent = 1;
|
|
var ContinuousEvent = 2;
|
|
function makePrefixMap(styleProp, eventName) {
|
|
var prefixes2 = {};
|
|
prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
prefixes2["Webkit" + styleProp] = "webkit" + eventName;
|
|
prefixes2["Moz" + styleProp] = "moz" + eventName;
|
|
return prefixes2;
|
|
}
|
|
var vendorPrefixes = {
|
|
animationend: makePrefixMap("Animation", "AnimationEnd"),
|
|
animationiteration: makePrefixMap("Animation", "AnimationIteration"),
|
|
animationstart: makePrefixMap("Animation", "AnimationStart"),
|
|
transitionend: makePrefixMap("Transition", "TransitionEnd")
|
|
};
|
|
var prefixedEventNames = {};
|
|
var style = {};
|
|
if (canUseDOM) {
|
|
style = document.createElement("div").style;
|
|
if (!("AnimationEvent" in window)) {
|
|
delete vendorPrefixes.animationend.animation;
|
|
delete vendorPrefixes.animationiteration.animation;
|
|
delete vendorPrefixes.animationstart.animation;
|
|
}
|
|
if (!("TransitionEvent" in window)) {
|
|
delete vendorPrefixes.transitionend.transition;
|
|
}
|
|
}
|
|
function getVendorPrefixedEventName(eventName) {
|
|
if (prefixedEventNames[eventName]) {
|
|
return prefixedEventNames[eventName];
|
|
} else if (!vendorPrefixes[eventName]) {
|
|
return eventName;
|
|
}
|
|
var prefixMap = vendorPrefixes[eventName];
|
|
for (var styleProp in prefixMap) {
|
|
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
|
|
return prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
}
|
|
}
|
|
return eventName;
|
|
}
|
|
var ANIMATION_END = getVendorPrefixedEventName("animationend");
|
|
var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
|
|
var ANIMATION_START = getVendorPrefixedEventName("animationstart");
|
|
var TRANSITION_END = getVendorPrefixedEventName("transitionend");
|
|
var topLevelEventsToReactNames = new Map();
|
|
var eventPriorities = new Map();
|
|
var discreteEventPairsForSimpleEventPlugin = [
|
|
"cancel",
|
|
"cancel",
|
|
"click",
|
|
"click",
|
|
"close",
|
|
"close",
|
|
"contextmenu",
|
|
"contextMenu",
|
|
"copy",
|
|
"copy",
|
|
"cut",
|
|
"cut",
|
|
"auxclick",
|
|
"auxClick",
|
|
"dblclick",
|
|
"doubleClick",
|
|
"dragend",
|
|
"dragEnd",
|
|
"dragstart",
|
|
"dragStart",
|
|
"drop",
|
|
"drop",
|
|
"focusin",
|
|
"focus",
|
|
"focusout",
|
|
"blur",
|
|
"input",
|
|
"input",
|
|
"invalid",
|
|
"invalid",
|
|
"keydown",
|
|
"keyDown",
|
|
"keypress",
|
|
"keyPress",
|
|
"keyup",
|
|
"keyUp",
|
|
"mousedown",
|
|
"mouseDown",
|
|
"mouseup",
|
|
"mouseUp",
|
|
"paste",
|
|
"paste",
|
|
"pause",
|
|
"pause",
|
|
"play",
|
|
"play",
|
|
"pointercancel",
|
|
"pointerCancel",
|
|
"pointerdown",
|
|
"pointerDown",
|
|
"pointerup",
|
|
"pointerUp",
|
|
"ratechange",
|
|
"rateChange",
|
|
"reset",
|
|
"reset",
|
|
"seeked",
|
|
"seeked",
|
|
"submit",
|
|
"submit",
|
|
"touchcancel",
|
|
"touchCancel",
|
|
"touchend",
|
|
"touchEnd",
|
|
"touchstart",
|
|
"touchStart",
|
|
"volumechange",
|
|
"volumeChange"
|
|
];
|
|
var otherDiscreteEvents = ["change", "selectionchange", "textInput", "compositionstart", "compositionend", "compositionupdate"];
|
|
var userBlockingPairsForSimpleEventPlugin = ["drag", "drag", "dragenter", "dragEnter", "dragexit", "dragExit", "dragleave", "dragLeave", "dragover", "dragOver", "mousemove", "mouseMove", "mouseout", "mouseOut", "mouseover", "mouseOver", "pointermove", "pointerMove", "pointerout", "pointerOut", "pointerover", "pointerOver", "scroll", "scroll", "toggle", "toggle", "touchmove", "touchMove", "wheel", "wheel"];
|
|
var continuousPairsForSimpleEventPlugin = ["abort", "abort", ANIMATION_END, "animationEnd", ANIMATION_ITERATION, "animationIteration", ANIMATION_START, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", TRANSITION_END, "transitionEnd", "waiting", "waiting"];
|
|
function registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {
|
|
for (var i = 0; i < eventTypes.length; i += 2) {
|
|
var topEvent = eventTypes[i];
|
|
var event = eventTypes[i + 1];
|
|
var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
|
|
var reactName = "on" + capitalizedEvent;
|
|
eventPriorities.set(topEvent, priority);
|
|
topLevelEventsToReactNames.set(topEvent, reactName);
|
|
registerTwoPhaseEvent(reactName, [topEvent]);
|
|
}
|
|
}
|
|
function setEventPriorities(eventTypes, priority) {
|
|
for (var i = 0; i < eventTypes.length; i++) {
|
|
eventPriorities.set(eventTypes[i], priority);
|
|
}
|
|
}
|
|
function getEventPriorityForPluginSystem(domEventName) {
|
|
var priority = eventPriorities.get(domEventName);
|
|
return priority === void 0 ? ContinuousEvent : priority;
|
|
}
|
|
function registerSimpleEvents() {
|
|
registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
|
|
registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
|
|
registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);
|
|
setEventPriorities(otherDiscreteEvents, DiscreteEvent);
|
|
}
|
|
var Scheduler_now = Scheduler.unstable_now;
|
|
{
|
|
if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
|
|
{
|
|
throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
|
|
}
|
|
}
|
|
}
|
|
var ImmediatePriority = 99;
|
|
var UserBlockingPriority = 98;
|
|
var NormalPriority = 97;
|
|
var LowPriority = 96;
|
|
var IdlePriority = 95;
|
|
var NoPriority = 90;
|
|
var initialTimeMs = Scheduler_now();
|
|
var SyncLanePriority = 15;
|
|
var SyncBatchedLanePriority = 14;
|
|
var InputDiscreteHydrationLanePriority = 13;
|
|
var InputDiscreteLanePriority = 12;
|
|
var InputContinuousHydrationLanePriority = 11;
|
|
var InputContinuousLanePriority = 10;
|
|
var DefaultHydrationLanePriority = 9;
|
|
var DefaultLanePriority = 8;
|
|
var TransitionHydrationPriority = 7;
|
|
var TransitionPriority = 6;
|
|
var RetryLanePriority = 5;
|
|
var SelectiveHydrationLanePriority = 4;
|
|
var IdleHydrationLanePriority = 3;
|
|
var IdleLanePriority = 2;
|
|
var OffscreenLanePriority = 1;
|
|
var NoLanePriority = 0;
|
|
var TotalLanes = 31;
|
|
var NoLanes = 0;
|
|
var NoLane = 0;
|
|
var SyncLane = 1;
|
|
var SyncBatchedLane = 2;
|
|
var InputDiscreteHydrationLane = 4;
|
|
var InputDiscreteLanes = 24;
|
|
var InputContinuousHydrationLane = 32;
|
|
var InputContinuousLanes = 192;
|
|
var DefaultHydrationLane = 256;
|
|
var DefaultLanes = 3584;
|
|
var TransitionHydrationLane = 4096;
|
|
var TransitionLanes = 4186112;
|
|
var RetryLanes = 62914560;
|
|
var SomeRetryLane = 33554432;
|
|
var SelectiveHydrationLane = 67108864;
|
|
var NonIdleLanes = 134217727;
|
|
var IdleHydrationLane = 134217728;
|
|
var IdleLanes = 805306368;
|
|
var OffscreenLane = 1073741824;
|
|
var NoTimestamp = -1;
|
|
function setCurrentUpdateLanePriority(newLanePriority) {
|
|
}
|
|
var return_highestLanePriority = DefaultLanePriority;
|
|
function getHighestPriorityLanes(lanes) {
|
|
if ((SyncLane & lanes) !== NoLanes) {
|
|
return_highestLanePriority = SyncLanePriority;
|
|
return SyncLane;
|
|
}
|
|
if ((SyncBatchedLane & lanes) !== NoLanes) {
|
|
return_highestLanePriority = SyncBatchedLanePriority;
|
|
return SyncBatchedLane;
|
|
}
|
|
if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {
|
|
return_highestLanePriority = InputDiscreteHydrationLanePriority;
|
|
return InputDiscreteHydrationLane;
|
|
}
|
|
var inputDiscreteLanes = InputDiscreteLanes & lanes;
|
|
if (inputDiscreteLanes !== NoLanes) {
|
|
return_highestLanePriority = InputDiscreteLanePriority;
|
|
return inputDiscreteLanes;
|
|
}
|
|
if ((lanes & InputContinuousHydrationLane) !== NoLanes) {
|
|
return_highestLanePriority = InputContinuousHydrationLanePriority;
|
|
return InputContinuousHydrationLane;
|
|
}
|
|
var inputContinuousLanes = InputContinuousLanes & lanes;
|
|
if (inputContinuousLanes !== NoLanes) {
|
|
return_highestLanePriority = InputContinuousLanePriority;
|
|
return inputContinuousLanes;
|
|
}
|
|
if ((lanes & DefaultHydrationLane) !== NoLanes) {
|
|
return_highestLanePriority = DefaultHydrationLanePriority;
|
|
return DefaultHydrationLane;
|
|
}
|
|
var defaultLanes = DefaultLanes & lanes;
|
|
if (defaultLanes !== NoLanes) {
|
|
return_highestLanePriority = DefaultLanePriority;
|
|
return defaultLanes;
|
|
}
|
|
if ((lanes & TransitionHydrationLane) !== NoLanes) {
|
|
return_highestLanePriority = TransitionHydrationPriority;
|
|
return TransitionHydrationLane;
|
|
}
|
|
var transitionLanes = TransitionLanes & lanes;
|
|
if (transitionLanes !== NoLanes) {
|
|
return_highestLanePriority = TransitionPriority;
|
|
return transitionLanes;
|
|
}
|
|
var retryLanes = RetryLanes & lanes;
|
|
if (retryLanes !== NoLanes) {
|
|
return_highestLanePriority = RetryLanePriority;
|
|
return retryLanes;
|
|
}
|
|
if (lanes & SelectiveHydrationLane) {
|
|
return_highestLanePriority = SelectiveHydrationLanePriority;
|
|
return SelectiveHydrationLane;
|
|
}
|
|
if ((lanes & IdleHydrationLane) !== NoLanes) {
|
|
return_highestLanePriority = IdleHydrationLanePriority;
|
|
return IdleHydrationLane;
|
|
}
|
|
var idleLanes = IdleLanes & lanes;
|
|
if (idleLanes !== NoLanes) {
|
|
return_highestLanePriority = IdleLanePriority;
|
|
return idleLanes;
|
|
}
|
|
if ((OffscreenLane & lanes) !== NoLanes) {
|
|
return_highestLanePriority = OffscreenLanePriority;
|
|
return OffscreenLane;
|
|
}
|
|
{
|
|
error("Should have found matching lanes. This is a bug in React.");
|
|
}
|
|
return_highestLanePriority = DefaultLanePriority;
|
|
return lanes;
|
|
}
|
|
function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
|
|
switch (schedulerPriorityLevel) {
|
|
case ImmediatePriority:
|
|
return SyncLanePriority;
|
|
case UserBlockingPriority:
|
|
return InputContinuousLanePriority;
|
|
case NormalPriority:
|
|
case LowPriority:
|
|
return DefaultLanePriority;
|
|
case IdlePriority:
|
|
return IdleLanePriority;
|
|
default:
|
|
return NoLanePriority;
|
|
}
|
|
}
|
|
function lanePriorityToSchedulerPriority(lanePriority) {
|
|
switch (lanePriority) {
|
|
case SyncLanePriority:
|
|
case SyncBatchedLanePriority:
|
|
return ImmediatePriority;
|
|
case InputDiscreteHydrationLanePriority:
|
|
case InputDiscreteLanePriority:
|
|
case InputContinuousHydrationLanePriority:
|
|
case InputContinuousLanePriority:
|
|
return UserBlockingPriority;
|
|
case DefaultHydrationLanePriority:
|
|
case DefaultLanePriority:
|
|
case TransitionHydrationPriority:
|
|
case TransitionPriority:
|
|
case SelectiveHydrationLanePriority:
|
|
case RetryLanePriority:
|
|
return NormalPriority;
|
|
case IdleHydrationLanePriority:
|
|
case IdleLanePriority:
|
|
case OffscreenLanePriority:
|
|
return IdlePriority;
|
|
case NoLanePriority:
|
|
return NoPriority;
|
|
default: {
|
|
{
|
|
throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getNextLanes(root2, wipLanes) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
if (pendingLanes === NoLanes) {
|
|
return_highestLanePriority = NoLanePriority;
|
|
return NoLanes;
|
|
}
|
|
var nextLanes = NoLanes;
|
|
var nextLanePriority = NoLanePriority;
|
|
var expiredLanes = root2.expiredLanes;
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
var pingedLanes = root2.pingedLanes;
|
|
if (expiredLanes !== NoLanes) {
|
|
nextLanes = expiredLanes;
|
|
nextLanePriority = return_highestLanePriority = SyncLanePriority;
|
|
} else {
|
|
var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
|
|
if (nonIdlePendingLanes !== NoLanes) {
|
|
var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
|
|
if (nonIdleUnblockedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
|
|
nextLanePriority = return_highestLanePriority;
|
|
} else {
|
|
var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
|
|
if (nonIdlePingedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
|
|
nextLanePriority = return_highestLanePriority;
|
|
}
|
|
}
|
|
} else {
|
|
var unblockedLanes = pendingLanes & ~suspendedLanes;
|
|
if (unblockedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(unblockedLanes);
|
|
nextLanePriority = return_highestLanePriority;
|
|
} else {
|
|
if (pingedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(pingedLanes);
|
|
nextLanePriority = return_highestLanePriority;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (nextLanes === NoLanes) {
|
|
return NoLanes;
|
|
}
|
|
nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes);
|
|
if (wipLanes !== NoLanes && wipLanes !== nextLanes && (wipLanes & suspendedLanes) === NoLanes) {
|
|
getHighestPriorityLanes(wipLanes);
|
|
var wipLanePriority = return_highestLanePriority;
|
|
if (nextLanePriority <= wipLanePriority) {
|
|
return wipLanes;
|
|
} else {
|
|
return_highestLanePriority = nextLanePriority;
|
|
}
|
|
}
|
|
var entangledLanes = root2.entangledLanes;
|
|
if (entangledLanes !== NoLanes) {
|
|
var entanglements = root2.entanglements;
|
|
var lanes = nextLanes & entangledLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
nextLanes |= entanglements[index2];
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
return nextLanes;
|
|
}
|
|
function getMostRecentEventTime(root2, lanes) {
|
|
var eventTimes = root2.eventTimes;
|
|
var mostRecentEventTime = NoTimestamp;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var eventTime = eventTimes[index2];
|
|
if (eventTime > mostRecentEventTime) {
|
|
mostRecentEventTime = eventTime;
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
return mostRecentEventTime;
|
|
}
|
|
function computeExpirationTime(lane, currentTime) {
|
|
getHighestPriorityLanes(lane);
|
|
var priority = return_highestLanePriority;
|
|
if (priority >= InputContinuousLanePriority) {
|
|
return currentTime + 250;
|
|
} else if (priority >= TransitionPriority) {
|
|
return currentTime + 5e3;
|
|
} else {
|
|
return NoTimestamp;
|
|
}
|
|
}
|
|
function markStarvedLanesAsExpired(root2, currentTime) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
var pingedLanes = root2.pingedLanes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = pendingLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var expirationTime = expirationTimes[index2];
|
|
if (expirationTime === NoTimestamp) {
|
|
if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
|
|
expirationTimes[index2] = computeExpirationTime(lane, currentTime);
|
|
}
|
|
} else if (expirationTime <= currentTime) {
|
|
root2.expiredLanes |= lane;
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function getLanesToRetrySynchronouslyOnError(root2) {
|
|
var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
|
|
if (everythingButOffscreen !== NoLanes) {
|
|
return everythingButOffscreen;
|
|
}
|
|
if (everythingButOffscreen & OffscreenLane) {
|
|
return OffscreenLane;
|
|
}
|
|
return NoLanes;
|
|
}
|
|
function returnNextLanesPriority() {
|
|
return return_highestLanePriority;
|
|
}
|
|
function includesNonIdleWork(lanes) {
|
|
return (lanes & NonIdleLanes) !== NoLanes;
|
|
}
|
|
function includesOnlyRetries(lanes) {
|
|
return (lanes & RetryLanes) === lanes;
|
|
}
|
|
function includesOnlyTransitions(lanes) {
|
|
return (lanes & TransitionLanes) === lanes;
|
|
}
|
|
function findUpdateLane(lanePriority, wipLanes) {
|
|
switch (lanePriority) {
|
|
case NoLanePriority:
|
|
break;
|
|
case SyncLanePriority:
|
|
return SyncLane;
|
|
case SyncBatchedLanePriority:
|
|
return SyncBatchedLane;
|
|
case InputDiscreteLanePriority: {
|
|
var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);
|
|
if (_lane === NoLane) {
|
|
return findUpdateLane(InputContinuousLanePriority, wipLanes);
|
|
}
|
|
return _lane;
|
|
}
|
|
case InputContinuousLanePriority: {
|
|
var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);
|
|
if (_lane2 === NoLane) {
|
|
return findUpdateLane(DefaultLanePriority, wipLanes);
|
|
}
|
|
return _lane2;
|
|
}
|
|
case DefaultLanePriority: {
|
|
var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);
|
|
if (_lane3 === NoLane) {
|
|
_lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);
|
|
if (_lane3 === NoLane) {
|
|
_lane3 = pickArbitraryLane(DefaultLanes);
|
|
}
|
|
}
|
|
return _lane3;
|
|
}
|
|
case TransitionPriority:
|
|
case RetryLanePriority:
|
|
break;
|
|
case IdleLanePriority:
|
|
var lane = pickArbitraryLane(IdleLanes & ~wipLanes);
|
|
if (lane === NoLane) {
|
|
lane = pickArbitraryLane(IdleLanes);
|
|
}
|
|
return lane;
|
|
}
|
|
{
|
|
{
|
|
throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
|
|
}
|
|
}
|
|
}
|
|
function findTransitionLane(wipLanes, pendingLanes) {
|
|
var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);
|
|
if (lane === NoLane) {
|
|
lane = pickArbitraryLane(TransitionLanes & ~wipLanes);
|
|
if (lane === NoLane) {
|
|
lane = pickArbitraryLane(TransitionLanes);
|
|
}
|
|
}
|
|
return lane;
|
|
}
|
|
function findRetryLane(wipLanes) {
|
|
var lane = pickArbitraryLane(RetryLanes & ~wipLanes);
|
|
if (lane === NoLane) {
|
|
lane = pickArbitraryLane(RetryLanes);
|
|
}
|
|
return lane;
|
|
}
|
|
function getHighestPriorityLane(lanes) {
|
|
return lanes & -lanes;
|
|
}
|
|
function getLowestPriorityLane(lanes) {
|
|
var index2 = 31 - clz32(lanes);
|
|
return index2 < 0 ? NoLanes : 1 << index2;
|
|
}
|
|
function getEqualOrHigherPriorityLanes(lanes) {
|
|
return (getLowestPriorityLane(lanes) << 1) - 1;
|
|
}
|
|
function pickArbitraryLane(lanes) {
|
|
return getHighestPriorityLane(lanes);
|
|
}
|
|
function pickArbitraryLaneIndex(lanes) {
|
|
return 31 - clz32(lanes);
|
|
}
|
|
function laneToIndex(lane) {
|
|
return pickArbitraryLaneIndex(lane);
|
|
}
|
|
function includesSomeLane(a, b) {
|
|
return (a & b) !== NoLanes;
|
|
}
|
|
function isSubsetOfLanes(set2, subset) {
|
|
return (set2 & subset) === subset;
|
|
}
|
|
function mergeLanes(a, b) {
|
|
return a | b;
|
|
}
|
|
function removeLanes(set2, subset) {
|
|
return set2 & ~subset;
|
|
}
|
|
function laneToLanes(lane) {
|
|
return lane;
|
|
}
|
|
function higherPriorityLane(a, b) {
|
|
return a !== NoLane && a < b ? a : b;
|
|
}
|
|
function createLaneMap(initial) {
|
|
var laneMap = [];
|
|
for (var i = 0; i < TotalLanes; i++) {
|
|
laneMap.push(initial);
|
|
}
|
|
return laneMap;
|
|
}
|
|
function markRootUpdated(root2, updateLane, eventTime) {
|
|
root2.pendingLanes |= updateLane;
|
|
var higherPriorityLanes = updateLane - 1;
|
|
root2.suspendedLanes &= higherPriorityLanes;
|
|
root2.pingedLanes &= higherPriorityLanes;
|
|
var eventTimes = root2.eventTimes;
|
|
var index2 = laneToIndex(updateLane);
|
|
eventTimes[index2] = eventTime;
|
|
}
|
|
function markRootSuspended(root2, suspendedLanes) {
|
|
root2.suspendedLanes |= suspendedLanes;
|
|
root2.pingedLanes &= ~suspendedLanes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = suspendedLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
expirationTimes[index2] = NoTimestamp;
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function markRootPinged(root2, pingedLanes, eventTime) {
|
|
root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
|
|
}
|
|
function markDiscreteUpdatesExpired(root2) {
|
|
root2.expiredLanes |= InputDiscreteLanes & root2.pendingLanes;
|
|
}
|
|
function hasDiscreteLanes(lanes) {
|
|
return (lanes & InputDiscreteLanes) !== NoLanes;
|
|
}
|
|
function markRootMutableRead(root2, updateLane) {
|
|
root2.mutableReadLanes |= updateLane & root2.pendingLanes;
|
|
}
|
|
function markRootFinished(root2, remainingLanes) {
|
|
var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
|
|
root2.pendingLanes = remainingLanes;
|
|
root2.suspendedLanes = 0;
|
|
root2.pingedLanes = 0;
|
|
root2.expiredLanes &= remainingLanes;
|
|
root2.mutableReadLanes &= remainingLanes;
|
|
root2.entangledLanes &= remainingLanes;
|
|
var entanglements = root2.entanglements;
|
|
var eventTimes = root2.eventTimes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = noLongerPendingLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
entanglements[index2] = NoLanes;
|
|
eventTimes[index2] = NoTimestamp;
|
|
expirationTimes[index2] = NoTimestamp;
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function markRootEntangled(root2, entangledLanes) {
|
|
root2.entangledLanes |= entangledLanes;
|
|
var entanglements = root2.entanglements;
|
|
var lanes = entangledLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
entanglements[index2] |= entangledLanes;
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
|
|
var log = Math.log;
|
|
var LN2 = Math.LN2;
|
|
function clz32Fallback(lanes) {
|
|
if (lanes === 0) {
|
|
return 32;
|
|
}
|
|
return 31 - (log(lanes) / LN2 | 0) | 0;
|
|
}
|
|
var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority, runWithPriority = Scheduler.unstable_runWithPriority;
|
|
var _enabled = true;
|
|
function setEnabled(enabled) {
|
|
_enabled = !!enabled;
|
|
}
|
|
function isEnabled() {
|
|
return _enabled;
|
|
}
|
|
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
|
|
var eventPriority = getEventPriorityForPluginSystem(domEventName);
|
|
var listenerWrapper;
|
|
switch (eventPriority) {
|
|
case DiscreteEvent:
|
|
listenerWrapper = dispatchDiscreteEvent;
|
|
break;
|
|
case UserBlockingEvent:
|
|
listenerWrapper = dispatchUserBlockingUpdate;
|
|
break;
|
|
case ContinuousEvent:
|
|
default:
|
|
listenerWrapper = dispatchEvent;
|
|
break;
|
|
}
|
|
return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
|
|
}
|
|
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
{
|
|
flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
|
|
}
|
|
discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
|
|
}
|
|
function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
{
|
|
runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));
|
|
}
|
|
}
|
|
function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (!_enabled) {
|
|
return;
|
|
}
|
|
var allowReplay = true;
|
|
{
|
|
allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;
|
|
}
|
|
if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {
|
|
queueDiscreteEvent(null, domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
return;
|
|
}
|
|
var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
if (blockedOn === null) {
|
|
if (allowReplay) {
|
|
clearIfContinuousEvent(domEventName, nativeEvent);
|
|
}
|
|
return;
|
|
}
|
|
if (allowReplay) {
|
|
if (isReplayableDiscreteEvent(domEventName)) {
|
|
queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
return;
|
|
}
|
|
if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
|
|
return;
|
|
}
|
|
clearIfContinuousEvent(domEventName, nativeEvent);
|
|
}
|
|
dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
|
|
}
|
|
function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
var nativeEventTarget = getEventTarget(nativeEvent);
|
|
var targetInst = getClosestInstanceFromNode(nativeEventTarget);
|
|
if (targetInst !== null) {
|
|
var nearestMounted = getNearestMountedFiber(targetInst);
|
|
if (nearestMounted === null) {
|
|
targetInst = null;
|
|
} else {
|
|
var tag = nearestMounted.tag;
|
|
if (tag === SuspenseComponent) {
|
|
var instance = getSuspenseInstanceFromFiber(nearestMounted);
|
|
if (instance !== null) {
|
|
return instance;
|
|
}
|
|
targetInst = null;
|
|
} else if (tag === HostRoot) {
|
|
var root2 = nearestMounted.stateNode;
|
|
if (root2.hydrate) {
|
|
return getContainerFromFiber(nearestMounted);
|
|
}
|
|
targetInst = null;
|
|
} else if (nearestMounted !== targetInst) {
|
|
targetInst = null;
|
|
}
|
|
}
|
|
}
|
|
dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer);
|
|
return null;
|
|
}
|
|
function addEventBubbleListener(target, eventType, listener) {
|
|
target.addEventListener(eventType, listener, false);
|
|
return listener;
|
|
}
|
|
function addEventCaptureListener(target, eventType, listener) {
|
|
target.addEventListener(eventType, listener, true);
|
|
return listener;
|
|
}
|
|
function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
|
|
target.addEventListener(eventType, listener, {
|
|
capture: true,
|
|
passive
|
|
});
|
|
return listener;
|
|
}
|
|
function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
|
|
target.addEventListener(eventType, listener, {
|
|
passive
|
|
});
|
|
return listener;
|
|
}
|
|
var root = null;
|
|
var startText = null;
|
|
var fallbackText = null;
|
|
function initialize(nativeEventTarget) {
|
|
root = nativeEventTarget;
|
|
startText = getText();
|
|
return true;
|
|
}
|
|
function reset() {
|
|
root = null;
|
|
startText = null;
|
|
fallbackText = null;
|
|
}
|
|
function getData() {
|
|
if (fallbackText) {
|
|
return fallbackText;
|
|
}
|
|
var start;
|
|
var startValue = startText;
|
|
var startLength = startValue.length;
|
|
var end;
|
|
var endValue = getText();
|
|
var endLength = endValue.length;
|
|
for (start = 0; start < startLength; start++) {
|
|
if (startValue[start] !== endValue[start]) {
|
|
break;
|
|
}
|
|
}
|
|
var minEnd = startLength - start;
|
|
for (end = 1; end <= minEnd; end++) {
|
|
if (startValue[startLength - end] !== endValue[endLength - end]) {
|
|
break;
|
|
}
|
|
}
|
|
var sliceTail = end > 1 ? 1 - end : void 0;
|
|
fallbackText = endValue.slice(start, sliceTail);
|
|
return fallbackText;
|
|
}
|
|
function getText() {
|
|
if ("value" in root) {
|
|
return root.value;
|
|
}
|
|
return root.textContent;
|
|
}
|
|
function getEventCharCode(nativeEvent) {
|
|
var charCode;
|
|
var keyCode = nativeEvent.keyCode;
|
|
if ("charCode" in nativeEvent) {
|
|
charCode = nativeEvent.charCode;
|
|
if (charCode === 0 && keyCode === 13) {
|
|
charCode = 13;
|
|
}
|
|
} else {
|
|
charCode = keyCode;
|
|
}
|
|
if (charCode === 10) {
|
|
charCode = 13;
|
|
}
|
|
if (charCode >= 32 || charCode === 13) {
|
|
return charCode;
|
|
}
|
|
return 0;
|
|
}
|
|
function functionThatReturnsTrue() {
|
|
return true;
|
|
}
|
|
function functionThatReturnsFalse() {
|
|
return false;
|
|
}
|
|
function createSyntheticEvent(Interface) {
|
|
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
|
|
this._reactName = reactName;
|
|
this._targetInst = targetInst;
|
|
this.type = reactEventType;
|
|
this.nativeEvent = nativeEvent;
|
|
this.target = nativeEventTarget;
|
|
this.currentTarget = null;
|
|
for (var _propName in Interface) {
|
|
if (!Interface.hasOwnProperty(_propName)) {
|
|
continue;
|
|
}
|
|
var normalize = Interface[_propName];
|
|
if (normalize) {
|
|
this[_propName] = normalize(nativeEvent);
|
|
} else {
|
|
this[_propName] = nativeEvent[_propName];
|
|
}
|
|
}
|
|
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
if (defaultPrevented) {
|
|
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
} else {
|
|
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
}
|
|
this.isPropagationStopped = functionThatReturnsFalse;
|
|
return this;
|
|
}
|
|
_assign(SyntheticBaseEvent.prototype, {
|
|
preventDefault: function() {
|
|
this.defaultPrevented = true;
|
|
var event = this.nativeEvent;
|
|
if (!event) {
|
|
return;
|
|
}
|
|
if (event.preventDefault) {
|
|
event.preventDefault();
|
|
} else if (typeof event.returnValue !== "unknown") {
|
|
event.returnValue = false;
|
|
}
|
|
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
},
|
|
stopPropagation: function() {
|
|
var event = this.nativeEvent;
|
|
if (!event) {
|
|
return;
|
|
}
|
|
if (event.stopPropagation) {
|
|
event.stopPropagation();
|
|
} else if (typeof event.cancelBubble !== "unknown") {
|
|
event.cancelBubble = true;
|
|
}
|
|
this.isPropagationStopped = functionThatReturnsTrue;
|
|
},
|
|
persist: function() {
|
|
},
|
|
isPersistent: functionThatReturnsTrue
|
|
});
|
|
return SyntheticBaseEvent;
|
|
}
|
|
var EventInterface = {
|
|
eventPhase: 0,
|
|
bubbles: 0,
|
|
cancelable: 0,
|
|
timeStamp: function(event) {
|
|
return event.timeStamp || Date.now();
|
|
},
|
|
defaultPrevented: 0,
|
|
isTrusted: 0
|
|
};
|
|
var SyntheticEvent = createSyntheticEvent(EventInterface);
|
|
var UIEventInterface = _assign({}, EventInterface, {
|
|
view: 0,
|
|
detail: 0
|
|
});
|
|
var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
|
|
var lastMovementX;
|
|
var lastMovementY;
|
|
var lastMouseEvent;
|
|
function updateMouseMovementPolyfillState(event) {
|
|
if (event !== lastMouseEvent) {
|
|
if (lastMouseEvent && event.type === "mousemove") {
|
|
lastMovementX = event.screenX - lastMouseEvent.screenX;
|
|
lastMovementY = event.screenY - lastMouseEvent.screenY;
|
|
} else {
|
|
lastMovementX = 0;
|
|
lastMovementY = 0;
|
|
}
|
|
lastMouseEvent = event;
|
|
}
|
|
}
|
|
var MouseEventInterface = _assign({}, UIEventInterface, {
|
|
screenX: 0,
|
|
screenY: 0,
|
|
clientX: 0,
|
|
clientY: 0,
|
|
pageX: 0,
|
|
pageY: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
getModifierState: getEventModifierState,
|
|
button: 0,
|
|
buttons: 0,
|
|
relatedTarget: function(event) {
|
|
if (event.relatedTarget === void 0)
|
|
return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
|
|
return event.relatedTarget;
|
|
},
|
|
movementX: function(event) {
|
|
if ("movementX" in event) {
|
|
return event.movementX;
|
|
}
|
|
updateMouseMovementPolyfillState(event);
|
|
return lastMovementX;
|
|
},
|
|
movementY: function(event) {
|
|
if ("movementY" in event) {
|
|
return event.movementY;
|
|
}
|
|
return lastMovementY;
|
|
}
|
|
});
|
|
var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
|
|
var DragEventInterface = _assign({}, MouseEventInterface, {
|
|
dataTransfer: 0
|
|
});
|
|
var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
|
|
var FocusEventInterface = _assign({}, UIEventInterface, {
|
|
relatedTarget: 0
|
|
});
|
|
var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
|
|
var AnimationEventInterface = _assign({}, EventInterface, {
|
|
animationName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
});
|
|
var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
|
|
var ClipboardEventInterface = _assign({}, EventInterface, {
|
|
clipboardData: function(event) {
|
|
return "clipboardData" in event ? event.clipboardData : window.clipboardData;
|
|
}
|
|
});
|
|
var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
|
|
var CompositionEventInterface = _assign({}, EventInterface, {
|
|
data: 0
|
|
});
|
|
var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
|
|
var SyntheticInputEvent = SyntheticCompositionEvent;
|
|
var normalizeKey = {
|
|
Esc: "Escape",
|
|
Spacebar: " ",
|
|
Left: "ArrowLeft",
|
|
Up: "ArrowUp",
|
|
Right: "ArrowRight",
|
|
Down: "ArrowDown",
|
|
Del: "Delete",
|
|
Win: "OS",
|
|
Menu: "ContextMenu",
|
|
Apps: "ContextMenu",
|
|
Scroll: "ScrollLock",
|
|
MozPrintableKey: "Unidentified"
|
|
};
|
|
var translateToKey = {
|
|
"8": "Backspace",
|
|
"9": "Tab",
|
|
"12": "Clear",
|
|
"13": "Enter",
|
|
"16": "Shift",
|
|
"17": "Control",
|
|
"18": "Alt",
|
|
"19": "Pause",
|
|
"20": "CapsLock",
|
|
"27": "Escape",
|
|
"32": " ",
|
|
"33": "PageUp",
|
|
"34": "PageDown",
|
|
"35": "End",
|
|
"36": "Home",
|
|
"37": "ArrowLeft",
|
|
"38": "ArrowUp",
|
|
"39": "ArrowRight",
|
|
"40": "ArrowDown",
|
|
"45": "Insert",
|
|
"46": "Delete",
|
|
"112": "F1",
|
|
"113": "F2",
|
|
"114": "F3",
|
|
"115": "F4",
|
|
"116": "F5",
|
|
"117": "F6",
|
|
"118": "F7",
|
|
"119": "F8",
|
|
"120": "F9",
|
|
"121": "F10",
|
|
"122": "F11",
|
|
"123": "F12",
|
|
"144": "NumLock",
|
|
"145": "ScrollLock",
|
|
"224": "Meta"
|
|
};
|
|
function getEventKey(nativeEvent) {
|
|
if (nativeEvent.key) {
|
|
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
|
if (key !== "Unidentified") {
|
|
return key;
|
|
}
|
|
}
|
|
if (nativeEvent.type === "keypress") {
|
|
var charCode = getEventCharCode(nativeEvent);
|
|
return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
|
|
}
|
|
if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
|
|
return translateToKey[nativeEvent.keyCode] || "Unidentified";
|
|
}
|
|
return "";
|
|
}
|
|
var modifierKeyToProp = {
|
|
Alt: "altKey",
|
|
Control: "ctrlKey",
|
|
Meta: "metaKey",
|
|
Shift: "shiftKey"
|
|
};
|
|
function modifierStateGetter(keyArg) {
|
|
var syntheticEvent = this;
|
|
var nativeEvent = syntheticEvent.nativeEvent;
|
|
if (nativeEvent.getModifierState) {
|
|
return nativeEvent.getModifierState(keyArg);
|
|
}
|
|
var keyProp = modifierKeyToProp[keyArg];
|
|
return keyProp ? !!nativeEvent[keyProp] : false;
|
|
}
|
|
function getEventModifierState(nativeEvent) {
|
|
return modifierStateGetter;
|
|
}
|
|
var KeyboardEventInterface = _assign({}, UIEventInterface, {
|
|
key: getEventKey,
|
|
code: 0,
|
|
location: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
repeat: 0,
|
|
locale: 0,
|
|
getModifierState: getEventModifierState,
|
|
charCode: function(event) {
|
|
if (event.type === "keypress") {
|
|
return getEventCharCode(event);
|
|
}
|
|
return 0;
|
|
},
|
|
keyCode: function(event) {
|
|
if (event.type === "keydown" || event.type === "keyup") {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
},
|
|
which: function(event) {
|
|
if (event.type === "keypress") {
|
|
return getEventCharCode(event);
|
|
}
|
|
if (event.type === "keydown" || event.type === "keyup") {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
}
|
|
});
|
|
var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
|
|
var PointerEventInterface = _assign({}, MouseEventInterface, {
|
|
pointerId: 0,
|
|
width: 0,
|
|
height: 0,
|
|
pressure: 0,
|
|
tangentialPressure: 0,
|
|
tiltX: 0,
|
|
tiltY: 0,
|
|
twist: 0,
|
|
pointerType: 0,
|
|
isPrimary: 0
|
|
});
|
|
var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
|
|
var TouchEventInterface = _assign({}, UIEventInterface, {
|
|
touches: 0,
|
|
targetTouches: 0,
|
|
changedTouches: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
getModifierState: getEventModifierState
|
|
});
|
|
var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
|
|
var TransitionEventInterface = _assign({}, EventInterface, {
|
|
propertyName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
});
|
|
var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
|
|
var WheelEventInterface = _assign({}, MouseEventInterface, {
|
|
deltaX: function(event) {
|
|
return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
|
|
},
|
|
deltaY: function(event) {
|
|
return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
|
|
},
|
|
deltaZ: 0,
|
|
deltaMode: 0
|
|
});
|
|
var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
|
|
var END_KEYCODES = [9, 13, 27, 32];
|
|
var START_KEYCODE = 229;
|
|
var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
|
|
var documentMode = null;
|
|
if (canUseDOM && "documentMode" in document) {
|
|
documentMode = document.documentMode;
|
|
}
|
|
var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
|
|
var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
|
var SPACEBAR_CODE = 32;
|
|
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
|
function registerEvents() {
|
|
registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
|
|
registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
}
|
|
var hasSpaceKeypress = false;
|
|
function isKeypressCommand(nativeEvent) {
|
|
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
|
}
|
|
function getCompositionEventType(domEventName) {
|
|
switch (domEventName) {
|
|
case "compositionstart":
|
|
return "onCompositionStart";
|
|
case "compositionend":
|
|
return "onCompositionEnd";
|
|
case "compositionupdate":
|
|
return "onCompositionUpdate";
|
|
}
|
|
}
|
|
function isFallbackCompositionStart(domEventName, nativeEvent) {
|
|
return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
|
|
}
|
|
function isFallbackCompositionEnd(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "keyup":
|
|
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
|
case "keydown":
|
|
return nativeEvent.keyCode !== START_KEYCODE;
|
|
case "keypress":
|
|
case "mousedown":
|
|
case "focusout":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function getDataFromCustomEvent(nativeEvent) {
|
|
var detail = nativeEvent.detail;
|
|
if (typeof detail === "object" && "data" in detail) {
|
|
return detail.data;
|
|
}
|
|
return null;
|
|
}
|
|
function isUsingKoreanIME(nativeEvent) {
|
|
return nativeEvent.locale === "ko";
|
|
}
|
|
var isComposing = false;
|
|
function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
|
|
var eventType;
|
|
var fallbackData;
|
|
if (canUseCompositionEvent) {
|
|
eventType = getCompositionEventType(domEventName);
|
|
} else if (!isComposing) {
|
|
if (isFallbackCompositionStart(domEventName, nativeEvent)) {
|
|
eventType = "onCompositionStart";
|
|
}
|
|
} else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
|
|
eventType = "onCompositionEnd";
|
|
}
|
|
if (!eventType) {
|
|
return null;
|
|
}
|
|
if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
|
|
if (!isComposing && eventType === "onCompositionStart") {
|
|
isComposing = initialize(nativeEventTarget);
|
|
} else if (eventType === "onCompositionEnd") {
|
|
if (isComposing) {
|
|
fallbackData = getData();
|
|
}
|
|
}
|
|
}
|
|
var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
if (fallbackData) {
|
|
event.data = fallbackData;
|
|
} else {
|
|
var customData = getDataFromCustomEvent(nativeEvent);
|
|
if (customData !== null) {
|
|
event.data = customData;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getNativeBeforeInputChars(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "compositionend":
|
|
return getDataFromCustomEvent(nativeEvent);
|
|
case "keypress":
|
|
var which = nativeEvent.which;
|
|
if (which !== SPACEBAR_CODE) {
|
|
return null;
|
|
}
|
|
hasSpaceKeypress = true;
|
|
return SPACEBAR_CHAR;
|
|
case "textInput":
|
|
var chars = nativeEvent.data;
|
|
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
|
return null;
|
|
}
|
|
return chars;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function getFallbackBeforeInputChars(domEventName, nativeEvent) {
|
|
if (isComposing) {
|
|
if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
|
|
var chars = getData();
|
|
reset();
|
|
isComposing = false;
|
|
return chars;
|
|
}
|
|
return null;
|
|
}
|
|
switch (domEventName) {
|
|
case "paste":
|
|
return null;
|
|
case "keypress":
|
|
if (!isKeypressCommand(nativeEvent)) {
|
|
if (nativeEvent.char && nativeEvent.char.length > 1) {
|
|
return nativeEvent.char;
|
|
} else if (nativeEvent.which) {
|
|
return String.fromCharCode(nativeEvent.which);
|
|
}
|
|
}
|
|
return null;
|
|
case "compositionend":
|
|
return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
|
|
var chars;
|
|
if (canUseTextInputEvent) {
|
|
chars = getNativeBeforeInputChars(domEventName, nativeEvent);
|
|
} else {
|
|
chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
|
|
}
|
|
if (!chars) {
|
|
return null;
|
|
}
|
|
var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
event.data = chars;
|
|
}
|
|
}
|
|
function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
}
|
|
var supportedInputTypes = {
|
|
color: true,
|
|
date: true,
|
|
datetime: true,
|
|
"datetime-local": true,
|
|
email: true,
|
|
month: true,
|
|
number: true,
|
|
password: true,
|
|
range: true,
|
|
search: true,
|
|
tel: true,
|
|
text: true,
|
|
time: true,
|
|
url: true,
|
|
week: true
|
|
};
|
|
function isTextInputElement(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
if (nodeName === "input") {
|
|
return !!supportedInputTypes[elem.type];
|
|
}
|
|
if (nodeName === "textarea") {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function isEventSupported(eventNameSuffix) {
|
|
if (!canUseDOM) {
|
|
return false;
|
|
}
|
|
var eventName = "on" + eventNameSuffix;
|
|
var isSupported = eventName in document;
|
|
if (!isSupported) {
|
|
var element = document.createElement("div");
|
|
element.setAttribute(eventName, "return;");
|
|
isSupported = typeof element[eventName] === "function";
|
|
}
|
|
return isSupported;
|
|
}
|
|
function registerEvents$1() {
|
|
registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
|
|
}
|
|
function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
|
|
enqueueStateRestore(target);
|
|
var listeners = accumulateTwoPhaseListeners(inst, "onChange");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
}
|
|
}
|
|
var activeElement = null;
|
|
var activeElementInst = null;
|
|
function shouldUseChangeEvent(elem) {
|
|
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName === "select" || nodeName === "input" && elem.type === "file";
|
|
}
|
|
function manualDispatchChangeEvent(nativeEvent) {
|
|
var dispatchQueue = [];
|
|
createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
|
|
batchedUpdates(runEventInBatch, dispatchQueue);
|
|
}
|
|
function runEventInBatch(dispatchQueue) {
|
|
processDispatchQueue(dispatchQueue, 0);
|
|
}
|
|
function getInstIfValueChanged(targetInst) {
|
|
var targetNode = getNodeFromInstance(targetInst);
|
|
if (updateValueIfChanged(targetNode)) {
|
|
return targetInst;
|
|
}
|
|
}
|
|
function getTargetInstForChangeEvent(domEventName, targetInst) {
|
|
if (domEventName === "change") {
|
|
return targetInst;
|
|
}
|
|
}
|
|
var isInputEventSupported = false;
|
|
if (canUseDOM) {
|
|
isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
|
|
}
|
|
function startWatchingForValueChange(target, targetInst) {
|
|
activeElement = target;
|
|
activeElementInst = targetInst;
|
|
activeElement.attachEvent("onpropertychange", handlePropertyChange);
|
|
}
|
|
function stopWatchingForValueChange() {
|
|
if (!activeElement) {
|
|
return;
|
|
}
|
|
activeElement.detachEvent("onpropertychange", handlePropertyChange);
|
|
activeElement = null;
|
|
activeElementInst = null;
|
|
}
|
|
function handlePropertyChange(nativeEvent) {
|
|
if (nativeEvent.propertyName !== "value") {
|
|
return;
|
|
}
|
|
if (getInstIfValueChanged(activeElementInst)) {
|
|
manualDispatchChangeEvent(nativeEvent);
|
|
}
|
|
}
|
|
function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
|
|
if (domEventName === "focusin") {
|
|
stopWatchingForValueChange();
|
|
startWatchingForValueChange(target, targetInst);
|
|
} else if (domEventName === "focusout") {
|
|
stopWatchingForValueChange();
|
|
}
|
|
}
|
|
function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
|
|
if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
|
|
return getInstIfValueChanged(activeElementInst);
|
|
}
|
|
}
|
|
function shouldUseClickEvent(elem) {
|
|
var nodeName = elem.nodeName;
|
|
return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
|
|
}
|
|
function getTargetInstForClickEvent(domEventName, targetInst) {
|
|
if (domEventName === "click") {
|
|
return getInstIfValueChanged(targetInst);
|
|
}
|
|
}
|
|
function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
|
|
if (domEventName === "input" || domEventName === "change") {
|
|
return getInstIfValueChanged(targetInst);
|
|
}
|
|
}
|
|
function handleControlledInputBlur(node) {
|
|
var state = node._wrapperState;
|
|
if (!state || !state.controlled || node.type !== "number") {
|
|
return;
|
|
}
|
|
{
|
|
setDefaultValue(node, "number", node.value);
|
|
}
|
|
}
|
|
function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
var getTargetInstFunc, handleEventFunc;
|
|
if (shouldUseChangeEvent(targetNode)) {
|
|
getTargetInstFunc = getTargetInstForChangeEvent;
|
|
} else if (isTextInputElement(targetNode)) {
|
|
if (isInputEventSupported) {
|
|
getTargetInstFunc = getTargetInstForInputOrChangeEvent;
|
|
} else {
|
|
getTargetInstFunc = getTargetInstForInputEventPolyfill;
|
|
handleEventFunc = handleEventsForInputEventPolyfill;
|
|
}
|
|
} else if (shouldUseClickEvent(targetNode)) {
|
|
getTargetInstFunc = getTargetInstForClickEvent;
|
|
}
|
|
if (getTargetInstFunc) {
|
|
var inst = getTargetInstFunc(domEventName, targetInst);
|
|
if (inst) {
|
|
createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
|
|
return;
|
|
}
|
|
}
|
|
if (handleEventFunc) {
|
|
handleEventFunc(domEventName, targetNode, targetInst);
|
|
}
|
|
if (domEventName === "focusout") {
|
|
handleControlledInputBlur(targetNode);
|
|
}
|
|
}
|
|
function registerEvents$2() {
|
|
registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
|
|
registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
|
|
}
|
|
function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
|
|
var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
|
|
if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {
|
|
var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
|
|
if (related) {
|
|
if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
if (!isOutEvent && !isOverEvent) {
|
|
return;
|
|
}
|
|
var win;
|
|
if (nativeEventTarget.window === nativeEventTarget) {
|
|
win = nativeEventTarget;
|
|
} else {
|
|
var doc = nativeEventTarget.ownerDocument;
|
|
if (doc) {
|
|
win = doc.defaultView || doc.parentWindow;
|
|
} else {
|
|
win = window;
|
|
}
|
|
}
|
|
var from;
|
|
var to;
|
|
if (isOutEvent) {
|
|
var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
|
|
from = targetInst;
|
|
to = _related ? getClosestInstanceFromNode(_related) : null;
|
|
if (to !== null) {
|
|
var nearestMounted = getNearestMountedFiber(to);
|
|
if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
|
|
to = null;
|
|
}
|
|
}
|
|
} else {
|
|
from = null;
|
|
to = targetInst;
|
|
}
|
|
if (from === to) {
|
|
return;
|
|
}
|
|
var SyntheticEventCtor = SyntheticMouseEvent;
|
|
var leaveEventType = "onMouseLeave";
|
|
var enterEventType = "onMouseEnter";
|
|
var eventTypePrefix = "mouse";
|
|
if (domEventName === "pointerout" || domEventName === "pointerover") {
|
|
SyntheticEventCtor = SyntheticPointerEvent;
|
|
leaveEventType = "onPointerLeave";
|
|
enterEventType = "onPointerEnter";
|
|
eventTypePrefix = "pointer";
|
|
}
|
|
var fromNode = from == null ? win : getNodeFromInstance(from);
|
|
var toNode = to == null ? win : getNodeFromInstance(to);
|
|
var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
|
|
leave.target = fromNode;
|
|
leave.relatedTarget = toNode;
|
|
var enter = null;
|
|
var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
|
|
if (nativeTargetInst === targetInst) {
|
|
var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
|
|
enterEvent.target = toNode;
|
|
enterEvent.relatedTarget = fromNode;
|
|
enter = enterEvent;
|
|
}
|
|
accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
|
|
}
|
|
function is(x, y) {
|
|
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
}
|
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
function shallowEqual(objA, objB) {
|
|
if (objectIs(objA, objB)) {
|
|
return true;
|
|
}
|
|
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
return false;
|
|
}
|
|
var keysA = Object.keys(objA);
|
|
var keysB = Object.keys(objB);
|
|
if (keysA.length !== keysB.length) {
|
|
return false;
|
|
}
|
|
for (var i = 0; i < keysA.length; i++) {
|
|
if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function getLeafNode(node) {
|
|
while (node && node.firstChild) {
|
|
node = node.firstChild;
|
|
}
|
|
return node;
|
|
}
|
|
function getSiblingNode(node) {
|
|
while (node) {
|
|
if (node.nextSibling) {
|
|
return node.nextSibling;
|
|
}
|
|
node = node.parentNode;
|
|
}
|
|
}
|
|
function getNodeForCharacterOffset(root2, offset) {
|
|
var node = getLeafNode(root2);
|
|
var nodeStart = 0;
|
|
var nodeEnd = 0;
|
|
while (node) {
|
|
if (node.nodeType === TEXT_NODE) {
|
|
nodeEnd = nodeStart + node.textContent.length;
|
|
if (nodeStart <= offset && nodeEnd >= offset) {
|
|
return {
|
|
node,
|
|
offset: offset - nodeStart
|
|
};
|
|
}
|
|
nodeStart = nodeEnd;
|
|
}
|
|
node = getLeafNode(getSiblingNode(node));
|
|
}
|
|
}
|
|
function getOffsets(outerNode) {
|
|
var ownerDocument = outerNode.ownerDocument;
|
|
var win = ownerDocument && ownerDocument.defaultView || window;
|
|
var selection = win.getSelection && win.getSelection();
|
|
if (!selection || selection.rangeCount === 0) {
|
|
return null;
|
|
}
|
|
var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
|
|
try {
|
|
anchorNode.nodeType;
|
|
focusNode.nodeType;
|
|
} catch (e) {
|
|
return null;
|
|
}
|
|
return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
|
|
}
|
|
function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
|
|
var length = 0;
|
|
var start = -1;
|
|
var end = -1;
|
|
var indexWithinAnchor = 0;
|
|
var indexWithinFocus = 0;
|
|
var node = outerNode;
|
|
var parentNode = null;
|
|
outer:
|
|
while (true) {
|
|
var next = null;
|
|
while (true) {
|
|
if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
|
|
start = length + anchorOffset;
|
|
}
|
|
if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
|
|
end = length + focusOffset;
|
|
}
|
|
if (node.nodeType === TEXT_NODE) {
|
|
length += node.nodeValue.length;
|
|
}
|
|
if ((next = node.firstChild) === null) {
|
|
break;
|
|
}
|
|
parentNode = node;
|
|
node = next;
|
|
}
|
|
while (true) {
|
|
if (node === outerNode) {
|
|
break outer;
|
|
}
|
|
if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
|
|
start = length;
|
|
}
|
|
if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
|
|
end = length;
|
|
}
|
|
if ((next = node.nextSibling) !== null) {
|
|
break;
|
|
}
|
|
node = parentNode;
|
|
parentNode = node.parentNode;
|
|
}
|
|
node = next;
|
|
}
|
|
if (start === -1 || end === -1) {
|
|
return null;
|
|
}
|
|
return {
|
|
start,
|
|
end
|
|
};
|
|
}
|
|
function setOffsets(node, offsets) {
|
|
var doc = node.ownerDocument || document;
|
|
var win = doc && doc.defaultView || window;
|
|
if (!win.getSelection) {
|
|
return;
|
|
}
|
|
var selection = win.getSelection();
|
|
var length = node.textContent.length;
|
|
var start = Math.min(offsets.start, length);
|
|
var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
|
|
if (!selection.extend && start > end) {
|
|
var temp = end;
|
|
end = start;
|
|
start = temp;
|
|
}
|
|
var startMarker = getNodeForCharacterOffset(node, start);
|
|
var endMarker = getNodeForCharacterOffset(node, end);
|
|
if (startMarker && endMarker) {
|
|
if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
|
|
return;
|
|
}
|
|
var range = doc.createRange();
|
|
range.setStart(startMarker.node, startMarker.offset);
|
|
selection.removeAllRanges();
|
|
if (start > end) {
|
|
selection.addRange(range);
|
|
selection.extend(endMarker.node, endMarker.offset);
|
|
} else {
|
|
range.setEnd(endMarker.node, endMarker.offset);
|
|
selection.addRange(range);
|
|
}
|
|
}
|
|
}
|
|
function isTextNode(node) {
|
|
return node && node.nodeType === TEXT_NODE;
|
|
}
|
|
function containsNode(outerNode, innerNode) {
|
|
if (!outerNode || !innerNode) {
|
|
return false;
|
|
} else if (outerNode === innerNode) {
|
|
return true;
|
|
} else if (isTextNode(outerNode)) {
|
|
return false;
|
|
} else if (isTextNode(innerNode)) {
|
|
return containsNode(outerNode, innerNode.parentNode);
|
|
} else if ("contains" in outerNode) {
|
|
return outerNode.contains(innerNode);
|
|
} else if (outerNode.compareDocumentPosition) {
|
|
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function isInDocument(node) {
|
|
return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
|
|
}
|
|
function isSameOriginFrame(iframe) {
|
|
try {
|
|
return typeof iframe.contentWindow.location.href === "string";
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|
|
function getActiveElementDeep() {
|
|
var win = window;
|
|
var element = getActiveElement();
|
|
while (element instanceof win.HTMLIFrameElement) {
|
|
if (isSameOriginFrame(element)) {
|
|
win = element.contentWindow;
|
|
} else {
|
|
return element;
|
|
}
|
|
element = getActiveElement(win.document);
|
|
}
|
|
return element;
|
|
}
|
|
function hasSelectionCapabilities(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
|
|
}
|
|
function getSelectionInformation() {
|
|
var focusedElem = getActiveElementDeep();
|
|
return {
|
|
focusedElem,
|
|
selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
|
|
};
|
|
}
|
|
function restoreSelection(priorSelectionInformation) {
|
|
var curFocusedElem = getActiveElementDeep();
|
|
var priorFocusedElem = priorSelectionInformation.focusedElem;
|
|
var priorSelectionRange = priorSelectionInformation.selectionRange;
|
|
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
|
if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
|
|
setSelection(priorFocusedElem, priorSelectionRange);
|
|
}
|
|
var ancestors = [];
|
|
var ancestor = priorFocusedElem;
|
|
while (ancestor = ancestor.parentNode) {
|
|
if (ancestor.nodeType === ELEMENT_NODE) {
|
|
ancestors.push({
|
|
element: ancestor,
|
|
left: ancestor.scrollLeft,
|
|
top: ancestor.scrollTop
|
|
});
|
|
}
|
|
}
|
|
if (typeof priorFocusedElem.focus === "function") {
|
|
priorFocusedElem.focus();
|
|
}
|
|
for (var i = 0; i < ancestors.length; i++) {
|
|
var info = ancestors[i];
|
|
info.element.scrollLeft = info.left;
|
|
info.element.scrollTop = info.top;
|
|
}
|
|
}
|
|
}
|
|
function getSelection(input) {
|
|
var selection;
|
|
if ("selectionStart" in input) {
|
|
selection = {
|
|
start: input.selectionStart,
|
|
end: input.selectionEnd
|
|
};
|
|
} else {
|
|
selection = getOffsets(input);
|
|
}
|
|
return selection || {
|
|
start: 0,
|
|
end: 0
|
|
};
|
|
}
|
|
function setSelection(input, offsets) {
|
|
var start = offsets.start;
|
|
var end = offsets.end;
|
|
if (end === void 0) {
|
|
end = start;
|
|
}
|
|
if ("selectionStart" in input) {
|
|
input.selectionStart = start;
|
|
input.selectionEnd = Math.min(end, input.value.length);
|
|
} else {
|
|
setOffsets(input, offsets);
|
|
}
|
|
}
|
|
var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
|
|
function registerEvents$3() {
|
|
registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
|
|
}
|
|
var activeElement$1 = null;
|
|
var activeElementInst$1 = null;
|
|
var lastSelection = null;
|
|
var mouseDown = false;
|
|
function getSelection$1(node) {
|
|
if ("selectionStart" in node && hasSelectionCapabilities(node)) {
|
|
return {
|
|
start: node.selectionStart,
|
|
end: node.selectionEnd
|
|
};
|
|
} else {
|
|
var win = node.ownerDocument && node.ownerDocument.defaultView || window;
|
|
var selection = win.getSelection();
|
|
return {
|
|
anchorNode: selection.anchorNode,
|
|
anchorOffset: selection.anchorOffset,
|
|
focusNode: selection.focusNode,
|
|
focusOffset: selection.focusOffset
|
|
};
|
|
}
|
|
}
|
|
function getEventTargetDocument(eventTarget) {
|
|
return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
|
|
}
|
|
function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
|
|
var doc = getEventTargetDocument(nativeEventTarget);
|
|
if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
|
|
return;
|
|
}
|
|
var currentSelection = getSelection$1(activeElement$1);
|
|
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
|
lastSelection = currentSelection;
|
|
var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
event.target = activeElement$1;
|
|
}
|
|
}
|
|
}
|
|
function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
|
|
activeElement$1 = targetNode;
|
|
activeElementInst$1 = targetInst;
|
|
lastSelection = null;
|
|
}
|
|
break;
|
|
case "focusout":
|
|
activeElement$1 = null;
|
|
activeElementInst$1 = null;
|
|
lastSelection = null;
|
|
break;
|
|
case "mousedown":
|
|
mouseDown = true;
|
|
break;
|
|
case "contextmenu":
|
|
case "mouseup":
|
|
case "dragend":
|
|
mouseDown = false;
|
|
constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
|
|
break;
|
|
case "selectionchange":
|
|
if (skipSelectionChangeEvent) {
|
|
break;
|
|
}
|
|
case "keydown":
|
|
case "keyup":
|
|
constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
|
|
}
|
|
}
|
|
function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var reactName = topLevelEventsToReactNames.get(domEventName);
|
|
if (reactName === void 0) {
|
|
return;
|
|
}
|
|
var SyntheticEventCtor = SyntheticEvent;
|
|
var reactEventType = domEventName;
|
|
switch (domEventName) {
|
|
case "keypress":
|
|
if (getEventCharCode(nativeEvent) === 0) {
|
|
return;
|
|
}
|
|
case "keydown":
|
|
case "keyup":
|
|
SyntheticEventCtor = SyntheticKeyboardEvent;
|
|
break;
|
|
case "focusin":
|
|
reactEventType = "focus";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "focusout":
|
|
reactEventType = "blur";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "beforeblur":
|
|
case "afterblur":
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "click":
|
|
if (nativeEvent.button === 2) {
|
|
return;
|
|
}
|
|
case "auxclick":
|
|
case "dblclick":
|
|
case "mousedown":
|
|
case "mousemove":
|
|
case "mouseup":
|
|
case "mouseout":
|
|
case "mouseover":
|
|
case "contextmenu":
|
|
SyntheticEventCtor = SyntheticMouseEvent;
|
|
break;
|
|
case "drag":
|
|
case "dragend":
|
|
case "dragenter":
|
|
case "dragexit":
|
|
case "dragleave":
|
|
case "dragover":
|
|
case "dragstart":
|
|
case "drop":
|
|
SyntheticEventCtor = SyntheticDragEvent;
|
|
break;
|
|
case "touchcancel":
|
|
case "touchend":
|
|
case "touchmove":
|
|
case "touchstart":
|
|
SyntheticEventCtor = SyntheticTouchEvent;
|
|
break;
|
|
case ANIMATION_END:
|
|
case ANIMATION_ITERATION:
|
|
case ANIMATION_START:
|
|
SyntheticEventCtor = SyntheticAnimationEvent;
|
|
break;
|
|
case TRANSITION_END:
|
|
SyntheticEventCtor = SyntheticTransitionEvent;
|
|
break;
|
|
case "scroll":
|
|
SyntheticEventCtor = SyntheticUIEvent;
|
|
break;
|
|
case "wheel":
|
|
SyntheticEventCtor = SyntheticWheelEvent;
|
|
break;
|
|
case "copy":
|
|
case "cut":
|
|
case "paste":
|
|
SyntheticEventCtor = SyntheticClipboardEvent;
|
|
break;
|
|
case "gotpointercapture":
|
|
case "lostpointercapture":
|
|
case "pointercancel":
|
|
case "pointerdown":
|
|
case "pointermove":
|
|
case "pointerout":
|
|
case "pointerover":
|
|
case "pointerup":
|
|
SyntheticEventCtor = SyntheticPointerEvent;
|
|
break;
|
|
}
|
|
var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
|
|
{
|
|
var accumulateTargetOnly = !inCapturePhase && domEventName === "scroll";
|
|
var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
|
|
if (_listeners.length > 0) {
|
|
var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event: _event,
|
|
listeners: _listeners
|
|
});
|
|
}
|
|
}
|
|
}
|
|
registerSimpleEvents();
|
|
registerEvents$2();
|
|
registerEvents$1();
|
|
registerEvents$3();
|
|
registerEvents();
|
|
function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
|
|
var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
|
|
if (shouldProcessPolyfillPlugins) {
|
|
extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
|
|
extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
}
|
|
}
|
|
var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
|
|
var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
|
|
function executeDispatch(event, listener, currentTarget) {
|
|
var type = event.type || "unknown-event";
|
|
event.currentTarget = currentTarget;
|
|
invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
|
|
event.currentTarget = null;
|
|
}
|
|
function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
|
|
var previousInstance;
|
|
if (inCapturePhase) {
|
|
for (var i = dispatchListeners.length - 1; i >= 0; i--) {
|
|
var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
|
|
if (instance !== previousInstance && event.isPropagationStopped()) {
|
|
return;
|
|
}
|
|
executeDispatch(event, listener, currentTarget);
|
|
previousInstance = instance;
|
|
}
|
|
} else {
|
|
for (var _i = 0; _i < dispatchListeners.length; _i++) {
|
|
var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
|
|
if (_instance !== previousInstance && event.isPropagationStopped()) {
|
|
return;
|
|
}
|
|
executeDispatch(event, _listener, _currentTarget);
|
|
previousInstance = _instance;
|
|
}
|
|
}
|
|
}
|
|
function processDispatchQueue(dispatchQueue, eventSystemFlags) {
|
|
var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
|
|
for (var i = 0; i < dispatchQueue.length; i++) {
|
|
var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
|
|
processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
|
|
}
|
|
rethrowCaughtError();
|
|
}
|
|
function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
|
|
var nativeEventTarget = getEventTarget(nativeEvent);
|
|
var dispatchQueue = [];
|
|
extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
|
|
processDispatchQueue(dispatchQueue, eventSystemFlags);
|
|
}
|
|
function listenToNonDelegatedEvent(domEventName, targetElement) {
|
|
var isCapturePhaseListener = false;
|
|
var listenerSet = getEventListenerSet(targetElement);
|
|
var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
|
|
if (!listenerSet.has(listenerSetKey)) {
|
|
addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
|
|
listenerSet.add(listenerSetKey);
|
|
}
|
|
}
|
|
var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
|
|
function listenToAllSupportedEvents(rootContainerElement) {
|
|
{
|
|
if (rootContainerElement[listeningMarker]) {
|
|
return;
|
|
}
|
|
rootContainerElement[listeningMarker] = true;
|
|
allNativeEvents.forEach(function(domEventName) {
|
|
if (!nonDelegatedEvents.has(domEventName)) {
|
|
listenToNativeEvent(domEventName, false, rootContainerElement, null);
|
|
}
|
|
listenToNativeEvent(domEventName, true, rootContainerElement, null);
|
|
});
|
|
}
|
|
}
|
|
function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
|
|
var eventSystemFlags = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
|
|
var target = rootContainerElement;
|
|
if (domEventName === "selectionchange" && rootContainerElement.nodeType !== DOCUMENT_NODE) {
|
|
target = rootContainerElement.ownerDocument;
|
|
}
|
|
if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {
|
|
if (domEventName !== "scroll") {
|
|
return;
|
|
}
|
|
eventSystemFlags |= IS_NON_DELEGATED;
|
|
target = targetElement;
|
|
}
|
|
var listenerSet = getEventListenerSet(target);
|
|
var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
|
|
if (!listenerSet.has(listenerSetKey)) {
|
|
if (isCapturePhaseListener) {
|
|
eventSystemFlags |= IS_CAPTURE_PHASE;
|
|
}
|
|
addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
|
|
listenerSet.add(listenerSetKey);
|
|
}
|
|
}
|
|
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
|
|
var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
|
|
var isPassiveListener = void 0;
|
|
if (passiveBrowserEventsSupported) {
|
|
if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
|
|
isPassiveListener = true;
|
|
}
|
|
}
|
|
targetContainer = targetContainer;
|
|
var unsubscribeListener;
|
|
if (isCapturePhaseListener) {
|
|
if (isPassiveListener !== void 0) {
|
|
unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
|
|
} else {
|
|
unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
|
|
}
|
|
} else {
|
|
if (isPassiveListener !== void 0) {
|
|
unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
|
|
} else {
|
|
unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
|
|
}
|
|
}
|
|
}
|
|
function isMatchingRootContainer(grandContainer, targetContainer) {
|
|
return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
|
|
}
|
|
function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
|
|
var ancestorInst = targetInst;
|
|
if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
|
|
var targetContainerNode = targetContainer;
|
|
if (targetInst !== null) {
|
|
var node = targetInst;
|
|
mainLoop:
|
|
while (true) {
|
|
if (node === null) {
|
|
return;
|
|
}
|
|
var nodeTag = node.tag;
|
|
if (nodeTag === HostRoot || nodeTag === HostPortal) {
|
|
var container = node.stateNode.containerInfo;
|
|
if (isMatchingRootContainer(container, targetContainerNode)) {
|
|
break;
|
|
}
|
|
if (nodeTag === HostPortal) {
|
|
var grandNode = node.return;
|
|
while (grandNode !== null) {
|
|
var grandTag = grandNode.tag;
|
|
if (grandTag === HostRoot || grandTag === HostPortal) {
|
|
var grandContainer = grandNode.stateNode.containerInfo;
|
|
if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
|
|
return;
|
|
}
|
|
}
|
|
grandNode = grandNode.return;
|
|
}
|
|
}
|
|
while (container !== null) {
|
|
var parentNode = getClosestInstanceFromNode(container);
|
|
if (parentNode === null) {
|
|
return;
|
|
}
|
|
var parentTag = parentNode.tag;
|
|
if (parentTag === HostComponent || parentTag === HostText) {
|
|
node = ancestorInst = parentNode;
|
|
continue mainLoop;
|
|
}
|
|
container = container.parentNode;
|
|
}
|
|
}
|
|
node = node.return;
|
|
}
|
|
}
|
|
}
|
|
batchedEventUpdates(function() {
|
|
return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
|
|
});
|
|
}
|
|
function createDispatchListener(instance, listener, currentTarget) {
|
|
return {
|
|
instance,
|
|
listener,
|
|
currentTarget
|
|
};
|
|
}
|
|
function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
|
|
var captureName = reactName !== null ? reactName + "Capture" : null;
|
|
var reactEventName = inCapturePhase ? captureName : reactName;
|
|
var listeners = [];
|
|
var instance = targetFiber;
|
|
var lastHostComponent = null;
|
|
while (instance !== null) {
|
|
var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
lastHostComponent = stateNode;
|
|
if (reactEventName !== null) {
|
|
var listener = getListener(instance, reactEventName);
|
|
if (listener != null) {
|
|
listeners.push(createDispatchListener(instance, listener, lastHostComponent));
|
|
}
|
|
}
|
|
}
|
|
if (accumulateTargetOnly) {
|
|
break;
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
return listeners;
|
|
}
|
|
function accumulateTwoPhaseListeners(targetFiber, reactName) {
|
|
var captureName = reactName + "Capture";
|
|
var listeners = [];
|
|
var instance = targetFiber;
|
|
while (instance !== null) {
|
|
var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
var currentTarget = stateNode;
|
|
var captureListener = getListener(instance, captureName);
|
|
if (captureListener != null) {
|
|
listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
|
|
}
|
|
var bubbleListener = getListener(instance, reactName);
|
|
if (bubbleListener != null) {
|
|
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
}
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
return listeners;
|
|
}
|
|
function getParent(inst) {
|
|
if (inst === null) {
|
|
return null;
|
|
}
|
|
do {
|
|
inst = inst.return;
|
|
} while (inst && inst.tag !== HostComponent);
|
|
if (inst) {
|
|
return inst;
|
|
}
|
|
return null;
|
|
}
|
|
function getLowestCommonAncestor(instA, instB) {
|
|
var nodeA = instA;
|
|
var nodeB = instB;
|
|
var depthA = 0;
|
|
for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
|
|
depthA++;
|
|
}
|
|
var depthB = 0;
|
|
for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
|
|
depthB++;
|
|
}
|
|
while (depthA - depthB > 0) {
|
|
nodeA = getParent(nodeA);
|
|
depthA--;
|
|
}
|
|
while (depthB - depthA > 0) {
|
|
nodeB = getParent(nodeB);
|
|
depthB--;
|
|
}
|
|
var depth = depthA;
|
|
while (depth--) {
|
|
if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
|
|
return nodeA;
|
|
}
|
|
nodeA = getParent(nodeA);
|
|
nodeB = getParent(nodeB);
|
|
}
|
|
return null;
|
|
}
|
|
function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
|
|
var registrationName = event._reactName;
|
|
var listeners = [];
|
|
var instance = target;
|
|
while (instance !== null) {
|
|
if (instance === common) {
|
|
break;
|
|
}
|
|
var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
|
|
if (alternate !== null && alternate === common) {
|
|
break;
|
|
}
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
var currentTarget = stateNode;
|
|
if (inCapturePhase) {
|
|
var captureListener = getListener(instance, registrationName);
|
|
if (captureListener != null) {
|
|
listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
|
|
}
|
|
} else if (!inCapturePhase) {
|
|
var bubbleListener = getListener(instance, registrationName);
|
|
if (bubbleListener != null) {
|
|
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
}
|
|
}
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
if (listeners.length !== 0) {
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
}
|
|
}
|
|
function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
|
|
var common = from && to ? getLowestCommonAncestor(from, to) : null;
|
|
if (from !== null) {
|
|
accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
|
|
}
|
|
if (to !== null && enterEvent !== null) {
|
|
accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
|
|
}
|
|
}
|
|
function getListenerSetKey(domEventName, capture) {
|
|
return domEventName + "__" + (capture ? "capture" : "bubble");
|
|
}
|
|
var didWarnInvalidHydration = false;
|
|
var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
|
|
var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
|
|
var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
|
|
var AUTOFOCUS = "autoFocus";
|
|
var CHILDREN = "children";
|
|
var STYLE = "style";
|
|
var HTML$1 = "__html";
|
|
var HTML_NAMESPACE$1 = Namespaces.html;
|
|
var warnedUnknownTags;
|
|
var suppressHydrationWarning;
|
|
var validatePropertiesInDevelopment;
|
|
var warnForTextDifference;
|
|
var warnForPropDifference;
|
|
var warnForExtraAttributes;
|
|
var warnForInvalidEventListener;
|
|
var canDiffStyleForHydrationWarning;
|
|
var normalizeMarkupForTextOrAttribute;
|
|
var normalizeHTML;
|
|
{
|
|
warnedUnknownTags = {
|
|
dialog: true,
|
|
webview: true
|
|
};
|
|
validatePropertiesInDevelopment = function(type, props) {
|
|
validateProperties(type, props);
|
|
validateProperties$1(type, props);
|
|
validateProperties$2(type, props, {
|
|
registrationNameDependencies,
|
|
possibleRegistrationNames
|
|
});
|
|
};
|
|
canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
|
|
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
|
|
var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
|
|
normalizeMarkupForTextOrAttribute = function(markup) {
|
|
var markupString = typeof markup === "string" ? markup : "" + markup;
|
|
return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
|
|
};
|
|
warnForTextDifference = function(serverText, clientText) {
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
|
|
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
|
|
if (normalizedServerText === normalizedClientText) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
|
|
};
|
|
warnForPropDifference = function(propName, serverValue, clientValue) {
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
|
|
var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
|
|
if (normalizedServerValue === normalizedClientValue) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
|
|
};
|
|
warnForExtraAttributes = function(attributeNames) {
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
var names = [];
|
|
attributeNames.forEach(function(name) {
|
|
names.push(name);
|
|
});
|
|
error("Extra attributes from the server: %s", names);
|
|
};
|
|
warnForInvalidEventListener = function(registrationName, listener) {
|
|
if (listener === false) {
|
|
error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
|
|
} else {
|
|
error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
|
|
}
|
|
};
|
|
normalizeHTML = function(parent, html) {
|
|
var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
|
|
testElement.innerHTML = html;
|
|
return testElement.innerHTML;
|
|
};
|
|
}
|
|
function getOwnerDocumentFromRootContainer(rootContainerElement) {
|
|
return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
}
|
|
function noop() {
|
|
}
|
|
function trapClickOnNonInteractiveElement(node) {
|
|
node.onclick = noop;
|
|
}
|
|
function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
|
|
for (var propKey in nextProps) {
|
|
if (!nextProps.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
var nextProp = nextProps[propKey];
|
|
if (propKey === STYLE) {
|
|
{
|
|
if (nextProp) {
|
|
Object.freeze(nextProp);
|
|
}
|
|
}
|
|
setValueForStyles(domElement, nextProp);
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
setInnerHTML(domElement, nextHtml);
|
|
}
|
|
} else if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string") {
|
|
var canSetTextContent = tag !== "textarea" || nextProp !== "";
|
|
if (canSetTextContent) {
|
|
setTextContent(domElement, nextProp);
|
|
}
|
|
} else if (typeof nextProp === "number") {
|
|
setTextContent(domElement, "" + nextProp);
|
|
}
|
|
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (propKey === AUTOFOCUS)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
} else if (nextProp != null) {
|
|
setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
|
|
}
|
|
}
|
|
}
|
|
function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
|
|
for (var i = 0; i < updatePayload.length; i += 2) {
|
|
var propKey = updatePayload[i];
|
|
var propValue = updatePayload[i + 1];
|
|
if (propKey === STYLE) {
|
|
setValueForStyles(domElement, propValue);
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
setInnerHTML(domElement, propValue);
|
|
} else if (propKey === CHILDREN) {
|
|
setTextContent(domElement, propValue);
|
|
} else {
|
|
setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
|
|
}
|
|
}
|
|
}
|
|
function createElement(type, props, rootContainerElement, parentNamespace) {
|
|
var isCustomComponentTag;
|
|
var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
|
|
var domElement;
|
|
var namespaceURI = parentNamespace;
|
|
if (namespaceURI === HTML_NAMESPACE$1) {
|
|
namespaceURI = getIntrinsicNamespace(type);
|
|
}
|
|
if (namespaceURI === HTML_NAMESPACE$1) {
|
|
{
|
|
isCustomComponentTag = isCustomComponent(type, props);
|
|
if (!isCustomComponentTag && type !== type.toLowerCase()) {
|
|
error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
|
|
}
|
|
}
|
|
if (type === "script") {
|
|
var div = ownerDocument.createElement("div");
|
|
div.innerHTML = "<script><\/script>";
|
|
var firstChild = div.firstChild;
|
|
domElement = div.removeChild(firstChild);
|
|
} else if (typeof props.is === "string") {
|
|
domElement = ownerDocument.createElement(type, {
|
|
is: props.is
|
|
});
|
|
} else {
|
|
domElement = ownerDocument.createElement(type);
|
|
if (type === "select") {
|
|
var node = domElement;
|
|
if (props.multiple) {
|
|
node.multiple = true;
|
|
} else if (props.size) {
|
|
node.size = props.size;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
domElement = ownerDocument.createElementNS(namespaceURI, type);
|
|
}
|
|
{
|
|
if (namespaceURI === HTML_NAMESPACE$1) {
|
|
if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
|
|
warnedUnknownTags[type] = true;
|
|
error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
|
|
}
|
|
}
|
|
}
|
|
return domElement;
|
|
}
|
|
function createTextNode(text, rootContainerElement) {
|
|
return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
|
|
}
|
|
function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
|
|
var isCustomComponentTag = isCustomComponent(tag, rawProps);
|
|
{
|
|
validatePropertiesInDevelopment(tag, rawProps);
|
|
}
|
|
var props;
|
|
switch (tag) {
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("cancel", domElement);
|
|
listenToNonDelegatedEvent("close", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
case "embed":
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (var i = 0; i < mediaEventTypes.length; i++) {
|
|
listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
|
|
}
|
|
props = rawProps;
|
|
break;
|
|
case "source":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "img":
|
|
case "image":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "input":
|
|
initWrapperState(domElement, rawProps);
|
|
props = getHostProps(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "option":
|
|
validateProps(domElement, rawProps);
|
|
props = getHostProps$1(domElement, rawProps);
|
|
break;
|
|
case "select":
|
|
initWrapperState$1(domElement, rawProps);
|
|
props = getHostProps$2(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "textarea":
|
|
initWrapperState$2(domElement, rawProps);
|
|
props = getHostProps$3(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
default:
|
|
props = rawProps;
|
|
}
|
|
assertValidProps(tag, props);
|
|
setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
|
|
switch (tag) {
|
|
case "input":
|
|
track(domElement);
|
|
postMountWrapper(domElement, rawProps, false);
|
|
break;
|
|
case "textarea":
|
|
track(domElement);
|
|
postMountWrapper$3(domElement);
|
|
break;
|
|
case "option":
|
|
postMountWrapper$1(domElement, rawProps);
|
|
break;
|
|
case "select":
|
|
postMountWrapper$2(domElement, rawProps);
|
|
break;
|
|
default:
|
|
if (typeof props.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
|
|
{
|
|
validatePropertiesInDevelopment(tag, nextRawProps);
|
|
}
|
|
var updatePayload = null;
|
|
var lastProps;
|
|
var nextProps;
|
|
switch (tag) {
|
|
case "input":
|
|
lastProps = getHostProps(domElement, lastRawProps);
|
|
nextProps = getHostProps(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
case "option":
|
|
lastProps = getHostProps$1(domElement, lastRawProps);
|
|
nextProps = getHostProps$1(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
case "select":
|
|
lastProps = getHostProps$2(domElement, lastRawProps);
|
|
nextProps = getHostProps$2(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
case "textarea":
|
|
lastProps = getHostProps$3(domElement, lastRawProps);
|
|
nextProps = getHostProps$3(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
default:
|
|
lastProps = lastRawProps;
|
|
nextProps = nextRawProps;
|
|
if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
assertValidProps(tag, nextProps);
|
|
var propKey;
|
|
var styleName;
|
|
var styleUpdates = null;
|
|
for (propKey in lastProps) {
|
|
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
var lastStyle = lastProps[propKey];
|
|
for (styleName in lastStyle) {
|
|
if (lastStyle.hasOwnProperty(styleName)) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = "";
|
|
}
|
|
}
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN)
|
|
;
|
|
else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (propKey === AUTOFOCUS)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (!updatePayload) {
|
|
updatePayload = [];
|
|
}
|
|
} else {
|
|
(updatePayload = updatePayload || []).push(propKey, null);
|
|
}
|
|
}
|
|
for (propKey in nextProps) {
|
|
var nextProp = nextProps[propKey];
|
|
var lastProp = lastProps != null ? lastProps[propKey] : void 0;
|
|
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
{
|
|
if (nextProp) {
|
|
Object.freeze(nextProp);
|
|
}
|
|
}
|
|
if (lastProp) {
|
|
for (styleName in lastProp) {
|
|
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = "";
|
|
}
|
|
}
|
|
for (styleName in nextProp) {
|
|
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = nextProp[styleName];
|
|
}
|
|
}
|
|
} else {
|
|
if (!styleUpdates) {
|
|
if (!updatePayload) {
|
|
updatePayload = [];
|
|
}
|
|
updatePayload.push(propKey, styleUpdates);
|
|
}
|
|
styleUpdates = nextProp;
|
|
}
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
if (lastHtml !== nextHtml) {
|
|
(updatePayload = updatePayload || []).push(propKey, nextHtml);
|
|
}
|
|
}
|
|
} else if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string" || typeof nextProp === "number") {
|
|
(updatePayload = updatePayload || []).push(propKey, "" + nextProp);
|
|
}
|
|
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
if (!updatePayload && lastProp !== nextProp) {
|
|
updatePayload = [];
|
|
}
|
|
} else if (typeof nextProp === "object" && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {
|
|
nextProp.toString();
|
|
} else {
|
|
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
|
}
|
|
}
|
|
if (styleUpdates) {
|
|
{
|
|
validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
|
|
}
|
|
(updatePayload = updatePayload || []).push(STYLE, styleUpdates);
|
|
}
|
|
return updatePayload;
|
|
}
|
|
function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
|
|
if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
|
|
updateChecked(domElement, nextRawProps);
|
|
}
|
|
var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
|
|
var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
|
|
updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
|
|
switch (tag) {
|
|
case "input":
|
|
updateWrapper(domElement, nextRawProps);
|
|
break;
|
|
case "textarea":
|
|
updateWrapper$1(domElement, nextRawProps);
|
|
break;
|
|
case "select":
|
|
postUpdateWrapper(domElement, nextRawProps);
|
|
break;
|
|
}
|
|
}
|
|
function getPossibleStandardName(propName) {
|
|
{
|
|
var lowerCasedName = propName.toLowerCase();
|
|
if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
return null;
|
|
}
|
|
return possibleStandardNames[lowerCasedName] || null;
|
|
}
|
|
}
|
|
function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
|
|
var isCustomComponentTag;
|
|
var extraAttributeNames;
|
|
{
|
|
suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
|
|
isCustomComponentTag = isCustomComponent(tag, rawProps);
|
|
validatePropertiesInDevelopment(tag, rawProps);
|
|
}
|
|
switch (tag) {
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("cancel", domElement);
|
|
listenToNonDelegatedEvent("close", domElement);
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
case "embed":
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (var i = 0; i < mediaEventTypes.length; i++) {
|
|
listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
|
|
}
|
|
break;
|
|
case "source":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
break;
|
|
case "img":
|
|
case "image":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
break;
|
|
case "input":
|
|
initWrapperState(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "option":
|
|
validateProps(domElement, rawProps);
|
|
break;
|
|
case "select":
|
|
initWrapperState$1(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "textarea":
|
|
initWrapperState$2(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
}
|
|
assertValidProps(tag, rawProps);
|
|
{
|
|
extraAttributeNames = new Set();
|
|
var attributes = domElement.attributes;
|
|
for (var _i = 0; _i < attributes.length; _i++) {
|
|
var name = attributes[_i].name.toLowerCase();
|
|
switch (name) {
|
|
case "data-reactroot":
|
|
break;
|
|
case "value":
|
|
break;
|
|
case "checked":
|
|
break;
|
|
case "selected":
|
|
break;
|
|
default:
|
|
extraAttributeNames.add(attributes[_i].name);
|
|
}
|
|
}
|
|
}
|
|
var updatePayload = null;
|
|
for (var propKey in rawProps) {
|
|
if (!rawProps.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
var nextProp = rawProps[propKey];
|
|
if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string") {
|
|
if (domElement.textContent !== nextProp) {
|
|
if (!suppressHydrationWarning) {
|
|
warnForTextDifference(domElement.textContent, nextProp);
|
|
}
|
|
updatePayload = [CHILDREN, nextProp];
|
|
}
|
|
} else if (typeof nextProp === "number") {
|
|
if (domElement.textContent !== "" + nextProp) {
|
|
if (!suppressHydrationWarning) {
|
|
warnForTextDifference(domElement.textContent, nextProp);
|
|
}
|
|
updatePayload = [CHILDREN, "" + nextProp];
|
|
}
|
|
}
|
|
} else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
} else if (typeof isCustomComponentTag === "boolean") {
|
|
var serverValue = void 0;
|
|
var propertyInfo = getPropertyInfo(propKey);
|
|
if (suppressHydrationWarning)
|
|
;
|
|
else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || propKey === "value" || propKey === "checked" || propKey === "selected")
|
|
;
|
|
else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var serverHTML = domElement.innerHTML;
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
var expectedHTML = normalizeHTML(domElement, nextHtml);
|
|
if (expectedHTML !== serverHTML) {
|
|
warnForPropDifference(propKey, serverHTML, expectedHTML);
|
|
}
|
|
}
|
|
} else if (propKey === STYLE) {
|
|
extraAttributeNames.delete(propKey);
|
|
if (canDiffStyleForHydrationWarning) {
|
|
var expectedStyle = createDangerousStringForStyles(nextProp);
|
|
serverValue = domElement.getAttribute("style");
|
|
if (expectedStyle !== serverValue) {
|
|
warnForPropDifference(propKey, serverValue, expectedStyle);
|
|
}
|
|
}
|
|
} else if (isCustomComponentTag) {
|
|
extraAttributeNames.delete(propKey.toLowerCase());
|
|
serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
|
if (nextProp !== serverValue) {
|
|
warnForPropDifference(propKey, serverValue, nextProp);
|
|
}
|
|
} else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
|
|
var isMismatchDueToBadCasing = false;
|
|
if (propertyInfo !== null) {
|
|
extraAttributeNames.delete(propertyInfo.attributeName);
|
|
serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
|
|
} else {
|
|
var ownNamespace = parentNamespace;
|
|
if (ownNamespace === HTML_NAMESPACE$1) {
|
|
ownNamespace = getIntrinsicNamespace(tag);
|
|
}
|
|
if (ownNamespace === HTML_NAMESPACE$1) {
|
|
extraAttributeNames.delete(propKey.toLowerCase());
|
|
} else {
|
|
var standardName = getPossibleStandardName(propKey);
|
|
if (standardName !== null && standardName !== propKey) {
|
|
isMismatchDueToBadCasing = true;
|
|
extraAttributeNames.delete(standardName);
|
|
}
|
|
extraAttributeNames.delete(propKey);
|
|
}
|
|
serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
|
}
|
|
if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
|
|
warnForPropDifference(propKey, serverValue, nextProp);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
|
|
warnForExtraAttributes(extraAttributeNames);
|
|
}
|
|
}
|
|
switch (tag) {
|
|
case "input":
|
|
track(domElement);
|
|
postMountWrapper(domElement, rawProps, true);
|
|
break;
|
|
case "textarea":
|
|
track(domElement);
|
|
postMountWrapper$3(domElement);
|
|
break;
|
|
case "select":
|
|
case "option":
|
|
break;
|
|
default:
|
|
if (typeof rawProps.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
return updatePayload;
|
|
}
|
|
function diffHydratedText(textNode, text) {
|
|
var isDifferent = textNode.nodeValue !== text;
|
|
return isDifferent;
|
|
}
|
|
function warnForUnmatchedText(textNode, text) {
|
|
{
|
|
warnForTextDifference(textNode.nodeValue, text);
|
|
}
|
|
}
|
|
function warnForDeletedHydratableElement(parentNode, child) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForDeletedHydratableText(parentNode, child) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForInsertedHydratedElement(parentNode, tag, props) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForInsertedHydratedText(parentNode, text) {
|
|
{
|
|
if (text === "") {
|
|
return;
|
|
}
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function restoreControlledState$3(domElement, tag, props) {
|
|
switch (tag) {
|
|
case "input":
|
|
restoreControlledState(domElement, props);
|
|
return;
|
|
case "textarea":
|
|
restoreControlledState$2(domElement, props);
|
|
return;
|
|
case "select":
|
|
restoreControlledState$1(domElement, props);
|
|
return;
|
|
}
|
|
}
|
|
var validateDOMNesting = function() {
|
|
};
|
|
var updatedAncestorInfo = function() {
|
|
};
|
|
{
|
|
var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
|
|
var inScopeTags = [
|
|
"applet",
|
|
"caption",
|
|
"html",
|
|
"table",
|
|
"td",
|
|
"th",
|
|
"marquee",
|
|
"object",
|
|
"template",
|
|
"foreignObject",
|
|
"desc",
|
|
"title"
|
|
];
|
|
var buttonScopeTags = inScopeTags.concat(["button"]);
|
|
var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
|
|
var emptyAncestorInfo = {
|
|
current: null,
|
|
formTag: null,
|
|
aTagInScope: null,
|
|
buttonTagInScope: null,
|
|
nobrTagInScope: null,
|
|
pTagInButtonScope: null,
|
|
listItemTagAutoclosing: null,
|
|
dlItemTagAutoclosing: null
|
|
};
|
|
updatedAncestorInfo = function(oldInfo, tag) {
|
|
var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
|
|
var info = {
|
|
tag
|
|
};
|
|
if (inScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.aTagInScope = null;
|
|
ancestorInfo.buttonTagInScope = null;
|
|
ancestorInfo.nobrTagInScope = null;
|
|
}
|
|
if (buttonScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.pTagInButtonScope = null;
|
|
}
|
|
if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
|
|
ancestorInfo.listItemTagAutoclosing = null;
|
|
ancestorInfo.dlItemTagAutoclosing = null;
|
|
}
|
|
ancestorInfo.current = info;
|
|
if (tag === "form") {
|
|
ancestorInfo.formTag = info;
|
|
}
|
|
if (tag === "a") {
|
|
ancestorInfo.aTagInScope = info;
|
|
}
|
|
if (tag === "button") {
|
|
ancestorInfo.buttonTagInScope = info;
|
|
}
|
|
if (tag === "nobr") {
|
|
ancestorInfo.nobrTagInScope = info;
|
|
}
|
|
if (tag === "p") {
|
|
ancestorInfo.pTagInButtonScope = info;
|
|
}
|
|
if (tag === "li") {
|
|
ancestorInfo.listItemTagAutoclosing = info;
|
|
}
|
|
if (tag === "dd" || tag === "dt") {
|
|
ancestorInfo.dlItemTagAutoclosing = info;
|
|
}
|
|
return ancestorInfo;
|
|
};
|
|
var isTagValidWithParent = function(tag, parentTag) {
|
|
switch (parentTag) {
|
|
case "select":
|
|
return tag === "option" || tag === "optgroup" || tag === "#text";
|
|
case "optgroup":
|
|
return tag === "option" || tag === "#text";
|
|
case "option":
|
|
return tag === "#text";
|
|
case "tr":
|
|
return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
|
|
case "tbody":
|
|
case "thead":
|
|
case "tfoot":
|
|
return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
|
|
case "colgroup":
|
|
return tag === "col" || tag === "template";
|
|
case "table":
|
|
return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
|
|
case "head":
|
|
return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
|
|
case "html":
|
|
return tag === "head" || tag === "body" || tag === "frameset";
|
|
case "frameset":
|
|
return tag === "frame";
|
|
case "#document":
|
|
return tag === "html";
|
|
}
|
|
switch (tag) {
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
|
|
case "rp":
|
|
case "rt":
|
|
return impliedEndTags.indexOf(parentTag) === -1;
|
|
case "body":
|
|
case "caption":
|
|
case "col":
|
|
case "colgroup":
|
|
case "frameset":
|
|
case "frame":
|
|
case "head":
|
|
case "html":
|
|
case "tbody":
|
|
case "td":
|
|
case "tfoot":
|
|
case "th":
|
|
case "thead":
|
|
case "tr":
|
|
return parentTag == null;
|
|
}
|
|
return true;
|
|
};
|
|
var findInvalidAncestorForTag = function(tag, ancestorInfo) {
|
|
switch (tag) {
|
|
case "address":
|
|
case "article":
|
|
case "aside":
|
|
case "blockquote":
|
|
case "center":
|
|
case "details":
|
|
case "dialog":
|
|
case "dir":
|
|
case "div":
|
|
case "dl":
|
|
case "fieldset":
|
|
case "figcaption":
|
|
case "figure":
|
|
case "footer":
|
|
case "header":
|
|
case "hgroup":
|
|
case "main":
|
|
case "menu":
|
|
case "nav":
|
|
case "ol":
|
|
case "p":
|
|
case "section":
|
|
case "summary":
|
|
case "ul":
|
|
case "pre":
|
|
case "listing":
|
|
case "table":
|
|
case "hr":
|
|
case "xmp":
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return ancestorInfo.pTagInButtonScope;
|
|
case "form":
|
|
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
|
case "li":
|
|
return ancestorInfo.listItemTagAutoclosing;
|
|
case "dd":
|
|
case "dt":
|
|
return ancestorInfo.dlItemTagAutoclosing;
|
|
case "button":
|
|
return ancestorInfo.buttonTagInScope;
|
|
case "a":
|
|
return ancestorInfo.aTagInScope;
|
|
case "nobr":
|
|
return ancestorInfo.nobrTagInScope;
|
|
}
|
|
return null;
|
|
};
|
|
var didWarn$1 = {};
|
|
validateDOMNesting = function(childTag, childText, ancestorInfo) {
|
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
var parentInfo = ancestorInfo.current;
|
|
var parentTag = parentInfo && parentInfo.tag;
|
|
if (childText != null) {
|
|
if (childTag != null) {
|
|
error("validateDOMNesting: when childText is passed, childTag should be null");
|
|
}
|
|
childTag = "#text";
|
|
}
|
|
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
|
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
|
var invalidParentOrAncestor = invalidParent || invalidAncestor;
|
|
if (!invalidParentOrAncestor) {
|
|
return;
|
|
}
|
|
var ancestorTag = invalidParentOrAncestor.tag;
|
|
var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
|
|
if (didWarn$1[warnKey]) {
|
|
return;
|
|
}
|
|
didWarn$1[warnKey] = true;
|
|
var tagDisplayName = childTag;
|
|
var whitespaceInfo = "";
|
|
if (childTag === "#text") {
|
|
if (/\S/.test(childText)) {
|
|
tagDisplayName = "Text nodes";
|
|
} else {
|
|
tagDisplayName = "Whitespace text nodes";
|
|
whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
|
|
}
|
|
} else {
|
|
tagDisplayName = "<" + childTag + ">";
|
|
}
|
|
if (invalidParent) {
|
|
var info = "";
|
|
if (ancestorTag === "table" && childTag === "tr") {
|
|
info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
|
|
}
|
|
error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
|
|
} else {
|
|
error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
|
|
}
|
|
};
|
|
}
|
|
var SUPPRESS_HYDRATION_WARNING$1;
|
|
{
|
|
SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
|
|
}
|
|
var SUSPENSE_START_DATA = "$";
|
|
var SUSPENSE_END_DATA = "/$";
|
|
var SUSPENSE_PENDING_START_DATA = "$?";
|
|
var SUSPENSE_FALLBACK_START_DATA = "$!";
|
|
var STYLE$1 = "style";
|
|
var eventsEnabled = null;
|
|
var selectionInformation = null;
|
|
function shouldAutoFocusHostComponent(type, props) {
|
|
switch (type) {
|
|
case "button":
|
|
case "input":
|
|
case "select":
|
|
case "textarea":
|
|
return !!props.autoFocus;
|
|
}
|
|
return false;
|
|
}
|
|
function getRootHostContext(rootContainerInstance) {
|
|
var type;
|
|
var namespace;
|
|
var nodeType = rootContainerInstance.nodeType;
|
|
switch (nodeType) {
|
|
case DOCUMENT_NODE:
|
|
case DOCUMENT_FRAGMENT_NODE: {
|
|
type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
|
|
var root2 = rootContainerInstance.documentElement;
|
|
namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
|
|
break;
|
|
}
|
|
default: {
|
|
var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
|
|
var ownNamespace = container.namespaceURI || null;
|
|
type = container.tagName;
|
|
namespace = getChildNamespace(ownNamespace, type);
|
|
break;
|
|
}
|
|
}
|
|
{
|
|
var validatedTag = type.toLowerCase();
|
|
var ancestorInfo = updatedAncestorInfo(null, validatedTag);
|
|
return {
|
|
namespace,
|
|
ancestorInfo
|
|
};
|
|
}
|
|
}
|
|
function getChildHostContext(parentHostContext, type, rootContainerInstance) {
|
|
{
|
|
var parentHostContextDev = parentHostContext;
|
|
var namespace = getChildNamespace(parentHostContextDev.namespace, type);
|
|
var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
|
|
return {
|
|
namespace,
|
|
ancestorInfo
|
|
};
|
|
}
|
|
}
|
|
function getPublicInstance(instance) {
|
|
return instance;
|
|
}
|
|
function prepareForCommit(containerInfo) {
|
|
eventsEnabled = isEnabled();
|
|
selectionInformation = getSelectionInformation();
|
|
var activeInstance = null;
|
|
setEnabled(false);
|
|
return activeInstance;
|
|
}
|
|
function resetAfterCommit(containerInfo) {
|
|
restoreSelection(selectionInformation);
|
|
setEnabled(eventsEnabled);
|
|
eventsEnabled = null;
|
|
selectionInformation = null;
|
|
}
|
|
function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
var parentNamespace;
|
|
{
|
|
var hostContextDev = hostContext;
|
|
validateDOMNesting(type, null, hostContextDev.ancestorInfo);
|
|
if (typeof props.children === "string" || typeof props.children === "number") {
|
|
var string = "" + props.children;
|
|
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
|
validateDOMNesting(null, string, ownAncestorInfo);
|
|
}
|
|
parentNamespace = hostContextDev.namespace;
|
|
}
|
|
var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
|
|
precacheFiberNode(internalInstanceHandle, domElement);
|
|
updateFiberProps(domElement, props);
|
|
return domElement;
|
|
}
|
|
function appendInitialChild(parentInstance, child) {
|
|
parentInstance.appendChild(child);
|
|
}
|
|
function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
|
|
setInitialProperties(domElement, type, props, rootContainerInstance);
|
|
return shouldAutoFocusHostComponent(type, props);
|
|
}
|
|
function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
|
|
{
|
|
var hostContextDev = hostContext;
|
|
if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
|
|
var string = "" + newProps.children;
|
|
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
|
validateDOMNesting(null, string, ownAncestorInfo);
|
|
}
|
|
}
|
|
return diffProperties(domElement, type, oldProps, newProps);
|
|
}
|
|
function shouldSetTextContent(type, props) {
|
|
return type === "textarea" || type === "option" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
|
|
}
|
|
function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
{
|
|
var hostContextDev = hostContext;
|
|
validateDOMNesting(null, text, hostContextDev.ancestorInfo);
|
|
}
|
|
var textNode = createTextNode(text, rootContainerInstance);
|
|
precacheFiberNode(internalInstanceHandle, textNode);
|
|
return textNode;
|
|
}
|
|
var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
|
|
var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
|
|
var noTimeout = -1;
|
|
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
|
if (shouldAutoFocusHostComponent(type, newProps)) {
|
|
domElement.focus();
|
|
}
|
|
}
|
|
function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
|
|
updateFiberProps(domElement, newProps);
|
|
updateProperties(domElement, updatePayload, type, oldProps, newProps);
|
|
}
|
|
function resetTextContent(domElement) {
|
|
setTextContent(domElement, "");
|
|
}
|
|
function commitTextUpdate(textInstance, oldText, newText) {
|
|
textInstance.nodeValue = newText;
|
|
}
|
|
function appendChild(parentInstance, child) {
|
|
parentInstance.appendChild(child);
|
|
}
|
|
function appendChildToContainer(container, child) {
|
|
var parentNode;
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
parentNode = container.parentNode;
|
|
parentNode.insertBefore(child, container);
|
|
} else {
|
|
parentNode = container;
|
|
parentNode.appendChild(child);
|
|
}
|
|
var reactRootContainer = container._reactRootContainer;
|
|
if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
|
|
trapClickOnNonInteractiveElement(parentNode);
|
|
}
|
|
}
|
|
function insertBefore(parentInstance, child, beforeChild) {
|
|
parentInstance.insertBefore(child, beforeChild);
|
|
}
|
|
function insertInContainerBefore(container, child, beforeChild) {
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
container.parentNode.insertBefore(child, beforeChild);
|
|
} else {
|
|
container.insertBefore(child, beforeChild);
|
|
}
|
|
}
|
|
function removeChild(parentInstance, child) {
|
|
parentInstance.removeChild(child);
|
|
}
|
|
function removeChildFromContainer(container, child) {
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
container.parentNode.removeChild(child);
|
|
} else {
|
|
container.removeChild(child);
|
|
}
|
|
}
|
|
function hideInstance(instance) {
|
|
instance = instance;
|
|
var style2 = instance.style;
|
|
if (typeof style2.setProperty === "function") {
|
|
style2.setProperty("display", "none", "important");
|
|
} else {
|
|
style2.display = "none";
|
|
}
|
|
}
|
|
function hideTextInstance(textInstance) {
|
|
textInstance.nodeValue = "";
|
|
}
|
|
function unhideInstance(instance, props) {
|
|
instance = instance;
|
|
var styleProp = props[STYLE$1];
|
|
var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
|
|
instance.style.display = dangerousStyleValue("display", display);
|
|
}
|
|
function unhideTextInstance(textInstance, text) {
|
|
textInstance.nodeValue = text;
|
|
}
|
|
function clearContainer(container) {
|
|
if (container.nodeType === ELEMENT_NODE) {
|
|
container.textContent = "";
|
|
} else if (container.nodeType === DOCUMENT_NODE) {
|
|
var body = container.body;
|
|
if (body != null) {
|
|
body.textContent = "";
|
|
}
|
|
}
|
|
}
|
|
function canHydrateInstance(instance, type, props) {
|
|
if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
|
|
return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function canHydrateTextInstance(instance, text) {
|
|
if (text === "" || instance.nodeType !== TEXT_NODE) {
|
|
return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function isSuspenseInstancePending(instance) {
|
|
return instance.data === SUSPENSE_PENDING_START_DATA;
|
|
}
|
|
function isSuspenseInstanceFallback(instance) {
|
|
return instance.data === SUSPENSE_FALLBACK_START_DATA;
|
|
}
|
|
function getNextHydratable(node) {
|
|
for (; node != null; node = node.nextSibling) {
|
|
var nodeType = node.nodeType;
|
|
if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
|
|
break;
|
|
}
|
|
}
|
|
return node;
|
|
}
|
|
function getNextHydratableSibling(instance) {
|
|
return getNextHydratable(instance.nextSibling);
|
|
}
|
|
function getFirstHydratableChild(parentInstance) {
|
|
return getNextHydratable(parentInstance.firstChild);
|
|
}
|
|
function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
precacheFiberNode(internalInstanceHandle, instance);
|
|
updateFiberProps(instance, props);
|
|
var parentNamespace;
|
|
{
|
|
var hostContextDev = hostContext;
|
|
parentNamespace = hostContextDev.namespace;
|
|
}
|
|
return diffHydratedProperties(instance, type, props, parentNamespace);
|
|
}
|
|
function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
|
|
precacheFiberNode(internalInstanceHandle, textInstance);
|
|
return diffHydratedText(textInstance, text);
|
|
}
|
|
function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
|
|
var node = suspenseInstance.nextSibling;
|
|
var depth = 0;
|
|
while (node) {
|
|
if (node.nodeType === COMMENT_NODE) {
|
|
var data = node.data;
|
|
if (data === SUSPENSE_END_DATA) {
|
|
if (depth === 0) {
|
|
return getNextHydratableSibling(node);
|
|
} else {
|
|
depth--;
|
|
}
|
|
} else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
|
|
depth++;
|
|
}
|
|
}
|
|
node = node.nextSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function getParentSuspenseInstance(targetInstance) {
|
|
var node = targetInstance.previousSibling;
|
|
var depth = 0;
|
|
while (node) {
|
|
if (node.nodeType === COMMENT_NODE) {
|
|
var data = node.data;
|
|
if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
|
|
if (depth === 0) {
|
|
return node;
|
|
} else {
|
|
depth--;
|
|
}
|
|
} else if (data === SUSPENSE_END_DATA) {
|
|
depth++;
|
|
}
|
|
}
|
|
node = node.previousSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function commitHydratedContainer(container) {
|
|
retryIfBlockedOn(container);
|
|
}
|
|
function commitHydratedSuspenseInstance(suspenseInstance) {
|
|
retryIfBlockedOn(suspenseInstance);
|
|
}
|
|
function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
|
|
{
|
|
warnForUnmatchedText(textInstance, text);
|
|
}
|
|
}
|
|
function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
warnForUnmatchedText(textInstance, text);
|
|
}
|
|
}
|
|
function didNotHydrateContainerInstance(parentContainer, instance) {
|
|
{
|
|
if (instance.nodeType === ELEMENT_NODE) {
|
|
warnForDeletedHydratableElement(parentContainer, instance);
|
|
} else if (instance.nodeType === COMMENT_NODE)
|
|
;
|
|
else {
|
|
warnForDeletedHydratableText(parentContainer, instance);
|
|
}
|
|
}
|
|
}
|
|
function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
if (instance.nodeType === ELEMENT_NODE) {
|
|
warnForDeletedHydratableElement(parentInstance, instance);
|
|
} else if (instance.nodeType === COMMENT_NODE)
|
|
;
|
|
else {
|
|
warnForDeletedHydratableText(parentInstance, instance);
|
|
}
|
|
}
|
|
}
|
|
function didNotFindHydratableContainerInstance(parentContainer, type, props) {
|
|
{
|
|
warnForInsertedHydratedElement(parentContainer, type);
|
|
}
|
|
}
|
|
function didNotFindHydratableContainerTextInstance(parentContainer, text) {
|
|
{
|
|
warnForInsertedHydratedText(parentContainer, text);
|
|
}
|
|
}
|
|
function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
warnForInsertedHydratedElement(parentInstance, type);
|
|
}
|
|
}
|
|
function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
warnForInsertedHydratedText(parentInstance, text);
|
|
}
|
|
}
|
|
function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true)
|
|
;
|
|
}
|
|
var clientId = 0;
|
|
function makeClientIdInDEV(warnOnAccessInDEV) {
|
|
var id = "r:" + (clientId++).toString(36);
|
|
return {
|
|
toString: function() {
|
|
warnOnAccessInDEV();
|
|
return id;
|
|
},
|
|
valueOf: function() {
|
|
warnOnAccessInDEV();
|
|
return id;
|
|
}
|
|
};
|
|
}
|
|
function isOpaqueHydratingObject(value) {
|
|
return value !== null && typeof value === "object" && value.$$typeof === REACT_OPAQUE_ID_TYPE;
|
|
}
|
|
function makeOpaqueHydratingObject(attemptToReadValue) {
|
|
return {
|
|
$$typeof: REACT_OPAQUE_ID_TYPE,
|
|
toString: attemptToReadValue,
|
|
valueOf: attemptToReadValue
|
|
};
|
|
}
|
|
function preparePortalMount(portalInstance) {
|
|
{
|
|
listenToAllSupportedEvents(portalInstance);
|
|
}
|
|
}
|
|
var randomKey = Math.random().toString(36).slice(2);
|
|
var internalInstanceKey = "__reactFiber$" + randomKey;
|
|
var internalPropsKey = "__reactProps$" + randomKey;
|
|
var internalContainerInstanceKey = "__reactContainer$" + randomKey;
|
|
var internalEventHandlersKey = "__reactEvents$" + randomKey;
|
|
function precacheFiberNode(hostInst, node) {
|
|
node[internalInstanceKey] = hostInst;
|
|
}
|
|
function markContainerAsRoot(hostRoot, node) {
|
|
node[internalContainerInstanceKey] = hostRoot;
|
|
}
|
|
function unmarkContainerAsRoot(node) {
|
|
node[internalContainerInstanceKey] = null;
|
|
}
|
|
function isContainerMarkedAsRoot(node) {
|
|
return !!node[internalContainerInstanceKey];
|
|
}
|
|
function getClosestInstanceFromNode(targetNode) {
|
|
var targetInst = targetNode[internalInstanceKey];
|
|
if (targetInst) {
|
|
return targetInst;
|
|
}
|
|
var parentNode = targetNode.parentNode;
|
|
while (parentNode) {
|
|
targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
|
|
if (targetInst) {
|
|
var alternate = targetInst.alternate;
|
|
if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
|
|
var suspenseInstance = getParentSuspenseInstance(targetNode);
|
|
while (suspenseInstance !== null) {
|
|
var targetSuspenseInst = suspenseInstance[internalInstanceKey];
|
|
if (targetSuspenseInst) {
|
|
return targetSuspenseInst;
|
|
}
|
|
suspenseInstance = getParentSuspenseInstance(suspenseInstance);
|
|
}
|
|
}
|
|
return targetInst;
|
|
}
|
|
targetNode = parentNode;
|
|
parentNode = targetNode.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function getInstanceFromNode(node) {
|
|
var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
|
|
if (inst) {
|
|
if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
|
|
return inst;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getNodeFromInstance(inst) {
|
|
if (inst.tag === HostComponent || inst.tag === HostText) {
|
|
return inst.stateNode;
|
|
}
|
|
{
|
|
{
|
|
throw Error("getNodeFromInstance: Invalid argument.");
|
|
}
|
|
}
|
|
}
|
|
function getFiberCurrentPropsFromNode(node) {
|
|
return node[internalPropsKey] || null;
|
|
}
|
|
function updateFiberProps(node, props) {
|
|
node[internalPropsKey] = props;
|
|
}
|
|
function getEventListenerSet(node) {
|
|
var elementListenerSet = node[internalEventHandlersKey];
|
|
if (elementListenerSet === void 0) {
|
|
elementListenerSet = node[internalEventHandlersKey] = new Set();
|
|
}
|
|
return elementListenerSet;
|
|
}
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
{
|
|
var has2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has2(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var valueStack = [];
|
|
var fiberStack;
|
|
{
|
|
fiberStack = [];
|
|
}
|
|
var index = -1;
|
|
function createCursor(defaultValue) {
|
|
return {
|
|
current: defaultValue
|
|
};
|
|
}
|
|
function pop(cursor, fiber) {
|
|
if (index < 0) {
|
|
{
|
|
error("Unexpected pop.");
|
|
}
|
|
return;
|
|
}
|
|
{
|
|
if (fiber !== fiberStack[index]) {
|
|
error("Unexpected Fiber popped.");
|
|
}
|
|
}
|
|
cursor.current = valueStack[index];
|
|
valueStack[index] = null;
|
|
{
|
|
fiberStack[index] = null;
|
|
}
|
|
index--;
|
|
}
|
|
function push(cursor, value, fiber) {
|
|
index++;
|
|
valueStack[index] = cursor.current;
|
|
{
|
|
fiberStack[index] = fiber;
|
|
}
|
|
cursor.current = value;
|
|
}
|
|
var warnedAboutMissingGetChildContext;
|
|
{
|
|
warnedAboutMissingGetChildContext = {};
|
|
}
|
|
var emptyContextObject = {};
|
|
{
|
|
Object.freeze(emptyContextObject);
|
|
}
|
|
var contextStackCursor = createCursor(emptyContextObject);
|
|
var didPerformWorkStackCursor = createCursor(false);
|
|
var previousContext = emptyContextObject;
|
|
function getUnmaskedContext(workInProgress2, Component, didPushOwnContextIfProvider) {
|
|
{
|
|
if (didPushOwnContextIfProvider && isContextProvider(Component)) {
|
|
return previousContext;
|
|
}
|
|
return contextStackCursor.current;
|
|
}
|
|
}
|
|
function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
|
|
instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
|
|
}
|
|
}
|
|
function getMaskedContext(workInProgress2, unmaskedContext) {
|
|
{
|
|
var type = workInProgress2.type;
|
|
var contextTypes = type.contextTypes;
|
|
if (!contextTypes) {
|
|
return emptyContextObject;
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
|
|
return instance.__reactInternalMemoizedMaskedChildContext;
|
|
}
|
|
var context = {};
|
|
for (var key in contextTypes) {
|
|
context[key] = unmaskedContext[key];
|
|
}
|
|
{
|
|
var name = getComponentName(type) || "Unknown";
|
|
checkPropTypes(contextTypes, context, "context", name);
|
|
}
|
|
if (instance) {
|
|
cacheContext(workInProgress2, unmaskedContext, context);
|
|
}
|
|
return context;
|
|
}
|
|
}
|
|
function hasContextChanged() {
|
|
{
|
|
return didPerformWorkStackCursor.current;
|
|
}
|
|
}
|
|
function isContextProvider(type) {
|
|
{
|
|
var childContextTypes = type.childContextTypes;
|
|
return childContextTypes !== null && childContextTypes !== void 0;
|
|
}
|
|
}
|
|
function popContext(fiber) {
|
|
{
|
|
pop(didPerformWorkStackCursor, fiber);
|
|
pop(contextStackCursor, fiber);
|
|
}
|
|
}
|
|
function popTopLevelContextObject(fiber) {
|
|
{
|
|
pop(didPerformWorkStackCursor, fiber);
|
|
pop(contextStackCursor, fiber);
|
|
}
|
|
}
|
|
function pushTopLevelContextObject(fiber, context, didChange) {
|
|
{
|
|
if (!(contextStackCursor.current === emptyContextObject)) {
|
|
{
|
|
throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
push(contextStackCursor, context, fiber);
|
|
push(didPerformWorkStackCursor, didChange, fiber);
|
|
}
|
|
}
|
|
function processChildContext(fiber, type, parentContext) {
|
|
{
|
|
var instance = fiber.stateNode;
|
|
var childContextTypes = type.childContextTypes;
|
|
if (typeof instance.getChildContext !== "function") {
|
|
{
|
|
var componentName = getComponentName(type) || "Unknown";
|
|
if (!warnedAboutMissingGetChildContext[componentName]) {
|
|
warnedAboutMissingGetChildContext[componentName] = true;
|
|
error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
|
|
}
|
|
}
|
|
return parentContext;
|
|
}
|
|
var childContext = instance.getChildContext();
|
|
for (var contextKey in childContext) {
|
|
if (!(contextKey in childContextTypes)) {
|
|
{
|
|
throw Error((getComponentName(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
|
|
}
|
|
}
|
|
}
|
|
{
|
|
var name = getComponentName(type) || "Unknown";
|
|
checkPropTypes(childContextTypes, childContext, "child context", name);
|
|
}
|
|
return _assign({}, parentContext, childContext);
|
|
}
|
|
}
|
|
function pushContextProvider(workInProgress2) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
|
|
previousContext = contextStackCursor.current;
|
|
push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
|
|
push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
|
|
return true;
|
|
}
|
|
}
|
|
function invalidateContextProvider(workInProgress2, type, didChange) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
if (!instance) {
|
|
{
|
|
throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (didChange) {
|
|
var mergedContext = processChildContext(workInProgress2, type, previousContext);
|
|
instance.__reactInternalMemoizedMergedChildContext = mergedContext;
|
|
pop(didPerformWorkStackCursor, workInProgress2);
|
|
pop(contextStackCursor, workInProgress2);
|
|
push(contextStackCursor, mergedContext, workInProgress2);
|
|
push(didPerformWorkStackCursor, didChange, workInProgress2);
|
|
} else {
|
|
pop(didPerformWorkStackCursor, workInProgress2);
|
|
push(didPerformWorkStackCursor, didChange, workInProgress2);
|
|
}
|
|
}
|
|
}
|
|
function findCurrentUnmaskedContext(fiber) {
|
|
{
|
|
if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
|
|
{
|
|
throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var node = fiber;
|
|
do {
|
|
switch (node.tag) {
|
|
case HostRoot:
|
|
return node.stateNode.context;
|
|
case ClassComponent: {
|
|
var Component = node.type;
|
|
if (isContextProvider(Component)) {
|
|
return node.stateNode.__reactInternalMemoizedMergedChildContext;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
node = node.return;
|
|
} while (node !== null);
|
|
{
|
|
{
|
|
throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var LegacyRoot = 0;
|
|
var BlockingRoot = 1;
|
|
var ConcurrentRoot = 2;
|
|
var rendererID = null;
|
|
var injectedHook = null;
|
|
var hasLoggedError = false;
|
|
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
|
|
function injectInternals(internals) {
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
|
|
return false;
|
|
}
|
|
var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
if (hook.isDisabled) {
|
|
return true;
|
|
}
|
|
if (!hook.supportsFiber) {
|
|
{
|
|
error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
|
|
}
|
|
return true;
|
|
}
|
|
try {
|
|
rendererID = hook.inject(internals);
|
|
injectedHook = hook;
|
|
} catch (err) {
|
|
{
|
|
error("React instrumentation encountered an error: %s.", err);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function onScheduleRoot(root2, children) {
|
|
{
|
|
if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
|
|
try {
|
|
injectedHook.onScheduleFiberRoot(rendererID, root2, children);
|
|
} catch (err) {
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onCommitRoot(root2, priorityLevel) {
|
|
if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
|
|
try {
|
|
var didError = (root2.current.flags & DidCapture) === DidCapture;
|
|
if (enableProfilerTimer) {
|
|
injectedHook.onCommitFiberRoot(rendererID, root2, priorityLevel, didError);
|
|
} else {
|
|
injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
|
|
}
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onCommitUnmount(fiber) {
|
|
if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
|
|
try {
|
|
injectedHook.onCommitFiberUnmount(rendererID, fiber);
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority, Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback, Scheduler_cancelCallback = Scheduler.unstable_cancelCallback, Scheduler_shouldYield = Scheduler.unstable_shouldYield, Scheduler_requestPaint = Scheduler.unstable_requestPaint, Scheduler_now$1 = Scheduler.unstable_now, Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority, Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, Scheduler_NormalPriority = Scheduler.unstable_NormalPriority, Scheduler_LowPriority = Scheduler.unstable_LowPriority, Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
|
|
{
|
|
if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
|
|
{
|
|
throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
|
|
}
|
|
}
|
|
}
|
|
var fakeCallbackNode = {};
|
|
var ImmediatePriority$1 = 99;
|
|
var UserBlockingPriority$2 = 98;
|
|
var NormalPriority$1 = 97;
|
|
var LowPriority$1 = 96;
|
|
var IdlePriority$1 = 95;
|
|
var NoPriority$1 = 90;
|
|
var shouldYield = Scheduler_shouldYield;
|
|
var requestPaint = Scheduler_requestPaint !== void 0 ? Scheduler_requestPaint : function() {
|
|
};
|
|
var syncQueue = null;
|
|
var immediateQueueCallbackNode = null;
|
|
var isFlushingSyncQueue = false;
|
|
var initialTimeMs$1 = Scheduler_now$1();
|
|
var now = initialTimeMs$1 < 1e4 ? Scheduler_now$1 : function() {
|
|
return Scheduler_now$1() - initialTimeMs$1;
|
|
};
|
|
function getCurrentPriorityLevel() {
|
|
switch (Scheduler_getCurrentPriorityLevel()) {
|
|
case Scheduler_ImmediatePriority:
|
|
return ImmediatePriority$1;
|
|
case Scheduler_UserBlockingPriority:
|
|
return UserBlockingPriority$2;
|
|
case Scheduler_NormalPriority:
|
|
return NormalPriority$1;
|
|
case Scheduler_LowPriority:
|
|
return LowPriority$1;
|
|
case Scheduler_IdlePriority:
|
|
return IdlePriority$1;
|
|
default: {
|
|
{
|
|
throw Error("Unknown priority level.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function reactPriorityToSchedulerPriority(reactPriorityLevel) {
|
|
switch (reactPriorityLevel) {
|
|
case ImmediatePriority$1:
|
|
return Scheduler_ImmediatePriority;
|
|
case UserBlockingPriority$2:
|
|
return Scheduler_UserBlockingPriority;
|
|
case NormalPriority$1:
|
|
return Scheduler_NormalPriority;
|
|
case LowPriority$1:
|
|
return Scheduler_LowPriority;
|
|
case IdlePriority$1:
|
|
return Scheduler_IdlePriority;
|
|
default: {
|
|
{
|
|
throw Error("Unknown priority level.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function runWithPriority$1(reactPriorityLevel, fn) {
|
|
var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
|
|
return Scheduler_runWithPriority(priorityLevel, fn);
|
|
}
|
|
function scheduleCallback(reactPriorityLevel, callback, options2) {
|
|
var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
|
|
return Scheduler_scheduleCallback(priorityLevel, callback, options2);
|
|
}
|
|
function scheduleSyncCallback(callback) {
|
|
if (syncQueue === null) {
|
|
syncQueue = [callback];
|
|
immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
|
|
} else {
|
|
syncQueue.push(callback);
|
|
}
|
|
return fakeCallbackNode;
|
|
}
|
|
function cancelCallback(callbackNode) {
|
|
if (callbackNode !== fakeCallbackNode) {
|
|
Scheduler_cancelCallback(callbackNode);
|
|
}
|
|
}
|
|
function flushSyncCallbackQueue() {
|
|
if (immediateQueueCallbackNode !== null) {
|
|
var node = immediateQueueCallbackNode;
|
|
immediateQueueCallbackNode = null;
|
|
Scheduler_cancelCallback(node);
|
|
}
|
|
flushSyncCallbackQueueImpl();
|
|
}
|
|
function flushSyncCallbackQueueImpl() {
|
|
if (!isFlushingSyncQueue && syncQueue !== null) {
|
|
isFlushingSyncQueue = true;
|
|
var i = 0;
|
|
{
|
|
try {
|
|
var _isSync2 = true;
|
|
var _queue = syncQueue;
|
|
runWithPriority$1(ImmediatePriority$1, function() {
|
|
for (; i < _queue.length; i++) {
|
|
var callback = _queue[i];
|
|
do {
|
|
callback = callback(_isSync2);
|
|
} while (callback !== null);
|
|
}
|
|
});
|
|
syncQueue = null;
|
|
} catch (error2) {
|
|
if (syncQueue !== null) {
|
|
syncQueue = syncQueue.slice(i + 1);
|
|
}
|
|
Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
|
|
throw error2;
|
|
} finally {
|
|
isFlushingSyncQueue = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactVersion = "17.0.2";
|
|
var NoMode = 0;
|
|
var StrictMode = 1;
|
|
var BlockingMode = 2;
|
|
var ConcurrentMode = 4;
|
|
var ProfileMode = 8;
|
|
var DebugTracingMode = 16;
|
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
var NoTransition = 0;
|
|
function requestCurrentTransition() {
|
|
return ReactCurrentBatchConfig.transition;
|
|
}
|
|
var ReactStrictModeWarnings = {
|
|
recordUnsafeLifecycleWarnings: function(fiber, instance) {
|
|
},
|
|
flushPendingUnsafeLifecycleWarnings: function() {
|
|
},
|
|
recordLegacyContextWarning: function(fiber, instance) {
|
|
},
|
|
flushLegacyContextWarning: function() {
|
|
},
|
|
discardPendingWarnings: function() {
|
|
}
|
|
};
|
|
{
|
|
var findStrictRoot = function(fiber) {
|
|
var maybeStrictRoot = null;
|
|
var node = fiber;
|
|
while (node !== null) {
|
|
if (node.mode & StrictMode) {
|
|
maybeStrictRoot = node;
|
|
}
|
|
node = node.return;
|
|
}
|
|
return maybeStrictRoot;
|
|
};
|
|
var setToSortedString = function(set2) {
|
|
var array = [];
|
|
set2.forEach(function(value) {
|
|
array.push(value);
|
|
});
|
|
return array.sort().join(", ");
|
|
};
|
|
var pendingComponentWillMountWarnings = [];
|
|
var pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
var pendingComponentWillReceivePropsWarnings = [];
|
|
var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
var pendingComponentWillUpdateWarnings = [];
|
|
var pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
var didWarnAboutUnsafeLifecycles = new Set();
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
|
|
if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
|
|
return;
|
|
}
|
|
if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillMountWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === "function") {
|
|
pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
|
|
}
|
|
if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillReceivePropsWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
|
|
}
|
|
if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillUpdateWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
|
|
}
|
|
};
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
|
|
var componentWillMountUniqueNames = new Set();
|
|
if (pendingComponentWillMountWarnings.length > 0) {
|
|
pendingComponentWillMountWarnings.forEach(function(fiber) {
|
|
componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillMountWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillMountUniqueNames = new Set();
|
|
if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
}
|
|
var componentWillReceivePropsUniqueNames = new Set();
|
|
if (pendingComponentWillReceivePropsWarnings.length > 0) {
|
|
pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
|
|
componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillReceivePropsWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
|
|
if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
}
|
|
var componentWillUpdateUniqueNames = new Set();
|
|
if (pendingComponentWillUpdateWarnings.length > 0) {
|
|
pendingComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillUpdateWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillUpdateUniqueNames = new Set();
|
|
if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
}
|
|
if (UNSAFE_componentWillMountUniqueNames.size > 0) {
|
|
var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
|
|
error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
|
|
}
|
|
if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
|
|
var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
|
|
error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
|
|
}
|
|
if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
|
|
var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
|
|
error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
|
|
}
|
|
if (componentWillMountUniqueNames.size > 0) {
|
|
var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
|
|
warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
|
|
}
|
|
if (componentWillReceivePropsUniqueNames.size > 0) {
|
|
var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
|
|
warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
|
|
}
|
|
if (componentWillUpdateUniqueNames.size > 0) {
|
|
var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
|
|
warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
|
|
}
|
|
};
|
|
var pendingLegacyContextWarning = new Map();
|
|
var didWarnAboutLegacyContext = new Set();
|
|
ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
|
|
var strictRoot = findStrictRoot(fiber);
|
|
if (strictRoot === null) {
|
|
error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
|
|
return;
|
|
}
|
|
if (didWarnAboutLegacyContext.has(fiber.type)) {
|
|
return;
|
|
}
|
|
var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
|
|
if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
|
|
if (warningsForRoot === void 0) {
|
|
warningsForRoot = [];
|
|
pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
|
|
}
|
|
warningsForRoot.push(fiber);
|
|
}
|
|
};
|
|
ReactStrictModeWarnings.flushLegacyContextWarning = function() {
|
|
pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
|
|
if (fiberArray.length === 0) {
|
|
return;
|
|
}
|
|
var firstFiber = fiberArray[0];
|
|
var uniqueNames = new Set();
|
|
fiberArray.forEach(function(fiber) {
|
|
uniqueNames.add(getComponentName(fiber.type) || "Component");
|
|
didWarnAboutLegacyContext.add(fiber.type);
|
|
});
|
|
var sortedNames = setToSortedString(uniqueNames);
|
|
try {
|
|
setCurrentFiber(firstFiber);
|
|
error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
|
|
} finally {
|
|
resetCurrentFiber();
|
|
}
|
|
});
|
|
};
|
|
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
|
pendingComponentWillMountWarnings = [];
|
|
pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
pendingComponentWillReceivePropsWarnings = [];
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
pendingComponentWillUpdateWarnings = [];
|
|
pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
pendingLegacyContextWarning = new Map();
|
|
};
|
|
}
|
|
function resolveDefaultProps(Component, baseProps) {
|
|
if (Component && Component.defaultProps) {
|
|
var props = _assign({}, baseProps);
|
|
var defaultProps = Component.defaultProps;
|
|
for (var propName in defaultProps) {
|
|
if (props[propName] === void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
return baseProps;
|
|
}
|
|
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
var valueCursor = createCursor(null);
|
|
var rendererSigil;
|
|
{
|
|
rendererSigil = {};
|
|
}
|
|
var currentlyRenderingFiber = null;
|
|
var lastContextDependency = null;
|
|
var lastContextWithAllBitsObserved = null;
|
|
var isDisallowedContextReadInDEV = false;
|
|
function resetContextDependencies() {
|
|
currentlyRenderingFiber = null;
|
|
lastContextDependency = null;
|
|
lastContextWithAllBitsObserved = null;
|
|
{
|
|
isDisallowedContextReadInDEV = false;
|
|
}
|
|
}
|
|
function enterDisallowedContextReadInDEV() {
|
|
{
|
|
isDisallowedContextReadInDEV = true;
|
|
}
|
|
}
|
|
function exitDisallowedContextReadInDEV() {
|
|
{
|
|
isDisallowedContextReadInDEV = false;
|
|
}
|
|
}
|
|
function pushProvider(providerFiber, nextValue) {
|
|
var context = providerFiber.type._context;
|
|
{
|
|
push(valueCursor, context._currentValue, providerFiber);
|
|
context._currentValue = nextValue;
|
|
{
|
|
if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
|
|
error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
|
|
}
|
|
context._currentRenderer = rendererSigil;
|
|
}
|
|
}
|
|
}
|
|
function popProvider(providerFiber) {
|
|
var currentValue = valueCursor.current;
|
|
pop(valueCursor, providerFiber);
|
|
var context = providerFiber.type._context;
|
|
{
|
|
context._currentValue = currentValue;
|
|
}
|
|
}
|
|
function calculateChangedBits(context, newValue, oldValue) {
|
|
if (objectIs(oldValue, newValue)) {
|
|
return 0;
|
|
} else {
|
|
var changedBits = typeof context._calculateChangedBits === "function" ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
{
|
|
if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
|
|
error("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", changedBits);
|
|
}
|
|
}
|
|
return changedBits | 0;
|
|
}
|
|
}
|
|
function scheduleWorkOnParentPath(parent, renderLanes2) {
|
|
var node = parent;
|
|
while (node !== null) {
|
|
var alternate = node.alternate;
|
|
if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
|
|
node.childLanes = mergeLanes(node.childLanes, renderLanes2);
|
|
if (alternate !== null) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
|
|
}
|
|
} else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
|
|
} else {
|
|
break;
|
|
}
|
|
node = node.return;
|
|
}
|
|
}
|
|
function propagateContextChange(workInProgress2, context, changedBits, renderLanes2) {
|
|
var fiber = workInProgress2.child;
|
|
if (fiber !== null) {
|
|
fiber.return = workInProgress2;
|
|
}
|
|
while (fiber !== null) {
|
|
var nextFiber = void 0;
|
|
var list = fiber.dependencies;
|
|
if (list !== null) {
|
|
nextFiber = fiber.child;
|
|
var dependency = list.firstContext;
|
|
while (dependency !== null) {
|
|
if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
|
|
if (fiber.tag === ClassComponent) {
|
|
var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes2));
|
|
update.tag = ForceUpdate;
|
|
enqueueUpdate(fiber, update);
|
|
}
|
|
fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
|
|
}
|
|
scheduleWorkOnParentPath(fiber.return, renderLanes2);
|
|
list.lanes = mergeLanes(list.lanes, renderLanes2);
|
|
break;
|
|
}
|
|
dependency = dependency.next;
|
|
}
|
|
} else if (fiber.tag === ContextProvider) {
|
|
nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
|
|
} else {
|
|
nextFiber = fiber.child;
|
|
}
|
|
if (nextFiber !== null) {
|
|
nextFiber.return = fiber;
|
|
} else {
|
|
nextFiber = fiber;
|
|
while (nextFiber !== null) {
|
|
if (nextFiber === workInProgress2) {
|
|
nextFiber = null;
|
|
break;
|
|
}
|
|
var sibling = nextFiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = nextFiber.return;
|
|
nextFiber = sibling;
|
|
break;
|
|
}
|
|
nextFiber = nextFiber.return;
|
|
}
|
|
}
|
|
fiber = nextFiber;
|
|
}
|
|
}
|
|
function prepareToReadContext(workInProgress2, renderLanes2) {
|
|
currentlyRenderingFiber = workInProgress2;
|
|
lastContextDependency = null;
|
|
lastContextWithAllBitsObserved = null;
|
|
var dependencies = workInProgress2.dependencies;
|
|
if (dependencies !== null) {
|
|
var firstContext = dependencies.firstContext;
|
|
if (firstContext !== null) {
|
|
if (includesSomeLane(dependencies.lanes, renderLanes2)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
dependencies.firstContext = null;
|
|
}
|
|
}
|
|
}
|
|
function readContext(context, observedBits) {
|
|
{
|
|
if (isDisallowedContextReadInDEV) {
|
|
error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
}
|
|
}
|
|
if (lastContextWithAllBitsObserved === context)
|
|
;
|
|
else if (observedBits === false || observedBits === 0)
|
|
;
|
|
else {
|
|
var resolvedObservedBits;
|
|
if (typeof observedBits !== "number" || observedBits === MAX_SIGNED_31_BIT_INT) {
|
|
lastContextWithAllBitsObserved = context;
|
|
resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
|
|
} else {
|
|
resolvedObservedBits = observedBits;
|
|
}
|
|
var contextItem = {
|
|
context,
|
|
observedBits: resolvedObservedBits,
|
|
next: null
|
|
};
|
|
if (lastContextDependency === null) {
|
|
if (!(currentlyRenderingFiber !== null)) {
|
|
{
|
|
throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
}
|
|
}
|
|
lastContextDependency = contextItem;
|
|
currentlyRenderingFiber.dependencies = {
|
|
lanes: NoLanes,
|
|
firstContext: contextItem,
|
|
responders: null
|
|
};
|
|
} else {
|
|
lastContextDependency = lastContextDependency.next = contextItem;
|
|
}
|
|
}
|
|
return context._currentValue;
|
|
}
|
|
var UpdateState = 0;
|
|
var ReplaceState = 1;
|
|
var ForceUpdate = 2;
|
|
var CaptureUpdate = 3;
|
|
var hasForceUpdate = false;
|
|
var didWarnUpdateInsideUpdate;
|
|
var currentlyProcessingQueue;
|
|
{
|
|
didWarnUpdateInsideUpdate = false;
|
|
currentlyProcessingQueue = null;
|
|
}
|
|
function initializeUpdateQueue(fiber) {
|
|
var queue = {
|
|
baseState: fiber.memoizedState,
|
|
firstBaseUpdate: null,
|
|
lastBaseUpdate: null,
|
|
shared: {
|
|
pending: null
|
|
},
|
|
effects: null
|
|
};
|
|
fiber.updateQueue = queue;
|
|
}
|
|
function cloneUpdateQueue(current2, workInProgress2) {
|
|
var queue = workInProgress2.updateQueue;
|
|
var currentQueue = current2.updateQueue;
|
|
if (queue === currentQueue) {
|
|
var clone = {
|
|
baseState: currentQueue.baseState,
|
|
firstBaseUpdate: currentQueue.firstBaseUpdate,
|
|
lastBaseUpdate: currentQueue.lastBaseUpdate,
|
|
shared: currentQueue.shared,
|
|
effects: currentQueue.effects
|
|
};
|
|
workInProgress2.updateQueue = clone;
|
|
}
|
|
}
|
|
function createUpdate(eventTime, lane) {
|
|
var update = {
|
|
eventTime,
|
|
lane,
|
|
tag: UpdateState,
|
|
payload: null,
|
|
callback: null,
|
|
next: null
|
|
};
|
|
return update;
|
|
}
|
|
function enqueueUpdate(fiber, update) {
|
|
var updateQueue = fiber.updateQueue;
|
|
if (updateQueue === null) {
|
|
return;
|
|
}
|
|
var sharedQueue = updateQueue.shared;
|
|
var pending = sharedQueue.pending;
|
|
if (pending === null) {
|
|
update.next = update;
|
|
} else {
|
|
update.next = pending.next;
|
|
pending.next = update;
|
|
}
|
|
sharedQueue.pending = update;
|
|
{
|
|
if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
|
|
error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
|
|
didWarnUpdateInsideUpdate = true;
|
|
}
|
|
}
|
|
}
|
|
function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
|
|
var queue = workInProgress2.updateQueue;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 !== null) {
|
|
var currentQueue = current2.updateQueue;
|
|
if (queue === currentQueue) {
|
|
var newFirst = null;
|
|
var newLast = null;
|
|
var firstBaseUpdate = queue.firstBaseUpdate;
|
|
if (firstBaseUpdate !== null) {
|
|
var update = firstBaseUpdate;
|
|
do {
|
|
var clone = {
|
|
eventTime: update.eventTime,
|
|
lane: update.lane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
if (newLast === null) {
|
|
newFirst = newLast = clone;
|
|
} else {
|
|
newLast.next = clone;
|
|
newLast = clone;
|
|
}
|
|
update = update.next;
|
|
} while (update !== null);
|
|
if (newLast === null) {
|
|
newFirst = newLast = capturedUpdate;
|
|
} else {
|
|
newLast.next = capturedUpdate;
|
|
newLast = capturedUpdate;
|
|
}
|
|
} else {
|
|
newFirst = newLast = capturedUpdate;
|
|
}
|
|
queue = {
|
|
baseState: currentQueue.baseState,
|
|
firstBaseUpdate: newFirst,
|
|
lastBaseUpdate: newLast,
|
|
shared: currentQueue.shared,
|
|
effects: currentQueue.effects
|
|
};
|
|
workInProgress2.updateQueue = queue;
|
|
return;
|
|
}
|
|
}
|
|
var lastBaseUpdate = queue.lastBaseUpdate;
|
|
if (lastBaseUpdate === null) {
|
|
queue.firstBaseUpdate = capturedUpdate;
|
|
} else {
|
|
lastBaseUpdate.next = capturedUpdate;
|
|
}
|
|
queue.lastBaseUpdate = capturedUpdate;
|
|
}
|
|
function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
|
|
switch (update.tag) {
|
|
case ReplaceState: {
|
|
var payload = update.payload;
|
|
if (typeof payload === "function") {
|
|
{
|
|
enterDisallowedContextReadInDEV();
|
|
}
|
|
var nextState = payload.call(instance, prevState, nextProps);
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
payload.call(instance, prevState, nextProps);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
exitDisallowedContextReadInDEV();
|
|
}
|
|
return nextState;
|
|
}
|
|
return payload;
|
|
}
|
|
case CaptureUpdate: {
|
|
workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
|
|
}
|
|
case UpdateState: {
|
|
var _payload = update.payload;
|
|
var partialState;
|
|
if (typeof _payload === "function") {
|
|
{
|
|
enterDisallowedContextReadInDEV();
|
|
}
|
|
partialState = _payload.call(instance, prevState, nextProps);
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
_payload.call(instance, prevState, nextProps);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
exitDisallowedContextReadInDEV();
|
|
}
|
|
} else {
|
|
partialState = _payload;
|
|
}
|
|
if (partialState === null || partialState === void 0) {
|
|
return prevState;
|
|
}
|
|
return _assign({}, prevState, partialState);
|
|
}
|
|
case ForceUpdate: {
|
|
hasForceUpdate = true;
|
|
return prevState;
|
|
}
|
|
}
|
|
return prevState;
|
|
}
|
|
function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
|
|
var queue = workInProgress2.updateQueue;
|
|
hasForceUpdate = false;
|
|
{
|
|
currentlyProcessingQueue = queue.shared;
|
|
}
|
|
var firstBaseUpdate = queue.firstBaseUpdate;
|
|
var lastBaseUpdate = queue.lastBaseUpdate;
|
|
var pendingQueue = queue.shared.pending;
|
|
if (pendingQueue !== null) {
|
|
queue.shared.pending = null;
|
|
var lastPendingUpdate = pendingQueue;
|
|
var firstPendingUpdate = lastPendingUpdate.next;
|
|
lastPendingUpdate.next = null;
|
|
if (lastBaseUpdate === null) {
|
|
firstBaseUpdate = firstPendingUpdate;
|
|
} else {
|
|
lastBaseUpdate.next = firstPendingUpdate;
|
|
}
|
|
lastBaseUpdate = lastPendingUpdate;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 !== null) {
|
|
var currentQueue = current2.updateQueue;
|
|
var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
|
|
if (currentLastBaseUpdate !== lastBaseUpdate) {
|
|
if (currentLastBaseUpdate === null) {
|
|
currentQueue.firstBaseUpdate = firstPendingUpdate;
|
|
} else {
|
|
currentLastBaseUpdate.next = firstPendingUpdate;
|
|
}
|
|
currentQueue.lastBaseUpdate = lastPendingUpdate;
|
|
}
|
|
}
|
|
}
|
|
if (firstBaseUpdate !== null) {
|
|
var newState = queue.baseState;
|
|
var newLanes = NoLanes;
|
|
var newBaseState = null;
|
|
var newFirstBaseUpdate = null;
|
|
var newLastBaseUpdate = null;
|
|
var update = firstBaseUpdate;
|
|
do {
|
|
var updateLane = update.lane;
|
|
var updateEventTime = update.eventTime;
|
|
if (!isSubsetOfLanes(renderLanes2, updateLane)) {
|
|
var clone = {
|
|
eventTime: updateEventTime,
|
|
lane: updateLane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
if (newLastBaseUpdate === null) {
|
|
newFirstBaseUpdate = newLastBaseUpdate = clone;
|
|
newBaseState = newState;
|
|
} else {
|
|
newLastBaseUpdate = newLastBaseUpdate.next = clone;
|
|
}
|
|
newLanes = mergeLanes(newLanes, updateLane);
|
|
} else {
|
|
if (newLastBaseUpdate !== null) {
|
|
var _clone = {
|
|
eventTime: updateEventTime,
|
|
lane: NoLane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
newLastBaseUpdate = newLastBaseUpdate.next = _clone;
|
|
}
|
|
newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
|
|
var callback = update.callback;
|
|
if (callback !== null) {
|
|
workInProgress2.flags |= Callback;
|
|
var effects = queue.effects;
|
|
if (effects === null) {
|
|
queue.effects = [update];
|
|
} else {
|
|
effects.push(update);
|
|
}
|
|
}
|
|
}
|
|
update = update.next;
|
|
if (update === null) {
|
|
pendingQueue = queue.shared.pending;
|
|
if (pendingQueue === null) {
|
|
break;
|
|
} else {
|
|
var _lastPendingUpdate = pendingQueue;
|
|
var _firstPendingUpdate = _lastPendingUpdate.next;
|
|
_lastPendingUpdate.next = null;
|
|
update = _firstPendingUpdate;
|
|
queue.lastBaseUpdate = _lastPendingUpdate;
|
|
queue.shared.pending = null;
|
|
}
|
|
}
|
|
} while (true);
|
|
if (newLastBaseUpdate === null) {
|
|
newBaseState = newState;
|
|
}
|
|
queue.baseState = newBaseState;
|
|
queue.firstBaseUpdate = newFirstBaseUpdate;
|
|
queue.lastBaseUpdate = newLastBaseUpdate;
|
|
markSkippedUpdateLanes(newLanes);
|
|
workInProgress2.lanes = newLanes;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
{
|
|
currentlyProcessingQueue = null;
|
|
}
|
|
}
|
|
function callCallback(callback, context) {
|
|
if (!(typeof callback === "function")) {
|
|
{
|
|
throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
|
|
}
|
|
}
|
|
callback.call(context);
|
|
}
|
|
function resetHasForceUpdateBeforeProcessing() {
|
|
hasForceUpdate = false;
|
|
}
|
|
function checkHasForceUpdateAfterProcessing() {
|
|
return hasForceUpdate;
|
|
}
|
|
function commitUpdateQueue(finishedWork, finishedQueue, instance) {
|
|
var effects = finishedQueue.effects;
|
|
finishedQueue.effects = null;
|
|
if (effects !== null) {
|
|
for (var i = 0; i < effects.length; i++) {
|
|
var effect = effects[i];
|
|
var callback = effect.callback;
|
|
if (callback !== null) {
|
|
effect.callback = null;
|
|
callCallback(callback, instance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var fakeInternalInstance = {};
|
|
var isArray = Array.isArray;
|
|
var emptyRefsObject = new React31.Component().refs;
|
|
var didWarnAboutStateAssignmentForComponent;
|
|
var didWarnAboutUninitializedState;
|
|
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
|
var didWarnAboutLegacyLifecyclesAndDerivedState;
|
|
var didWarnAboutUndefinedDerivedState;
|
|
var warnOnUndefinedDerivedState;
|
|
var warnOnInvalidCallback;
|
|
var didWarnAboutDirectlyAssigningPropsToState;
|
|
var didWarnAboutContextTypeAndContextTypes;
|
|
var didWarnAboutInvalidateContextType;
|
|
{
|
|
didWarnAboutStateAssignmentForComponent = new Set();
|
|
didWarnAboutUninitializedState = new Set();
|
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
|
|
didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
|
|
didWarnAboutDirectlyAssigningPropsToState = new Set();
|
|
didWarnAboutUndefinedDerivedState = new Set();
|
|
didWarnAboutContextTypeAndContextTypes = new Set();
|
|
didWarnAboutInvalidateContextType = new Set();
|
|
var didWarnOnInvalidCallback = new Set();
|
|
warnOnInvalidCallback = function(callback, callerName) {
|
|
if (callback === null || typeof callback === "function") {
|
|
return;
|
|
}
|
|
var key = callerName + "_" + callback;
|
|
if (!didWarnOnInvalidCallback.has(key)) {
|
|
didWarnOnInvalidCallback.add(key);
|
|
error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
|
|
}
|
|
};
|
|
warnOnUndefinedDerivedState = function(type, partialState) {
|
|
if (partialState === void 0) {
|
|
var componentName = getComponentName(type) || "Component";
|
|
if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
|
|
didWarnAboutUndefinedDerivedState.add(componentName);
|
|
error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
|
|
}
|
|
}
|
|
};
|
|
Object.defineProperty(fakeInternalInstance, "_processChildContext", {
|
|
enumerable: false,
|
|
value: function() {
|
|
{
|
|
{
|
|
throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
Object.freeze(fakeInternalInstance);
|
|
}
|
|
function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
|
|
var prevState = workInProgress2.memoizedState;
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
getDerivedStateFromProps(nextProps, prevState);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
}
|
|
var partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
{
|
|
warnOnUndefinedDerivedState(ctor, partialState);
|
|
}
|
|
var memoizedState = partialState === null || partialState === void 0 ? prevState : _assign({}, prevState, partialState);
|
|
workInProgress2.memoizedState = memoizedState;
|
|
if (workInProgress2.lanes === NoLanes) {
|
|
var updateQueue = workInProgress2.updateQueue;
|
|
updateQueue.baseState = memoizedState;
|
|
}
|
|
}
|
|
var classComponentUpdater = {
|
|
isMounted,
|
|
enqueueSetState: function(inst, payload, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.payload = payload;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "setState");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
enqueueUpdate(fiber, update);
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
},
|
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.tag = ReplaceState;
|
|
update.payload = payload;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "replaceState");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
enqueueUpdate(fiber, update);
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
},
|
|
enqueueForceUpdate: function(inst, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.tag = ForceUpdate;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "forceUpdate");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
enqueueUpdate(fiber, update);
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
}
|
|
};
|
|
function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
|
|
var instance = workInProgress2.stateNode;
|
|
if (typeof instance.shouldComponentUpdate === "function") {
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
instance.shouldComponentUpdate(newProps, newState, nextContext);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
}
|
|
var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
|
|
{
|
|
if (shouldUpdate === void 0) {
|
|
error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentName(ctor) || "Component");
|
|
}
|
|
}
|
|
return shouldUpdate;
|
|
}
|
|
if (ctor.prototype && ctor.prototype.isPureReactComponent) {
|
|
return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
|
|
}
|
|
return true;
|
|
}
|
|
function checkClassInstance(workInProgress2, ctor, newProps) {
|
|
var instance = workInProgress2.stateNode;
|
|
{
|
|
var name = getComponentName(ctor) || "Component";
|
|
var renderPresent = instance.render;
|
|
if (!renderPresent) {
|
|
if (ctor.prototype && typeof ctor.prototype.render === "function") {
|
|
error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
|
|
} else {
|
|
error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
|
|
}
|
|
}
|
|
if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
|
|
error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name);
|
|
}
|
|
if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name);
|
|
}
|
|
if (instance.propTypes) {
|
|
error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
|
|
}
|
|
if (instance.contextType) {
|
|
error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
|
|
}
|
|
{
|
|
if (instance.contextTypes) {
|
|
error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
|
|
}
|
|
if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
|
|
didWarnAboutContextTypeAndContextTypes.add(ctor);
|
|
error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
|
|
}
|
|
}
|
|
if (typeof instance.componentShouldUpdate === "function") {
|
|
error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name);
|
|
}
|
|
if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
|
|
error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentName(ctor) || "A pure component");
|
|
}
|
|
if (typeof instance.componentDidUnmount === "function") {
|
|
error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
|
|
}
|
|
if (typeof instance.componentDidReceiveProps === "function") {
|
|
error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name);
|
|
}
|
|
if (typeof instance.componentWillRecieveProps === "function") {
|
|
error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
|
|
error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
|
|
}
|
|
var hasMutatedProps = instance.props !== newProps;
|
|
if (instance.props !== void 0 && hasMutatedProps) {
|
|
error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
|
|
}
|
|
if (instance.defaultProps) {
|
|
error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name);
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
|
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
|
|
error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentName(ctor));
|
|
}
|
|
if (typeof instance.getDerivedStateFromProps === "function") {
|
|
error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
|
|
}
|
|
if (typeof instance.getDerivedStateFromError === "function") {
|
|
error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
|
|
}
|
|
if (typeof ctor.getSnapshotBeforeUpdate === "function") {
|
|
error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
|
|
}
|
|
var _state = instance.state;
|
|
if (_state && (typeof _state !== "object" || isArray(_state))) {
|
|
error("%s.state: must be set to an object or null", name);
|
|
}
|
|
if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
|
|
error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
|
|
}
|
|
}
|
|
}
|
|
function adoptClassInstance(workInProgress2, instance) {
|
|
instance.updater = classComponentUpdater;
|
|
workInProgress2.stateNode = instance;
|
|
set(instance, workInProgress2);
|
|
{
|
|
instance._reactInternalInstance = fakeInternalInstance;
|
|
}
|
|
}
|
|
function constructClassInstance(workInProgress2, ctor, props) {
|
|
var isLegacyContextConsumer = false;
|
|
var unmaskedContext = emptyContextObject;
|
|
var context = emptyContextObject;
|
|
var contextType = ctor.contextType;
|
|
{
|
|
if ("contextType" in ctor) {
|
|
var isValid = contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0;
|
|
if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
|
|
didWarnAboutInvalidateContextType.add(ctor);
|
|
var addendum = "";
|
|
if (contextType === void 0) {
|
|
addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
|
|
} else if (typeof contextType !== "object") {
|
|
addendum = " However, it is set to a " + typeof contextType + ".";
|
|
} else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
|
|
addendum = " Did you accidentally pass the Context.Provider instead?";
|
|
} else if (contextType._context !== void 0) {
|
|
addendum = " Did you accidentally pass the Context.Consumer instead?";
|
|
} else {
|
|
addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
|
|
}
|
|
error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentName(ctor) || "Component", addendum);
|
|
}
|
|
}
|
|
}
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
context = readContext(contextType);
|
|
} else {
|
|
unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
var contextTypes = ctor.contextTypes;
|
|
isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
|
|
context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
|
|
}
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
new ctor(props, context);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
}
|
|
var instance = new ctor(props, context);
|
|
var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
|
|
adoptClassInstance(workInProgress2, instance);
|
|
{
|
|
if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
|
|
var componentName = getComponentName(ctor) || "Component";
|
|
if (!didWarnAboutUninitializedState.has(componentName)) {
|
|
didWarnAboutUninitializedState.add(componentName);
|
|
error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
|
|
}
|
|
}
|
|
if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
var foundWillMountName = null;
|
|
var foundWillReceivePropsName = null;
|
|
var foundWillUpdateName = null;
|
|
if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
foundWillMountName = "componentWillMount";
|
|
} else if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
foundWillMountName = "UNSAFE_componentWillMount";
|
|
}
|
|
if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
|
foundWillReceivePropsName = "componentWillReceiveProps";
|
|
} else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
|
|
}
|
|
if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
|
foundWillUpdateName = "componentWillUpdate";
|
|
} else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
foundWillUpdateName = "UNSAFE_componentWillUpdate";
|
|
}
|
|
if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
|
var _componentName = getComponentName(ctor) || "Component";
|
|
var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
|
|
if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
|
|
didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
|
|
error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isLegacyContextConsumer) {
|
|
cacheContext(workInProgress2, unmaskedContext, context);
|
|
}
|
|
return instance;
|
|
}
|
|
function callComponentWillMount(workInProgress2, instance) {
|
|
var oldState = instance.state;
|
|
if (typeof instance.componentWillMount === "function") {
|
|
instance.componentWillMount();
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
instance.UNSAFE_componentWillMount();
|
|
}
|
|
if (oldState !== instance.state) {
|
|
{
|
|
error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentName(workInProgress2.type) || "Component");
|
|
}
|
|
classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
}
|
|
}
|
|
function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
|
|
var oldState = instance.state;
|
|
if (typeof instance.componentWillReceiveProps === "function") {
|
|
instance.componentWillReceiveProps(newProps, nextContext);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
|
}
|
|
if (instance.state !== oldState) {
|
|
{
|
|
var componentName = getComponentName(workInProgress2.type) || "Component";
|
|
if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
|
|
didWarnAboutStateAssignmentForComponent.add(componentName);
|
|
error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
|
|
}
|
|
}
|
|
classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
}
|
|
}
|
|
function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
|
|
{
|
|
checkClassInstance(workInProgress2, ctor, newProps);
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
instance.props = newProps;
|
|
instance.state = workInProgress2.memoizedState;
|
|
instance.refs = emptyRefsObject;
|
|
initializeUpdateQueue(workInProgress2);
|
|
var contextType = ctor.contextType;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
instance.context = readContext(contextType);
|
|
} else {
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
instance.context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
{
|
|
if (instance.state === newProps) {
|
|
var componentName = getComponentName(ctor) || "Component";
|
|
if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
|
|
didWarnAboutDirectlyAssigningPropsToState.add(componentName);
|
|
error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
|
|
}
|
|
}
|
|
if (workInProgress2.mode & StrictMode) {
|
|
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
|
|
}
|
|
{
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
|
|
}
|
|
}
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
instance.state = workInProgress2.memoizedState;
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
instance.state = workInProgress2.memoizedState;
|
|
}
|
|
if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
|
|
callComponentWillMount(workInProgress2, instance);
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
instance.state = workInProgress2.memoizedState;
|
|
}
|
|
if (typeof instance.componentDidMount === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
|
|
var instance = workInProgress2.stateNode;
|
|
var oldProps = workInProgress2.memoizedProps;
|
|
instance.props = oldProps;
|
|
var oldContext = instance.context;
|
|
var contextType = ctor.contextType;
|
|
var nextContext = emptyContextObject;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
nextContext = readContext(contextType);
|
|
} else {
|
|
var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
|
|
}
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
|
|
if (oldProps !== newProps || oldContext !== nextContext) {
|
|
callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
|
|
}
|
|
}
|
|
resetHasForceUpdateBeforeProcessing();
|
|
var oldState = workInProgress2.memoizedState;
|
|
var newState = instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
newState = workInProgress2.memoizedState;
|
|
if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
|
|
if (typeof instance.componentDidMount === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
return false;
|
|
}
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
newState = workInProgress2.memoizedState;
|
|
}
|
|
var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
|
|
if (shouldUpdate) {
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
|
|
if (typeof instance.componentWillMount === "function") {
|
|
instance.componentWillMount();
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
instance.UNSAFE_componentWillMount();
|
|
}
|
|
}
|
|
if (typeof instance.componentDidMount === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
} else {
|
|
if (typeof instance.componentDidMount === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
workInProgress2.memoizedProps = newProps;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
instance.props = newProps;
|
|
instance.state = newState;
|
|
instance.context = nextContext;
|
|
return shouldUpdate;
|
|
}
|
|
function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
|
|
var instance = workInProgress2.stateNode;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
var unresolvedOldProps = workInProgress2.memoizedProps;
|
|
var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
|
|
instance.props = oldProps;
|
|
var unresolvedNewProps = workInProgress2.pendingProps;
|
|
var oldContext = instance.context;
|
|
var contextType = ctor.contextType;
|
|
var nextContext = emptyContextObject;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
nextContext = readContext(contextType);
|
|
} else {
|
|
var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
|
|
}
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
|
|
if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
|
|
callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
|
|
}
|
|
}
|
|
resetHasForceUpdateBeforeProcessing();
|
|
var oldState = workInProgress2.memoizedState;
|
|
var newState = instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
newState = workInProgress2.memoizedState;
|
|
if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
newState = workInProgress2.memoizedState;
|
|
}
|
|
var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
|
|
if (shouldUpdate) {
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
|
|
if (typeof instance.componentWillUpdate === "function") {
|
|
instance.componentWillUpdate(newProps, newState, nextContext);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
|
|
}
|
|
}
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
} else {
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
}
|
|
workInProgress2.memoizedProps = newProps;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
instance.props = newProps;
|
|
instance.state = newState;
|
|
instance.context = nextContext;
|
|
return shouldUpdate;
|
|
}
|
|
var didWarnAboutMaps;
|
|
var didWarnAboutGenerators;
|
|
var didWarnAboutStringRefs;
|
|
var ownerHasKeyUseWarning;
|
|
var ownerHasFunctionTypeWarning;
|
|
var warnForMissingKey = function(child, returnFiber) {
|
|
};
|
|
{
|
|
didWarnAboutMaps = false;
|
|
didWarnAboutGenerators = false;
|
|
didWarnAboutStringRefs = {};
|
|
ownerHasKeyUseWarning = {};
|
|
ownerHasFunctionTypeWarning = {};
|
|
warnForMissingKey = function(child, returnFiber) {
|
|
if (child === null || typeof child !== "object") {
|
|
return;
|
|
}
|
|
if (!child._store || child._store.validated || child.key != null) {
|
|
return;
|
|
}
|
|
if (!(typeof child._store === "object")) {
|
|
{
|
|
throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
child._store.validated = true;
|
|
var componentName = getComponentName(returnFiber.type) || "Component";
|
|
if (ownerHasKeyUseWarning[componentName]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[componentName] = true;
|
|
error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
|
|
};
|
|
}
|
|
var isArray$1 = Array.isArray;
|
|
function coerceRef(returnFiber, current2, element) {
|
|
var mixedRef = element.ref;
|
|
if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
|
|
{
|
|
if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self)) {
|
|
var componentName = getComponentName(returnFiber.type) || "Component";
|
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
{
|
|
error('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', mixedRef);
|
|
}
|
|
didWarnAboutStringRefs[componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
if (element._owner) {
|
|
var owner = element._owner;
|
|
var inst;
|
|
if (owner) {
|
|
var ownerFiber = owner;
|
|
if (!(ownerFiber.tag === ClassComponent)) {
|
|
{
|
|
throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
|
|
}
|
|
}
|
|
inst = ownerFiber.stateNode;
|
|
}
|
|
if (!inst) {
|
|
{
|
|
throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var stringRef = "" + mixedRef;
|
|
if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
|
|
return current2.ref;
|
|
}
|
|
var ref = function(value) {
|
|
var refs = inst.refs;
|
|
if (refs === emptyRefsObject) {
|
|
refs = inst.refs = {};
|
|
}
|
|
if (value === null) {
|
|
delete refs[stringRef];
|
|
} else {
|
|
refs[stringRef] = value;
|
|
}
|
|
};
|
|
ref._stringRef = stringRef;
|
|
return ref;
|
|
} else {
|
|
if (!(typeof mixedRef === "string")) {
|
|
{
|
|
throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
|
|
}
|
|
}
|
|
if (!element._owner) {
|
|
{
|
|
throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return mixedRef;
|
|
}
|
|
function throwOnInvalidObjectType(returnFiber, newChild) {
|
|
if (returnFiber.type !== "textarea") {
|
|
{
|
|
{
|
|
throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild) + "). If you meant to render a collection of children, use an array instead.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function warnOnFunctionType(returnFiber) {
|
|
{
|
|
var componentName = getComponentName(returnFiber.type) || "Component";
|
|
if (ownerHasFunctionTypeWarning[componentName]) {
|
|
return;
|
|
}
|
|
ownerHasFunctionTypeWarning[componentName] = true;
|
|
error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
|
|
}
|
|
}
|
|
function ChildReconciler(shouldTrackSideEffects) {
|
|
function deleteChild(returnFiber, childToDelete) {
|
|
if (!shouldTrackSideEffects) {
|
|
return;
|
|
}
|
|
var last = returnFiber.lastEffect;
|
|
if (last !== null) {
|
|
last.nextEffect = childToDelete;
|
|
returnFiber.lastEffect = childToDelete;
|
|
} else {
|
|
returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
|
|
}
|
|
childToDelete.nextEffect = null;
|
|
childToDelete.flags = Deletion;
|
|
}
|
|
function deleteRemainingChildren(returnFiber, currentFirstChild) {
|
|
if (!shouldTrackSideEffects) {
|
|
return null;
|
|
}
|
|
var childToDelete = currentFirstChild;
|
|
while (childToDelete !== null) {
|
|
deleteChild(returnFiber, childToDelete);
|
|
childToDelete = childToDelete.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function mapRemainingChildren(returnFiber, currentFirstChild) {
|
|
var existingChildren = new Map();
|
|
var existingChild = currentFirstChild;
|
|
while (existingChild !== null) {
|
|
if (existingChild.key !== null) {
|
|
existingChildren.set(existingChild.key, existingChild);
|
|
} else {
|
|
existingChildren.set(existingChild.index, existingChild);
|
|
}
|
|
existingChild = existingChild.sibling;
|
|
}
|
|
return existingChildren;
|
|
}
|
|
function useFiber(fiber, pendingProps) {
|
|
var clone = createWorkInProgress(fiber, pendingProps);
|
|
clone.index = 0;
|
|
clone.sibling = null;
|
|
return clone;
|
|
}
|
|
function placeChild(newFiber, lastPlacedIndex, newIndex) {
|
|
newFiber.index = newIndex;
|
|
if (!shouldTrackSideEffects) {
|
|
return lastPlacedIndex;
|
|
}
|
|
var current2 = newFiber.alternate;
|
|
if (current2 !== null) {
|
|
var oldIndex = current2.index;
|
|
if (oldIndex < lastPlacedIndex) {
|
|
newFiber.flags = Placement;
|
|
return lastPlacedIndex;
|
|
} else {
|
|
return oldIndex;
|
|
}
|
|
} else {
|
|
newFiber.flags = Placement;
|
|
return lastPlacedIndex;
|
|
}
|
|
}
|
|
function placeSingleChild(newFiber) {
|
|
if (shouldTrackSideEffects && newFiber.alternate === null) {
|
|
newFiber.flags = Placement;
|
|
}
|
|
return newFiber;
|
|
}
|
|
function updateTextNode(returnFiber, current2, textContent, lanes) {
|
|
if (current2 === null || current2.tag !== HostText) {
|
|
var created = createFiberFromText(textContent, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, textContent);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function updateElement(returnFiber, current2, element, lanes) {
|
|
if (current2 !== null) {
|
|
if (current2.elementType === element.type || isCompatibleFamilyForHotReloading(current2, element)) {
|
|
var existing = useFiber(current2, element.props);
|
|
existing.ref = coerceRef(returnFiber, current2, element);
|
|
existing.return = returnFiber;
|
|
{
|
|
existing._debugSource = element._source;
|
|
existing._debugOwner = element._owner;
|
|
}
|
|
return existing;
|
|
}
|
|
}
|
|
var created = createFiberFromElement(element, returnFiber.mode, lanes);
|
|
created.ref = coerceRef(returnFiber, current2, element);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function updatePortal(returnFiber, current2, portal, lanes) {
|
|
if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
|
|
var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, portal.children || []);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
|
if (current2 === null || current2.tag !== Fragment) {
|
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, fragment);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function createChild(returnFiber, newChild, lanes) {
|
|
if (typeof newChild === "string" || typeof newChild === "number") {
|
|
var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
|
|
_created.ref = coerceRef(returnFiber, null, newChild);
|
|
_created.return = returnFiber;
|
|
return _created;
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
|
|
_created2.return = returnFiber;
|
|
return _created2;
|
|
}
|
|
}
|
|
if (isArray$1(newChild) || getIteratorFn(newChild)) {
|
|
var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
|
|
_created3.return = returnFiber;
|
|
return _created3;
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
|
|
var key = oldFiber !== null ? oldFiber.key : null;
|
|
if (typeof newChild === "string" || typeof newChild === "number") {
|
|
if (key !== null) {
|
|
return null;
|
|
}
|
|
return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
if (newChild.key === key) {
|
|
if (newChild.type === REACT_FRAGMENT_TYPE) {
|
|
return updateFragment2(returnFiber, oldFiber, newChild.props.children, lanes, key);
|
|
}
|
|
return updateElement(returnFiber, oldFiber, newChild, lanes);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
if (newChild.key === key) {
|
|
return updatePortal(returnFiber, oldFiber, newChild, lanes);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
if (isArray$1(newChild) || getIteratorFn(newChild)) {
|
|
if (key !== null) {
|
|
return null;
|
|
}
|
|
return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
|
|
if (typeof newChild === "string" || typeof newChild === "number") {
|
|
var matchedFiber = existingChildren.get(newIdx) || null;
|
|
return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
|
if (newChild.type === REACT_FRAGMENT_TYPE) {
|
|
return updateFragment2(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);
|
|
}
|
|
return updateElement(returnFiber, _matchedFiber, newChild, lanes);
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
|
return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
|
|
}
|
|
}
|
|
if (isArray$1(newChild) || getIteratorFn(newChild)) {
|
|
var _matchedFiber3 = existingChildren.get(newIdx) || null;
|
|
return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function warnOnInvalidKey(child, knownKeys, returnFiber) {
|
|
{
|
|
if (typeof child !== "object" || child === null) {
|
|
return knownKeys;
|
|
}
|
|
switch (child.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
warnForMissingKey(child, returnFiber);
|
|
var key = child.key;
|
|
if (typeof key !== "string") {
|
|
break;
|
|
}
|
|
if (knownKeys === null) {
|
|
knownKeys = new Set();
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
if (!knownKeys.has(key)) {
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key);
|
|
break;
|
|
}
|
|
}
|
|
return knownKeys;
|
|
}
|
|
function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
|
|
{
|
|
var knownKeys = null;
|
|
for (var i = 0; i < newChildren.length; i++) {
|
|
var child = newChildren[i];
|
|
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
}
|
|
}
|
|
var resultingFirstChild = null;
|
|
var previousNewFiber = null;
|
|
var oldFiber = currentFirstChild;
|
|
var lastPlacedIndex = 0;
|
|
var newIdx = 0;
|
|
var nextOldFiber = null;
|
|
for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
|
|
if (oldFiber.index > newIdx) {
|
|
nextOldFiber = oldFiber;
|
|
oldFiber = null;
|
|
} else {
|
|
nextOldFiber = oldFiber.sibling;
|
|
}
|
|
var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
|
|
if (newFiber === null) {
|
|
if (oldFiber === null) {
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
break;
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
if (oldFiber && newFiber.alternate === null) {
|
|
deleteChild(returnFiber, oldFiber);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = newFiber;
|
|
}
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (newIdx === newChildren.length) {
|
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
return resultingFirstChild;
|
|
}
|
|
if (oldFiber === null) {
|
|
for (; newIdx < newChildren.length; newIdx++) {
|
|
var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
|
|
if (_newFiber === null) {
|
|
continue;
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber;
|
|
}
|
|
previousNewFiber = _newFiber;
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
|
for (; newIdx < newChildren.length; newIdx++) {
|
|
var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
|
|
if (_newFiber2 !== null) {
|
|
if (shouldTrackSideEffects) {
|
|
if (_newFiber2.alternate !== null) {
|
|
existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber2;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber2;
|
|
}
|
|
previousNewFiber = _newFiber2;
|
|
}
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
existingChildren.forEach(function(child2) {
|
|
return deleteChild(returnFiber, child2);
|
|
});
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
|
|
var iteratorFn = getIteratorFn(newChildrenIterable);
|
|
if (!(typeof iteratorFn === "function")) {
|
|
{
|
|
throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
{
|
|
if (typeof Symbol === "function" && newChildrenIterable[Symbol.toStringTag] === "Generator") {
|
|
if (!didWarnAboutGenerators) {
|
|
error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
|
|
}
|
|
didWarnAboutGenerators = true;
|
|
}
|
|
if (newChildrenIterable.entries === iteratorFn) {
|
|
if (!didWarnAboutMaps) {
|
|
error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
}
|
|
didWarnAboutMaps = true;
|
|
}
|
|
var _newChildren = iteratorFn.call(newChildrenIterable);
|
|
if (_newChildren) {
|
|
var knownKeys = null;
|
|
var _step = _newChildren.next();
|
|
for (; !_step.done; _step = _newChildren.next()) {
|
|
var child = _step.value;
|
|
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
}
|
|
}
|
|
}
|
|
var newChildren = iteratorFn.call(newChildrenIterable);
|
|
if (!(newChildren != null)) {
|
|
{
|
|
throw Error("An iterable object provided no iterator.");
|
|
}
|
|
}
|
|
var resultingFirstChild = null;
|
|
var previousNewFiber = null;
|
|
var oldFiber = currentFirstChild;
|
|
var lastPlacedIndex = 0;
|
|
var newIdx = 0;
|
|
var nextOldFiber = null;
|
|
var step = newChildren.next();
|
|
for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
|
|
if (oldFiber.index > newIdx) {
|
|
nextOldFiber = oldFiber;
|
|
oldFiber = null;
|
|
} else {
|
|
nextOldFiber = oldFiber.sibling;
|
|
}
|
|
var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
|
|
if (newFiber === null) {
|
|
if (oldFiber === null) {
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
break;
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
if (oldFiber && newFiber.alternate === null) {
|
|
deleteChild(returnFiber, oldFiber);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = newFiber;
|
|
}
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (step.done) {
|
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
return resultingFirstChild;
|
|
}
|
|
if (oldFiber === null) {
|
|
for (; !step.done; newIdx++, step = newChildren.next()) {
|
|
var _newFiber3 = createChild(returnFiber, step.value, lanes);
|
|
if (_newFiber3 === null) {
|
|
continue;
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber3;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber3;
|
|
}
|
|
previousNewFiber = _newFiber3;
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
|
for (; !step.done; newIdx++, step = newChildren.next()) {
|
|
var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
|
|
if (_newFiber4 !== null) {
|
|
if (shouldTrackSideEffects) {
|
|
if (_newFiber4.alternate !== null) {
|
|
existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber4;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber4;
|
|
}
|
|
previousNewFiber = _newFiber4;
|
|
}
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
existingChildren.forEach(function(child2) {
|
|
return deleteChild(returnFiber, child2);
|
|
});
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
|
|
if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
|
|
deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
|
|
var existing = useFiber(currentFirstChild, textContent);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
var created = createFiberFromText(textContent, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
|
|
var key = element.key;
|
|
var child = currentFirstChild;
|
|
while (child !== null) {
|
|
if (child.key === key) {
|
|
switch (child.tag) {
|
|
case Fragment: {
|
|
if (element.type === REACT_FRAGMENT_TYPE) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var existing = useFiber(child, element.props.children);
|
|
existing.return = returnFiber;
|
|
{
|
|
existing._debugSource = element._source;
|
|
existing._debugOwner = element._owner;
|
|
}
|
|
return existing;
|
|
}
|
|
break;
|
|
}
|
|
case Block:
|
|
default: {
|
|
if (child.elementType === element.type || isCompatibleFamilyForHotReloading(child, element)) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var _existing3 = useFiber(child, element.props);
|
|
_existing3.ref = coerceRef(returnFiber, child, element);
|
|
_existing3.return = returnFiber;
|
|
{
|
|
_existing3._debugSource = element._source;
|
|
_existing3._debugOwner = element._owner;
|
|
}
|
|
return _existing3;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
deleteRemainingChildren(returnFiber, child);
|
|
break;
|
|
} else {
|
|
deleteChild(returnFiber, child);
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
if (element.type === REACT_FRAGMENT_TYPE) {
|
|
var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
|
|
_created4.ref = coerceRef(returnFiber, currentFirstChild, element);
|
|
_created4.return = returnFiber;
|
|
return _created4;
|
|
}
|
|
}
|
|
function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
|
|
var key = portal.key;
|
|
var child = currentFirstChild;
|
|
while (child !== null) {
|
|
if (child.key === key) {
|
|
if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var existing = useFiber(child, portal.children || []);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
} else {
|
|
deleteRemainingChildren(returnFiber, child);
|
|
break;
|
|
}
|
|
} else {
|
|
deleteChild(returnFiber, child);
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
|
|
var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
|
|
if (isUnkeyedTopLevelFragment) {
|
|
newChild = newChild.props.children;
|
|
}
|
|
var isObject = typeof newChild === "object" && newChild !== null;
|
|
if (isObject) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
|
|
case REACT_PORTAL_TYPE:
|
|
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
|
|
}
|
|
}
|
|
if (typeof newChild === "string" || typeof newChild === "number") {
|
|
return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
|
|
}
|
|
if (isArray$1(newChild)) {
|
|
return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
|
|
}
|
|
if (getIteratorFn(newChild)) {
|
|
return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
|
|
}
|
|
if (isObject) {
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
if (typeof newChild === "undefined" && !isUnkeyedTopLevelFragment) {
|
|
switch (returnFiber.tag) {
|
|
case ClassComponent: {
|
|
{
|
|
var instance = returnFiber.stateNode;
|
|
if (instance.render._isMockFunction) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
case Block:
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case SimpleMemoComponent: {
|
|
{
|
|
{
|
|
throw Error((getComponentName(returnFiber.type) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
}
|
|
return reconcileChildFibers2;
|
|
}
|
|
var reconcileChildFibers = ChildReconciler(true);
|
|
var mountChildFibers = ChildReconciler(false);
|
|
function cloneChildFibers(current2, workInProgress2) {
|
|
if (!(current2 === null || workInProgress2.child === current2.child)) {
|
|
{
|
|
throw Error("Resuming work not yet implemented.");
|
|
}
|
|
}
|
|
if (workInProgress2.child === null) {
|
|
return;
|
|
}
|
|
var currentChild = workInProgress2.child;
|
|
var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
|
|
workInProgress2.child = newChild;
|
|
newChild.return = workInProgress2;
|
|
while (currentChild.sibling !== null) {
|
|
currentChild = currentChild.sibling;
|
|
newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
|
|
newChild.return = workInProgress2;
|
|
}
|
|
newChild.sibling = null;
|
|
}
|
|
function resetChildFibers(workInProgress2, lanes) {
|
|
var child = workInProgress2.child;
|
|
while (child !== null) {
|
|
resetWorkInProgress(child, lanes);
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
var NO_CONTEXT = {};
|
|
var contextStackCursor$1 = createCursor(NO_CONTEXT);
|
|
var contextFiberStackCursor = createCursor(NO_CONTEXT);
|
|
var rootInstanceStackCursor = createCursor(NO_CONTEXT);
|
|
function requiredContext(c) {
|
|
if (!(c !== NO_CONTEXT)) {
|
|
{
|
|
throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
return c;
|
|
}
|
|
function getRootHostContainer() {
|
|
var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
|
return rootInstance;
|
|
}
|
|
function pushHostContainer(fiber, nextRootInstance) {
|
|
push(rootInstanceStackCursor, nextRootInstance, fiber);
|
|
push(contextFiberStackCursor, fiber, fiber);
|
|
push(contextStackCursor$1, NO_CONTEXT, fiber);
|
|
var nextRootContext = getRootHostContext(nextRootInstance);
|
|
pop(contextStackCursor$1, fiber);
|
|
push(contextStackCursor$1, nextRootContext, fiber);
|
|
}
|
|
function popHostContainer(fiber) {
|
|
pop(contextStackCursor$1, fiber);
|
|
pop(contextFiberStackCursor, fiber);
|
|
pop(rootInstanceStackCursor, fiber);
|
|
}
|
|
function getHostContext() {
|
|
var context = requiredContext(contextStackCursor$1.current);
|
|
return context;
|
|
}
|
|
function pushHostContext(fiber) {
|
|
var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
|
var context = requiredContext(contextStackCursor$1.current);
|
|
var nextContext = getChildHostContext(context, fiber.type);
|
|
if (context === nextContext) {
|
|
return;
|
|
}
|
|
push(contextFiberStackCursor, fiber, fiber);
|
|
push(contextStackCursor$1, nextContext, fiber);
|
|
}
|
|
function popHostContext(fiber) {
|
|
if (contextFiberStackCursor.current !== fiber) {
|
|
return;
|
|
}
|
|
pop(contextStackCursor$1, fiber);
|
|
pop(contextFiberStackCursor, fiber);
|
|
}
|
|
var DefaultSuspenseContext = 0;
|
|
var SubtreeSuspenseContextMask = 1;
|
|
var InvisibleParentSuspenseContext = 1;
|
|
var ForceSuspenseFallback = 2;
|
|
var suspenseStackCursor = createCursor(DefaultSuspenseContext);
|
|
function hasSuspenseContext(parentContext, flag) {
|
|
return (parentContext & flag) !== 0;
|
|
}
|
|
function setDefaultShallowSuspenseContext(parentContext) {
|
|
return parentContext & SubtreeSuspenseContextMask;
|
|
}
|
|
function setShallowSuspenseContext(parentContext, shallowContext) {
|
|
return parentContext & SubtreeSuspenseContextMask | shallowContext;
|
|
}
|
|
function addSubtreeSuspenseContext(parentContext, subtreeContext) {
|
|
return parentContext | subtreeContext;
|
|
}
|
|
function pushSuspenseContext(fiber, newContext) {
|
|
push(suspenseStackCursor, newContext, fiber);
|
|
}
|
|
function popSuspenseContext(fiber) {
|
|
pop(suspenseStackCursor, fiber);
|
|
}
|
|
function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
|
|
var nextState = workInProgress2.memoizedState;
|
|
if (nextState !== null) {
|
|
if (nextState.dehydrated !== null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
var props = workInProgress2.memoizedProps;
|
|
if (props.fallback === void 0) {
|
|
return false;
|
|
}
|
|
if (props.unstable_avoidThisFallback !== true) {
|
|
return true;
|
|
}
|
|
if (hasInvisibleParent) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function findFirstSuspended(row) {
|
|
var node = row;
|
|
while (node !== null) {
|
|
if (node.tag === SuspenseComponent) {
|
|
var state = node.memoizedState;
|
|
if (state !== null) {
|
|
var dehydrated = state.dehydrated;
|
|
if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
|
|
return node;
|
|
}
|
|
}
|
|
} else if (node.tag === SuspenseListComponent && node.memoizedProps.revealOrder !== void 0) {
|
|
var didSuspend = (node.flags & DidCapture) !== NoFlags;
|
|
if (didSuspend) {
|
|
return node;
|
|
}
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === row) {
|
|
return null;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === row) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
var NoFlags$1 = 0;
|
|
var HasEffect = 1;
|
|
var Layout = 2;
|
|
var Passive$1 = 4;
|
|
var hydrationParentFiber = null;
|
|
var nextHydratableInstance = null;
|
|
var isHydrating = false;
|
|
function enterHydrationState(fiber) {
|
|
var parentInstance = fiber.stateNode.containerInfo;
|
|
nextHydratableInstance = getFirstHydratableChild(parentInstance);
|
|
hydrationParentFiber = fiber;
|
|
isHydrating = true;
|
|
return true;
|
|
}
|
|
function deleteHydratableInstance(returnFiber, instance) {
|
|
{
|
|
switch (returnFiber.tag) {
|
|
case HostRoot:
|
|
didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
|
|
break;
|
|
case HostComponent:
|
|
didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
|
|
break;
|
|
}
|
|
}
|
|
var childToDelete = createFiberFromHostInstanceForDeletion();
|
|
childToDelete.stateNode = instance;
|
|
childToDelete.return = returnFiber;
|
|
childToDelete.flags = Deletion;
|
|
if (returnFiber.lastEffect !== null) {
|
|
returnFiber.lastEffect.nextEffect = childToDelete;
|
|
returnFiber.lastEffect = childToDelete;
|
|
} else {
|
|
returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
|
|
}
|
|
}
|
|
function insertNonHydratedInstance(returnFiber, fiber) {
|
|
fiber.flags = fiber.flags & ~Hydrating | Placement;
|
|
{
|
|
switch (returnFiber.tag) {
|
|
case HostRoot: {
|
|
var parentContainer = returnFiber.stateNode.containerInfo;
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
var type = fiber.type;
|
|
var props = fiber.pendingProps;
|
|
didNotFindHydratableContainerInstance(parentContainer, type);
|
|
break;
|
|
case HostText:
|
|
var text = fiber.pendingProps;
|
|
didNotFindHydratableContainerTextInstance(parentContainer, text);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var parentType = returnFiber.type;
|
|
var parentProps = returnFiber.memoizedProps;
|
|
var parentInstance = returnFiber.stateNode;
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
var _type = fiber.type;
|
|
var _props = fiber.pendingProps;
|
|
didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
|
|
break;
|
|
case HostText:
|
|
var _text = fiber.pendingProps;
|
|
didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
|
|
break;
|
|
case SuspenseComponent:
|
|
didNotFindHydratableSuspenseInstance(parentType, parentProps);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function tryHydrate(fiber, nextInstance) {
|
|
switch (fiber.tag) {
|
|
case HostComponent: {
|
|
var type = fiber.type;
|
|
var props = fiber.pendingProps;
|
|
var instance = canHydrateInstance(nextInstance, type);
|
|
if (instance !== null) {
|
|
fiber.stateNode = instance;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
case HostText: {
|
|
var text = fiber.pendingProps;
|
|
var textInstance = canHydrateTextInstance(nextInstance, text);
|
|
if (textInstance !== null) {
|
|
fiber.stateNode = textInstance;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
case SuspenseComponent: {
|
|
return false;
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function tryToClaimNextHydratableInstance(fiber) {
|
|
if (!isHydrating) {
|
|
return;
|
|
}
|
|
var nextInstance = nextHydratableInstance;
|
|
if (!nextInstance) {
|
|
insertNonHydratedInstance(hydrationParentFiber, fiber);
|
|
isHydrating = false;
|
|
hydrationParentFiber = fiber;
|
|
return;
|
|
}
|
|
var firstAttemptedInstance = nextInstance;
|
|
if (!tryHydrate(fiber, nextInstance)) {
|
|
nextInstance = getNextHydratableSibling(firstAttemptedInstance);
|
|
if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
|
|
insertNonHydratedInstance(hydrationParentFiber, fiber);
|
|
isHydrating = false;
|
|
hydrationParentFiber = fiber;
|
|
return;
|
|
}
|
|
deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
|
|
}
|
|
hydrationParentFiber = fiber;
|
|
nextHydratableInstance = getFirstHydratableChild(nextInstance);
|
|
}
|
|
function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
|
|
var instance = fiber.stateNode;
|
|
var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
|
|
fiber.updateQueue = updatePayload;
|
|
if (updatePayload !== null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function prepareToHydrateHostTextInstance(fiber) {
|
|
var textInstance = fiber.stateNode;
|
|
var textContent = fiber.memoizedProps;
|
|
var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
|
|
{
|
|
if (shouldUpdate) {
|
|
var returnFiber = hydrationParentFiber;
|
|
if (returnFiber !== null) {
|
|
switch (returnFiber.tag) {
|
|
case HostRoot: {
|
|
var parentContainer = returnFiber.stateNode.containerInfo;
|
|
didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var parentType = returnFiber.type;
|
|
var parentProps = returnFiber.memoizedProps;
|
|
var parentInstance = returnFiber.stateNode;
|
|
didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return shouldUpdate;
|
|
}
|
|
function skipPastDehydratedSuspenseInstance(fiber) {
|
|
var suspenseState = fiber.memoizedState;
|
|
var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
|
|
if (!suspenseInstance) {
|
|
{
|
|
throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
|
|
}
|
|
function popToNextHostParent(fiber) {
|
|
var parent = fiber.return;
|
|
while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
|
|
parent = parent.return;
|
|
}
|
|
hydrationParentFiber = parent;
|
|
}
|
|
function popHydrationState(fiber) {
|
|
if (fiber !== hydrationParentFiber) {
|
|
return false;
|
|
}
|
|
if (!isHydrating) {
|
|
popToNextHostParent(fiber);
|
|
isHydrating = true;
|
|
return false;
|
|
}
|
|
var type = fiber.type;
|
|
if (fiber.tag !== HostComponent || type !== "head" && type !== "body" && !shouldSetTextContent(type, fiber.memoizedProps)) {
|
|
var nextInstance = nextHydratableInstance;
|
|
while (nextInstance) {
|
|
deleteHydratableInstance(fiber, nextInstance);
|
|
nextInstance = getNextHydratableSibling(nextInstance);
|
|
}
|
|
}
|
|
popToNextHostParent(fiber);
|
|
if (fiber.tag === SuspenseComponent) {
|
|
nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
|
|
} else {
|
|
nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
|
|
}
|
|
return true;
|
|
}
|
|
function resetHydrationState() {
|
|
hydrationParentFiber = null;
|
|
nextHydratableInstance = null;
|
|
isHydrating = false;
|
|
}
|
|
function getIsHydrating() {
|
|
return isHydrating;
|
|
}
|
|
var workInProgressSources = [];
|
|
var rendererSigil$1;
|
|
{
|
|
rendererSigil$1 = {};
|
|
}
|
|
function markSourceAsDirty(mutableSource) {
|
|
workInProgressSources.push(mutableSource);
|
|
}
|
|
function resetWorkInProgressVersions() {
|
|
for (var i = 0; i < workInProgressSources.length; i++) {
|
|
var mutableSource = workInProgressSources[i];
|
|
{
|
|
mutableSource._workInProgressVersionPrimary = null;
|
|
}
|
|
}
|
|
workInProgressSources.length = 0;
|
|
}
|
|
function getWorkInProgressVersion(mutableSource) {
|
|
{
|
|
return mutableSource._workInProgressVersionPrimary;
|
|
}
|
|
}
|
|
function setWorkInProgressVersion(mutableSource, version) {
|
|
{
|
|
mutableSource._workInProgressVersionPrimary = version;
|
|
}
|
|
workInProgressSources.push(mutableSource);
|
|
}
|
|
function warnAboutMultipleRenderersDEV(mutableSource) {
|
|
{
|
|
{
|
|
if (mutableSource._currentPrimaryRenderer == null) {
|
|
mutableSource._currentPrimaryRenderer = rendererSigil$1;
|
|
} else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {
|
|
error("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
var didWarnAboutMismatchedHooksForComponent;
|
|
var didWarnAboutUseOpaqueIdentifier;
|
|
{
|
|
didWarnAboutUseOpaqueIdentifier = {};
|
|
didWarnAboutMismatchedHooksForComponent = new Set();
|
|
}
|
|
var renderLanes = NoLanes;
|
|
var currentlyRenderingFiber$1 = null;
|
|
var currentHook = null;
|
|
var workInProgressHook = null;
|
|
var didScheduleRenderPhaseUpdate = false;
|
|
var didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
var RE_RENDER_LIMIT = 25;
|
|
var currentHookNameInDev = null;
|
|
var hookTypesDev = null;
|
|
var hookTypesUpdateIndexDev = -1;
|
|
var ignorePreviousDependencies = false;
|
|
function mountHookTypesDev() {
|
|
{
|
|
var hookName = currentHookNameInDev;
|
|
if (hookTypesDev === null) {
|
|
hookTypesDev = [hookName];
|
|
} else {
|
|
hookTypesDev.push(hookName);
|
|
}
|
|
}
|
|
}
|
|
function updateHookTypesDev() {
|
|
{
|
|
var hookName = currentHookNameInDev;
|
|
if (hookTypesDev !== null) {
|
|
hookTypesUpdateIndexDev++;
|
|
if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
|
|
warnOnHookMismatchInDev(hookName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function checkDepsAreArrayDev(deps) {
|
|
{
|
|
if (deps !== void 0 && deps !== null && !Array.isArray(deps)) {
|
|
error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
|
|
}
|
|
}
|
|
}
|
|
function warnOnHookMismatchInDev(currentHookName) {
|
|
{
|
|
var componentName = getComponentName(currentlyRenderingFiber$1.type);
|
|
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
|
|
didWarnAboutMismatchedHooksForComponent.add(componentName);
|
|
if (hookTypesDev !== null) {
|
|
var table = "";
|
|
var secondColumnStart = 30;
|
|
for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
|
|
var oldHookName = hookTypesDev[i];
|
|
var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
|
|
var row = i + 1 + ". " + oldHookName;
|
|
while (row.length < secondColumnStart) {
|
|
row += " ";
|
|
}
|
|
row += newHookName + "\n";
|
|
table += row;
|
|
}
|
|
error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function throwInvalidHookError() {
|
|
{
|
|
{
|
|
throw 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
}
|
|
}
|
|
}
|
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
{
|
|
if (ignorePreviousDependencies) {
|
|
return false;
|
|
}
|
|
}
|
|
if (prevDeps === null) {
|
|
{
|
|
error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
|
|
}
|
|
return false;
|
|
}
|
|
{
|
|
if (nextDeps.length !== prevDeps.length) {
|
|
error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
|
|
}
|
|
}
|
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
|
if (objectIs(nextDeps[i], prevDeps[i])) {
|
|
continue;
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) {
|
|
renderLanes = nextRenderLanes;
|
|
currentlyRenderingFiber$1 = workInProgress2;
|
|
{
|
|
hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
|
|
}
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
workInProgress2.lanes = NoLanes;
|
|
{
|
|
if (current2 !== null && current2.memoizedState !== null) {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
} else if (hookTypesDev !== null) {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
|
|
} else {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
|
|
}
|
|
}
|
|
var children = Component(props, secondArg);
|
|
if (didScheduleRenderPhaseUpdateDuringThisPass) {
|
|
var numberOfReRenders = 0;
|
|
do {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
{
|
|
throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
|
|
}
|
|
}
|
|
numberOfReRenders += 1;
|
|
{
|
|
ignorePreviousDependencies = false;
|
|
}
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
workInProgress2.updateQueue = null;
|
|
{
|
|
hookTypesUpdateIndexDev = -1;
|
|
}
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
|
|
children = Component(props, secondArg);
|
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
}
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
{
|
|
workInProgress2._debugHookTypes = hookTypesDev;
|
|
}
|
|
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
|
|
renderLanes = NoLanes;
|
|
currentlyRenderingFiber$1 = null;
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
{
|
|
currentHookNameInDev = null;
|
|
hookTypesDev = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
}
|
|
didScheduleRenderPhaseUpdate = false;
|
|
if (!!didRenderTooFewHooks) {
|
|
{
|
|
throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
|
|
}
|
|
}
|
|
return children;
|
|
}
|
|
function bailoutHooks(current2, workInProgress2, lanes) {
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
workInProgress2.flags &= ~(Passive | Update);
|
|
current2.lanes = removeLanes(current2.lanes, lanes);
|
|
}
|
|
function resetHooksAfterThrow() {
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
if (didScheduleRenderPhaseUpdate) {
|
|
var hook = currentlyRenderingFiber$1.memoizedState;
|
|
while (hook !== null) {
|
|
var queue = hook.queue;
|
|
if (queue !== null) {
|
|
queue.pending = null;
|
|
}
|
|
hook = hook.next;
|
|
}
|
|
didScheduleRenderPhaseUpdate = false;
|
|
}
|
|
renderLanes = NoLanes;
|
|
currentlyRenderingFiber$1 = null;
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
{
|
|
hookTypesDev = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
currentHookNameInDev = null;
|
|
isUpdatingOpaqueValueInRenderPhase = false;
|
|
}
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
}
|
|
function mountWorkInProgressHook() {
|
|
var hook = {
|
|
memoizedState: null,
|
|
baseState: null,
|
|
baseQueue: null,
|
|
queue: null,
|
|
next: null
|
|
};
|
|
if (workInProgressHook === null) {
|
|
currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
|
|
} else {
|
|
workInProgressHook = workInProgressHook.next = hook;
|
|
}
|
|
return workInProgressHook;
|
|
}
|
|
function updateWorkInProgressHook() {
|
|
var nextCurrentHook;
|
|
if (currentHook === null) {
|
|
var current2 = currentlyRenderingFiber$1.alternate;
|
|
if (current2 !== null) {
|
|
nextCurrentHook = current2.memoizedState;
|
|
} else {
|
|
nextCurrentHook = null;
|
|
}
|
|
} else {
|
|
nextCurrentHook = currentHook.next;
|
|
}
|
|
var nextWorkInProgressHook;
|
|
if (workInProgressHook === null) {
|
|
nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
|
|
} else {
|
|
nextWorkInProgressHook = workInProgressHook.next;
|
|
}
|
|
if (nextWorkInProgressHook !== null) {
|
|
workInProgressHook = nextWorkInProgressHook;
|
|
nextWorkInProgressHook = workInProgressHook.next;
|
|
currentHook = nextCurrentHook;
|
|
} else {
|
|
if (!(nextCurrentHook !== null)) {
|
|
{
|
|
throw Error("Rendered more hooks than during the previous render.");
|
|
}
|
|
}
|
|
currentHook = nextCurrentHook;
|
|
var newHook = {
|
|
memoizedState: currentHook.memoizedState,
|
|
baseState: currentHook.baseState,
|
|
baseQueue: currentHook.baseQueue,
|
|
queue: currentHook.queue,
|
|
next: null
|
|
};
|
|
if (workInProgressHook === null) {
|
|
currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
|
|
} else {
|
|
workInProgressHook = workInProgressHook.next = newHook;
|
|
}
|
|
}
|
|
return workInProgressHook;
|
|
}
|
|
function createFunctionComponentUpdateQueue() {
|
|
return {
|
|
lastEffect: null
|
|
};
|
|
}
|
|
function basicStateReducer(state, action) {
|
|
return typeof action === "function" ? action(state) : action;
|
|
}
|
|
function mountReducer(reducer, initialArg, init) {
|
|
var hook = mountWorkInProgressHook();
|
|
var initialState;
|
|
if (init !== void 0) {
|
|
initialState = init(initialArg);
|
|
} else {
|
|
initialState = initialArg;
|
|
}
|
|
hook.memoizedState = hook.baseState = initialState;
|
|
var queue = hook.queue = {
|
|
pending: null,
|
|
dispatch: null,
|
|
lastRenderedReducer: reducer,
|
|
lastRenderedState: initialState
|
|
};
|
|
var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function updateReducer(reducer, initialArg, init) {
|
|
var hook = updateWorkInProgressHook();
|
|
var queue = hook.queue;
|
|
if (!(queue !== null)) {
|
|
{
|
|
throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
queue.lastRenderedReducer = reducer;
|
|
var current2 = currentHook;
|
|
var baseQueue = current2.baseQueue;
|
|
var pendingQueue = queue.pending;
|
|
if (pendingQueue !== null) {
|
|
if (baseQueue !== null) {
|
|
var baseFirst = baseQueue.next;
|
|
var pendingFirst = pendingQueue.next;
|
|
baseQueue.next = pendingFirst;
|
|
pendingQueue.next = baseFirst;
|
|
}
|
|
{
|
|
if (current2.baseQueue !== baseQueue) {
|
|
error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
|
|
}
|
|
}
|
|
current2.baseQueue = baseQueue = pendingQueue;
|
|
queue.pending = null;
|
|
}
|
|
if (baseQueue !== null) {
|
|
var first = baseQueue.next;
|
|
var newState = current2.baseState;
|
|
var newBaseState = null;
|
|
var newBaseQueueFirst = null;
|
|
var newBaseQueueLast = null;
|
|
var update = first;
|
|
do {
|
|
var updateLane = update.lane;
|
|
if (!isSubsetOfLanes(renderLanes, updateLane)) {
|
|
var clone = {
|
|
lane: updateLane,
|
|
action: update.action,
|
|
eagerReducer: update.eagerReducer,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
};
|
|
if (newBaseQueueLast === null) {
|
|
newBaseQueueFirst = newBaseQueueLast = clone;
|
|
newBaseState = newState;
|
|
} else {
|
|
newBaseQueueLast = newBaseQueueLast.next = clone;
|
|
}
|
|
currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
|
|
markSkippedUpdateLanes(updateLane);
|
|
} else {
|
|
if (newBaseQueueLast !== null) {
|
|
var _clone = {
|
|
lane: NoLane,
|
|
action: update.action,
|
|
eagerReducer: update.eagerReducer,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
};
|
|
newBaseQueueLast = newBaseQueueLast.next = _clone;
|
|
}
|
|
if (update.eagerReducer === reducer) {
|
|
newState = update.eagerState;
|
|
} else {
|
|
var action = update.action;
|
|
newState = reducer(newState, action);
|
|
}
|
|
}
|
|
update = update.next;
|
|
} while (update !== null && update !== first);
|
|
if (newBaseQueueLast === null) {
|
|
newBaseState = newState;
|
|
} else {
|
|
newBaseQueueLast.next = newBaseQueueFirst;
|
|
}
|
|
if (!objectIs(newState, hook.memoizedState)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newBaseState;
|
|
hook.baseQueue = newBaseQueueLast;
|
|
queue.lastRenderedState = newState;
|
|
}
|
|
var dispatch = queue.dispatch;
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function rerenderReducer(reducer, initialArg, init) {
|
|
var hook = updateWorkInProgressHook();
|
|
var queue = hook.queue;
|
|
if (!(queue !== null)) {
|
|
{
|
|
throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
queue.lastRenderedReducer = reducer;
|
|
var dispatch = queue.dispatch;
|
|
var lastRenderPhaseUpdate = queue.pending;
|
|
var newState = hook.memoizedState;
|
|
if (lastRenderPhaseUpdate !== null) {
|
|
queue.pending = null;
|
|
var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
|
var update = firstRenderPhaseUpdate;
|
|
do {
|
|
var action = update.action;
|
|
newState = reducer(newState, action);
|
|
update = update.next;
|
|
} while (update !== firstRenderPhaseUpdate);
|
|
if (!objectIs(newState, hook.memoizedState)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
hook.memoizedState = newState;
|
|
if (hook.baseQueue === null) {
|
|
hook.baseState = newState;
|
|
}
|
|
queue.lastRenderedState = newState;
|
|
}
|
|
return [newState, dispatch];
|
|
}
|
|
function readFromUnsubcribedMutableSource(root2, source, getSnapshot) {
|
|
{
|
|
warnAboutMultipleRenderersDEV(source);
|
|
}
|
|
var getVersion = source._getVersion;
|
|
var version = getVersion(source._source);
|
|
var isSafeToReadFromSource = false;
|
|
var currentRenderVersion = getWorkInProgressVersion(source);
|
|
if (currentRenderVersion !== null) {
|
|
isSafeToReadFromSource = currentRenderVersion === version;
|
|
} else {
|
|
isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root2.mutableReadLanes);
|
|
if (isSafeToReadFromSource) {
|
|
setWorkInProgressVersion(source, version);
|
|
}
|
|
}
|
|
if (isSafeToReadFromSource) {
|
|
var snapshot = getSnapshot(source._source);
|
|
{
|
|
if (typeof snapshot === "function") {
|
|
error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
|
|
}
|
|
}
|
|
return snapshot;
|
|
} else {
|
|
markSourceAsDirty(source);
|
|
{
|
|
{
|
|
throw Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function useMutableSource(hook, source, getSnapshot, subscribe) {
|
|
var root2 = getWorkInProgressRoot();
|
|
if (!(root2 !== null)) {
|
|
{
|
|
throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var getVersion = source._getVersion;
|
|
var version = getVersion(source._source);
|
|
var dispatcher = ReactCurrentDispatcher$1.current;
|
|
var _dispatcher$useState = dispatcher.useState(function() {
|
|
return readFromUnsubcribedMutableSource(root2, source, getSnapshot);
|
|
}), currentSnapshot = _dispatcher$useState[0], setSnapshot = _dispatcher$useState[1];
|
|
var snapshot = currentSnapshot;
|
|
var stateHook = workInProgressHook;
|
|
var memoizedState = hook.memoizedState;
|
|
var refs = memoizedState.refs;
|
|
var prevGetSnapshot = refs.getSnapshot;
|
|
var prevSource = memoizedState.source;
|
|
var prevSubscribe = memoizedState.subscribe;
|
|
var fiber = currentlyRenderingFiber$1;
|
|
hook.memoizedState = {
|
|
refs,
|
|
source,
|
|
subscribe
|
|
};
|
|
dispatcher.useEffect(function() {
|
|
refs.getSnapshot = getSnapshot;
|
|
refs.setSnapshot = setSnapshot;
|
|
var maybeNewVersion = getVersion(source._source);
|
|
if (!objectIs(version, maybeNewVersion)) {
|
|
var maybeNewSnapshot = getSnapshot(source._source);
|
|
{
|
|
if (typeof maybeNewSnapshot === "function") {
|
|
error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
|
|
}
|
|
}
|
|
if (!objectIs(snapshot, maybeNewSnapshot)) {
|
|
setSnapshot(maybeNewSnapshot);
|
|
var lane = requestUpdateLane(fiber);
|
|
markRootMutableRead(root2, lane);
|
|
}
|
|
markRootEntangled(root2, root2.mutableReadLanes);
|
|
}
|
|
}, [getSnapshot, source, subscribe]);
|
|
dispatcher.useEffect(function() {
|
|
var handleChange = function() {
|
|
var latestGetSnapshot = refs.getSnapshot;
|
|
var latestSetSnapshot = refs.setSnapshot;
|
|
try {
|
|
latestSetSnapshot(latestGetSnapshot(source._source));
|
|
var lane = requestUpdateLane(fiber);
|
|
markRootMutableRead(root2, lane);
|
|
} catch (error2) {
|
|
latestSetSnapshot(function() {
|
|
throw error2;
|
|
});
|
|
}
|
|
};
|
|
var unsubscribe = subscribe(source._source, handleChange);
|
|
{
|
|
if (typeof unsubscribe !== "function") {
|
|
error("Mutable source subscribe function must return an unsubscribe function.");
|
|
}
|
|
}
|
|
return unsubscribe;
|
|
}, [source, subscribe]);
|
|
if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {
|
|
var newQueue = {
|
|
pending: null,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: snapshot
|
|
};
|
|
newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);
|
|
stateHook.queue = newQueue;
|
|
stateHook.baseQueue = null;
|
|
snapshot = readFromUnsubcribedMutableSource(root2, source, getSnapshot);
|
|
stateHook.memoizedState = stateHook.baseState = snapshot;
|
|
}
|
|
return snapshot;
|
|
}
|
|
function mountMutableSource(source, getSnapshot, subscribe) {
|
|
var hook = mountWorkInProgressHook();
|
|
hook.memoizedState = {
|
|
refs: {
|
|
getSnapshot,
|
|
setSnapshot: null
|
|
},
|
|
source,
|
|
subscribe
|
|
};
|
|
return useMutableSource(hook, source, getSnapshot, subscribe);
|
|
}
|
|
function updateMutableSource(source, getSnapshot, subscribe) {
|
|
var hook = updateWorkInProgressHook();
|
|
return useMutableSource(hook, source, getSnapshot, subscribe);
|
|
}
|
|
function mountState(initialState) {
|
|
var hook = mountWorkInProgressHook();
|
|
if (typeof initialState === "function") {
|
|
initialState = initialState();
|
|
}
|
|
hook.memoizedState = hook.baseState = initialState;
|
|
var queue = hook.queue = {
|
|
pending: null,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: initialState
|
|
};
|
|
var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function updateState(initialState) {
|
|
return updateReducer(basicStateReducer);
|
|
}
|
|
function rerenderState(initialState) {
|
|
return rerenderReducer(basicStateReducer);
|
|
}
|
|
function pushEffect(tag, create, destroy, deps) {
|
|
var effect = {
|
|
tag,
|
|
create,
|
|
destroy,
|
|
deps,
|
|
next: null
|
|
};
|
|
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
|
|
if (componentUpdateQueue === null) {
|
|
componentUpdateQueue = createFunctionComponentUpdateQueue();
|
|
currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
|
|
componentUpdateQueue.lastEffect = effect.next = effect;
|
|
} else {
|
|
var lastEffect = componentUpdateQueue.lastEffect;
|
|
if (lastEffect === null) {
|
|
componentUpdateQueue.lastEffect = effect.next = effect;
|
|
} else {
|
|
var firstEffect = lastEffect.next;
|
|
lastEffect.next = effect;
|
|
effect.next = firstEffect;
|
|
componentUpdateQueue.lastEffect = effect;
|
|
}
|
|
}
|
|
return effect;
|
|
}
|
|
function mountRef(initialValue) {
|
|
var hook = mountWorkInProgressHook();
|
|
var ref = {
|
|
current: initialValue
|
|
};
|
|
{
|
|
Object.seal(ref);
|
|
}
|
|
hook.memoizedState = ref;
|
|
return ref;
|
|
}
|
|
function updateRef(initialValue) {
|
|
var hook = updateWorkInProgressHook();
|
|
return hook.memoizedState;
|
|
}
|
|
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
|
|
}
|
|
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var destroy = void 0;
|
|
if (currentHook !== null) {
|
|
var prevEffect = currentHook.memoizedState;
|
|
destroy = prevEffect.destroy;
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevEffect.deps;
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
pushEffect(hookFlags, create, destroy, nextDeps);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
|
|
}
|
|
function mountEffect(create, deps) {
|
|
{
|
|
if (typeof jest !== "undefined") {
|
|
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
|
|
}
|
|
}
|
|
return mountEffectImpl(Update | Passive, Passive$1, create, deps);
|
|
}
|
|
function updateEffect(create, deps) {
|
|
{
|
|
if (typeof jest !== "undefined") {
|
|
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
|
|
}
|
|
}
|
|
return updateEffectImpl(Update | Passive, Passive$1, create, deps);
|
|
}
|
|
function mountLayoutEffect(create, deps) {
|
|
return mountEffectImpl(Update, Layout, create, deps);
|
|
}
|
|
function updateLayoutEffect(create, deps) {
|
|
return updateEffectImpl(Update, Layout, create, deps);
|
|
}
|
|
function imperativeHandleEffect(create, ref) {
|
|
if (typeof ref === "function") {
|
|
var refCallback = ref;
|
|
var _inst = create();
|
|
refCallback(_inst);
|
|
return function() {
|
|
refCallback(null);
|
|
};
|
|
} else if (ref !== null && ref !== void 0) {
|
|
var refObject = ref;
|
|
{
|
|
if (!refObject.hasOwnProperty("current")) {
|
|
error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
|
|
}
|
|
}
|
|
var _inst2 = create();
|
|
refObject.current = _inst2;
|
|
return function() {
|
|
refObject.current = null;
|
|
};
|
|
}
|
|
}
|
|
function mountImperativeHandle(ref, create, deps) {
|
|
{
|
|
if (typeof create !== "function") {
|
|
error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
|
|
}
|
|
}
|
|
var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
|
|
return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
|
|
}
|
|
function updateImperativeHandle(ref, create, deps) {
|
|
{
|
|
if (typeof create !== "function") {
|
|
error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
|
|
}
|
|
}
|
|
var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
|
|
return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
|
|
}
|
|
function mountDebugValue(value, formatterFn) {
|
|
}
|
|
var updateDebugValue = mountDebugValue;
|
|
function mountCallback(callback, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
hook.memoizedState = [callback, nextDeps];
|
|
return callback;
|
|
}
|
|
function updateCallback(callback, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (prevState !== null) {
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevState[1];
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
return prevState[0];
|
|
}
|
|
}
|
|
}
|
|
hook.memoizedState = [callback, nextDeps];
|
|
return callback;
|
|
}
|
|
function mountMemo(nextCreate, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var nextValue = nextCreate();
|
|
hook.memoizedState = [nextValue, nextDeps];
|
|
return nextValue;
|
|
}
|
|
function updateMemo(nextCreate, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (prevState !== null) {
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevState[1];
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
return prevState[0];
|
|
}
|
|
}
|
|
}
|
|
var nextValue = nextCreate();
|
|
hook.memoizedState = [nextValue, nextDeps];
|
|
return nextValue;
|
|
}
|
|
function mountDeferredValue(value) {
|
|
var _mountState = mountState(value), prevValue = _mountState[0], setValue = _mountState[1];
|
|
mountEffect(function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
}, [value]);
|
|
return prevValue;
|
|
}
|
|
function updateDeferredValue(value) {
|
|
var _updateState = updateState(), prevValue = _updateState[0], setValue = _updateState[1];
|
|
updateEffect(function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
}, [value]);
|
|
return prevValue;
|
|
}
|
|
function rerenderDeferredValue(value) {
|
|
var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue = _rerenderState[1];
|
|
updateEffect(function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setValue(value);
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
}, [value]);
|
|
return prevValue;
|
|
}
|
|
function startTransition(setPending, callback) {
|
|
var priorityLevel = getCurrentPriorityLevel();
|
|
{
|
|
runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function() {
|
|
setPending(true);
|
|
});
|
|
runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function() {
|
|
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
ReactCurrentBatchConfig$1.transition = 1;
|
|
try {
|
|
setPending(false);
|
|
callback();
|
|
} finally {
|
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function mountTransition() {
|
|
var _mountState2 = mountState(false), isPending = _mountState2[0], setPending = _mountState2[1];
|
|
var start = startTransition.bind(null, setPending);
|
|
mountRef(start);
|
|
return [start, isPending];
|
|
}
|
|
function updateTransition() {
|
|
var _updateState2 = updateState(), isPending = _updateState2[0];
|
|
var startRef = updateRef();
|
|
var start = startRef.current;
|
|
return [start, isPending];
|
|
}
|
|
function rerenderTransition() {
|
|
var _rerenderState2 = rerenderState(), isPending = _rerenderState2[0];
|
|
var startRef = updateRef();
|
|
var start = startRef.current;
|
|
return [start, isPending];
|
|
}
|
|
var isUpdatingOpaqueValueInRenderPhase = false;
|
|
function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
|
|
{
|
|
return isUpdatingOpaqueValueInRenderPhase;
|
|
}
|
|
}
|
|
function warnOnOpaqueIdentifierAccessInDEV(fiber) {
|
|
{
|
|
var name = getComponentName(fiber.type) || "Unknown";
|
|
if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {
|
|
error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
|
|
didWarnAboutUseOpaqueIdentifier[name] = true;
|
|
}
|
|
}
|
|
}
|
|
function mountOpaqueIdentifier() {
|
|
var makeId = makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1));
|
|
if (getIsHydrating()) {
|
|
var didUpgrade = false;
|
|
var fiber = currentlyRenderingFiber$1;
|
|
var readValue = function() {
|
|
if (!didUpgrade) {
|
|
didUpgrade = true;
|
|
{
|
|
isUpdatingOpaqueValueInRenderPhase = true;
|
|
setId(makeId());
|
|
isUpdatingOpaqueValueInRenderPhase = false;
|
|
warnOnOpaqueIdentifierAccessInDEV(fiber);
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
|
|
}
|
|
}
|
|
};
|
|
var id = makeOpaqueHydratingObject(readValue);
|
|
var setId = mountState(id)[1];
|
|
if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
|
|
currentlyRenderingFiber$1.flags |= Update | Passive;
|
|
pushEffect(HasEffect | Passive$1, function() {
|
|
setId(makeId());
|
|
}, void 0, null);
|
|
}
|
|
return id;
|
|
} else {
|
|
var _id = makeId();
|
|
mountState(_id);
|
|
return _id;
|
|
}
|
|
}
|
|
function updateOpaqueIdentifier() {
|
|
var id = updateState()[0];
|
|
return id;
|
|
}
|
|
function rerenderOpaqueIdentifier() {
|
|
var id = rerenderState()[0];
|
|
return id;
|
|
}
|
|
function dispatchAction(fiber, queue, action) {
|
|
{
|
|
if (typeof arguments[3] === "function") {
|
|
error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
|
|
}
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = {
|
|
lane,
|
|
action,
|
|
eagerReducer: null,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
var pending = queue.pending;
|
|
if (pending === null) {
|
|
update.next = update;
|
|
} else {
|
|
update.next = pending.next;
|
|
pending.next = update;
|
|
}
|
|
queue.pending = update;
|
|
var alternate = fiber.alternate;
|
|
if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
} else {
|
|
if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
|
|
var lastRenderedReducer = queue.lastRenderedReducer;
|
|
if (lastRenderedReducer !== null) {
|
|
var prevDispatcher;
|
|
{
|
|
prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
}
|
|
try {
|
|
var currentState = queue.lastRenderedState;
|
|
var eagerState = lastRenderedReducer(currentState, action);
|
|
update.eagerReducer = lastRenderedReducer;
|
|
update.eagerState = eagerState;
|
|
if (objectIs(eagerState, currentState)) {
|
|
return;
|
|
}
|
|
} catch (error2) {
|
|
} finally {
|
|
{
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (typeof jest !== "undefined") {
|
|
warnIfNotScopedWithMatchingAct(fiber);
|
|
warnIfNotCurrentlyActingUpdatesInDev(fiber);
|
|
}
|
|
}
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
}
|
|
}
|
|
var ContextOnlyDispatcher = {
|
|
readContext,
|
|
useCallback: throwInvalidHookError,
|
|
useContext: throwInvalidHookError,
|
|
useEffect: throwInvalidHookError,
|
|
useImperativeHandle: throwInvalidHookError,
|
|
useLayoutEffect: throwInvalidHookError,
|
|
useMemo: throwInvalidHookError,
|
|
useReducer: throwInvalidHookError,
|
|
useRef: throwInvalidHookError,
|
|
useState: throwInvalidHookError,
|
|
useDebugValue: throwInvalidHookError,
|
|
useDeferredValue: throwInvalidHookError,
|
|
useTransition: throwInvalidHookError,
|
|
useMutableSource: throwInvalidHookError,
|
|
useOpaqueIdentifier: throwInvalidHookError,
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
var HooksDispatcherOnMountInDEV = null;
|
|
var HooksDispatcherOnMountWithHookTypesInDEV = null;
|
|
var HooksDispatcherOnUpdateInDEV = null;
|
|
var HooksDispatcherOnRerenderInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnMountInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
{
|
|
var warnInvalidContextAccess = function() {
|
|
error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
};
|
|
var warnInvalidHookAccess = function() {
|
|
error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
|
|
};
|
|
HooksDispatcherOnMountInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
mountHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
mountHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
mountHookTypesDev();
|
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
mountHookTypesDev();
|
|
return mountOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnMountWithHookTypesInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
updateHookTypesDev();
|
|
return mountOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
updateHookTypesDev();
|
|
return updateOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
updateHookTypesDev();
|
|
return rerenderOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnMountInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context, observedBits) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context, observedBits) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context, observedBits);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderState(initialState);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
},
|
|
useOpaqueIdentifier: function() {
|
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderOpaqueIdentifier();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
}
|
|
var now$1 = Scheduler.unstable_now;
|
|
var commitTime = 0;
|
|
var profilerStartTime = -1;
|
|
function getCommitTime() {
|
|
return commitTime;
|
|
}
|
|
function recordCommitTime() {
|
|
commitTime = now$1();
|
|
}
|
|
function startProfilerTimer(fiber) {
|
|
profilerStartTime = now$1();
|
|
if (fiber.actualStartTime < 0) {
|
|
fiber.actualStartTime = now$1();
|
|
}
|
|
}
|
|
function stopProfilerTimerIfRunning(fiber) {
|
|
profilerStartTime = -1;
|
|
}
|
|
function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
|
|
if (profilerStartTime >= 0) {
|
|
var elapsedTime = now$1() - profilerStartTime;
|
|
fiber.actualDuration += elapsedTime;
|
|
if (overrideBaseTime) {
|
|
fiber.selfBaseDuration = elapsedTime;
|
|
}
|
|
profilerStartTime = -1;
|
|
}
|
|
}
|
|
function transferActualDuration(fiber) {
|
|
var child = fiber.child;
|
|
while (child) {
|
|
fiber.actualDuration += child.actualDuration;
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
var didReceiveUpdate = false;
|
|
var didWarnAboutBadClass;
|
|
var didWarnAboutModulePatternComponent;
|
|
var didWarnAboutContextTypeOnFunctionComponent;
|
|
var didWarnAboutGetDerivedStateOnFunctionComponent;
|
|
var didWarnAboutFunctionRefs;
|
|
var didWarnAboutReassigningProps;
|
|
var didWarnAboutRevealOrder;
|
|
var didWarnAboutTailOptions;
|
|
{
|
|
didWarnAboutBadClass = {};
|
|
didWarnAboutModulePatternComponent = {};
|
|
didWarnAboutContextTypeOnFunctionComponent = {};
|
|
didWarnAboutGetDerivedStateOnFunctionComponent = {};
|
|
didWarnAboutFunctionRefs = {};
|
|
didWarnAboutReassigningProps = false;
|
|
didWarnAboutRevealOrder = {};
|
|
didWarnAboutTailOptions = {};
|
|
}
|
|
function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
if (current2 === null) {
|
|
workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
} else {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
|
|
}
|
|
}
|
|
function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
}
|
|
function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component));
|
|
}
|
|
}
|
|
}
|
|
var render2 = Component.render;
|
|
var ref = workInProgress2.ref;
|
|
var nextChildren;
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
if (current2 !== null && !didReceiveUpdate) {
|
|
bailoutHooks(current2, workInProgress2, renderLanes2);
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateMemoComponent(current2, workInProgress2, Component, nextProps, updateLanes, renderLanes2) {
|
|
if (current2 === null) {
|
|
var type = Component.type;
|
|
if (isSimpleFunctionComponent(type) && Component.compare === null && Component.defaultProps === void 0) {
|
|
var resolvedType = type;
|
|
{
|
|
resolvedType = resolveFunctionForHotReloading(type);
|
|
}
|
|
workInProgress2.tag = SimpleMemoComponent;
|
|
workInProgress2.type = resolvedType;
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, type);
|
|
}
|
|
return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, updateLanes, renderLanes2);
|
|
}
|
|
{
|
|
var innerPropTypes = type.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(type));
|
|
}
|
|
}
|
|
var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
|
|
child.ref = workInProgress2.ref;
|
|
child.return = workInProgress2;
|
|
workInProgress2.child = child;
|
|
return child;
|
|
}
|
|
{
|
|
var _type = Component.type;
|
|
var _innerPropTypes = _type.propTypes;
|
|
if (_innerPropTypes) {
|
|
checkPropTypes(_innerPropTypes, nextProps, "prop", getComponentName(_type));
|
|
}
|
|
}
|
|
var currentChild = current2.child;
|
|
if (!includesSomeLane(updateLanes, renderLanes2)) {
|
|
var prevProps = currentChild.memoizedProps;
|
|
var compare = Component.compare;
|
|
compare = compare !== null ? compare : shallowEqual;
|
|
if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
var newChild = createWorkInProgress(currentChild, nextProps);
|
|
newChild.ref = workInProgress2.ref;
|
|
newChild.return = workInProgress2;
|
|
workInProgress2.child = newChild;
|
|
return newChild;
|
|
}
|
|
function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, updateLanes, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerMemoType = workInProgress2.elementType;
|
|
if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
|
|
var lazyComponent = outerMemoType;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
outerMemoType = init(payload);
|
|
} catch (x) {
|
|
outerMemoType = null;
|
|
}
|
|
var outerPropTypes = outerMemoType && outerMemoType.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(outerPropTypes, nextProps, "prop", getComponentName(outerMemoType));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (current2 !== null) {
|
|
var prevProps = current2.memoizedProps;
|
|
if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) {
|
|
didReceiveUpdate = false;
|
|
if (!includesSomeLane(renderLanes2, updateLanes)) {
|
|
workInProgress2.lanes = current2.lanes;
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
} else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
didReceiveUpdate = true;
|
|
}
|
|
}
|
|
}
|
|
return updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2);
|
|
}
|
|
function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var nextChildren = nextProps.children;
|
|
var prevState = current2 !== null ? current2.memoizedState : null;
|
|
if (nextProps.mode === "hidden" || nextProps.mode === "unstable-defer-without-hiding") {
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
var nextState = {
|
|
baseLanes: NoLanes
|
|
};
|
|
workInProgress2.memoizedState = nextState;
|
|
pushRenderLanes(workInProgress2, renderLanes2);
|
|
} else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
|
|
var nextBaseLanes;
|
|
if (prevState !== null) {
|
|
var prevBaseLanes = prevState.baseLanes;
|
|
nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
|
|
} else {
|
|
nextBaseLanes = renderLanes2;
|
|
}
|
|
{
|
|
markSpawnedWork(OffscreenLane);
|
|
}
|
|
workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
|
|
var _nextState = {
|
|
baseLanes: nextBaseLanes
|
|
};
|
|
workInProgress2.memoizedState = _nextState;
|
|
pushRenderLanes(workInProgress2, nextBaseLanes);
|
|
return null;
|
|
} else {
|
|
var _nextState2 = {
|
|
baseLanes: NoLanes
|
|
};
|
|
workInProgress2.memoizedState = _nextState2;
|
|
var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
|
|
pushRenderLanes(workInProgress2, subtreeRenderLanes2);
|
|
}
|
|
} else {
|
|
var _subtreeRenderLanes;
|
|
if (prevState !== null) {
|
|
_subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
|
|
workInProgress2.memoizedState = null;
|
|
} else {
|
|
_subtreeRenderLanes = renderLanes2;
|
|
}
|
|
pushRenderLanes(workInProgress2, _subtreeRenderLanes);
|
|
}
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
var updateLegacyHiddenComponent = updateOffscreenComponent;
|
|
function updateFragment(current2, workInProgress2, renderLanes2) {
|
|
var nextChildren = workInProgress2.pendingProps;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateMode(current2, workInProgress2, renderLanes2) {
|
|
var nextChildren = workInProgress2.pendingProps.children;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateProfiler(current2, workInProgress2, renderLanes2) {
|
|
{
|
|
workInProgress2.flags |= Update;
|
|
var stateNode = workInProgress2.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
}
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var nextChildren = nextProps.children;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function markRef(current2, workInProgress2) {
|
|
var ref = workInProgress2.ref;
|
|
if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
|
|
workInProgress2.flags |= Ref;
|
|
}
|
|
}
|
|
function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component));
|
|
}
|
|
}
|
|
}
|
|
var context;
|
|
{
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, Component, true);
|
|
context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
var nextChildren;
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
if (current2 !== null && !didReceiveUpdate) {
|
|
bailoutHooks(current2, workInProgress2, renderLanes2);
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component));
|
|
}
|
|
}
|
|
}
|
|
var hasContext;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var instance = workInProgress2.stateNode;
|
|
var shouldUpdate;
|
|
if (instance === null) {
|
|
if (current2 !== null) {
|
|
current2.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
workInProgress2.flags |= Placement;
|
|
}
|
|
constructClassInstance(workInProgress2, Component, nextProps);
|
|
mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
shouldUpdate = true;
|
|
} else if (current2 === null) {
|
|
shouldUpdate = resumeMountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
} else {
|
|
shouldUpdate = updateClassInstance(current2, workInProgress2, Component, nextProps, renderLanes2);
|
|
}
|
|
var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2);
|
|
{
|
|
var inst = workInProgress2.stateNode;
|
|
if (shouldUpdate && inst.props !== nextProps) {
|
|
if (!didWarnAboutReassigningProps) {
|
|
error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentName(workInProgress2.type) || "a component");
|
|
}
|
|
didWarnAboutReassigningProps = true;
|
|
}
|
|
}
|
|
return nextUnitOfWork;
|
|
}
|
|
function finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2) {
|
|
markRef(current2, workInProgress2);
|
|
var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
if (!shouldUpdate && !didCaptureError) {
|
|
if (hasContext) {
|
|
invalidateContextProvider(workInProgress2, Component, false);
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
var nextChildren;
|
|
if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") {
|
|
nextChildren = null;
|
|
{
|
|
stopProfilerTimerIfRunning();
|
|
}
|
|
} else {
|
|
{
|
|
setIsRendering(true);
|
|
nextChildren = instance.render();
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
instance.render();
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
if (current2 !== null && didCaptureError) {
|
|
forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
|
|
} else {
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
}
|
|
workInProgress2.memoizedState = instance.state;
|
|
if (hasContext) {
|
|
invalidateContextProvider(workInProgress2, Component, true);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function pushHostRootContext(workInProgress2) {
|
|
var root2 = workInProgress2.stateNode;
|
|
if (root2.pendingContext) {
|
|
pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
|
|
} else if (root2.context) {
|
|
pushTopLevelContextObject(workInProgress2, root2.context, false);
|
|
}
|
|
pushHostContainer(workInProgress2, root2.containerInfo);
|
|
}
|
|
function updateHostRoot(current2, workInProgress2, renderLanes2) {
|
|
pushHostRootContext(workInProgress2);
|
|
var updateQueue = workInProgress2.updateQueue;
|
|
if (!(current2 !== null && updateQueue !== null)) {
|
|
{
|
|
throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var prevState = workInProgress2.memoizedState;
|
|
var prevChildren = prevState !== null ? prevState.element : null;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
|
|
var nextState = workInProgress2.memoizedState;
|
|
var nextChildren = nextState.element;
|
|
if (nextChildren === prevChildren) {
|
|
resetHydrationState();
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
var root2 = workInProgress2.stateNode;
|
|
if (root2.hydrate && enterHydrationState(workInProgress2)) {
|
|
{
|
|
var mutableSourceEagerHydrationData = root2.mutableSourceEagerHydrationData;
|
|
if (mutableSourceEagerHydrationData != null) {
|
|
for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {
|
|
var mutableSource = mutableSourceEagerHydrationData[i];
|
|
var version = mutableSourceEagerHydrationData[i + 1];
|
|
setWorkInProgressVersion(mutableSource, version);
|
|
}
|
|
}
|
|
}
|
|
var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
workInProgress2.child = child;
|
|
var node = child;
|
|
while (node) {
|
|
node.flags = node.flags & ~Placement | Hydrating;
|
|
node = node.sibling;
|
|
}
|
|
} else {
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
resetHydrationState();
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function updateHostComponent(current2, workInProgress2, renderLanes2) {
|
|
pushHostContext(workInProgress2);
|
|
if (current2 === null) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
}
|
|
var type = workInProgress2.type;
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var prevProps = current2 !== null ? current2.memoizedProps : null;
|
|
var nextChildren = nextProps.children;
|
|
var isDirectTextChild = shouldSetTextContent(type, nextProps);
|
|
if (isDirectTextChild) {
|
|
nextChildren = null;
|
|
} else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
|
|
workInProgress2.flags |= ContentReset;
|
|
}
|
|
markRef(current2, workInProgress2);
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateHostText(current2, workInProgress2) {
|
|
if (current2 === null) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
}
|
|
return null;
|
|
}
|
|
function mountLazyComponent(_current, workInProgress2, elementType, updateLanes, renderLanes2) {
|
|
if (_current !== null) {
|
|
_current.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
workInProgress2.flags |= Placement;
|
|
}
|
|
var props = workInProgress2.pendingProps;
|
|
var lazyComponent = elementType;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
var Component = init(payload);
|
|
workInProgress2.type = Component;
|
|
var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component);
|
|
var resolvedProps = resolveDefaultProps(Component, props);
|
|
var child;
|
|
switch (resolvedTag) {
|
|
case FunctionComponent: {
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
|
|
}
|
|
child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case ClassComponent: {
|
|
{
|
|
workInProgress2.type = Component = resolveClassForHotReloading(Component);
|
|
}
|
|
child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case ForwardRef: {
|
|
{
|
|
workInProgress2.type = Component = resolveForwardRefForHotReloading(Component);
|
|
}
|
|
child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case MemoComponent: {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerPropTypes = Component.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(outerPropTypes, resolvedProps, "prop", getComponentName(Component));
|
|
}
|
|
}
|
|
}
|
|
child = updateMemoComponent(null, workInProgress2, Component, resolveDefaultProps(Component.type, resolvedProps), updateLanes, renderLanes2);
|
|
return child;
|
|
}
|
|
}
|
|
var hint = "";
|
|
{
|
|
if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) {
|
|
hint = " Did you wrap a component in React.lazy() more than once?";
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint);
|
|
}
|
|
}
|
|
}
|
|
function mountIncompleteClassComponent(_current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
if (_current !== null) {
|
|
_current.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
workInProgress2.flags |= Placement;
|
|
}
|
|
workInProgress2.tag = ClassComponent;
|
|
var hasContext;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
constructClassInstance(workInProgress2, Component, nextProps);
|
|
mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
|
|
}
|
|
function mountIndeterminateComponent(_current, workInProgress2, Component, renderLanes2) {
|
|
if (_current !== null) {
|
|
_current.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
workInProgress2.flags |= Placement;
|
|
}
|
|
var props = workInProgress2.pendingProps;
|
|
var context;
|
|
{
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, Component, false);
|
|
context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var value;
|
|
{
|
|
if (Component.prototype && typeof Component.prototype.render === "function") {
|
|
var componentName = getComponentName(Component) || "Unknown";
|
|
if (!didWarnAboutBadClass[componentName]) {
|
|
error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
|
|
didWarnAboutBadClass[componentName] = true;
|
|
}
|
|
}
|
|
if (workInProgress2.mode & StrictMode) {
|
|
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
|
|
}
|
|
setIsRendering(true);
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
|
|
setIsRendering(false);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
{
|
|
if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
|
|
var _componentName = getComponentName(Component) || "Unknown";
|
|
if (!didWarnAboutModulePatternComponent[_componentName]) {
|
|
error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
|
|
didWarnAboutModulePatternComponent[_componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
|
|
{
|
|
var _componentName2 = getComponentName(Component) || "Unknown";
|
|
if (!didWarnAboutModulePatternComponent[_componentName2]) {
|
|
error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
|
|
didWarnAboutModulePatternComponent[_componentName2] = true;
|
|
}
|
|
}
|
|
workInProgress2.tag = ClassComponent;
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
var hasContext = false;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
|
|
initializeUpdateQueue(workInProgress2);
|
|
var getDerivedStateFromProps = Component.getDerivedStateFromProps;
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, Component, getDerivedStateFromProps, props);
|
|
}
|
|
adoptClassInstance(workInProgress2, value);
|
|
mountClassInstance(workInProgress2, Component, props, renderLanes2);
|
|
return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
|
|
} else {
|
|
workInProgress2.tag = FunctionComponent;
|
|
{
|
|
if (workInProgress2.mode & StrictMode) {
|
|
disableLogs();
|
|
try {
|
|
value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
|
|
} finally {
|
|
reenableLogs();
|
|
}
|
|
}
|
|
}
|
|
reconcileChildren(null, workInProgress2, value, renderLanes2);
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
}
|
|
function validateFunctionComponentInDev(workInProgress2, Component) {
|
|
{
|
|
if (Component) {
|
|
if (Component.childContextTypes) {
|
|
error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component");
|
|
}
|
|
}
|
|
if (workInProgress2.ref !== null) {
|
|
var info = "";
|
|
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
|
if (ownerName) {
|
|
info += "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
var warningKey = ownerName || workInProgress2._debugID || "";
|
|
var debugSource = workInProgress2._debugSource;
|
|
if (debugSource) {
|
|
warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
|
|
}
|
|
if (!didWarnAboutFunctionRefs[warningKey]) {
|
|
didWarnAboutFunctionRefs[warningKey] = true;
|
|
error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
|
|
}
|
|
}
|
|
if (typeof Component.getDerivedStateFromProps === "function") {
|
|
var _componentName3 = getComponentName(Component) || "Unknown";
|
|
if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
|
|
error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
|
|
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
|
|
}
|
|
}
|
|
if (typeof Component.contextType === "object" && Component.contextType !== null) {
|
|
var _componentName4 = getComponentName(Component) || "Unknown";
|
|
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
|
|
error("%s: Function components do not support contextType.", _componentName4);
|
|
didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var SUSPENDED_MARKER = {
|
|
dehydrated: null,
|
|
retryLane: NoLane
|
|
};
|
|
function mountSuspenseOffscreenState(renderLanes2) {
|
|
return {
|
|
baseLanes: renderLanes2
|
|
};
|
|
}
|
|
function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
|
|
return {
|
|
baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2)
|
|
};
|
|
}
|
|
function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
|
|
if (current2 !== null) {
|
|
var suspenseState = current2.memoizedState;
|
|
if (suspenseState === null) {
|
|
return false;
|
|
}
|
|
}
|
|
return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
}
|
|
function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
|
|
return removeLanes(current2.childLanes, renderLanes2);
|
|
}
|
|
function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
{
|
|
if (shouldSuspend(workInProgress2)) {
|
|
workInProgress2.flags |= DidCapture;
|
|
}
|
|
}
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
var showFallback = false;
|
|
var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
|
|
showFallback = true;
|
|
workInProgress2.flags &= ~DidCapture;
|
|
} else {
|
|
if (current2 === null || current2.memoizedState !== null) {
|
|
if (nextProps.fallback !== void 0 && nextProps.unstable_avoidThisFallback !== true) {
|
|
suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
|
|
}
|
|
}
|
|
}
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
if (current2 === null) {
|
|
if (nextProps.fallback !== void 0) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
}
|
|
var nextPrimaryChildren = nextProps.children;
|
|
var nextFallbackChildren = nextProps.fallback;
|
|
if (showFallback) {
|
|
var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
|
|
var primaryChildFragment = workInProgress2.child;
|
|
primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return fallbackFragment;
|
|
} else if (typeof nextProps.unstable_expectedLoadTime === "number") {
|
|
var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
|
|
var _primaryChildFragment = workInProgress2.child;
|
|
_primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
workInProgress2.lanes = SomeRetryLane;
|
|
{
|
|
markSpawnedWork(SomeRetryLane);
|
|
}
|
|
return _fallbackFragment;
|
|
} else {
|
|
return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren, renderLanes2);
|
|
}
|
|
} else {
|
|
var prevState = current2.memoizedState;
|
|
if (prevState !== null) {
|
|
if (showFallback) {
|
|
var _nextFallbackChildren2 = nextProps.fallback;
|
|
var _nextPrimaryChildren2 = nextProps.children;
|
|
var _fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes2);
|
|
var _primaryChildFragment3 = workInProgress2.child;
|
|
var prevOffscreenState = current2.child.memoizedState;
|
|
_primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
|
|
_primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return _fallbackChildFragment;
|
|
} else {
|
|
var _nextPrimaryChildren3 = nextProps.children;
|
|
var _primaryChildFragment4 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren3, renderLanes2);
|
|
workInProgress2.memoizedState = null;
|
|
return _primaryChildFragment4;
|
|
}
|
|
} else {
|
|
if (showFallback) {
|
|
var _nextFallbackChildren3 = nextProps.fallback;
|
|
var _nextPrimaryChildren4 = nextProps.children;
|
|
var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes2);
|
|
var _primaryChildFragment5 = workInProgress2.child;
|
|
var _prevOffscreenState = current2.child.memoizedState;
|
|
_primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes2);
|
|
_primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return _fallbackChildFragment2;
|
|
} else {
|
|
var _nextPrimaryChildren5 = nextProps.children;
|
|
var _primaryChildFragment6 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren5, renderLanes2);
|
|
workInProgress2.memoizedState = null;
|
|
return _primaryChildFragment6;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var primaryChildProps = {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes2, null);
|
|
primaryChildFragment.return = workInProgress2;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return primaryChildFragment;
|
|
}
|
|
function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var progressedPrimaryFragment = workInProgress2.child;
|
|
var primaryChildProps = {
|
|
mode: "hidden",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment;
|
|
var fallbackChildFragment;
|
|
if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {
|
|
primaryChildFragment = progressedPrimaryFragment;
|
|
primaryChildFragment.childLanes = NoLanes;
|
|
primaryChildFragment.pendingProps = primaryChildProps;
|
|
if (workInProgress2.mode & ProfileMode) {
|
|
primaryChildFragment.actualDuration = 0;
|
|
primaryChildFragment.actualStartTime = -1;
|
|
primaryChildFragment.selfBaseDuration = 0;
|
|
primaryChildFragment.treeBaseDuration = 0;
|
|
}
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
} else {
|
|
primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
}
|
|
primaryChildFragment.return = workInProgress2;
|
|
fallbackChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = fallbackChildFragment;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return fallbackChildFragment;
|
|
}
|
|
function createWorkInProgressOffscreenFiber(current2, offscreenProps) {
|
|
return createWorkInProgress(current2, offscreenProps);
|
|
}
|
|
function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
|
|
var currentPrimaryChildFragment = current2.child;
|
|
var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
|
|
var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
});
|
|
if ((workInProgress2.mode & BlockingMode) === NoMode) {
|
|
primaryChildFragment.lanes = renderLanes2;
|
|
}
|
|
primaryChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = null;
|
|
if (currentFallbackChildFragment !== null) {
|
|
currentFallbackChildFragment.nextEffect = null;
|
|
currentFallbackChildFragment.flags = Deletion;
|
|
workInProgress2.firstEffect = workInProgress2.lastEffect = currentFallbackChildFragment;
|
|
}
|
|
workInProgress2.child = primaryChildFragment;
|
|
return primaryChildFragment;
|
|
}
|
|
function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var currentPrimaryChildFragment = current2.child;
|
|
var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
|
|
var primaryChildProps = {
|
|
mode: "hidden",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment;
|
|
if ((mode & BlockingMode) === NoMode && workInProgress2.child !== currentPrimaryChildFragment) {
|
|
var progressedPrimaryFragment = workInProgress2.child;
|
|
primaryChildFragment = progressedPrimaryFragment;
|
|
primaryChildFragment.childLanes = NoLanes;
|
|
primaryChildFragment.pendingProps = primaryChildProps;
|
|
if (workInProgress2.mode & ProfileMode) {
|
|
primaryChildFragment.actualDuration = 0;
|
|
primaryChildFragment.actualStartTime = -1;
|
|
primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
|
|
primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
|
|
}
|
|
var progressedLastEffect = primaryChildFragment.lastEffect;
|
|
if (progressedLastEffect !== null) {
|
|
workInProgress2.firstEffect = primaryChildFragment.firstEffect;
|
|
workInProgress2.lastEffect = progressedLastEffect;
|
|
progressedLastEffect.nextEffect = null;
|
|
} else {
|
|
workInProgress2.firstEffect = workInProgress2.lastEffect = null;
|
|
}
|
|
} else {
|
|
primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
|
|
}
|
|
var fallbackChildFragment;
|
|
if (currentFallbackChildFragment !== null) {
|
|
fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
|
|
} else {
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
fallbackChildFragment.flags |= Placement;
|
|
}
|
|
fallbackChildFragment.return = workInProgress2;
|
|
primaryChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = fallbackChildFragment;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return fallbackChildFragment;
|
|
}
|
|
function scheduleWorkOnFiber(fiber, renderLanes2) {
|
|
fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
|
|
}
|
|
scheduleWorkOnParentPath(fiber.return, renderLanes2);
|
|
}
|
|
function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
|
|
var node = firstChild;
|
|
while (node !== null) {
|
|
if (node.tag === SuspenseComponent) {
|
|
var state = node.memoizedState;
|
|
if (state !== null) {
|
|
scheduleWorkOnFiber(node, renderLanes2);
|
|
}
|
|
} else if (node.tag === SuspenseListComponent) {
|
|
scheduleWorkOnFiber(node, renderLanes2);
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === workInProgress2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === workInProgress2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function findLastContentRow(firstChild) {
|
|
var row = firstChild;
|
|
var lastContentRow = null;
|
|
while (row !== null) {
|
|
var currentRow = row.alternate;
|
|
if (currentRow !== null && findFirstSuspended(currentRow) === null) {
|
|
lastContentRow = row;
|
|
}
|
|
row = row.sibling;
|
|
}
|
|
return lastContentRow;
|
|
}
|
|
function validateRevealOrder(revealOrder) {
|
|
{
|
|
if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
|
|
didWarnAboutRevealOrder[revealOrder] = true;
|
|
if (typeof revealOrder === "string") {
|
|
switch (revealOrder.toLowerCase()) {
|
|
case "together":
|
|
case "forwards":
|
|
case "backwards": {
|
|
error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
|
|
break;
|
|
}
|
|
case "forward":
|
|
case "backward": {
|
|
error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
|
|
break;
|
|
}
|
|
default:
|
|
error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
|
|
break;
|
|
}
|
|
} else {
|
|
error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validateTailOptions(tailMode, revealOrder) {
|
|
{
|
|
if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
|
|
if (tailMode !== "collapsed" && tailMode !== "hidden") {
|
|
didWarnAboutTailOptions[tailMode] = true;
|
|
error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
|
|
} else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
|
|
didWarnAboutTailOptions[tailMode] = true;
|
|
error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validateSuspenseListNestedChild(childSlot, index2) {
|
|
{
|
|
var isArray2 = Array.isArray(childSlot);
|
|
var isIterable = !isArray2 && typeof getIteratorFn(childSlot) === "function";
|
|
if (isArray2 || isIterable) {
|
|
var type = isArray2 ? "array" : "iterable";
|
|
error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function validateSuspenseListChildren(children, revealOrder) {
|
|
{
|
|
if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
if (!validateSuspenseListNestedChild(children[i], i)) {
|
|
return;
|
|
}
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
if (typeof iteratorFn === "function") {
|
|
var childrenIterator = iteratorFn.call(children);
|
|
if (childrenIterator) {
|
|
var step = childrenIterator.next();
|
|
var _i = 0;
|
|
for (; !step.done; step = childrenIterator.next()) {
|
|
if (!validateSuspenseListNestedChild(step.value, _i)) {
|
|
return;
|
|
}
|
|
_i++;
|
|
}
|
|
}
|
|
} else {
|
|
error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState === null) {
|
|
workInProgress2.memoizedState = {
|
|
isBackwards,
|
|
rendering: null,
|
|
renderingStartTime: 0,
|
|
last: lastContentRow,
|
|
tail,
|
|
tailMode,
|
|
lastEffect: lastEffectBeforeRendering
|
|
};
|
|
} else {
|
|
renderState.isBackwards = isBackwards;
|
|
renderState.rendering = null;
|
|
renderState.renderingStartTime = 0;
|
|
renderState.last = lastContentRow;
|
|
renderState.tail = tail;
|
|
renderState.tailMode = tailMode;
|
|
renderState.lastEffect = lastEffectBeforeRendering;
|
|
}
|
|
}
|
|
function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var revealOrder = nextProps.revealOrder;
|
|
var tailMode = nextProps.tail;
|
|
var newChildren = nextProps.children;
|
|
validateRevealOrder(revealOrder);
|
|
validateTailOptions(tailMode, revealOrder);
|
|
validateSuspenseListChildren(newChildren, revealOrder);
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
if (shouldForceFallback) {
|
|
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
workInProgress2.flags |= DidCapture;
|
|
} else {
|
|
var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
|
|
if (didSuspendBefore) {
|
|
propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
|
|
}
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
if ((workInProgress2.mode & BlockingMode) === NoMode) {
|
|
workInProgress2.memoizedState = null;
|
|
} else {
|
|
switch (revealOrder) {
|
|
case "forwards": {
|
|
var lastContentRow = findLastContentRow(workInProgress2.child);
|
|
var tail;
|
|
if (lastContentRow === null) {
|
|
tail = workInProgress2.child;
|
|
workInProgress2.child = null;
|
|
} else {
|
|
tail = lastContentRow.sibling;
|
|
lastContentRow.sibling = null;
|
|
}
|
|
initSuspenseListRenderState(workInProgress2, false, tail, lastContentRow, tailMode, workInProgress2.lastEffect);
|
|
break;
|
|
}
|
|
case "backwards": {
|
|
var _tail = null;
|
|
var row = workInProgress2.child;
|
|
workInProgress2.child = null;
|
|
while (row !== null) {
|
|
var currentRow = row.alternate;
|
|
if (currentRow !== null && findFirstSuspended(currentRow) === null) {
|
|
workInProgress2.child = row;
|
|
break;
|
|
}
|
|
var nextRow = row.sibling;
|
|
row.sibling = _tail;
|
|
_tail = row;
|
|
row = nextRow;
|
|
}
|
|
initSuspenseListRenderState(workInProgress2, true, _tail, null, tailMode, workInProgress2.lastEffect);
|
|
break;
|
|
}
|
|
case "together": {
|
|
initSuspenseListRenderState(workInProgress2, false, null, null, void 0, workInProgress2.lastEffect);
|
|
break;
|
|
}
|
|
default: {
|
|
workInProgress2.memoizedState = null;
|
|
}
|
|
}
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function updatePortalComponent(current2, workInProgress2, renderLanes2) {
|
|
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
|
|
var nextChildren = workInProgress2.pendingProps;
|
|
if (current2 === null) {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
} else {
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
|
|
function updateContextProvider(current2, workInProgress2, renderLanes2) {
|
|
var providerType = workInProgress2.type;
|
|
var context = providerType._context;
|
|
var newProps = workInProgress2.pendingProps;
|
|
var oldProps = workInProgress2.memoizedProps;
|
|
var newValue = newProps.value;
|
|
{
|
|
if (!("value" in newProps)) {
|
|
if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
|
|
hasWarnedAboutUsingNoValuePropOnContextProvider = true;
|
|
error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
|
|
}
|
|
}
|
|
var providerPropTypes = workInProgress2.type.propTypes;
|
|
if (providerPropTypes) {
|
|
checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
|
|
}
|
|
}
|
|
pushProvider(workInProgress2, newValue);
|
|
if (oldProps !== null) {
|
|
var oldValue = oldProps.value;
|
|
var changedBits = calculateChangedBits(context, newValue, oldValue);
|
|
if (changedBits === 0) {
|
|
if (oldProps.children === newProps.children && !hasContextChanged()) {
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
} else {
|
|
propagateContextChange(workInProgress2, context, changedBits, renderLanes2);
|
|
}
|
|
}
|
|
var newChildren = newProps.children;
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
var hasWarnedAboutUsingContextAsConsumer = false;
|
|
function updateContextConsumer(current2, workInProgress2, renderLanes2) {
|
|
var context = workInProgress2.type;
|
|
{
|
|
if (context._context === void 0) {
|
|
if (context !== context.Consumer) {
|
|
if (!hasWarnedAboutUsingContextAsConsumer) {
|
|
hasWarnedAboutUsingContextAsConsumer = true;
|
|
error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
}
|
|
}
|
|
} else {
|
|
context = context._context;
|
|
}
|
|
}
|
|
var newProps = workInProgress2.pendingProps;
|
|
var render2 = newProps.children;
|
|
{
|
|
if (typeof render2 !== "function") {
|
|
error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
|
|
}
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var newValue = readContext(context, newProps.unstable_observedBits);
|
|
var newChildren;
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
newChildren = render2(newValue);
|
|
setIsRendering(false);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function markWorkInProgressReceivedUpdate() {
|
|
didReceiveUpdate = true;
|
|
}
|
|
function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
|
|
if (current2 !== null) {
|
|
workInProgress2.dependencies = current2.dependencies;
|
|
}
|
|
{
|
|
stopProfilerTimerIfRunning();
|
|
}
|
|
markSkippedUpdateLanes(workInProgress2.lanes);
|
|
if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
|
|
return null;
|
|
} else {
|
|
cloneChildFibers(current2, workInProgress2);
|
|
return workInProgress2.child;
|
|
}
|
|
}
|
|
function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
|
|
{
|
|
var returnFiber = oldWorkInProgress.return;
|
|
if (returnFiber === null) {
|
|
throw new Error("Cannot swap the root fiber.");
|
|
}
|
|
current2.alternate = null;
|
|
oldWorkInProgress.alternate = null;
|
|
newWorkInProgress.index = oldWorkInProgress.index;
|
|
newWorkInProgress.sibling = oldWorkInProgress.sibling;
|
|
newWorkInProgress.return = oldWorkInProgress.return;
|
|
newWorkInProgress.ref = oldWorkInProgress.ref;
|
|
if (oldWorkInProgress === returnFiber.child) {
|
|
returnFiber.child = newWorkInProgress;
|
|
} else {
|
|
var prevSibling = returnFiber.child;
|
|
if (prevSibling === null) {
|
|
throw new Error("Expected parent to have a child.");
|
|
}
|
|
while (prevSibling.sibling !== oldWorkInProgress) {
|
|
prevSibling = prevSibling.sibling;
|
|
if (prevSibling === null) {
|
|
throw new Error("Expected to find the previous sibling.");
|
|
}
|
|
}
|
|
prevSibling.sibling = newWorkInProgress;
|
|
}
|
|
var last = returnFiber.lastEffect;
|
|
if (last !== null) {
|
|
last.nextEffect = current2;
|
|
returnFiber.lastEffect = current2;
|
|
} else {
|
|
returnFiber.firstEffect = returnFiber.lastEffect = current2;
|
|
}
|
|
current2.nextEffect = null;
|
|
current2.flags = Deletion;
|
|
newWorkInProgress.flags |= Placement;
|
|
return newWorkInProgress;
|
|
}
|
|
}
|
|
function beginWork(current2, workInProgress2, renderLanes2) {
|
|
var updateLanes = workInProgress2.lanes;
|
|
{
|
|
if (workInProgress2._debugNeedsRemount && current2 !== null) {
|
|
return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
|
|
}
|
|
}
|
|
if (current2 !== null) {
|
|
var oldProps = current2.memoizedProps;
|
|
var newProps = workInProgress2.pendingProps;
|
|
if (oldProps !== newProps || hasContextChanged() || workInProgress2.type !== current2.type) {
|
|
didReceiveUpdate = true;
|
|
} else if (!includesSomeLane(renderLanes2, updateLanes)) {
|
|
didReceiveUpdate = false;
|
|
switch (workInProgress2.tag) {
|
|
case HostRoot:
|
|
pushHostRootContext(workInProgress2);
|
|
resetHydrationState();
|
|
break;
|
|
case HostComponent:
|
|
pushHostContext(workInProgress2);
|
|
break;
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
pushContextProvider(workInProgress2);
|
|
}
|
|
break;
|
|
}
|
|
case HostPortal:
|
|
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
|
|
break;
|
|
case ContextProvider: {
|
|
var newValue = workInProgress2.memoizedProps.value;
|
|
pushProvider(workInProgress2, newValue);
|
|
break;
|
|
}
|
|
case Profiler:
|
|
{
|
|
var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
|
|
if (hasChildWork) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
var stateNode = workInProgress2.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
}
|
|
break;
|
|
case SuspenseComponent: {
|
|
var state = workInProgress2.memoizedState;
|
|
if (state !== null) {
|
|
var primaryChildFragment = workInProgress2.child;
|
|
var primaryChildLanes = primaryChildFragment.childLanes;
|
|
if (includesSomeLane(renderLanes2, primaryChildLanes)) {
|
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
} else {
|
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
if (child !== null) {
|
|
return child.sibling;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
} else {
|
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
}
|
|
break;
|
|
}
|
|
case SuspenseListComponent: {
|
|
var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
|
|
var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
|
|
if (didSuspendBefore) {
|
|
if (_hasChildWork) {
|
|
return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
workInProgress2.flags |= DidCapture;
|
|
}
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState !== null) {
|
|
renderState.rendering = null;
|
|
renderState.tail = null;
|
|
renderState.lastEffect = null;
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
|
|
if (_hasChildWork) {
|
|
break;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent: {
|
|
workInProgress2.lanes = NoLanes;
|
|
return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
} else {
|
|
if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
didReceiveUpdate = true;
|
|
} else {
|
|
didReceiveUpdate = false;
|
|
}
|
|
}
|
|
} else {
|
|
didReceiveUpdate = false;
|
|
}
|
|
workInProgress2.lanes = NoLanes;
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent: {
|
|
return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
|
|
}
|
|
case LazyComponent: {
|
|
var elementType = workInProgress2.elementType;
|
|
return mountLazyComponent(current2, workInProgress2, elementType, updateLanes, renderLanes2);
|
|
}
|
|
case FunctionComponent: {
|
|
var _Component = workInProgress2.type;
|
|
var unresolvedProps = workInProgress2.pendingProps;
|
|
var resolvedProps = workInProgress2.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
|
|
return updateFunctionComponent(current2, workInProgress2, _Component, resolvedProps, renderLanes2);
|
|
}
|
|
case ClassComponent: {
|
|
var _Component2 = workInProgress2.type;
|
|
var _unresolvedProps = workInProgress2.pendingProps;
|
|
var _resolvedProps = workInProgress2.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
|
|
return updateClassComponent(current2, workInProgress2, _Component2, _resolvedProps, renderLanes2);
|
|
}
|
|
case HostRoot:
|
|
return updateHostRoot(current2, workInProgress2, renderLanes2);
|
|
case HostComponent:
|
|
return updateHostComponent(current2, workInProgress2, renderLanes2);
|
|
case HostText:
|
|
return updateHostText(current2, workInProgress2);
|
|
case SuspenseComponent:
|
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
case HostPortal:
|
|
return updatePortalComponent(current2, workInProgress2, renderLanes2);
|
|
case ForwardRef: {
|
|
var type = workInProgress2.type;
|
|
var _unresolvedProps2 = workInProgress2.pendingProps;
|
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
|
}
|
|
case Fragment:
|
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
|
case Mode:
|
|
return updateMode(current2, workInProgress2, renderLanes2);
|
|
case Profiler:
|
|
return updateProfiler(current2, workInProgress2, renderLanes2);
|
|
case ContextProvider:
|
|
return updateContextProvider(current2, workInProgress2, renderLanes2);
|
|
case ContextConsumer:
|
|
return updateContextConsumer(current2, workInProgress2, renderLanes2);
|
|
case MemoComponent: {
|
|
var _type2 = workInProgress2.type;
|
|
var _unresolvedProps3 = workInProgress2.pendingProps;
|
|
var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerPropTypes = _type2.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(outerPropTypes, _resolvedProps3, "prop", getComponentName(_type2));
|
|
}
|
|
}
|
|
}
|
|
_resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
|
|
return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, updateLanes, renderLanes2);
|
|
}
|
|
case SimpleMemoComponent: {
|
|
return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, updateLanes, renderLanes2);
|
|
}
|
|
case IncompleteClassComponent: {
|
|
var _Component3 = workInProgress2.type;
|
|
var _unresolvedProps4 = workInProgress2.pendingProps;
|
|
var _resolvedProps4 = workInProgress2.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
|
|
return mountIncompleteClassComponent(current2, workInProgress2, _Component3, _resolvedProps4, renderLanes2);
|
|
}
|
|
case SuspenseListComponent: {
|
|
return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
case FundamentalComponent: {
|
|
break;
|
|
}
|
|
case ScopeComponent: {
|
|
break;
|
|
}
|
|
case Block: {
|
|
break;
|
|
}
|
|
case OffscreenComponent: {
|
|
return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
case LegacyHiddenComponent: {
|
|
return updateLegacyHiddenComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function markUpdate(workInProgress2) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
function markRef$1(workInProgress2) {
|
|
workInProgress2.flags |= Ref;
|
|
}
|
|
var appendAllChildren;
|
|
var updateHostContainer;
|
|
var updateHostComponent$1;
|
|
var updateHostText$1;
|
|
{
|
|
appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
|
|
var node = workInProgress2.child;
|
|
while (node !== null) {
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
appendInitialChild(parent, node.stateNode);
|
|
} else if (node.tag === HostPortal)
|
|
;
|
|
else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === workInProgress2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === workInProgress2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
};
|
|
updateHostContainer = function(workInProgress2) {
|
|
};
|
|
updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
|
|
var oldProps = current2.memoizedProps;
|
|
if (oldProps === newProps) {
|
|
return;
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
var currentHostContext = getHostContext();
|
|
var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
|
|
workInProgress2.updateQueue = updatePayload;
|
|
if (updatePayload) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
};
|
|
updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
|
|
if (oldText !== newText) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
};
|
|
}
|
|
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
|
if (getIsHydrating()) {
|
|
return;
|
|
}
|
|
switch (renderState.tailMode) {
|
|
case "hidden": {
|
|
var tailNode = renderState.tail;
|
|
var lastTailNode = null;
|
|
while (tailNode !== null) {
|
|
if (tailNode.alternate !== null) {
|
|
lastTailNode = tailNode;
|
|
}
|
|
tailNode = tailNode.sibling;
|
|
}
|
|
if (lastTailNode === null) {
|
|
renderState.tail = null;
|
|
} else {
|
|
lastTailNode.sibling = null;
|
|
}
|
|
break;
|
|
}
|
|
case "collapsed": {
|
|
var _tailNode = renderState.tail;
|
|
var _lastTailNode = null;
|
|
while (_tailNode !== null) {
|
|
if (_tailNode.alternate !== null) {
|
|
_lastTailNode = _tailNode;
|
|
}
|
|
_tailNode = _tailNode.sibling;
|
|
}
|
|
if (_lastTailNode === null) {
|
|
if (!hasRenderedATailFallback && renderState.tail !== null) {
|
|
renderState.tail.sibling = null;
|
|
} else {
|
|
renderState.tail = null;
|
|
}
|
|
} else {
|
|
_lastTailNode.sibling = null;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function completeWork(current2, workInProgress2, renderLanes2) {
|
|
var newProps = workInProgress2.pendingProps;
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent:
|
|
case LazyComponent:
|
|
case SimpleMemoComponent:
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case Fragment:
|
|
case Mode:
|
|
case Profiler:
|
|
case ContextConsumer:
|
|
case MemoComponent:
|
|
return null;
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
return null;
|
|
}
|
|
case HostRoot: {
|
|
popHostContainer(workInProgress2);
|
|
popTopLevelContextObject(workInProgress2);
|
|
resetWorkInProgressVersions();
|
|
var fiberRoot = workInProgress2.stateNode;
|
|
if (fiberRoot.pendingContext) {
|
|
fiberRoot.context = fiberRoot.pendingContext;
|
|
fiberRoot.pendingContext = null;
|
|
}
|
|
if (current2 === null || current2.child === null) {
|
|
var wasHydrated = popHydrationState(workInProgress2);
|
|
if (wasHydrated) {
|
|
markUpdate(workInProgress2);
|
|
} else if (!fiberRoot.hydrate) {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
}
|
|
updateHostContainer(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(workInProgress2);
|
|
var rootContainerInstance = getRootHostContainer();
|
|
var type = workInProgress2.type;
|
|
if (current2 !== null && workInProgress2.stateNode != null) {
|
|
updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
|
|
if (current2.ref !== workInProgress2.ref) {
|
|
markRef$1(workInProgress2);
|
|
}
|
|
} else {
|
|
if (!newProps) {
|
|
if (!(workInProgress2.stateNode !== null)) {
|
|
{
|
|
throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
var currentHostContext = getHostContext();
|
|
var _wasHydrated = popHydrationState(workInProgress2);
|
|
if (_wasHydrated) {
|
|
if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
} else {
|
|
var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
|
|
appendAllChildren(instance, workInProgress2, false, false);
|
|
workInProgress2.stateNode = instance;
|
|
if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
}
|
|
if (workInProgress2.ref !== null) {
|
|
markRef$1(workInProgress2);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
case HostText: {
|
|
var newText = newProps;
|
|
if (current2 && workInProgress2.stateNode != null) {
|
|
var oldText = current2.memoizedProps;
|
|
updateHostText$1(current2, workInProgress2, oldText, newText);
|
|
} else {
|
|
if (typeof newText !== "string") {
|
|
if (!(workInProgress2.stateNode !== null)) {
|
|
{
|
|
throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var _rootContainerInstance = getRootHostContainer();
|
|
var _currentHostContext = getHostContext();
|
|
var _wasHydrated2 = popHydrationState(workInProgress2);
|
|
if (_wasHydrated2) {
|
|
if (prepareToHydrateHostTextInstance(workInProgress2)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
} else {
|
|
workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
case SuspenseComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var nextState = workInProgress2.memoizedState;
|
|
if ((workInProgress2.flags & DidCapture) !== NoFlags) {
|
|
workInProgress2.lanes = renderLanes2;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
var nextDidTimeout = nextState !== null;
|
|
var prevDidTimeout = false;
|
|
if (current2 === null) {
|
|
if (workInProgress2.memoizedProps.fallback !== void 0) {
|
|
popHydrationState(workInProgress2);
|
|
}
|
|
} else {
|
|
var prevState = current2.memoizedState;
|
|
prevDidTimeout = prevState !== null;
|
|
}
|
|
if (nextDidTimeout && !prevDidTimeout) {
|
|
if ((workInProgress2.mode & BlockingMode) !== NoMode) {
|
|
var hasInvisibleChildContext = current2 === null && workInProgress2.memoizedProps.unstable_avoidThisFallback !== true;
|
|
if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
|
|
renderDidSuspend();
|
|
} else {
|
|
renderDidSuspendDelayIfPossible();
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (nextDidTimeout || prevDidTimeout) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(workInProgress2);
|
|
updateHostContainer(workInProgress2);
|
|
if (current2 === null) {
|
|
preparePortalMount(workInProgress2.stateNode.containerInfo);
|
|
}
|
|
return null;
|
|
case ContextProvider:
|
|
popProvider(workInProgress2);
|
|
return null;
|
|
case IncompleteClassComponent: {
|
|
var _Component = workInProgress2.type;
|
|
if (isContextProvider(_Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
return null;
|
|
}
|
|
case SuspenseListComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState === null) {
|
|
return null;
|
|
}
|
|
var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
var renderedTail = renderState.rendering;
|
|
if (renderedTail === null) {
|
|
if (!didSuspendAlready) {
|
|
var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
|
|
if (!cannotBeSuspended) {
|
|
var row = workInProgress2.child;
|
|
while (row !== null) {
|
|
var suspended = findFirstSuspended(row);
|
|
if (suspended !== null) {
|
|
didSuspendAlready = true;
|
|
workInProgress2.flags |= DidCapture;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
var newThennables = suspended.updateQueue;
|
|
if (newThennables !== null) {
|
|
workInProgress2.updateQueue = newThennables;
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
if (renderState.lastEffect === null) {
|
|
workInProgress2.firstEffect = null;
|
|
}
|
|
workInProgress2.lastEffect = renderState.lastEffect;
|
|
resetChildFibers(workInProgress2, renderLanes2);
|
|
pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
|
|
return workInProgress2.child;
|
|
}
|
|
row = row.sibling;
|
|
}
|
|
}
|
|
if (renderState.tail !== null && now() > getRenderTargetTime()) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
workInProgress2.lanes = SomeRetryLane;
|
|
{
|
|
markSpawnedWork(SomeRetryLane);
|
|
}
|
|
}
|
|
} else {
|
|
cutOffTailIfNeeded(renderState, false);
|
|
}
|
|
} else {
|
|
if (!didSuspendAlready) {
|
|
var _suspended = findFirstSuspended(renderedTail);
|
|
if (_suspended !== null) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
var _newThennables = _suspended.updateQueue;
|
|
if (_newThennables !== null) {
|
|
workInProgress2.updateQueue = _newThennables;
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
cutOffTailIfNeeded(renderState, true);
|
|
if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
|
|
var lastEffect = workInProgress2.lastEffect = renderState.lastEffect;
|
|
if (lastEffect !== null) {
|
|
lastEffect.nextEffect = null;
|
|
}
|
|
return null;
|
|
}
|
|
} else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
workInProgress2.lanes = SomeRetryLane;
|
|
{
|
|
markSpawnedWork(SomeRetryLane);
|
|
}
|
|
}
|
|
}
|
|
if (renderState.isBackwards) {
|
|
renderedTail.sibling = workInProgress2.child;
|
|
workInProgress2.child = renderedTail;
|
|
} else {
|
|
var previousSibling = renderState.last;
|
|
if (previousSibling !== null) {
|
|
previousSibling.sibling = renderedTail;
|
|
} else {
|
|
workInProgress2.child = renderedTail;
|
|
}
|
|
renderState.last = renderedTail;
|
|
}
|
|
}
|
|
if (renderState.tail !== null) {
|
|
var next = renderState.tail;
|
|
renderState.rendering = next;
|
|
renderState.tail = next.sibling;
|
|
renderState.lastEffect = workInProgress2.lastEffect;
|
|
renderState.renderingStartTime = now();
|
|
next.sibling = null;
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
if (didSuspendAlready) {
|
|
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
} else {
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
return next;
|
|
}
|
|
return null;
|
|
}
|
|
case FundamentalComponent: {
|
|
break;
|
|
}
|
|
case ScopeComponent: {
|
|
break;
|
|
}
|
|
case Block:
|
|
break;
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent: {
|
|
popRenderLanes(workInProgress2);
|
|
if (current2 !== null) {
|
|
var _nextState = workInProgress2.memoizedState;
|
|
var _prevState = current2.memoizedState;
|
|
var prevIsHidden = _prevState !== null;
|
|
var nextIsHidden = _nextState !== null;
|
|
if (prevIsHidden !== nextIsHidden && newProps.mode !== "unstable-defer-without-hiding") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function unwindWork(workInProgress2, renderLanes2) {
|
|
switch (workInProgress2.tag) {
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
var flags = workInProgress2.flags;
|
|
if (flags & ShouldCapture) {
|
|
workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
return null;
|
|
}
|
|
case HostRoot: {
|
|
popHostContainer(workInProgress2);
|
|
popTopLevelContextObject(workInProgress2);
|
|
resetWorkInProgressVersions();
|
|
var _flags = workInProgress2.flags;
|
|
if (!((_flags & DidCapture) === NoFlags)) {
|
|
{
|
|
throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
|
|
return workInProgress2;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(workInProgress2);
|
|
return null;
|
|
}
|
|
case SuspenseComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var _flags2 = workInProgress2.flags;
|
|
if (_flags2 & ShouldCapture) {
|
|
workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
return null;
|
|
}
|
|
case SuspenseListComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(workInProgress2);
|
|
return null;
|
|
case ContextProvider:
|
|
popProvider(workInProgress2);
|
|
return null;
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
popRenderLanes(workInProgress2);
|
|
return null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function unwindInterruptedWork(interruptedWork) {
|
|
switch (interruptedWork.tag) {
|
|
case ClassComponent: {
|
|
var childContextTypes = interruptedWork.type.childContextTypes;
|
|
if (childContextTypes !== null && childContextTypes !== void 0) {
|
|
popContext(interruptedWork);
|
|
}
|
|
break;
|
|
}
|
|
case HostRoot: {
|
|
popHostContainer(interruptedWork);
|
|
popTopLevelContextObject(interruptedWork);
|
|
resetWorkInProgressVersions();
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(interruptedWork);
|
|
break;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(interruptedWork);
|
|
break;
|
|
case SuspenseComponent:
|
|
popSuspenseContext(interruptedWork);
|
|
break;
|
|
case SuspenseListComponent:
|
|
popSuspenseContext(interruptedWork);
|
|
break;
|
|
case ContextProvider:
|
|
popProvider(interruptedWork);
|
|
break;
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
popRenderLanes(interruptedWork);
|
|
break;
|
|
}
|
|
}
|
|
function createCapturedValue(value, source) {
|
|
return {
|
|
value,
|
|
source,
|
|
stack: getStackByFiberInDevAndProd(source)
|
|
};
|
|
}
|
|
function showErrorDialog(boundary, errorInfo) {
|
|
return true;
|
|
}
|
|
function logCapturedError(boundary, errorInfo) {
|
|
try {
|
|
var logError = showErrorDialog(boundary, errorInfo);
|
|
if (logError === false) {
|
|
return;
|
|
}
|
|
var error2 = errorInfo.value;
|
|
if (true) {
|
|
var source = errorInfo.source;
|
|
var stack = errorInfo.stack;
|
|
var componentStack = stack !== null ? stack : "";
|
|
if (error2 != null && error2._suppressLogging) {
|
|
if (boundary.tag === ClassComponent) {
|
|
return;
|
|
}
|
|
console["error"](error2);
|
|
}
|
|
var componentName = source ? getComponentName(source.type) : null;
|
|
var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
|
|
var errorBoundaryMessage;
|
|
var errorBoundaryName = getComponentName(boundary.type);
|
|
if (errorBoundaryName) {
|
|
errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
|
|
} else {
|
|
errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
|
|
}
|
|
var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
|
|
console["error"](combinedMessage);
|
|
} else {
|
|
console["error"](error2);
|
|
}
|
|
} catch (e) {
|
|
setTimeout(function() {
|
|
throw e;
|
|
});
|
|
}
|
|
}
|
|
var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
|
|
function createRootErrorUpdate(fiber, errorInfo, lane) {
|
|
var update = createUpdate(NoTimestamp, lane);
|
|
update.tag = CaptureUpdate;
|
|
update.payload = {
|
|
element: null
|
|
};
|
|
var error2 = errorInfo.value;
|
|
update.callback = function() {
|
|
onUncaughtError(error2);
|
|
logCapturedError(fiber, errorInfo);
|
|
};
|
|
return update;
|
|
}
|
|
function createClassErrorUpdate(fiber, errorInfo, lane) {
|
|
var update = createUpdate(NoTimestamp, lane);
|
|
update.tag = CaptureUpdate;
|
|
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
|
if (typeof getDerivedStateFromError === "function") {
|
|
var error$1 = errorInfo.value;
|
|
update.payload = function() {
|
|
logCapturedError(fiber, errorInfo);
|
|
return getDerivedStateFromError(error$1);
|
|
};
|
|
}
|
|
var inst = fiber.stateNode;
|
|
if (inst !== null && typeof inst.componentDidCatch === "function") {
|
|
update.callback = function callback() {
|
|
{
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
}
|
|
if (typeof getDerivedStateFromError !== "function") {
|
|
markLegacyErrorBoundaryAsFailed(this);
|
|
logCapturedError(fiber, errorInfo);
|
|
}
|
|
var error$12 = errorInfo.value;
|
|
var stack = errorInfo.stack;
|
|
this.componentDidCatch(error$12, {
|
|
componentStack: stack !== null ? stack : ""
|
|
});
|
|
{
|
|
if (typeof getDerivedStateFromError !== "function") {
|
|
if (!includesSomeLane(fiber.lanes, SyncLane)) {
|
|
error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentName(fiber.type) || "Unknown");
|
|
}
|
|
}
|
|
}
|
|
};
|
|
} else {
|
|
update.callback = function() {
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
};
|
|
}
|
|
return update;
|
|
}
|
|
function attachPingListener(root2, wakeable, lanes) {
|
|
var pingCache = root2.pingCache;
|
|
var threadIDs;
|
|
if (pingCache === null) {
|
|
pingCache = root2.pingCache = new PossiblyWeakMap$1();
|
|
threadIDs = new Set();
|
|
pingCache.set(wakeable, threadIDs);
|
|
} else {
|
|
threadIDs = pingCache.get(wakeable);
|
|
if (threadIDs === void 0) {
|
|
threadIDs = new Set();
|
|
pingCache.set(wakeable, threadIDs);
|
|
}
|
|
}
|
|
if (!threadIDs.has(lanes)) {
|
|
threadIDs.add(lanes);
|
|
var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
|
|
wakeable.then(ping, ping);
|
|
}
|
|
}
|
|
function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
|
|
sourceFiber.flags |= Incomplete;
|
|
sourceFiber.firstEffect = sourceFiber.lastEffect = null;
|
|
if (value !== null && typeof value === "object" && typeof value.then === "function") {
|
|
var wakeable = value;
|
|
if ((sourceFiber.mode & BlockingMode) === NoMode) {
|
|
var currentSource = sourceFiber.alternate;
|
|
if (currentSource) {
|
|
sourceFiber.updateQueue = currentSource.updateQueue;
|
|
sourceFiber.memoizedState = currentSource.memoizedState;
|
|
sourceFiber.lanes = currentSource.lanes;
|
|
} else {
|
|
sourceFiber.updateQueue = null;
|
|
sourceFiber.memoizedState = null;
|
|
}
|
|
}
|
|
var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);
|
|
var _workInProgress = returnFiber;
|
|
do {
|
|
if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
|
|
var wakeables = _workInProgress.updateQueue;
|
|
if (wakeables === null) {
|
|
var updateQueue = new Set();
|
|
updateQueue.add(wakeable);
|
|
_workInProgress.updateQueue = updateQueue;
|
|
} else {
|
|
wakeables.add(wakeable);
|
|
}
|
|
if ((_workInProgress.mode & BlockingMode) === NoMode) {
|
|
_workInProgress.flags |= DidCapture;
|
|
sourceFiber.flags |= ForceUpdateForLegacySuspense;
|
|
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
if (sourceFiber.tag === ClassComponent) {
|
|
var currentSourceFiber = sourceFiber.alternate;
|
|
if (currentSourceFiber === null) {
|
|
sourceFiber.tag = IncompleteClassComponent;
|
|
} else {
|
|
var update = createUpdate(NoTimestamp, SyncLane);
|
|
update.tag = ForceUpdate;
|
|
enqueueUpdate(sourceFiber, update);
|
|
}
|
|
}
|
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
return;
|
|
}
|
|
attachPingListener(root2, wakeable, rootRenderLanes);
|
|
_workInProgress.flags |= ShouldCapture;
|
|
_workInProgress.lanes = rootRenderLanes;
|
|
return;
|
|
}
|
|
_workInProgress = _workInProgress.return;
|
|
} while (_workInProgress !== null);
|
|
value = new Error((getComponentName(sourceFiber.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.");
|
|
}
|
|
renderDidError();
|
|
value = createCapturedValue(value, sourceFiber);
|
|
var workInProgress2 = returnFiber;
|
|
do {
|
|
switch (workInProgress2.tag) {
|
|
case HostRoot: {
|
|
var _errorInfo = value;
|
|
workInProgress2.flags |= ShouldCapture;
|
|
var lane = pickArbitraryLane(rootRenderLanes);
|
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
|
|
var _update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
|
|
enqueueCapturedUpdate(workInProgress2, _update);
|
|
return;
|
|
}
|
|
case ClassComponent:
|
|
var errorInfo = value;
|
|
var ctor = workInProgress2.type;
|
|
var instance = workInProgress2.stateNode;
|
|
if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
|
|
workInProgress2.flags |= ShouldCapture;
|
|
var _lane = pickArbitraryLane(rootRenderLanes);
|
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
|
|
var _update2 = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
|
|
enqueueCapturedUpdate(workInProgress2, _update2);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
workInProgress2 = workInProgress2.return;
|
|
} while (workInProgress2 !== null);
|
|
}
|
|
var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
|
|
{
|
|
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
|
|
}
|
|
var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
|
|
var callComponentWillUnmountWithTimer = function(current2, instance) {
|
|
instance.props = current2.memoizedProps;
|
|
instance.state = current2.memoizedState;
|
|
{
|
|
instance.componentWillUnmount();
|
|
}
|
|
};
|
|
function safelyCallComponentWillUnmount(current2, instance) {
|
|
{
|
|
invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current2, instance);
|
|
if (hasCaughtError()) {
|
|
var unmountError = clearCaughtError();
|
|
captureCommitPhaseError(current2, unmountError);
|
|
}
|
|
}
|
|
}
|
|
function safelyDetachRef(current2) {
|
|
var ref = current2.ref;
|
|
if (ref !== null) {
|
|
if (typeof ref === "function") {
|
|
{
|
|
invokeGuardedCallback(null, ref, null, null);
|
|
if (hasCaughtError()) {
|
|
var refError = clearCaughtError();
|
|
captureCommitPhaseError(current2, refError);
|
|
}
|
|
}
|
|
} else {
|
|
ref.current = null;
|
|
}
|
|
}
|
|
}
|
|
function safelyCallDestroy(current2, destroy) {
|
|
{
|
|
invokeGuardedCallback(null, destroy, null);
|
|
if (hasCaughtError()) {
|
|
var error2 = clearCaughtError();
|
|
captureCommitPhaseError(current2, error2);
|
|
}
|
|
}
|
|
}
|
|
function commitBeforeMutationLifeCycles(current2, finishedWork) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case SimpleMemoComponent:
|
|
case Block: {
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
if (finishedWork.flags & Snapshot) {
|
|
if (current2 !== null) {
|
|
var prevProps = current2.memoizedProps;
|
|
var prevState = current2.memoizedState;
|
|
var instance = finishedWork.stateNode;
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
}
|
|
}
|
|
var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
|
|
{
|
|
var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
|
|
if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
|
|
didWarnSet.add(finishedWork.type);
|
|
error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentName(finishedWork.type));
|
|
}
|
|
}
|
|
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostRoot: {
|
|
{
|
|
if (finishedWork.flags & Snapshot) {
|
|
var root2 = finishedWork.stateNode;
|
|
clearContainer(root2.containerInfo);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostComponent:
|
|
case HostText:
|
|
case HostPortal:
|
|
case IncompleteClassComponent:
|
|
return;
|
|
}
|
|
{
|
|
{
|
|
throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function commitHookEffectListUnmount(tag, finishedWork) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
if ((effect.tag & tag) === tag) {
|
|
var destroy = effect.destroy;
|
|
effect.destroy = void 0;
|
|
if (destroy !== void 0) {
|
|
destroy();
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
function commitHookEffectListMount(tag, finishedWork) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
if ((effect.tag & tag) === tag) {
|
|
var create = effect.create;
|
|
effect.destroy = create();
|
|
{
|
|
var destroy = effect.destroy;
|
|
if (destroy !== void 0 && typeof destroy !== "function") {
|
|
var addendum = void 0;
|
|
if (destroy === null) {
|
|
addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
|
|
} else if (typeof destroy.then === "function") {
|
|
addendum = "\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
|
|
} else {
|
|
addendum = " You returned: " + destroy;
|
|
}
|
|
error("An effect function must not return anything besides a function, which is used for clean-up.%s", addendum);
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
function schedulePassiveEffects(finishedWork) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
var _effect = effect, next = _effect.next, tag = _effect.tag;
|
|
if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
|
|
enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);
|
|
enqueuePendingPassiveHookEffectMount(finishedWork, effect);
|
|
}
|
|
effect = next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
function commitLifeCycles(finishedRoot, current2, finishedWork, committedLanes) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case SimpleMemoComponent:
|
|
case Block: {
|
|
{
|
|
commitHookEffectListMount(Layout | HasEffect, finishedWork);
|
|
}
|
|
schedulePassiveEffects(finishedWork);
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
var instance = finishedWork.stateNode;
|
|
if (finishedWork.flags & Update) {
|
|
if (current2 === null) {
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
}
|
|
}
|
|
{
|
|
instance.componentDidMount();
|
|
}
|
|
} else {
|
|
var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
|
|
var prevState = current2.memoizedState;
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
}
|
|
}
|
|
{
|
|
instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
|
|
}
|
|
}
|
|
}
|
|
var updateQueue = finishedWork.updateQueue;
|
|
if (updateQueue !== null) {
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
|
|
}
|
|
}
|
|
}
|
|
commitUpdateQueue(finishedWork, updateQueue, instance);
|
|
}
|
|
return;
|
|
}
|
|
case HostRoot: {
|
|
var _updateQueue = finishedWork.updateQueue;
|
|
if (_updateQueue !== null) {
|
|
var _instance = null;
|
|
if (finishedWork.child !== null) {
|
|
switch (finishedWork.child.tag) {
|
|
case HostComponent:
|
|
_instance = getPublicInstance(finishedWork.child.stateNode);
|
|
break;
|
|
case ClassComponent:
|
|
_instance = finishedWork.child.stateNode;
|
|
break;
|
|
}
|
|
}
|
|
commitUpdateQueue(finishedWork, _updateQueue, _instance);
|
|
}
|
|
return;
|
|
}
|
|
case HostComponent: {
|
|
var _instance2 = finishedWork.stateNode;
|
|
if (current2 === null && finishedWork.flags & Update) {
|
|
var type = finishedWork.type;
|
|
var props = finishedWork.memoizedProps;
|
|
commitMount(_instance2, type, props);
|
|
}
|
|
return;
|
|
}
|
|
case HostText: {
|
|
return;
|
|
}
|
|
case HostPortal: {
|
|
return;
|
|
}
|
|
case Profiler: {
|
|
{
|
|
var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
|
|
var effectDuration = finishedWork.stateNode.effectDuration;
|
|
var commitTime2 = getCommitTime();
|
|
if (typeof onRender === "function") {
|
|
{
|
|
onRender(finishedWork.memoizedProps.id, current2 === null ? "mount" : "update", finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2, finishedRoot.memoizedInteractions);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case SuspenseComponent: {
|
|
commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
|
|
return;
|
|
}
|
|
case SuspenseListComponent:
|
|
case IncompleteClassComponent:
|
|
case FundamentalComponent:
|
|
case ScopeComponent:
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
return;
|
|
}
|
|
{
|
|
{
|
|
throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function hideOrUnhideAllChildren(finishedWork, isHidden) {
|
|
{
|
|
var node = finishedWork;
|
|
while (true) {
|
|
if (node.tag === HostComponent) {
|
|
var instance = node.stateNode;
|
|
if (isHidden) {
|
|
hideInstance(instance);
|
|
} else {
|
|
unhideInstance(node.stateNode, node.memoizedProps);
|
|
}
|
|
} else if (node.tag === HostText) {
|
|
var _instance3 = node.stateNode;
|
|
if (isHidden) {
|
|
hideTextInstance(_instance3);
|
|
} else {
|
|
unhideTextInstance(_instance3, node.memoizedProps);
|
|
}
|
|
} else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork)
|
|
;
|
|
else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === finishedWork) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === finishedWork) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
}
|
|
function commitAttachRef(finishedWork) {
|
|
var ref = finishedWork.ref;
|
|
if (ref !== null) {
|
|
var instance = finishedWork.stateNode;
|
|
var instanceToUse;
|
|
switch (finishedWork.tag) {
|
|
case HostComponent:
|
|
instanceToUse = getPublicInstance(instance);
|
|
break;
|
|
default:
|
|
instanceToUse = instance;
|
|
}
|
|
if (typeof ref === "function") {
|
|
ref(instanceToUse);
|
|
} else {
|
|
{
|
|
if (!ref.hasOwnProperty("current")) {
|
|
error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentName(finishedWork.type));
|
|
}
|
|
}
|
|
ref.current = instanceToUse;
|
|
}
|
|
}
|
|
}
|
|
function commitDetachRef(current2) {
|
|
var currentRef = current2.ref;
|
|
if (currentRef !== null) {
|
|
if (typeof currentRef === "function") {
|
|
currentRef(null);
|
|
} else {
|
|
currentRef.current = null;
|
|
}
|
|
}
|
|
}
|
|
function commitUnmount(finishedRoot, current2, renderPriorityLevel) {
|
|
onCommitUnmount(current2);
|
|
switch (current2.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent:
|
|
case Block: {
|
|
var updateQueue = current2.updateQueue;
|
|
if (updateQueue !== null) {
|
|
var lastEffect = updateQueue.lastEffect;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
var _effect2 = effect, destroy = _effect2.destroy, tag = _effect2.tag;
|
|
if (destroy !== void 0) {
|
|
if ((tag & Passive$1) !== NoFlags$1) {
|
|
enqueuePendingPassiveHookEffectUnmount(current2, effect);
|
|
} else {
|
|
{
|
|
safelyCallDestroy(current2, destroy);
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
safelyDetachRef(current2);
|
|
var instance = current2.stateNode;
|
|
if (typeof instance.componentWillUnmount === "function") {
|
|
safelyCallComponentWillUnmount(current2, instance);
|
|
}
|
|
return;
|
|
}
|
|
case HostComponent: {
|
|
safelyDetachRef(current2);
|
|
return;
|
|
}
|
|
case HostPortal: {
|
|
{
|
|
unmountHostComponents(finishedRoot, current2);
|
|
}
|
|
return;
|
|
}
|
|
case FundamentalComponent: {
|
|
return;
|
|
}
|
|
case DehydratedFragment: {
|
|
return;
|
|
}
|
|
case ScopeComponent: {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function commitNestedUnmounts(finishedRoot, root2, renderPriorityLevel) {
|
|
var node = root2;
|
|
while (true) {
|
|
commitUnmount(finishedRoot, node);
|
|
if (node.child !== null && node.tag !== HostPortal) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === root2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === root2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function detachFiberMutation(fiber) {
|
|
fiber.alternate = null;
|
|
fiber.child = null;
|
|
fiber.dependencies = null;
|
|
fiber.firstEffect = null;
|
|
fiber.lastEffect = null;
|
|
fiber.memoizedProps = null;
|
|
fiber.memoizedState = null;
|
|
fiber.pendingProps = null;
|
|
fiber.return = null;
|
|
fiber.updateQueue = null;
|
|
{
|
|
fiber._debugOwner = null;
|
|
}
|
|
}
|
|
function getHostParentFiber(fiber) {
|
|
var parent = fiber.return;
|
|
while (parent !== null) {
|
|
if (isHostParent(parent)) {
|
|
return parent;
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
{
|
|
{
|
|
throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function isHostParent(fiber) {
|
|
return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
|
|
}
|
|
function getHostSibling(fiber) {
|
|
var node = fiber;
|
|
siblings:
|
|
while (true) {
|
|
while (node.sibling === null) {
|
|
if (node.return === null || isHostParent(node.return)) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
|
|
if (node.flags & Placement) {
|
|
continue siblings;
|
|
}
|
|
if (node.child === null || node.tag === HostPortal) {
|
|
continue siblings;
|
|
} else {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
}
|
|
}
|
|
if (!(node.flags & Placement)) {
|
|
return node.stateNode;
|
|
}
|
|
}
|
|
}
|
|
function commitPlacement(finishedWork) {
|
|
var parentFiber = getHostParentFiber(finishedWork);
|
|
var parent;
|
|
var isContainer;
|
|
var parentStateNode = parentFiber.stateNode;
|
|
switch (parentFiber.tag) {
|
|
case HostComponent:
|
|
parent = parentStateNode;
|
|
isContainer = false;
|
|
break;
|
|
case HostRoot:
|
|
parent = parentStateNode.containerInfo;
|
|
isContainer = true;
|
|
break;
|
|
case HostPortal:
|
|
parent = parentStateNode.containerInfo;
|
|
isContainer = true;
|
|
break;
|
|
case FundamentalComponent:
|
|
default: {
|
|
{
|
|
throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
if (parentFiber.flags & ContentReset) {
|
|
resetTextContent(parent);
|
|
parentFiber.flags &= ~ContentReset;
|
|
}
|
|
var before = getHostSibling(finishedWork);
|
|
if (isContainer) {
|
|
insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
|
|
} else {
|
|
insertOrAppendPlacementNode(finishedWork, before, parent);
|
|
}
|
|
}
|
|
function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
|
|
var tag = node.tag;
|
|
var isHost = tag === HostComponent || tag === HostText;
|
|
if (isHost || enableFundamentalAPI) {
|
|
var stateNode = isHost ? node.stateNode : node.stateNode.instance;
|
|
if (before) {
|
|
insertInContainerBefore(parent, stateNode, before);
|
|
} else {
|
|
appendChildToContainer(parent, stateNode);
|
|
}
|
|
} else if (tag === HostPortal)
|
|
;
|
|
else {
|
|
var child = node.child;
|
|
if (child !== null) {
|
|
insertOrAppendPlacementNodeIntoContainer(child, before, parent);
|
|
var sibling = child.sibling;
|
|
while (sibling !== null) {
|
|
insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
|
|
sibling = sibling.sibling;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function insertOrAppendPlacementNode(node, before, parent) {
|
|
var tag = node.tag;
|
|
var isHost = tag === HostComponent || tag === HostText;
|
|
if (isHost || enableFundamentalAPI) {
|
|
var stateNode = isHost ? node.stateNode : node.stateNode.instance;
|
|
if (before) {
|
|
insertBefore(parent, stateNode, before);
|
|
} else {
|
|
appendChild(parent, stateNode);
|
|
}
|
|
} else if (tag === HostPortal)
|
|
;
|
|
else {
|
|
var child = node.child;
|
|
if (child !== null) {
|
|
insertOrAppendPlacementNode(child, before, parent);
|
|
var sibling = child.sibling;
|
|
while (sibling !== null) {
|
|
insertOrAppendPlacementNode(sibling, before, parent);
|
|
sibling = sibling.sibling;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function unmountHostComponents(finishedRoot, current2, renderPriorityLevel) {
|
|
var node = current2;
|
|
var currentParentIsValid = false;
|
|
var currentParent;
|
|
var currentParentIsContainer;
|
|
while (true) {
|
|
if (!currentParentIsValid) {
|
|
var parent = node.return;
|
|
findParent:
|
|
while (true) {
|
|
if (!(parent !== null)) {
|
|
{
|
|
throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var parentStateNode = parent.stateNode;
|
|
switch (parent.tag) {
|
|
case HostComponent:
|
|
currentParent = parentStateNode;
|
|
currentParentIsContainer = false;
|
|
break findParent;
|
|
case HostRoot:
|
|
currentParent = parentStateNode.containerInfo;
|
|
currentParentIsContainer = true;
|
|
break findParent;
|
|
case HostPortal:
|
|
currentParent = parentStateNode.containerInfo;
|
|
currentParentIsContainer = true;
|
|
break findParent;
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
currentParentIsValid = true;
|
|
}
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
commitNestedUnmounts(finishedRoot, node);
|
|
if (currentParentIsContainer) {
|
|
removeChildFromContainer(currentParent, node.stateNode);
|
|
} else {
|
|
removeChild(currentParent, node.stateNode);
|
|
}
|
|
} else if (node.tag === HostPortal) {
|
|
if (node.child !== null) {
|
|
currentParent = node.stateNode.containerInfo;
|
|
currentParentIsContainer = true;
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
} else {
|
|
commitUnmount(finishedRoot, node);
|
|
if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
}
|
|
if (node === current2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === current2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
if (node.tag === HostPortal) {
|
|
currentParentIsValid = false;
|
|
}
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function commitDeletion(finishedRoot, current2, renderPriorityLevel) {
|
|
{
|
|
unmountHostComponents(finishedRoot, current2);
|
|
}
|
|
var alternate = current2.alternate;
|
|
detachFiberMutation(current2);
|
|
if (alternate !== null) {
|
|
detachFiberMutation(alternate);
|
|
}
|
|
}
|
|
function commitWork(current2, finishedWork) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent:
|
|
case Block: {
|
|
{
|
|
commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
|
|
}
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
return;
|
|
}
|
|
case HostComponent: {
|
|
var instance = finishedWork.stateNode;
|
|
if (instance != null) {
|
|
var newProps = finishedWork.memoizedProps;
|
|
var oldProps = current2 !== null ? current2.memoizedProps : newProps;
|
|
var type = finishedWork.type;
|
|
var updatePayload = finishedWork.updateQueue;
|
|
finishedWork.updateQueue = null;
|
|
if (updatePayload !== null) {
|
|
commitUpdate(instance, updatePayload, type, oldProps, newProps);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostText: {
|
|
if (!(finishedWork.stateNode !== null)) {
|
|
{
|
|
throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var textInstance = finishedWork.stateNode;
|
|
var newText = finishedWork.memoizedProps;
|
|
var oldText = current2 !== null ? current2.memoizedProps : newText;
|
|
commitTextUpdate(textInstance, oldText, newText);
|
|
return;
|
|
}
|
|
case HostRoot: {
|
|
{
|
|
var _root = finishedWork.stateNode;
|
|
if (_root.hydrate) {
|
|
_root.hydrate = false;
|
|
commitHydratedContainer(_root.containerInfo);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case Profiler: {
|
|
return;
|
|
}
|
|
case SuspenseComponent: {
|
|
commitSuspenseComponent(finishedWork);
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
return;
|
|
}
|
|
case SuspenseListComponent: {
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
return;
|
|
}
|
|
case IncompleteClassComponent: {
|
|
return;
|
|
}
|
|
case FundamentalComponent: {
|
|
break;
|
|
}
|
|
case ScopeComponent: {
|
|
break;
|
|
}
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent: {
|
|
var newState = finishedWork.memoizedState;
|
|
var isHidden = newState !== null;
|
|
hideOrUnhideAllChildren(finishedWork, isHidden);
|
|
return;
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function commitSuspenseComponent(finishedWork) {
|
|
var newState = finishedWork.memoizedState;
|
|
if (newState !== null) {
|
|
markCommitTimeOfFallback();
|
|
{
|
|
var primaryChildParent = finishedWork.child;
|
|
hideOrUnhideAllChildren(primaryChildParent, true);
|
|
}
|
|
}
|
|
}
|
|
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
|
|
var newState = finishedWork.memoizedState;
|
|
if (newState === null) {
|
|
var current2 = finishedWork.alternate;
|
|
if (current2 !== null) {
|
|
var prevState = current2.memoizedState;
|
|
if (prevState !== null) {
|
|
var suspenseInstance = prevState.dehydrated;
|
|
if (suspenseInstance !== null) {
|
|
commitHydratedSuspenseInstance(suspenseInstance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function attachSuspenseRetryListeners(finishedWork) {
|
|
var wakeables = finishedWork.updateQueue;
|
|
if (wakeables !== null) {
|
|
finishedWork.updateQueue = null;
|
|
var retryCache = finishedWork.stateNode;
|
|
if (retryCache === null) {
|
|
retryCache = finishedWork.stateNode = new PossiblyWeakSet();
|
|
}
|
|
wakeables.forEach(function(wakeable) {
|
|
var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
|
|
if (!retryCache.has(wakeable)) {
|
|
{
|
|
if (wakeable.__reactDoNotTraceInteractions !== true) {
|
|
retry = tracing.unstable_wrap(retry);
|
|
}
|
|
}
|
|
retryCache.add(wakeable);
|
|
wakeable.then(retry, retry);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function isSuspenseBoundaryBeingHidden(current2, finishedWork) {
|
|
if (current2 !== null) {
|
|
var oldState = current2.memoizedState;
|
|
if (oldState === null || oldState.dehydrated !== null) {
|
|
var newState = finishedWork.memoizedState;
|
|
return newState !== null && newState.dehydrated === null;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function commitResetTextContent(current2) {
|
|
resetTextContent(current2.stateNode);
|
|
}
|
|
var COMPONENT_TYPE = 0;
|
|
var HAS_PSEUDO_CLASS_TYPE = 1;
|
|
var ROLE_TYPE = 2;
|
|
var TEST_NAME_TYPE = 3;
|
|
var TEXT_TYPE = 4;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor$1 = Symbol.for;
|
|
COMPONENT_TYPE = symbolFor$1("selector.component");
|
|
HAS_PSEUDO_CLASS_TYPE = symbolFor$1("selector.has_pseudo_class");
|
|
ROLE_TYPE = symbolFor$1("selector.role");
|
|
TEST_NAME_TYPE = symbolFor$1("selector.test_id");
|
|
TEXT_TYPE = symbolFor$1("selector.text");
|
|
}
|
|
var commitHooks = [];
|
|
function onCommitRoot$1() {
|
|
{
|
|
commitHooks.forEach(function(commitHook) {
|
|
return commitHook();
|
|
});
|
|
}
|
|
}
|
|
var ceil = Math.ceil;
|
|
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
|
|
var NoContext = 0;
|
|
var BatchedContext = 1;
|
|
var EventContext = 2;
|
|
var DiscreteEventContext = 4;
|
|
var LegacyUnbatchedContext = 8;
|
|
var RenderContext = 16;
|
|
var CommitContext = 32;
|
|
var RetryAfterError = 64;
|
|
var RootIncomplete = 0;
|
|
var RootFatalErrored = 1;
|
|
var RootErrored = 2;
|
|
var RootSuspended = 3;
|
|
var RootSuspendedWithDelay = 4;
|
|
var RootCompleted = 5;
|
|
var executionContext = NoContext;
|
|
var workInProgressRoot = null;
|
|
var workInProgress = null;
|
|
var workInProgressRootRenderLanes = NoLanes;
|
|
var subtreeRenderLanes = NoLanes;
|
|
var subtreeRenderLanesCursor = createCursor(NoLanes);
|
|
var workInProgressRootExitStatus = RootIncomplete;
|
|
var workInProgressRootFatalError = null;
|
|
var workInProgressRootIncludedLanes = NoLanes;
|
|
var workInProgressRootSkippedLanes = NoLanes;
|
|
var workInProgressRootUpdatedLanes = NoLanes;
|
|
var workInProgressRootPingedLanes = NoLanes;
|
|
var mostRecentlyUpdatedRoot = null;
|
|
var globalMostRecentFallbackTime = 0;
|
|
var FALLBACK_THROTTLE_MS = 500;
|
|
var workInProgressRootRenderTargetTime = Infinity;
|
|
var RENDER_TIMEOUT_MS = 500;
|
|
function resetRenderTimer() {
|
|
workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
|
|
}
|
|
function getRenderTargetTime() {
|
|
return workInProgressRootRenderTargetTime;
|
|
}
|
|
var nextEffect = null;
|
|
var hasUncaughtError = false;
|
|
var firstUncaughtError = null;
|
|
var legacyErrorBoundariesThatAlreadyFailed = null;
|
|
var rootDoesHavePassiveEffects = false;
|
|
var rootWithPendingPassiveEffects = null;
|
|
var pendingPassiveEffectsRenderPriority = NoPriority$1;
|
|
var pendingPassiveEffectsLanes = NoLanes;
|
|
var pendingPassiveHookEffectsMount = [];
|
|
var pendingPassiveHookEffectsUnmount = [];
|
|
var rootsWithPendingDiscreteUpdates = null;
|
|
var NESTED_UPDATE_LIMIT = 50;
|
|
var nestedUpdateCount = 0;
|
|
var rootWithNestedUpdates = null;
|
|
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
|
|
var nestedPassiveUpdateCount = 0;
|
|
var spawnedWorkDuringRender = null;
|
|
var currentEventTime = NoTimestamp;
|
|
var currentEventWipLanes = NoLanes;
|
|
var currentEventPendingLanes = NoLanes;
|
|
var isFlushingPassiveEffects = false;
|
|
var focusedInstanceHandle = null;
|
|
var shouldFireAfterActiveInstanceBlur = false;
|
|
function getWorkInProgressRoot() {
|
|
return workInProgressRoot;
|
|
}
|
|
function requestEventTime() {
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
return now();
|
|
}
|
|
if (currentEventTime !== NoTimestamp) {
|
|
return currentEventTime;
|
|
}
|
|
currentEventTime = now();
|
|
return currentEventTime;
|
|
}
|
|
function requestUpdateLane(fiber) {
|
|
var mode = fiber.mode;
|
|
if ((mode & BlockingMode) === NoMode) {
|
|
return SyncLane;
|
|
} else if ((mode & ConcurrentMode) === NoMode) {
|
|
return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
|
|
}
|
|
if (currentEventWipLanes === NoLanes) {
|
|
currentEventWipLanes = workInProgressRootIncludedLanes;
|
|
}
|
|
var isTransition = requestCurrentTransition() !== NoTransition;
|
|
if (isTransition) {
|
|
if (currentEventPendingLanes !== NoLanes) {
|
|
currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
|
|
}
|
|
return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);
|
|
}
|
|
var schedulerPriority = getCurrentPriorityLevel();
|
|
var lane;
|
|
if ((executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {
|
|
lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);
|
|
} else {
|
|
var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);
|
|
lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
|
|
}
|
|
return lane;
|
|
}
|
|
function requestRetryLane(fiber) {
|
|
var mode = fiber.mode;
|
|
if ((mode & BlockingMode) === NoMode) {
|
|
return SyncLane;
|
|
} else if ((mode & ConcurrentMode) === NoMode) {
|
|
return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
|
|
}
|
|
if (currentEventWipLanes === NoLanes) {
|
|
currentEventWipLanes = workInProgressRootIncludedLanes;
|
|
}
|
|
return findRetryLane(currentEventWipLanes);
|
|
}
|
|
function scheduleUpdateOnFiber(fiber, lane, eventTime) {
|
|
checkForNestedUpdates();
|
|
warnAboutRenderPhaseUpdatesInDEV(fiber);
|
|
var root2 = markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
if (root2 === null) {
|
|
warnAboutUpdateOnUnmountedFiberInDEV(fiber);
|
|
return null;
|
|
}
|
|
markRootUpdated(root2, lane, eventTime);
|
|
if (root2 === workInProgressRoot) {
|
|
{
|
|
workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);
|
|
}
|
|
if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
|
|
markRootSuspended$1(root2, workInProgressRootRenderLanes);
|
|
}
|
|
}
|
|
var priorityLevel = getCurrentPriorityLevel();
|
|
if (lane === SyncLane) {
|
|
if ((executionContext & LegacyUnbatchedContext) !== NoContext && (executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
schedulePendingInteractions(root2, lane);
|
|
performSyncWorkOnRoot(root2);
|
|
} else {
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, lane);
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
} else {
|
|
if ((executionContext & DiscreteEventContext) !== NoContext && (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {
|
|
if (rootsWithPendingDiscreteUpdates === null) {
|
|
rootsWithPendingDiscreteUpdates = new Set([root2]);
|
|
} else {
|
|
rootsWithPendingDiscreteUpdates.add(root2);
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, lane);
|
|
}
|
|
mostRecentlyUpdatedRoot = root2;
|
|
}
|
|
function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
|
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
|
|
var alternate = sourceFiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, lane);
|
|
}
|
|
{
|
|
if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
}
|
|
}
|
|
var node = sourceFiber;
|
|
var parent = sourceFiber.return;
|
|
while (parent !== null) {
|
|
parent.childLanes = mergeLanes(parent.childLanes, lane);
|
|
alternate = parent.alternate;
|
|
if (alternate !== null) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, lane);
|
|
} else {
|
|
{
|
|
if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
}
|
|
}
|
|
}
|
|
node = parent;
|
|
parent = parent.return;
|
|
}
|
|
if (node.tag === HostRoot) {
|
|
var root2 = node.stateNode;
|
|
return root2;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
function ensureRootIsScheduled(root2, currentTime) {
|
|
var existingCallbackNode = root2.callbackNode;
|
|
markStarvedLanesAsExpired(root2, currentTime);
|
|
var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
|
|
var newCallbackPriority = returnNextLanesPriority();
|
|
if (nextLanes === NoLanes) {
|
|
if (existingCallbackNode !== null) {
|
|
cancelCallback(existingCallbackNode);
|
|
root2.callbackNode = null;
|
|
root2.callbackPriority = NoLanePriority;
|
|
}
|
|
return;
|
|
}
|
|
if (existingCallbackNode !== null) {
|
|
var existingCallbackPriority = root2.callbackPriority;
|
|
if (existingCallbackPriority === newCallbackPriority) {
|
|
return;
|
|
}
|
|
cancelCallback(existingCallbackNode);
|
|
}
|
|
var newCallbackNode;
|
|
if (newCallbackPriority === SyncLanePriority) {
|
|
newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
|
|
} else if (newCallbackPriority === SyncBatchedLanePriority) {
|
|
newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root2));
|
|
} else {
|
|
var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
|
|
newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
|
|
}
|
|
root2.callbackPriority = newCallbackPriority;
|
|
root2.callbackNode = newCallbackNode;
|
|
}
|
|
function performConcurrentWorkOnRoot(root2) {
|
|
currentEventTime = NoTimestamp;
|
|
currentEventWipLanes = NoLanes;
|
|
currentEventPendingLanes = NoLanes;
|
|
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
|
|
{
|
|
throw Error("Should not already be working.");
|
|
}
|
|
}
|
|
var originalCallbackNode = root2.callbackNode;
|
|
var didFlushPassiveEffects = flushPassiveEffects();
|
|
if (didFlushPassiveEffects) {
|
|
if (root2.callbackNode !== originalCallbackNode) {
|
|
return null;
|
|
}
|
|
}
|
|
var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
|
|
if (lanes === NoLanes) {
|
|
return null;
|
|
}
|
|
var exitStatus = renderRootConcurrent(root2, lanes);
|
|
if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
|
|
prepareFreshStack(root2, NoLanes);
|
|
} else if (exitStatus !== RootIncomplete) {
|
|
if (exitStatus === RootErrored) {
|
|
executionContext |= RetryAfterError;
|
|
if (root2.hydrate) {
|
|
root2.hydrate = false;
|
|
clearContainer(root2.containerInfo);
|
|
}
|
|
lanes = getLanesToRetrySynchronouslyOnError(root2);
|
|
if (lanes !== NoLanes) {
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
}
|
|
}
|
|
if (exitStatus === RootFatalErrored) {
|
|
var fatalError = workInProgressRootFatalError;
|
|
prepareFreshStack(root2, NoLanes);
|
|
markRootSuspended$1(root2, lanes);
|
|
ensureRootIsScheduled(root2, now());
|
|
throw fatalError;
|
|
}
|
|
var finishedWork = root2.current.alternate;
|
|
root2.finishedWork = finishedWork;
|
|
root2.finishedLanes = lanes;
|
|
finishConcurrentRender(root2, exitStatus, lanes);
|
|
}
|
|
ensureRootIsScheduled(root2, now());
|
|
if (root2.callbackNode === originalCallbackNode) {
|
|
return performConcurrentWorkOnRoot.bind(null, root2);
|
|
}
|
|
return null;
|
|
}
|
|
function finishConcurrentRender(root2, exitStatus, lanes) {
|
|
switch (exitStatus) {
|
|
case RootIncomplete:
|
|
case RootFatalErrored: {
|
|
{
|
|
{
|
|
throw Error("Root did not complete. This is a bug in React.");
|
|
}
|
|
}
|
|
}
|
|
case RootErrored: {
|
|
commitRoot(root2);
|
|
break;
|
|
}
|
|
case RootSuspended: {
|
|
markRootSuspended$1(root2, lanes);
|
|
if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) {
|
|
var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
|
|
if (msUntilTimeout > 10) {
|
|
var nextLanes = getNextLanes(root2, NoLanes);
|
|
if (nextLanes !== NoLanes) {
|
|
break;
|
|
}
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
|
|
var eventTime = requestEventTime();
|
|
markRootPinged(root2, suspendedLanes);
|
|
break;
|
|
}
|
|
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), msUntilTimeout);
|
|
break;
|
|
}
|
|
}
|
|
commitRoot(root2);
|
|
break;
|
|
}
|
|
case RootSuspendedWithDelay: {
|
|
markRootSuspended$1(root2, lanes);
|
|
if (includesOnlyTransitions(lanes)) {
|
|
break;
|
|
}
|
|
if (!shouldForceFlushFallbacksInDEV()) {
|
|
var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
|
|
var eventTimeMs = mostRecentEventTime;
|
|
var timeElapsedMs = now() - eventTimeMs;
|
|
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
|
|
if (_msUntilTimeout > 10) {
|
|
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout);
|
|
break;
|
|
}
|
|
}
|
|
commitRoot(root2);
|
|
break;
|
|
}
|
|
case RootCompleted: {
|
|
commitRoot(root2);
|
|
break;
|
|
}
|
|
default: {
|
|
{
|
|
{
|
|
throw Error("Unknown root exit status.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function markRootSuspended$1(root2, suspendedLanes) {
|
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
|
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);
|
|
markRootSuspended(root2, suspendedLanes);
|
|
}
|
|
function performSyncWorkOnRoot(root2) {
|
|
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
|
|
{
|
|
throw Error("Should not already be working.");
|
|
}
|
|
}
|
|
flushPassiveEffects();
|
|
var lanes;
|
|
var exitStatus;
|
|
if (root2 === workInProgressRoot && includesSomeLane(root2.expiredLanes, workInProgressRootRenderLanes)) {
|
|
lanes = workInProgressRootRenderLanes;
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
|
|
lanes = getNextLanes(root2, lanes);
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
}
|
|
} else {
|
|
lanes = getNextLanes(root2, NoLanes);
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
}
|
|
if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
|
|
executionContext |= RetryAfterError;
|
|
if (root2.hydrate) {
|
|
root2.hydrate = false;
|
|
clearContainer(root2.containerInfo);
|
|
}
|
|
lanes = getLanesToRetrySynchronouslyOnError(root2);
|
|
if (lanes !== NoLanes) {
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
}
|
|
}
|
|
if (exitStatus === RootFatalErrored) {
|
|
var fatalError = workInProgressRootFatalError;
|
|
prepareFreshStack(root2, NoLanes);
|
|
markRootSuspended$1(root2, lanes);
|
|
ensureRootIsScheduled(root2, now());
|
|
throw fatalError;
|
|
}
|
|
var finishedWork = root2.current.alternate;
|
|
root2.finishedWork = finishedWork;
|
|
root2.finishedLanes = lanes;
|
|
commitRoot(root2);
|
|
ensureRootIsScheduled(root2, now());
|
|
return null;
|
|
}
|
|
function flushDiscreteUpdates() {
|
|
if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
|
|
{
|
|
if ((executionContext & RenderContext) !== NoContext) {
|
|
error("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
flushPendingDiscreteUpdates();
|
|
flushPassiveEffects();
|
|
}
|
|
function flushPendingDiscreteUpdates() {
|
|
if (rootsWithPendingDiscreteUpdates !== null) {
|
|
var roots = rootsWithPendingDiscreteUpdates;
|
|
rootsWithPendingDiscreteUpdates = null;
|
|
roots.forEach(function(root2) {
|
|
markDiscreteUpdatesExpired(root2);
|
|
ensureRootIsScheduled(root2, now());
|
|
});
|
|
}
|
|
flushSyncCallbackQueue();
|
|
}
|
|
function batchedUpdates$1(fn, a) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= BatchedContext;
|
|
try {
|
|
return fn(a);
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
}
|
|
function batchedEventUpdates$1(fn, a) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= EventContext;
|
|
try {
|
|
return fn(a);
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
}
|
|
function discreteUpdates$1(fn, a, b, c, d) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= DiscreteEventContext;
|
|
{
|
|
try {
|
|
return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function unbatchedUpdates(fn, a) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext &= ~BatchedContext;
|
|
executionContext |= LegacyUnbatchedContext;
|
|
try {
|
|
return fn(a);
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
}
|
|
function flushSync(fn, a) {
|
|
var prevExecutionContext = executionContext;
|
|
if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
{
|
|
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.");
|
|
}
|
|
return fn(a);
|
|
}
|
|
executionContext |= BatchedContext;
|
|
{
|
|
try {
|
|
if (fn) {
|
|
return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));
|
|
} else {
|
|
return void 0;
|
|
}
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
flushSyncCallbackQueue();
|
|
}
|
|
}
|
|
}
|
|
function pushRenderLanes(fiber, lanes) {
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
|
|
subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
|
|
workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
|
|
}
|
|
function popRenderLanes(fiber) {
|
|
subtreeRenderLanes = subtreeRenderLanesCursor.current;
|
|
pop(subtreeRenderLanesCursor, fiber);
|
|
}
|
|
function prepareFreshStack(root2, lanes) {
|
|
root2.finishedWork = null;
|
|
root2.finishedLanes = NoLanes;
|
|
var timeoutHandle = root2.timeoutHandle;
|
|
if (timeoutHandle !== noTimeout) {
|
|
root2.timeoutHandle = noTimeout;
|
|
cancelTimeout(timeoutHandle);
|
|
}
|
|
if (workInProgress !== null) {
|
|
var interruptedWork = workInProgress.return;
|
|
while (interruptedWork !== null) {
|
|
unwindInterruptedWork(interruptedWork);
|
|
interruptedWork = interruptedWork.return;
|
|
}
|
|
}
|
|
workInProgressRoot = root2;
|
|
workInProgress = createWorkInProgress(root2.current, null);
|
|
workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
|
|
workInProgressRootExitStatus = RootIncomplete;
|
|
workInProgressRootFatalError = null;
|
|
workInProgressRootSkippedLanes = NoLanes;
|
|
workInProgressRootUpdatedLanes = NoLanes;
|
|
workInProgressRootPingedLanes = NoLanes;
|
|
{
|
|
spawnedWorkDuringRender = null;
|
|
}
|
|
{
|
|
ReactStrictModeWarnings.discardPendingWarnings();
|
|
}
|
|
}
|
|
function handleError(root2, thrownValue) {
|
|
do {
|
|
var erroredWork = workInProgress;
|
|
try {
|
|
resetContextDependencies();
|
|
resetHooksAfterThrow();
|
|
resetCurrentFiber();
|
|
ReactCurrentOwner$2.current = null;
|
|
if (erroredWork === null || erroredWork.return === null) {
|
|
workInProgressRootExitStatus = RootFatalErrored;
|
|
workInProgressRootFatalError = thrownValue;
|
|
workInProgress = null;
|
|
return;
|
|
}
|
|
if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
|
|
stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
|
|
}
|
|
throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
|
|
completeUnitOfWork(erroredWork);
|
|
} catch (yetAnotherThrownValue) {
|
|
thrownValue = yetAnotherThrownValue;
|
|
if (workInProgress === erroredWork && erroredWork !== null) {
|
|
erroredWork = erroredWork.return;
|
|
workInProgress = erroredWork;
|
|
} else {
|
|
erroredWork = workInProgress;
|
|
}
|
|
continue;
|
|
}
|
|
return;
|
|
} while (true);
|
|
}
|
|
function pushDispatcher() {
|
|
var prevDispatcher = ReactCurrentDispatcher$2.current;
|
|
ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
|
|
if (prevDispatcher === null) {
|
|
return ContextOnlyDispatcher;
|
|
} else {
|
|
return prevDispatcher;
|
|
}
|
|
}
|
|
function popDispatcher(prevDispatcher) {
|
|
ReactCurrentDispatcher$2.current = prevDispatcher;
|
|
}
|
|
function pushInteractions(root2) {
|
|
{
|
|
var prevInteractions = tracing.__interactionsRef.current;
|
|
tracing.__interactionsRef.current = root2.memoizedInteractions;
|
|
return prevInteractions;
|
|
}
|
|
}
|
|
function popInteractions(prevInteractions) {
|
|
{
|
|
tracing.__interactionsRef.current = prevInteractions;
|
|
}
|
|
}
|
|
function markCommitTimeOfFallback() {
|
|
globalMostRecentFallbackTime = now();
|
|
}
|
|
function markSkippedUpdateLanes(lane) {
|
|
workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
|
|
}
|
|
function renderDidSuspend() {
|
|
if (workInProgressRootExitStatus === RootIncomplete) {
|
|
workInProgressRootExitStatus = RootSuspended;
|
|
}
|
|
}
|
|
function renderDidSuspendDelayIfPossible() {
|
|
if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
|
|
workInProgressRootExitStatus = RootSuspendedWithDelay;
|
|
}
|
|
if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {
|
|
markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
|
|
}
|
|
}
|
|
function renderDidError() {
|
|
if (workInProgressRootExitStatus !== RootCompleted) {
|
|
workInProgressRootExitStatus = RootErrored;
|
|
}
|
|
}
|
|
function renderHasNotSuspendedYet() {
|
|
return workInProgressRootExitStatus === RootIncomplete;
|
|
}
|
|
function renderRootSync(root2, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
prepareFreshStack(root2, lanes);
|
|
startWorkOnPendingInteractions(root2, lanes);
|
|
}
|
|
var prevInteractions = pushInteractions(root2);
|
|
do {
|
|
try {
|
|
workLoopSync();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root2, thrownValue);
|
|
}
|
|
} while (true);
|
|
resetContextDependencies();
|
|
{
|
|
popInteractions(prevInteractions);
|
|
}
|
|
executionContext = prevExecutionContext;
|
|
popDispatcher(prevDispatcher);
|
|
if (workInProgress !== null) {
|
|
{
|
|
{
|
|
throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
function workLoopSync() {
|
|
while (workInProgress !== null) {
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
}
|
|
function renderRootConcurrent(root2, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
resetRenderTimer();
|
|
prepareFreshStack(root2, lanes);
|
|
startWorkOnPendingInteractions(root2, lanes);
|
|
}
|
|
var prevInteractions = pushInteractions(root2);
|
|
do {
|
|
try {
|
|
workLoopConcurrent();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root2, thrownValue);
|
|
}
|
|
} while (true);
|
|
resetContextDependencies();
|
|
{
|
|
popInteractions(prevInteractions);
|
|
}
|
|
popDispatcher(prevDispatcher);
|
|
executionContext = prevExecutionContext;
|
|
if (workInProgress !== null) {
|
|
return RootIncomplete;
|
|
} else {
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
}
|
|
function workLoopConcurrent() {
|
|
while (workInProgress !== null && !shouldYield()) {
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
}
|
|
function performUnitOfWork(unitOfWork) {
|
|
var current2 = unitOfWork.alternate;
|
|
setCurrentFiber(unitOfWork);
|
|
var next;
|
|
if ((unitOfWork.mode & ProfileMode) !== NoMode) {
|
|
startProfilerTimer(unitOfWork);
|
|
next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
|
|
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
|
|
} else {
|
|
next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
|
|
}
|
|
resetCurrentFiber();
|
|
unitOfWork.memoizedProps = unitOfWork.pendingProps;
|
|
if (next === null) {
|
|
completeUnitOfWork(unitOfWork);
|
|
} else {
|
|
workInProgress = next;
|
|
}
|
|
ReactCurrentOwner$2.current = null;
|
|
}
|
|
function completeUnitOfWork(unitOfWork) {
|
|
var completedWork = unitOfWork;
|
|
do {
|
|
var current2 = completedWork.alternate;
|
|
var returnFiber = completedWork.return;
|
|
if ((completedWork.flags & Incomplete) === NoFlags) {
|
|
setCurrentFiber(completedWork);
|
|
var next = void 0;
|
|
if ((completedWork.mode & ProfileMode) === NoMode) {
|
|
next = completeWork(current2, completedWork, subtreeRenderLanes);
|
|
} else {
|
|
startProfilerTimer(completedWork);
|
|
next = completeWork(current2, completedWork, subtreeRenderLanes);
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
|
|
}
|
|
resetCurrentFiber();
|
|
if (next !== null) {
|
|
workInProgress = next;
|
|
return;
|
|
}
|
|
resetChildLanes(completedWork);
|
|
if (returnFiber !== null && (returnFiber.flags & Incomplete) === NoFlags) {
|
|
if (returnFiber.firstEffect === null) {
|
|
returnFiber.firstEffect = completedWork.firstEffect;
|
|
}
|
|
if (completedWork.lastEffect !== null) {
|
|
if (returnFiber.lastEffect !== null) {
|
|
returnFiber.lastEffect.nextEffect = completedWork.firstEffect;
|
|
}
|
|
returnFiber.lastEffect = completedWork.lastEffect;
|
|
}
|
|
var flags = completedWork.flags;
|
|
if (flags > PerformedWork) {
|
|
if (returnFiber.lastEffect !== null) {
|
|
returnFiber.lastEffect.nextEffect = completedWork;
|
|
} else {
|
|
returnFiber.firstEffect = completedWork;
|
|
}
|
|
returnFiber.lastEffect = completedWork;
|
|
}
|
|
}
|
|
} else {
|
|
var _next = unwindWork(completedWork);
|
|
if (_next !== null) {
|
|
_next.flags &= HostEffectMask;
|
|
workInProgress = _next;
|
|
return;
|
|
}
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
|
|
var actualDuration = completedWork.actualDuration;
|
|
var child = completedWork.child;
|
|
while (child !== null) {
|
|
actualDuration += child.actualDuration;
|
|
child = child.sibling;
|
|
}
|
|
completedWork.actualDuration = actualDuration;
|
|
}
|
|
if (returnFiber !== null) {
|
|
returnFiber.firstEffect = returnFiber.lastEffect = null;
|
|
returnFiber.flags |= Incomplete;
|
|
}
|
|
}
|
|
var siblingFiber = completedWork.sibling;
|
|
if (siblingFiber !== null) {
|
|
workInProgress = siblingFiber;
|
|
return;
|
|
}
|
|
completedWork = returnFiber;
|
|
workInProgress = completedWork;
|
|
} while (completedWork !== null);
|
|
if (workInProgressRootExitStatus === RootIncomplete) {
|
|
workInProgressRootExitStatus = RootCompleted;
|
|
}
|
|
}
|
|
function resetChildLanes(completedWork) {
|
|
if ((completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {
|
|
return;
|
|
}
|
|
var newChildLanes = NoLanes;
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
var actualDuration = completedWork.actualDuration;
|
|
var treeBaseDuration = completedWork.selfBaseDuration;
|
|
var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
|
|
var child = completedWork.child;
|
|
while (child !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
|
|
if (shouldBubbleActualDurations) {
|
|
actualDuration += child.actualDuration;
|
|
}
|
|
treeBaseDuration += child.treeBaseDuration;
|
|
child = child.sibling;
|
|
}
|
|
var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;
|
|
if (isTimedOutSuspense) {
|
|
var primaryChildFragment = completedWork.child;
|
|
if (primaryChildFragment !== null) {
|
|
treeBaseDuration -= primaryChildFragment.treeBaseDuration;
|
|
}
|
|
}
|
|
completedWork.actualDuration = actualDuration;
|
|
completedWork.treeBaseDuration = treeBaseDuration;
|
|
} else {
|
|
var _child = completedWork.child;
|
|
while (_child !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
|
|
_child = _child.sibling;
|
|
}
|
|
}
|
|
completedWork.childLanes = newChildLanes;
|
|
}
|
|
function commitRoot(root2) {
|
|
var renderPriorityLevel = getCurrentPriorityLevel();
|
|
runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root2, renderPriorityLevel));
|
|
return null;
|
|
}
|
|
function commitRootImpl(root2, renderPriorityLevel) {
|
|
do {
|
|
flushPassiveEffects();
|
|
} while (rootWithPendingPassiveEffects !== null);
|
|
flushRenderPhaseStrictModeWarningsInDEV();
|
|
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
|
|
{
|
|
throw Error("Should not already be working.");
|
|
}
|
|
}
|
|
var finishedWork = root2.finishedWork;
|
|
var lanes = root2.finishedLanes;
|
|
if (finishedWork === null) {
|
|
return null;
|
|
}
|
|
root2.finishedWork = null;
|
|
root2.finishedLanes = NoLanes;
|
|
if (!(finishedWork !== root2.current)) {
|
|
{
|
|
throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
root2.callbackNode = null;
|
|
var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
|
|
markRootFinished(root2, remainingLanes);
|
|
if (rootsWithPendingDiscreteUpdates !== null) {
|
|
if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root2)) {
|
|
rootsWithPendingDiscreteUpdates.delete(root2);
|
|
}
|
|
}
|
|
if (root2 === workInProgressRoot) {
|
|
workInProgressRoot = null;
|
|
workInProgress = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
}
|
|
var firstEffect;
|
|
if (finishedWork.flags > PerformedWork) {
|
|
if (finishedWork.lastEffect !== null) {
|
|
finishedWork.lastEffect.nextEffect = finishedWork;
|
|
firstEffect = finishedWork.firstEffect;
|
|
} else {
|
|
firstEffect = finishedWork;
|
|
}
|
|
} else {
|
|
firstEffect = finishedWork.firstEffect;
|
|
}
|
|
if (firstEffect !== null) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
var prevInteractions = pushInteractions(root2);
|
|
ReactCurrentOwner$2.current = null;
|
|
focusedInstanceHandle = prepareForCommit(root2.containerInfo);
|
|
shouldFireAfterActiveInstanceBlur = false;
|
|
nextEffect = firstEffect;
|
|
do {
|
|
{
|
|
invokeGuardedCallback(null, commitBeforeMutationEffects, null);
|
|
if (hasCaughtError()) {
|
|
if (!(nextEffect !== null)) {
|
|
{
|
|
throw Error("Should be working on an effect.");
|
|
}
|
|
}
|
|
var error2 = clearCaughtError();
|
|
captureCommitPhaseError(nextEffect, error2);
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
} while (nextEffect !== null);
|
|
focusedInstanceHandle = null;
|
|
{
|
|
recordCommitTime();
|
|
}
|
|
nextEffect = firstEffect;
|
|
do {
|
|
{
|
|
invokeGuardedCallback(null, commitMutationEffects, null, root2, renderPriorityLevel);
|
|
if (hasCaughtError()) {
|
|
if (!(nextEffect !== null)) {
|
|
{
|
|
throw Error("Should be working on an effect.");
|
|
}
|
|
}
|
|
var _error = clearCaughtError();
|
|
captureCommitPhaseError(nextEffect, _error);
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
} while (nextEffect !== null);
|
|
resetAfterCommit(root2.containerInfo);
|
|
root2.current = finishedWork;
|
|
nextEffect = firstEffect;
|
|
do {
|
|
{
|
|
invokeGuardedCallback(null, commitLayoutEffects, null, root2, lanes);
|
|
if (hasCaughtError()) {
|
|
if (!(nextEffect !== null)) {
|
|
{
|
|
throw Error("Should be working on an effect.");
|
|
}
|
|
}
|
|
var _error2 = clearCaughtError();
|
|
captureCommitPhaseError(nextEffect, _error2);
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
} while (nextEffect !== null);
|
|
nextEffect = null;
|
|
requestPaint();
|
|
{
|
|
popInteractions(prevInteractions);
|
|
}
|
|
executionContext = prevExecutionContext;
|
|
} else {
|
|
root2.current = finishedWork;
|
|
{
|
|
recordCommitTime();
|
|
}
|
|
}
|
|
var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
|
|
if (rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = false;
|
|
rootWithPendingPassiveEffects = root2;
|
|
pendingPassiveEffectsLanes = lanes;
|
|
pendingPassiveEffectsRenderPriority = renderPriorityLevel;
|
|
} else {
|
|
nextEffect = firstEffect;
|
|
while (nextEffect !== null) {
|
|
var nextNextEffect = nextEffect.nextEffect;
|
|
nextEffect.nextEffect = null;
|
|
if (nextEffect.flags & Deletion) {
|
|
detachFiberAfterEffects(nextEffect);
|
|
}
|
|
nextEffect = nextNextEffect;
|
|
}
|
|
}
|
|
remainingLanes = root2.pendingLanes;
|
|
if (remainingLanes !== NoLanes) {
|
|
{
|
|
if (spawnedWorkDuringRender !== null) {
|
|
var expirationTimes = spawnedWorkDuringRender;
|
|
spawnedWorkDuringRender = null;
|
|
for (var i = 0; i < expirationTimes.length; i++) {
|
|
scheduleInteractions(root2, expirationTimes[i], root2.memoizedInteractions);
|
|
}
|
|
}
|
|
schedulePendingInteractions(root2, remainingLanes);
|
|
}
|
|
} else {
|
|
legacyErrorBoundariesThatAlreadyFailed = null;
|
|
}
|
|
{
|
|
if (!rootDidHavePassiveEffects) {
|
|
finishPendingInteractions(root2, lanes);
|
|
}
|
|
}
|
|
if (remainingLanes === SyncLane) {
|
|
if (root2 === rootWithNestedUpdates) {
|
|
nestedUpdateCount++;
|
|
} else {
|
|
nestedUpdateCount = 0;
|
|
rootWithNestedUpdates = root2;
|
|
}
|
|
} else {
|
|
nestedUpdateCount = 0;
|
|
}
|
|
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
|
|
{
|
|
onCommitRoot$1();
|
|
}
|
|
ensureRootIsScheduled(root2, now());
|
|
if (hasUncaughtError) {
|
|
hasUncaughtError = false;
|
|
var _error3 = firstUncaughtError;
|
|
firstUncaughtError = null;
|
|
throw _error3;
|
|
}
|
|
if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
|
|
return null;
|
|
}
|
|
flushSyncCallbackQueue();
|
|
return null;
|
|
}
|
|
function commitBeforeMutationEffects() {
|
|
while (nextEffect !== null) {
|
|
var current2 = nextEffect.alternate;
|
|
if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
|
|
if ((nextEffect.flags & Deletion) !== NoFlags) {
|
|
if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
|
|
shouldFireAfterActiveInstanceBlur = true;
|
|
}
|
|
} else {
|
|
if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current2, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {
|
|
shouldFireAfterActiveInstanceBlur = true;
|
|
}
|
|
}
|
|
}
|
|
var flags = nextEffect.flags;
|
|
if ((flags & Snapshot) !== NoFlags) {
|
|
setCurrentFiber(nextEffect);
|
|
commitBeforeMutationLifeCycles(current2, nextEffect);
|
|
resetCurrentFiber();
|
|
}
|
|
if ((flags & Passive) !== NoFlags) {
|
|
if (!rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = true;
|
|
scheduleCallback(NormalPriority$1, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
});
|
|
}
|
|
}
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
function commitMutationEffects(root2, renderPriorityLevel) {
|
|
while (nextEffect !== null) {
|
|
setCurrentFiber(nextEffect);
|
|
var flags = nextEffect.flags;
|
|
if (flags & ContentReset) {
|
|
commitResetTextContent(nextEffect);
|
|
}
|
|
if (flags & Ref) {
|
|
var current2 = nextEffect.alternate;
|
|
if (current2 !== null) {
|
|
commitDetachRef(current2);
|
|
}
|
|
}
|
|
var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);
|
|
switch (primaryFlags) {
|
|
case Placement: {
|
|
commitPlacement(nextEffect);
|
|
nextEffect.flags &= ~Placement;
|
|
break;
|
|
}
|
|
case PlacementAndUpdate: {
|
|
commitPlacement(nextEffect);
|
|
nextEffect.flags &= ~Placement;
|
|
var _current = nextEffect.alternate;
|
|
commitWork(_current, nextEffect);
|
|
break;
|
|
}
|
|
case Hydrating: {
|
|
nextEffect.flags &= ~Hydrating;
|
|
break;
|
|
}
|
|
case HydratingAndUpdate: {
|
|
nextEffect.flags &= ~Hydrating;
|
|
var _current2 = nextEffect.alternate;
|
|
commitWork(_current2, nextEffect);
|
|
break;
|
|
}
|
|
case Update: {
|
|
var _current3 = nextEffect.alternate;
|
|
commitWork(_current3, nextEffect);
|
|
break;
|
|
}
|
|
case Deletion: {
|
|
commitDeletion(root2, nextEffect);
|
|
break;
|
|
}
|
|
}
|
|
resetCurrentFiber();
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
function commitLayoutEffects(root2, committedLanes) {
|
|
while (nextEffect !== null) {
|
|
setCurrentFiber(nextEffect);
|
|
var flags = nextEffect.flags;
|
|
if (flags & (Update | Callback)) {
|
|
var current2 = nextEffect.alternate;
|
|
commitLifeCycles(root2, current2, nextEffect);
|
|
}
|
|
{
|
|
if (flags & Ref) {
|
|
commitAttachRef(nextEffect);
|
|
}
|
|
}
|
|
resetCurrentFiber();
|
|
nextEffect = nextEffect.nextEffect;
|
|
}
|
|
}
|
|
function flushPassiveEffects() {
|
|
if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {
|
|
var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;
|
|
pendingPassiveEffectsRenderPriority = NoPriority$1;
|
|
{
|
|
return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function enqueuePendingPassiveHookEffectMount(fiber, effect) {
|
|
pendingPassiveHookEffectsMount.push(effect, fiber);
|
|
if (!rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = true;
|
|
scheduleCallback(NormalPriority$1, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
});
|
|
}
|
|
}
|
|
function enqueuePendingPassiveHookEffectUnmount(fiber, effect) {
|
|
pendingPassiveHookEffectsUnmount.push(effect, fiber);
|
|
{
|
|
fiber.flags |= PassiveUnmountPendingDev;
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.flags |= PassiveUnmountPendingDev;
|
|
}
|
|
}
|
|
if (!rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = true;
|
|
scheduleCallback(NormalPriority$1, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
});
|
|
}
|
|
}
|
|
function invokePassiveEffectCreate(effect) {
|
|
var create = effect.create;
|
|
effect.destroy = create();
|
|
}
|
|
function flushPassiveEffectsImpl() {
|
|
if (rootWithPendingPassiveEffects === null) {
|
|
return false;
|
|
}
|
|
var root2 = rootWithPendingPassiveEffects;
|
|
var lanes = pendingPassiveEffectsLanes;
|
|
rootWithPendingPassiveEffects = null;
|
|
pendingPassiveEffectsLanes = NoLanes;
|
|
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
|
|
{
|
|
throw Error("Cannot flush passive effects while already rendering.");
|
|
}
|
|
}
|
|
{
|
|
isFlushingPassiveEffects = true;
|
|
}
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
var prevInteractions = pushInteractions(root2);
|
|
var unmountEffects = pendingPassiveHookEffectsUnmount;
|
|
pendingPassiveHookEffectsUnmount = [];
|
|
for (var i = 0; i < unmountEffects.length; i += 2) {
|
|
var _effect = unmountEffects[i];
|
|
var fiber = unmountEffects[i + 1];
|
|
var destroy = _effect.destroy;
|
|
_effect.destroy = void 0;
|
|
{
|
|
fiber.flags &= ~PassiveUnmountPendingDev;
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.flags &= ~PassiveUnmountPendingDev;
|
|
}
|
|
}
|
|
if (typeof destroy === "function") {
|
|
{
|
|
setCurrentFiber(fiber);
|
|
{
|
|
invokeGuardedCallback(null, destroy, null);
|
|
}
|
|
if (hasCaughtError()) {
|
|
if (!(fiber !== null)) {
|
|
{
|
|
throw Error("Should be working on an effect.");
|
|
}
|
|
}
|
|
var error2 = clearCaughtError();
|
|
captureCommitPhaseError(fiber, error2);
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
var mountEffects = pendingPassiveHookEffectsMount;
|
|
pendingPassiveHookEffectsMount = [];
|
|
for (var _i = 0; _i < mountEffects.length; _i += 2) {
|
|
var _effect2 = mountEffects[_i];
|
|
var _fiber = mountEffects[_i + 1];
|
|
{
|
|
setCurrentFiber(_fiber);
|
|
{
|
|
invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);
|
|
}
|
|
if (hasCaughtError()) {
|
|
if (!(_fiber !== null)) {
|
|
{
|
|
throw Error("Should be working on an effect.");
|
|
}
|
|
}
|
|
var _error4 = clearCaughtError();
|
|
captureCommitPhaseError(_fiber, _error4);
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
var effect = root2.current.firstEffect;
|
|
while (effect !== null) {
|
|
var nextNextEffect = effect.nextEffect;
|
|
effect.nextEffect = null;
|
|
if (effect.flags & Deletion) {
|
|
detachFiberAfterEffects(effect);
|
|
}
|
|
effect = nextNextEffect;
|
|
}
|
|
{
|
|
popInteractions(prevInteractions);
|
|
finishPendingInteractions(root2, lanes);
|
|
}
|
|
{
|
|
isFlushingPassiveEffects = false;
|
|
}
|
|
executionContext = prevExecutionContext;
|
|
flushSyncCallbackQueue();
|
|
nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
|
|
return true;
|
|
}
|
|
function isAlreadyFailedLegacyErrorBoundary(instance) {
|
|
return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
|
|
}
|
|
function markLegacyErrorBoundaryAsFailed(instance) {
|
|
if (legacyErrorBoundariesThatAlreadyFailed === null) {
|
|
legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
|
|
} else {
|
|
legacyErrorBoundariesThatAlreadyFailed.add(instance);
|
|
}
|
|
}
|
|
function prepareToThrowUncaughtError(error2) {
|
|
if (!hasUncaughtError) {
|
|
hasUncaughtError = true;
|
|
firstUncaughtError = error2;
|
|
}
|
|
}
|
|
var onUncaughtError = prepareToThrowUncaughtError;
|
|
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
|
|
var errorInfo = createCapturedValue(error2, sourceFiber);
|
|
var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
|
|
enqueueUpdate(rootFiber, update);
|
|
var eventTime = requestEventTime();
|
|
var root2 = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, SyncLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, SyncLane);
|
|
}
|
|
}
|
|
function captureCommitPhaseError(sourceFiber, error2) {
|
|
if (sourceFiber.tag === HostRoot) {
|
|
captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
|
|
return;
|
|
}
|
|
var fiber = sourceFiber.return;
|
|
while (fiber !== null) {
|
|
if (fiber.tag === HostRoot) {
|
|
captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error2);
|
|
return;
|
|
} else if (fiber.tag === ClassComponent) {
|
|
var ctor = fiber.type;
|
|
var instance = fiber.stateNode;
|
|
if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
|
|
var errorInfo = createCapturedValue(error2, sourceFiber);
|
|
var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
|
|
enqueueUpdate(fiber, update);
|
|
var eventTime = requestEventTime();
|
|
var root2 = markUpdateLaneFromFiberToRoot(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, SyncLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, SyncLane);
|
|
} else {
|
|
if (typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
|
|
try {
|
|
instance.componentDidCatch(error2, errorInfo);
|
|
} catch (errorToIgnore) {
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
fiber = fiber.return;
|
|
}
|
|
}
|
|
function pingSuspendedRoot(root2, wakeable, pingedLanes) {
|
|
var pingCache = root2.pingCache;
|
|
if (pingCache !== null) {
|
|
pingCache.delete(wakeable);
|
|
}
|
|
var eventTime = requestEventTime();
|
|
markRootPinged(root2, pingedLanes);
|
|
if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
|
|
if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
|
|
prepareFreshStack(root2, NoLanes);
|
|
} else {
|
|
workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, pingedLanes);
|
|
}
|
|
function retryTimedOutBoundary(boundaryFiber, retryLane) {
|
|
if (retryLane === NoLane) {
|
|
retryLane = requestRetryLane(boundaryFiber);
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var root2 = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, retryLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
schedulePendingInteractions(root2, retryLane);
|
|
}
|
|
}
|
|
function resolveRetryWakeable(boundaryFiber, wakeable) {
|
|
var retryLane = NoLane;
|
|
var retryCache;
|
|
{
|
|
retryCache = boundaryFiber.stateNode;
|
|
}
|
|
if (retryCache !== null) {
|
|
retryCache.delete(wakeable);
|
|
}
|
|
retryTimedOutBoundary(boundaryFiber, retryLane);
|
|
}
|
|
function jnd(timeElapsed) {
|
|
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
|
|
}
|
|
function checkForNestedUpdates() {
|
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
|
nestedUpdateCount = 0;
|
|
rootWithNestedUpdates = null;
|
|
{
|
|
{
|
|
throw Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
|
|
nestedPassiveUpdateCount = 0;
|
|
error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
|
|
}
|
|
}
|
|
}
|
|
function flushRenderPhaseStrictModeWarningsInDEV() {
|
|
{
|
|
ReactStrictModeWarnings.flushLegacyContextWarning();
|
|
{
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
|
|
}
|
|
}
|
|
}
|
|
var didWarnStateUpdateForNotYetMountedComponent = null;
|
|
function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
|
|
{
|
|
if ((executionContext & RenderContext) !== NoContext) {
|
|
return;
|
|
}
|
|
if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {
|
|
return;
|
|
}
|
|
var tag = fiber.tag;
|
|
if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
|
|
return;
|
|
}
|
|
var componentName = getComponentName(fiber.type) || "ReactComponent";
|
|
if (didWarnStateUpdateForNotYetMountedComponent !== null) {
|
|
if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
|
|
return;
|
|
}
|
|
didWarnStateUpdateForNotYetMountedComponent.add(componentName);
|
|
} else {
|
|
didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);
|
|
}
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var didWarnStateUpdateForUnmountedComponent = null;
|
|
function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
|
|
{
|
|
var tag = fiber.tag;
|
|
if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
|
|
return;
|
|
}
|
|
if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
|
|
return;
|
|
}
|
|
var componentName = getComponentName(fiber.type) || "ReactComponent";
|
|
if (didWarnStateUpdateForUnmountedComponent !== null) {
|
|
if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
|
|
return;
|
|
}
|
|
didWarnStateUpdateForUnmountedComponent.add(componentName);
|
|
} else {
|
|
didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
|
|
}
|
|
if (isFlushingPassiveEffects)
|
|
;
|
|
else {
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.", tag === ClassComponent ? "the componentWillUnmount method" : "a useEffect cleanup function");
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var beginWork$1;
|
|
{
|
|
var dummyFiber = null;
|
|
beginWork$1 = function(current2, unitOfWork, lanes) {
|
|
var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
|
|
try {
|
|
return beginWork(current2, unitOfWork, lanes);
|
|
} catch (originalError) {
|
|
if (originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
|
|
throw originalError;
|
|
}
|
|
resetContextDependencies();
|
|
resetHooksAfterThrow();
|
|
unwindInterruptedWork(unitOfWork);
|
|
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
|
if (unitOfWork.mode & ProfileMode) {
|
|
startProfilerTimer(unitOfWork);
|
|
}
|
|
invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
|
|
if (hasCaughtError()) {
|
|
var replayError = clearCaughtError();
|
|
throw replayError;
|
|
} else {
|
|
throw originalError;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var didWarnAboutUpdateInRender = false;
|
|
var didWarnAboutUpdateInRenderForAnotherComponent;
|
|
{
|
|
didWarnAboutUpdateInRenderForAnotherComponent = new Set();
|
|
}
|
|
function warnAboutRenderPhaseUpdatesInDEV(fiber) {
|
|
{
|
|
if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef:
|
|
case SimpleMemoComponent: {
|
|
var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || "Unknown";
|
|
var dedupeKey = renderingComponentName;
|
|
if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
|
|
didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
|
|
var setStateComponentName = getComponentName(fiber.type) || "Unknown";
|
|
error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
if (!didWarnAboutUpdateInRender) {
|
|
error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
|
|
didWarnAboutUpdateInRender = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var IsThisRendererActing = {
|
|
current: false
|
|
};
|
|
function warnIfNotScopedWithMatchingAct(fiber) {
|
|
{
|
|
if (IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("It looks like you're using the wrong act() around your test interactions.\nBe sure to use the matching version of act() corresponding to your renderer:\n\n// for react-dom:\nimport {act} from 'react-dom/test-utils';\n// ...\nact(() => ...);\n\n// for react-test-renderer:\nimport TestRenderer from react-test-renderer';\nconst {act} = TestRenderer;\n// ...\nact(() => ...);");
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
|
|
{
|
|
if ((fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
|
|
error("An update to %s ran an effect, but was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
|
|
}
|
|
}
|
|
}
|
|
function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
|
|
{
|
|
if (executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
|
|
var didWarnAboutUnmockedScheduler = false;
|
|
function warnIfUnmockedScheduler(fiber) {
|
|
{
|
|
if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === void 0) {
|
|
if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
|
|
didWarnAboutUnmockedScheduler = true;
|
|
error(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest:
|
|
jest.mock('scheduler', () => require('scheduler/unstable_mock'));
|
|
|
|
For more info, visit https://reactjs.org/link/mock-scheduler`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function computeThreadID(root2, lane) {
|
|
return lane * 1e3 + root2.interactionThreadID;
|
|
}
|
|
function markSpawnedWork(lane) {
|
|
if (spawnedWorkDuringRender === null) {
|
|
spawnedWorkDuringRender = [lane];
|
|
} else {
|
|
spawnedWorkDuringRender.push(lane);
|
|
}
|
|
}
|
|
function scheduleInteractions(root2, lane, interactions) {
|
|
if (interactions.size > 0) {
|
|
var pendingInteractionMap = root2.pendingInteractionMap;
|
|
var pendingInteractions = pendingInteractionMap.get(lane);
|
|
if (pendingInteractions != null) {
|
|
interactions.forEach(function(interaction) {
|
|
if (!pendingInteractions.has(interaction)) {
|
|
interaction.__count++;
|
|
}
|
|
pendingInteractions.add(interaction);
|
|
});
|
|
} else {
|
|
pendingInteractionMap.set(lane, new Set(interactions));
|
|
interactions.forEach(function(interaction) {
|
|
interaction.__count++;
|
|
});
|
|
}
|
|
var subscriber = tracing.__subscriberRef.current;
|
|
if (subscriber !== null) {
|
|
var threadID = computeThreadID(root2, lane);
|
|
subscriber.onWorkScheduled(interactions, threadID);
|
|
}
|
|
}
|
|
}
|
|
function schedulePendingInteractions(root2, lane) {
|
|
scheduleInteractions(root2, lane, tracing.__interactionsRef.current);
|
|
}
|
|
function startWorkOnPendingInteractions(root2, lanes) {
|
|
var interactions = new Set();
|
|
root2.pendingInteractionMap.forEach(function(scheduledInteractions, scheduledLane) {
|
|
if (includesSomeLane(lanes, scheduledLane)) {
|
|
scheduledInteractions.forEach(function(interaction) {
|
|
return interactions.add(interaction);
|
|
});
|
|
}
|
|
});
|
|
root2.memoizedInteractions = interactions;
|
|
if (interactions.size > 0) {
|
|
var subscriber = tracing.__subscriberRef.current;
|
|
if (subscriber !== null) {
|
|
var threadID = computeThreadID(root2, lanes);
|
|
try {
|
|
subscriber.onWorkStarted(interactions, threadID);
|
|
} catch (error2) {
|
|
scheduleCallback(ImmediatePriority$1, function() {
|
|
throw error2;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function finishPendingInteractions(root2, committedLanes) {
|
|
var remainingLanesAfterCommit = root2.pendingLanes;
|
|
var subscriber;
|
|
try {
|
|
subscriber = tracing.__subscriberRef.current;
|
|
if (subscriber !== null && root2.memoizedInteractions.size > 0) {
|
|
var threadID = computeThreadID(root2, committedLanes);
|
|
subscriber.onWorkStopped(root2.memoizedInteractions, threadID);
|
|
}
|
|
} catch (error2) {
|
|
scheduleCallback(ImmediatePriority$1, function() {
|
|
throw error2;
|
|
});
|
|
} finally {
|
|
var pendingInteractionMap = root2.pendingInteractionMap;
|
|
pendingInteractionMap.forEach(function(scheduledInteractions, lane) {
|
|
if (!includesSomeLane(remainingLanesAfterCommit, lane)) {
|
|
pendingInteractionMap.delete(lane);
|
|
scheduledInteractions.forEach(function(interaction) {
|
|
interaction.__count--;
|
|
if (subscriber !== null && interaction.__count === 0) {
|
|
try {
|
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
} catch (error2) {
|
|
scheduleCallback(ImmediatePriority$1, function() {
|
|
throw error2;
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function shouldForceFlushFallbacksInDEV() {
|
|
return actingUpdatesScopeDepth > 0;
|
|
}
|
|
var actingUpdatesScopeDepth = 0;
|
|
function detachFiberAfterEffects(fiber) {
|
|
fiber.sibling = null;
|
|
fiber.stateNode = null;
|
|
}
|
|
var resolveFamily = null;
|
|
var failedBoundaries = null;
|
|
var setRefreshHandler = function(handler) {
|
|
{
|
|
resolveFamily = handler;
|
|
}
|
|
};
|
|
function resolveFunctionForHotReloading(type) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return type;
|
|
}
|
|
var family = resolveFamily(type);
|
|
if (family === void 0) {
|
|
return type;
|
|
}
|
|
return family.current;
|
|
}
|
|
}
|
|
function resolveClassForHotReloading(type) {
|
|
return resolveFunctionForHotReloading(type);
|
|
}
|
|
function resolveForwardRefForHotReloading(type) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return type;
|
|
}
|
|
var family = resolveFamily(type);
|
|
if (family === void 0) {
|
|
if (type !== null && type !== void 0 && typeof type.render === "function") {
|
|
var currentRender = resolveFunctionForHotReloading(type.render);
|
|
if (type.render !== currentRender) {
|
|
var syntheticType = {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render: currentRender
|
|
};
|
|
if (type.displayName !== void 0) {
|
|
syntheticType.displayName = type.displayName;
|
|
}
|
|
return syntheticType;
|
|
}
|
|
}
|
|
return type;
|
|
}
|
|
return family.current;
|
|
}
|
|
}
|
|
function isCompatibleFamilyForHotReloading(fiber, element) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return false;
|
|
}
|
|
var prevType = fiber.elementType;
|
|
var nextType = element.type;
|
|
var needsCompareFamilies = false;
|
|
var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
|
|
switch (fiber.tag) {
|
|
case ClassComponent: {
|
|
if (typeof nextType === "function") {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case FunctionComponent: {
|
|
if (typeof nextType === "function") {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case ForwardRef: {
|
|
if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case MemoComponent:
|
|
case SimpleMemoComponent: {
|
|
if ($$typeofNextType === REACT_MEMO_TYPE) {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
if (needsCompareFamilies) {
|
|
var prevFamily = resolveFamily(prevType);
|
|
if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
function markFailedErrorBoundaryForHotReloading(fiber) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return;
|
|
}
|
|
if (typeof WeakSet !== "function") {
|
|
return;
|
|
}
|
|
if (failedBoundaries === null) {
|
|
failedBoundaries = new WeakSet();
|
|
}
|
|
failedBoundaries.add(fiber);
|
|
}
|
|
}
|
|
var scheduleRefresh = function(root2, update) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return;
|
|
}
|
|
var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
|
|
flushPassiveEffects();
|
|
flushSync(function() {
|
|
scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
|
|
});
|
|
}
|
|
};
|
|
var scheduleRoot = function(root2, element) {
|
|
{
|
|
if (root2.context !== emptyContextObject) {
|
|
return;
|
|
}
|
|
flushPassiveEffects();
|
|
flushSync(function() {
|
|
updateContainer(element, root2, null, null);
|
|
});
|
|
}
|
|
};
|
|
function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
|
|
{
|
|
var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
var candidateType = null;
|
|
switch (tag) {
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
case ClassComponent:
|
|
candidateType = type;
|
|
break;
|
|
case ForwardRef:
|
|
candidateType = type.render;
|
|
break;
|
|
}
|
|
if (resolveFamily === null) {
|
|
throw new Error("Expected resolveFamily to be set during hot reload.");
|
|
}
|
|
var needsRender = false;
|
|
var needsRemount = false;
|
|
if (candidateType !== null) {
|
|
var family = resolveFamily(candidateType);
|
|
if (family !== void 0) {
|
|
if (staleFamilies.has(family)) {
|
|
needsRemount = true;
|
|
} else if (updatedFamilies.has(family)) {
|
|
if (tag === ClassComponent) {
|
|
needsRemount = true;
|
|
} else {
|
|
needsRender = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (failedBoundaries !== null) {
|
|
if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
|
|
needsRemount = true;
|
|
}
|
|
}
|
|
if (needsRemount) {
|
|
fiber._debugNeedsRemount = true;
|
|
}
|
|
if (needsRemount || needsRender) {
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
}
|
|
if (child !== null && !needsRemount) {
|
|
scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
|
|
}
|
|
if (sibling !== null) {
|
|
scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
|
|
}
|
|
}
|
|
}
|
|
var findHostInstancesForRefresh = function(root2, families) {
|
|
{
|
|
var hostInstances = new Set();
|
|
var types = new Set(families.map(function(family) {
|
|
return family.current;
|
|
}));
|
|
findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
|
|
return hostInstances;
|
|
}
|
|
};
|
|
function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
|
|
{
|
|
var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
var candidateType = null;
|
|
switch (tag) {
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
case ClassComponent:
|
|
candidateType = type;
|
|
break;
|
|
case ForwardRef:
|
|
candidateType = type.render;
|
|
break;
|
|
}
|
|
var didMatch = false;
|
|
if (candidateType !== null) {
|
|
if (types.has(candidateType)) {
|
|
didMatch = true;
|
|
}
|
|
}
|
|
if (didMatch) {
|
|
findHostInstancesForFiberShallowly(fiber, hostInstances);
|
|
} else {
|
|
if (child !== null) {
|
|
findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
|
|
}
|
|
}
|
|
if (sibling !== null) {
|
|
findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
|
|
}
|
|
}
|
|
}
|
|
function findHostInstancesForFiberShallowly(fiber, hostInstances) {
|
|
{
|
|
var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
|
|
if (foundHostInstances) {
|
|
return;
|
|
}
|
|
var node = fiber;
|
|
while (true) {
|
|
switch (node.tag) {
|
|
case HostComponent:
|
|
hostInstances.add(node.stateNode);
|
|
return;
|
|
case HostPortal:
|
|
hostInstances.add(node.stateNode.containerInfo);
|
|
return;
|
|
case HostRoot:
|
|
hostInstances.add(node.stateNode.containerInfo);
|
|
return;
|
|
}
|
|
if (node.return === null) {
|
|
throw new Error("Expected to reach root first.");
|
|
}
|
|
node = node.return;
|
|
}
|
|
}
|
|
}
|
|
function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
|
|
{
|
|
var node = fiber;
|
|
var foundHostInstances = false;
|
|
while (true) {
|
|
if (node.tag === HostComponent) {
|
|
foundHostInstances = true;
|
|
hostInstances.add(node.stateNode);
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === fiber) {
|
|
return foundHostInstances;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === fiber) {
|
|
return foundHostInstances;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
var hasBadMapPolyfill;
|
|
{
|
|
hasBadMapPolyfill = false;
|
|
try {
|
|
var nonExtensibleObject = Object.preventExtensions({});
|
|
new Map([[nonExtensibleObject, null]]);
|
|
new Set([nonExtensibleObject]);
|
|
} catch (e) {
|
|
hasBadMapPolyfill = true;
|
|
}
|
|
}
|
|
var debugCounter = 1;
|
|
function FiberNode(tag, pendingProps, key, mode) {
|
|
this.tag = tag;
|
|
this.key = key;
|
|
this.elementType = null;
|
|
this.type = null;
|
|
this.stateNode = null;
|
|
this.return = null;
|
|
this.child = null;
|
|
this.sibling = null;
|
|
this.index = 0;
|
|
this.ref = null;
|
|
this.pendingProps = pendingProps;
|
|
this.memoizedProps = null;
|
|
this.updateQueue = null;
|
|
this.memoizedState = null;
|
|
this.dependencies = null;
|
|
this.mode = mode;
|
|
this.flags = NoFlags;
|
|
this.nextEffect = null;
|
|
this.firstEffect = null;
|
|
this.lastEffect = null;
|
|
this.lanes = NoLanes;
|
|
this.childLanes = NoLanes;
|
|
this.alternate = null;
|
|
{
|
|
this.actualDuration = Number.NaN;
|
|
this.actualStartTime = Number.NaN;
|
|
this.selfBaseDuration = Number.NaN;
|
|
this.treeBaseDuration = Number.NaN;
|
|
this.actualDuration = 0;
|
|
this.actualStartTime = -1;
|
|
this.selfBaseDuration = 0;
|
|
this.treeBaseDuration = 0;
|
|
}
|
|
{
|
|
this._debugID = debugCounter++;
|
|
this._debugSource = null;
|
|
this._debugOwner = null;
|
|
this._debugNeedsRemount = false;
|
|
this._debugHookTypes = null;
|
|
if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
|
|
Object.preventExtensions(this);
|
|
}
|
|
}
|
|
}
|
|
var createFiber = function(tag, pendingProps, key, mode) {
|
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
};
|
|
function shouldConstruct$1(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function isSimpleFunctionComponent(type) {
|
|
return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
|
|
}
|
|
function resolveLazyComponentTag(Component) {
|
|
if (typeof Component === "function") {
|
|
return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
|
|
} else if (Component !== void 0 && Component !== null) {
|
|
var $$typeof = Component.$$typeof;
|
|
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
|
return ForwardRef;
|
|
}
|
|
if ($$typeof === REACT_MEMO_TYPE) {
|
|
return MemoComponent;
|
|
}
|
|
}
|
|
return IndeterminateComponent;
|
|
}
|
|
function createWorkInProgress(current2, pendingProps) {
|
|
var workInProgress2 = current2.alternate;
|
|
if (workInProgress2 === null) {
|
|
workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
|
|
workInProgress2.elementType = current2.elementType;
|
|
workInProgress2.type = current2.type;
|
|
workInProgress2.stateNode = current2.stateNode;
|
|
{
|
|
workInProgress2._debugID = current2._debugID;
|
|
workInProgress2._debugSource = current2._debugSource;
|
|
workInProgress2._debugOwner = current2._debugOwner;
|
|
workInProgress2._debugHookTypes = current2._debugHookTypes;
|
|
}
|
|
workInProgress2.alternate = current2;
|
|
current2.alternate = workInProgress2;
|
|
} else {
|
|
workInProgress2.pendingProps = pendingProps;
|
|
workInProgress2.type = current2.type;
|
|
workInProgress2.flags = NoFlags;
|
|
workInProgress2.nextEffect = null;
|
|
workInProgress2.firstEffect = null;
|
|
workInProgress2.lastEffect = null;
|
|
{
|
|
workInProgress2.actualDuration = 0;
|
|
workInProgress2.actualStartTime = -1;
|
|
}
|
|
}
|
|
workInProgress2.childLanes = current2.childLanes;
|
|
workInProgress2.lanes = current2.lanes;
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.memoizedProps = current2.memoizedProps;
|
|
workInProgress2.memoizedState = current2.memoizedState;
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
var currentDependencies = current2.dependencies;
|
|
workInProgress2.dependencies = currentDependencies === null ? null : {
|
|
lanes: currentDependencies.lanes,
|
|
firstContext: currentDependencies.firstContext
|
|
};
|
|
workInProgress2.sibling = current2.sibling;
|
|
workInProgress2.index = current2.index;
|
|
workInProgress2.ref = current2.ref;
|
|
{
|
|
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
|
|
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
|
|
}
|
|
{
|
|
workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent:
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
workInProgress2.type = resolveFunctionForHotReloading(current2.type);
|
|
break;
|
|
case ClassComponent:
|
|
workInProgress2.type = resolveClassForHotReloading(current2.type);
|
|
break;
|
|
case ForwardRef:
|
|
workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
|
|
break;
|
|
}
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
function resetWorkInProgress(workInProgress2, renderLanes2) {
|
|
workInProgress2.flags &= Placement;
|
|
workInProgress2.nextEffect = null;
|
|
workInProgress2.firstEffect = null;
|
|
workInProgress2.lastEffect = null;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 === null) {
|
|
workInProgress2.childLanes = NoLanes;
|
|
workInProgress2.lanes = renderLanes2;
|
|
workInProgress2.child = null;
|
|
workInProgress2.memoizedProps = null;
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
workInProgress2.dependencies = null;
|
|
workInProgress2.stateNode = null;
|
|
{
|
|
workInProgress2.selfBaseDuration = 0;
|
|
workInProgress2.treeBaseDuration = 0;
|
|
}
|
|
} else {
|
|
workInProgress2.childLanes = current2.childLanes;
|
|
workInProgress2.lanes = current2.lanes;
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.memoizedProps = current2.memoizedProps;
|
|
workInProgress2.memoizedState = current2.memoizedState;
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
workInProgress2.type = current2.type;
|
|
var currentDependencies = current2.dependencies;
|
|
workInProgress2.dependencies = currentDependencies === null ? null : {
|
|
lanes: currentDependencies.lanes,
|
|
firstContext: currentDependencies.firstContext
|
|
};
|
|
{
|
|
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
|
|
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
|
|
}
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
function createHostRootFiber(tag) {
|
|
var mode;
|
|
if (tag === ConcurrentRoot) {
|
|
mode = ConcurrentMode | BlockingMode | StrictMode;
|
|
} else if (tag === BlockingRoot) {
|
|
mode = BlockingMode | StrictMode;
|
|
} else {
|
|
mode = NoMode;
|
|
}
|
|
if (isDevToolsPresent) {
|
|
mode |= ProfileMode;
|
|
}
|
|
return createFiber(HostRoot, null, null, mode);
|
|
}
|
|
function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
|
|
var fiberTag = IndeterminateComponent;
|
|
var resolvedType = type;
|
|
if (typeof type === "function") {
|
|
if (shouldConstruct$1(type)) {
|
|
fiberTag = ClassComponent;
|
|
{
|
|
resolvedType = resolveClassForHotReloading(resolvedType);
|
|
}
|
|
} else {
|
|
{
|
|
resolvedType = resolveFunctionForHotReloading(resolvedType);
|
|
}
|
|
}
|
|
} else if (typeof type === "string") {
|
|
fiberTag = HostComponent;
|
|
} else {
|
|
getTag:
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return createFiberFromFragment(pendingProps.children, mode, lanes, key);
|
|
case REACT_DEBUG_TRACING_MODE_TYPE:
|
|
fiberTag = Mode;
|
|
mode |= DebugTracingMode;
|
|
break;
|
|
case REACT_STRICT_MODE_TYPE:
|
|
fiberTag = Mode;
|
|
mode |= StrictMode;
|
|
break;
|
|
case REACT_PROFILER_TYPE:
|
|
return createFiberFromProfiler(pendingProps, mode, lanes, key);
|
|
case REACT_SUSPENSE_TYPE:
|
|
return createFiberFromSuspense(pendingProps, mode, lanes, key);
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
|
|
case REACT_OFFSCREEN_TYPE:
|
|
return createFiberFromOffscreen(pendingProps, mode, lanes, key);
|
|
case REACT_LEGACY_HIDDEN_TYPE:
|
|
return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);
|
|
case REACT_SCOPE_TYPE:
|
|
default: {
|
|
if (typeof type === "object" && type !== null) {
|
|
switch (type.$$typeof) {
|
|
case REACT_PROVIDER_TYPE:
|
|
fiberTag = ContextProvider;
|
|
break getTag;
|
|
case REACT_CONTEXT_TYPE:
|
|
fiberTag = ContextConsumer;
|
|
break getTag;
|
|
case REACT_FORWARD_REF_TYPE:
|
|
fiberTag = ForwardRef;
|
|
{
|
|
resolvedType = resolveForwardRefForHotReloading(resolvedType);
|
|
}
|
|
break getTag;
|
|
case REACT_MEMO_TYPE:
|
|
fiberTag = MemoComponent;
|
|
break getTag;
|
|
case REACT_LAZY_TYPE:
|
|
fiberTag = LazyComponent;
|
|
resolvedType = null;
|
|
break getTag;
|
|
case REACT_BLOCK_TYPE:
|
|
fiberTag = Block;
|
|
break getTag;
|
|
}
|
|
}
|
|
var info = "";
|
|
{
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
}
|
|
var ownerName = owner ? getComponentName(owner.type) : null;
|
|
if (ownerName) {
|
|
info += "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
}
|
|
{
|
|
{
|
|
throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var fiber = createFiber(fiberTag, pendingProps, key, mode);
|
|
fiber.elementType = type;
|
|
fiber.type = resolvedType;
|
|
fiber.lanes = lanes;
|
|
{
|
|
fiber._debugOwner = owner;
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromElement(element, mode, lanes) {
|
|
var owner = null;
|
|
{
|
|
owner = element._owner;
|
|
}
|
|
var type = element.type;
|
|
var key = element.key;
|
|
var pendingProps = element.props;
|
|
var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
|
|
{
|
|
fiber._debugSource = element._source;
|
|
fiber._debugOwner = element._owner;
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
var fiber = createFiber(Fragment, elements, key, mode);
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromProfiler(pendingProps, mode, lanes, key) {
|
|
{
|
|
if (typeof pendingProps.id !== "string") {
|
|
error('Profiler must specify an "id" as a prop');
|
|
}
|
|
}
|
|
var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
|
|
fiber.elementType = REACT_PROFILER_TYPE;
|
|
fiber.type = REACT_PROFILER_TYPE;
|
|
fiber.lanes = lanes;
|
|
{
|
|
fiber.stateNode = {
|
|
effectDuration: 0,
|
|
passiveEffectDuration: 0
|
|
};
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromSuspense(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
|
|
fiber.type = REACT_SUSPENSE_TYPE;
|
|
fiber.elementType = REACT_SUSPENSE_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
|
|
{
|
|
fiber.type = REACT_SUSPENSE_LIST_TYPE;
|
|
}
|
|
fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
|
|
{
|
|
fiber.type = REACT_OFFSCREEN_TYPE;
|
|
}
|
|
fiber.elementType = REACT_OFFSCREEN_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode);
|
|
{
|
|
fiber.type = REACT_LEGACY_HIDDEN_TYPE;
|
|
}
|
|
fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromText(content, mode, lanes) {
|
|
var fiber = createFiber(HostText, content, null, mode);
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromHostInstanceForDeletion() {
|
|
var fiber = createFiber(HostComponent, null, null, NoMode);
|
|
fiber.elementType = "DELETED";
|
|
fiber.type = "DELETED";
|
|
return fiber;
|
|
}
|
|
function createFiberFromPortal(portal, mode, lanes) {
|
|
var pendingProps = portal.children !== null ? portal.children : [];
|
|
var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
|
|
fiber.lanes = lanes;
|
|
fiber.stateNode = {
|
|
containerInfo: portal.containerInfo,
|
|
pendingChildren: null,
|
|
implementation: portal.implementation
|
|
};
|
|
return fiber;
|
|
}
|
|
function assignFiberPropertiesInDEV(target, source) {
|
|
if (target === null) {
|
|
target = createFiber(IndeterminateComponent, null, null, NoMode);
|
|
}
|
|
target.tag = source.tag;
|
|
target.key = source.key;
|
|
target.elementType = source.elementType;
|
|
target.type = source.type;
|
|
target.stateNode = source.stateNode;
|
|
target.return = source.return;
|
|
target.child = source.child;
|
|
target.sibling = source.sibling;
|
|
target.index = source.index;
|
|
target.ref = source.ref;
|
|
target.pendingProps = source.pendingProps;
|
|
target.memoizedProps = source.memoizedProps;
|
|
target.updateQueue = source.updateQueue;
|
|
target.memoizedState = source.memoizedState;
|
|
target.dependencies = source.dependencies;
|
|
target.mode = source.mode;
|
|
target.flags = source.flags;
|
|
target.nextEffect = source.nextEffect;
|
|
target.firstEffect = source.firstEffect;
|
|
target.lastEffect = source.lastEffect;
|
|
target.lanes = source.lanes;
|
|
target.childLanes = source.childLanes;
|
|
target.alternate = source.alternate;
|
|
{
|
|
target.actualDuration = source.actualDuration;
|
|
target.actualStartTime = source.actualStartTime;
|
|
target.selfBaseDuration = source.selfBaseDuration;
|
|
target.treeBaseDuration = source.treeBaseDuration;
|
|
}
|
|
target._debugID = source._debugID;
|
|
target._debugSource = source._debugSource;
|
|
target._debugOwner = source._debugOwner;
|
|
target._debugNeedsRemount = source._debugNeedsRemount;
|
|
target._debugHookTypes = source._debugHookTypes;
|
|
return target;
|
|
}
|
|
function FiberRootNode(containerInfo, tag, hydrate2) {
|
|
this.tag = tag;
|
|
this.containerInfo = containerInfo;
|
|
this.pendingChildren = null;
|
|
this.current = null;
|
|
this.pingCache = null;
|
|
this.finishedWork = null;
|
|
this.timeoutHandle = noTimeout;
|
|
this.context = null;
|
|
this.pendingContext = null;
|
|
this.hydrate = hydrate2;
|
|
this.callbackNode = null;
|
|
this.callbackPriority = NoLanePriority;
|
|
this.eventTimes = createLaneMap(NoLanes);
|
|
this.expirationTimes = createLaneMap(NoTimestamp);
|
|
this.pendingLanes = NoLanes;
|
|
this.suspendedLanes = NoLanes;
|
|
this.pingedLanes = NoLanes;
|
|
this.expiredLanes = NoLanes;
|
|
this.mutableReadLanes = NoLanes;
|
|
this.finishedLanes = NoLanes;
|
|
this.entangledLanes = NoLanes;
|
|
this.entanglements = createLaneMap(NoLanes);
|
|
{
|
|
this.mutableSourceEagerHydrationData = null;
|
|
}
|
|
{
|
|
this.interactionThreadID = tracing.unstable_getThreadID();
|
|
this.memoizedInteractions = new Set();
|
|
this.pendingInteractionMap = new Map();
|
|
}
|
|
{
|
|
switch (tag) {
|
|
case BlockingRoot:
|
|
this._debugRootType = "createBlockingRoot()";
|
|
break;
|
|
case ConcurrentRoot:
|
|
this._debugRootType = "createRoot()";
|
|
break;
|
|
case LegacyRoot:
|
|
this._debugRootType = "createLegacyRoot()";
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function createFiberRoot(containerInfo, tag, hydrate2, hydrationCallbacks) {
|
|
var root2 = new FiberRootNode(containerInfo, tag, hydrate2);
|
|
var uninitializedFiber = createHostRootFiber(tag);
|
|
root2.current = uninitializedFiber;
|
|
uninitializedFiber.stateNode = root2;
|
|
initializeUpdateQueue(uninitializedFiber);
|
|
return root2;
|
|
}
|
|
function registerMutableSourceForHydration(root2, mutableSource) {
|
|
var getVersion = mutableSource._getVersion;
|
|
var version = getVersion(mutableSource._source);
|
|
if (root2.mutableSourceEagerHydrationData == null) {
|
|
root2.mutableSourceEagerHydrationData = [mutableSource, version];
|
|
} else {
|
|
root2.mutableSourceEagerHydrationData.push(mutableSource, version);
|
|
}
|
|
}
|
|
function createPortal(children, containerInfo, implementation) {
|
|
var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
return {
|
|
$$typeof: REACT_PORTAL_TYPE,
|
|
key: key == null ? null : "" + key,
|
|
children,
|
|
containerInfo,
|
|
implementation
|
|
};
|
|
}
|
|
var didWarnAboutNestedUpdates;
|
|
var didWarnAboutFindNodeInStrictMode;
|
|
{
|
|
didWarnAboutNestedUpdates = false;
|
|
didWarnAboutFindNodeInStrictMode = {};
|
|
}
|
|
function getContextForSubtree(parentComponent) {
|
|
if (!parentComponent) {
|
|
return emptyContextObject;
|
|
}
|
|
var fiber = get(parentComponent);
|
|
var parentContext = findCurrentUnmaskedContext(fiber);
|
|
if (fiber.tag === ClassComponent) {
|
|
var Component = fiber.type;
|
|
if (isContextProvider(Component)) {
|
|
return processChildContext(fiber, Component, parentContext);
|
|
}
|
|
}
|
|
return parentContext;
|
|
}
|
|
function findHostInstanceWithWarning(component, methodName) {
|
|
{
|
|
var fiber = get(component);
|
|
if (fiber === void 0) {
|
|
if (typeof component.render === "function") {
|
|
{
|
|
{
|
|
throw Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
} else {
|
|
{
|
|
{
|
|
throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
if (hostFiber.mode & StrictMode) {
|
|
var componentName = getComponentName(fiber.type) || "Component";
|
|
if (!didWarnAboutFindNodeInStrictMode[componentName]) {
|
|
didWarnAboutFindNodeInStrictMode[componentName] = true;
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(hostFiber);
|
|
if (fiber.mode & StrictMode) {
|
|
error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
|
|
} else {
|
|
error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
|
|
}
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(previousFiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
}
|
|
function createContainer(containerInfo, tag, hydrate2, hydrationCallbacks) {
|
|
return createFiberRoot(containerInfo, tag, hydrate2);
|
|
}
|
|
function updateContainer(element, container, parentComponent, callback) {
|
|
{
|
|
onScheduleRoot(container, element);
|
|
}
|
|
var current$1 = container.current;
|
|
var eventTime = requestEventTime();
|
|
{
|
|
if (typeof jest !== "undefined") {
|
|
warnIfUnmockedScheduler(current$1);
|
|
warnIfNotScopedWithMatchingAct(current$1);
|
|
}
|
|
}
|
|
var lane = requestUpdateLane(current$1);
|
|
var context = getContextForSubtree(parentComponent);
|
|
if (container.context === null) {
|
|
container.context = context;
|
|
} else {
|
|
container.pendingContext = context;
|
|
}
|
|
{
|
|
if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
|
|
didWarnAboutNestedUpdates = true;
|
|
error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentName(current.type) || "Unknown");
|
|
}
|
|
}
|
|
var update = createUpdate(eventTime, lane);
|
|
update.payload = {
|
|
element
|
|
};
|
|
callback = callback === void 0 ? null : callback;
|
|
if (callback !== null) {
|
|
{
|
|
if (typeof callback !== "function") {
|
|
error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
|
|
}
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
enqueueUpdate(current$1, update);
|
|
scheduleUpdateOnFiber(current$1, lane, eventTime);
|
|
return lane;
|
|
}
|
|
function getPublicRootInstance(container) {
|
|
var containerFiber = container.current;
|
|
if (!containerFiber.child) {
|
|
return null;
|
|
}
|
|
switch (containerFiber.child.tag) {
|
|
case HostComponent:
|
|
return getPublicInstance(containerFiber.child.stateNode);
|
|
default:
|
|
return containerFiber.child.stateNode;
|
|
}
|
|
}
|
|
function markRetryLaneImpl(fiber, retryLane) {
|
|
var suspenseState = fiber.memoizedState;
|
|
if (suspenseState !== null && suspenseState.dehydrated !== null) {
|
|
suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
|
|
}
|
|
}
|
|
function markRetryLaneIfNotHydrated(fiber, retryLane) {
|
|
markRetryLaneImpl(fiber, retryLane);
|
|
var alternate = fiber.alternate;
|
|
if (alternate) {
|
|
markRetryLaneImpl(alternate, retryLane);
|
|
}
|
|
}
|
|
function attemptUserBlockingHydration$1(fiber) {
|
|
if (fiber.tag !== SuspenseComponent) {
|
|
return;
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var lane = InputDiscreteHydrationLane;
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
function attemptContinuousHydration$1(fiber) {
|
|
if (fiber.tag !== SuspenseComponent) {
|
|
return;
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var lane = SelectiveHydrationLane;
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
function attemptHydrationAtCurrentPriority$1(fiber) {
|
|
if (fiber.tag !== SuspenseComponent) {
|
|
return;
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
function runWithPriority$2(priority, fn) {
|
|
try {
|
|
setCurrentUpdateLanePriority(priority);
|
|
return fn();
|
|
} finally {
|
|
}
|
|
}
|
|
function findHostInstanceWithNoPortals(fiber) {
|
|
var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
if (hostFiber.tag === FundamentalComponent) {
|
|
return hostFiber.stateNode.instance;
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
var shouldSuspendImpl = function(fiber) {
|
|
return false;
|
|
};
|
|
function shouldSuspend(fiber) {
|
|
return shouldSuspendImpl(fiber);
|
|
}
|
|
var overrideHookState = null;
|
|
var overrideHookStateDeletePath = null;
|
|
var overrideHookStateRenamePath = null;
|
|
var overrideProps = null;
|
|
var overridePropsDeletePath = null;
|
|
var overridePropsRenamePath = null;
|
|
var scheduleUpdate = null;
|
|
var setSuspenseHandler = null;
|
|
{
|
|
var copyWithDeleteImpl = function(obj, path, index2) {
|
|
var key = path[index2];
|
|
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
|
if (index2 + 1 === path.length) {
|
|
if (Array.isArray(updated)) {
|
|
updated.splice(key, 1);
|
|
} else {
|
|
delete updated[key];
|
|
}
|
|
return updated;
|
|
}
|
|
updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1);
|
|
return updated;
|
|
};
|
|
var copyWithDelete = function(obj, path) {
|
|
return copyWithDeleteImpl(obj, path, 0);
|
|
};
|
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
var oldKey = oldPath[index2];
|
|
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
|
if (index2 + 1 === oldPath.length) {
|
|
var newKey = newPath[index2];
|
|
updated[newKey] = updated[oldKey];
|
|
if (Array.isArray(updated)) {
|
|
updated.splice(oldKey, 1);
|
|
} else {
|
|
delete updated[oldKey];
|
|
}
|
|
} else {
|
|
updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index2 + 1);
|
|
}
|
|
return updated;
|
|
};
|
|
var copyWithRename = function(obj, oldPath, newPath) {
|
|
if (oldPath.length !== newPath.length) {
|
|
warn("copyWithRename() expects paths of the same length");
|
|
return;
|
|
} else {
|
|
for (var i = 0; i < newPath.length - 1; i++) {
|
|
if (oldPath[i] !== newPath[i]) {
|
|
warn("copyWithRename() expects paths to be the same except for the deepest key");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
};
|
|
var copyWithSetImpl = function(obj, path, index2, value) {
|
|
if (index2 >= path.length) {
|
|
return value;
|
|
}
|
|
var key = path[index2];
|
|
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
|
updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value);
|
|
return updated;
|
|
};
|
|
var copyWithSet = function(obj, path, value) {
|
|
return copyWithSetImpl(obj, path, 0, value);
|
|
};
|
|
var findHook = function(fiber, id) {
|
|
var currentHook2 = fiber.memoizedState;
|
|
while (currentHook2 !== null && id > 0) {
|
|
currentHook2 = currentHook2.next;
|
|
id--;
|
|
}
|
|
return currentHook2;
|
|
};
|
|
overrideHookState = function(fiber, id, path, value) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithSet(hook.memoizedState, path, value);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
overrideHookStateDeletePath = function(fiber, id, path) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithDelete(hook.memoizedState, path);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
overrideProps = function(fiber, path, value) {
|
|
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
};
|
|
overridePropsDeletePath = function(fiber, path) {
|
|
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
};
|
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
};
|
|
scheduleUpdate = function(fiber) {
|
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
};
|
|
setSuspenseHandler = function(newShouldSuspendImpl) {
|
|
shouldSuspendImpl = newShouldSuspendImpl;
|
|
};
|
|
}
|
|
function findHostInstanceByFiber(fiber) {
|
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
function emptyFindFiberByHostInstance(instance) {
|
|
return null;
|
|
}
|
|
function getCurrentFiberForDevTools() {
|
|
return current;
|
|
}
|
|
function injectIntoDevTools(devToolsConfig) {
|
|
var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
|
|
var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
return injectInternals({
|
|
bundleType: devToolsConfig.bundleType,
|
|
version: devToolsConfig.version,
|
|
rendererPackageName: devToolsConfig.rendererPackageName,
|
|
rendererConfig: devToolsConfig.rendererConfig,
|
|
overrideHookState,
|
|
overrideHookStateDeletePath,
|
|
overrideHookStateRenamePath,
|
|
overrideProps,
|
|
overridePropsDeletePath,
|
|
overridePropsRenamePath,
|
|
setSuspenseHandler,
|
|
scheduleUpdate,
|
|
currentDispatcherRef: ReactCurrentDispatcher2,
|
|
findHostInstanceByFiber,
|
|
findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
|
|
findHostInstancesForRefresh,
|
|
scheduleRefresh,
|
|
scheduleRoot,
|
|
setRefreshHandler,
|
|
getCurrentFiber: getCurrentFiberForDevTools
|
|
});
|
|
}
|
|
function ReactDOMRoot(container, options2) {
|
|
this._internalRoot = createRootImpl(container, ConcurrentRoot, options2);
|
|
}
|
|
function ReactDOMBlockingRoot(container, tag, options2) {
|
|
this._internalRoot = createRootImpl(container, tag, options2);
|
|
}
|
|
ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function(children) {
|
|
var root2 = this._internalRoot;
|
|
{
|
|
if (typeof arguments[1] === "function") {
|
|
error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
|
|
}
|
|
var container = root2.containerInfo;
|
|
if (container.nodeType !== COMMENT_NODE) {
|
|
var hostInstance = findHostInstanceWithNoPortals(root2.current);
|
|
if (hostInstance) {
|
|
if (hostInstance.parentNode !== container) {
|
|
error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
updateContainer(children, root2, null, null);
|
|
};
|
|
ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function() {
|
|
{
|
|
if (typeof arguments[0] === "function") {
|
|
error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
|
|
}
|
|
}
|
|
var root2 = this._internalRoot;
|
|
var container = root2.containerInfo;
|
|
updateContainer(null, root2, null, function() {
|
|
unmarkContainerAsRoot(container);
|
|
});
|
|
};
|
|
function createRootImpl(container, tag, options2) {
|
|
var hydrate2 = options2 != null && options2.hydrate === true;
|
|
var hydrationCallbacks = options2 != null && options2.hydrationOptions || null;
|
|
var mutableSources = options2 != null && options2.hydrationOptions != null && options2.hydrationOptions.mutableSources || null;
|
|
var root2 = createContainer(container, tag, hydrate2);
|
|
markContainerAsRoot(root2.current, container);
|
|
var containerNodeType = container.nodeType;
|
|
{
|
|
var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
|
|
listenToAllSupportedEvents(rootContainerElement);
|
|
}
|
|
if (mutableSources) {
|
|
for (var i = 0; i < mutableSources.length; i++) {
|
|
var mutableSource = mutableSources[i];
|
|
registerMutableSourceForHydration(root2, mutableSource);
|
|
}
|
|
}
|
|
return root2;
|
|
}
|
|
function createLegacyRoot(container, options2) {
|
|
return new ReactDOMBlockingRoot(container, LegacyRoot, options2);
|
|
}
|
|
function isValidContainer(node) {
|
|
return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
|
|
}
|
|
var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
|
|
var topLevelUpdateWarnings;
|
|
var warnedAboutHydrateAPI = false;
|
|
{
|
|
topLevelUpdateWarnings = function(container) {
|
|
if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
|
|
var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
|
|
if (hostInstance) {
|
|
if (hostInstance.parentNode !== container) {
|
|
error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
|
|
}
|
|
}
|
|
}
|
|
var isRootRenderedBySomeReact = !!container._reactRootContainer;
|
|
var rootEl = getReactRootElementInContainer(container);
|
|
var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
|
|
if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
|
|
error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
|
|
}
|
|
if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
|
|
error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
|
|
}
|
|
};
|
|
}
|
|
function getReactRootElementInContainer(container) {
|
|
if (!container) {
|
|
return null;
|
|
}
|
|
if (container.nodeType === DOCUMENT_NODE) {
|
|
return container.documentElement;
|
|
} else {
|
|
return container.firstChild;
|
|
}
|
|
}
|
|
function shouldHydrateDueToLegacyHeuristic(container) {
|
|
var rootElement = getReactRootElementInContainer(container);
|
|
return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
|
|
}
|
|
function legacyCreateRootFromDOMContainer(container, forceHydrate) {
|
|
var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
|
|
if (!shouldHydrate) {
|
|
var warned = false;
|
|
var rootSibling;
|
|
while (rootSibling = container.lastChild) {
|
|
{
|
|
if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
|
|
warned = true;
|
|
error("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.");
|
|
}
|
|
}
|
|
container.removeChild(rootSibling);
|
|
}
|
|
}
|
|
{
|
|
if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
|
|
warnedAboutHydrateAPI = true;
|
|
warn("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.");
|
|
}
|
|
}
|
|
return createLegacyRoot(container, shouldHydrate ? {
|
|
hydrate: true
|
|
} : void 0);
|
|
}
|
|
function warnOnInvalidCallback$1(callback, callerName) {
|
|
{
|
|
if (callback !== null && typeof callback !== "function") {
|
|
error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
|
|
}
|
|
}
|
|
}
|
|
function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
|
|
{
|
|
topLevelUpdateWarnings(container);
|
|
warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
|
|
}
|
|
var root2 = container._reactRootContainer;
|
|
var fiberRoot;
|
|
if (!root2) {
|
|
root2 = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
|
|
fiberRoot = root2._internalRoot;
|
|
if (typeof callback === "function") {
|
|
var originalCallback = callback;
|
|
callback = function() {
|
|
var instance = getPublicRootInstance(fiberRoot);
|
|
originalCallback.call(instance);
|
|
};
|
|
}
|
|
unbatchedUpdates(function() {
|
|
updateContainer(children, fiberRoot, parentComponent, callback);
|
|
});
|
|
} else {
|
|
fiberRoot = root2._internalRoot;
|
|
if (typeof callback === "function") {
|
|
var _originalCallback = callback;
|
|
callback = function() {
|
|
var instance = getPublicRootInstance(fiberRoot);
|
|
_originalCallback.call(instance);
|
|
};
|
|
}
|
|
updateContainer(children, fiberRoot, parentComponent, callback);
|
|
}
|
|
return getPublicRootInstance(fiberRoot);
|
|
}
|
|
function findDOMNode(componentOrElement) {
|
|
{
|
|
var owner = ReactCurrentOwner$3.current;
|
|
if (owner !== null && owner.stateNode !== null) {
|
|
var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
|
|
if (!warnedAboutRefsInRender) {
|
|
error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(owner.type) || "A component");
|
|
}
|
|
owner.stateNode._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
if (componentOrElement == null) {
|
|
return null;
|
|
}
|
|
if (componentOrElement.nodeType === ELEMENT_NODE) {
|
|
return componentOrElement;
|
|
}
|
|
{
|
|
return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
|
|
}
|
|
}
|
|
function hydrate(element, container, callback) {
|
|
if (!isValidContainer(container)) {
|
|
{
|
|
throw Error("Target container is not a DOM element.");
|
|
}
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
|
|
}
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
|
|
}
|
|
function render(element, container, callback) {
|
|
if (!isValidContainer(container)) {
|
|
{
|
|
throw Error("Target container is not a DOM element.");
|
|
}
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?");
|
|
}
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
|
|
}
|
|
function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
|
|
if (!isValidContainer(containerNode)) {
|
|
{
|
|
throw Error("Target container is not a DOM element.");
|
|
}
|
|
}
|
|
if (!(parentComponent != null && has(parentComponent))) {
|
|
{
|
|
throw Error("parentComponent must be a valid React Component");
|
|
}
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
|
|
}
|
|
function unmountComponentAtNode(container) {
|
|
if (!isValidContainer(container)) {
|
|
{
|
|
throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
|
|
}
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
|
|
}
|
|
}
|
|
if (container._reactRootContainer) {
|
|
{
|
|
var rootEl = getReactRootElementInContainer(container);
|
|
var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
|
|
if (renderedByDifferentReact) {
|
|
error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
|
|
}
|
|
}
|
|
unbatchedUpdates(function() {
|
|
legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
|
|
container._reactRootContainer = null;
|
|
unmarkContainerAsRoot(container);
|
|
});
|
|
});
|
|
return true;
|
|
} else {
|
|
{
|
|
var _rootEl = getReactRootElementInContainer(container);
|
|
var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
|
|
var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
|
|
if (hasNonRootReactChild) {
|
|
error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
|
|
setAttemptContinuousHydration(attemptContinuousHydration$1);
|
|
setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
|
|
setAttemptHydrationAtPriority(runWithPriority$2);
|
|
var didWarnAboutUnstableCreatePortal = false;
|
|
{
|
|
if (typeof Map !== "function" || Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
|
|
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");
|
|
}
|
|
}
|
|
setRestoreImplementation(restoreControlledState$3);
|
|
setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
|
|
function createPortal$1(children, container) {
|
|
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
if (!isValidContainer(container)) {
|
|
{
|
|
throw Error("Target container is not a DOM element.");
|
|
}
|
|
}
|
|
return createPortal(children, container, null, key);
|
|
}
|
|
function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
|
|
return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
|
|
}
|
|
function unstable_createPortal(children, container) {
|
|
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
{
|
|
if (!didWarnAboutUnstableCreatePortal) {
|
|
didWarnAboutUnstableCreatePortal = true;
|
|
warn('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.');
|
|
}
|
|
}
|
|
return createPortal$1(children, container, key);
|
|
}
|
|
var Internals = {
|
|
Events: [
|
|
getInstanceFromNode,
|
|
getNodeFromInstance,
|
|
getFiberCurrentPropsFromNode,
|
|
enqueueStateRestore,
|
|
restoreStateIfNeeded,
|
|
flushPassiveEffects,
|
|
IsThisRendererActing
|
|
]
|
|
};
|
|
var foundDevTools = injectIntoDevTools({
|
|
findFiberByHostInstance: getClosestInstanceFromNode,
|
|
bundleType: 1,
|
|
version: ReactVersion,
|
|
rendererPackageName: "react-dom"
|
|
});
|
|
{
|
|
if (!foundDevTools && canUseDOM && window.top === window.self) {
|
|
if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
|
|
var protocol = window.location.protocol;
|
|
if (/^(https?|file):$/.test(protocol)) {
|
|
console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
|
exports.createPortal = createPortal$1;
|
|
exports.findDOMNode = findDOMNode;
|
|
exports.flushSync = flushSync;
|
|
exports.hydrate = hydrate;
|
|
exports.render = render;
|
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
exports.unstable_batchedUpdates = batchedUpdates$1;
|
|
exports.unstable_createPortal = unstable_createPortal;
|
|
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
|
|
exports.version = ReactVersion;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/index.js
|
|
var require_react_dom = __commonJS({
|
|
"node_modules/react-dom/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
checkDCE();
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_dom_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-property/lib/possibleStandardNamesOptimized.js
|
|
var require_possibleStandardNamesOptimized = __commonJS({
|
|
"node_modules/react-property/lib/possibleStandardNamesOptimized.js"(exports) {
|
|
var SAME = 0;
|
|
exports.SAME = SAME;
|
|
var CAMELCASE = 1;
|
|
exports.CAMELCASE = CAMELCASE;
|
|
exports.possibleStandardNames = {
|
|
accept: 0,
|
|
acceptCharset: 1,
|
|
"accept-charset": "acceptCharset",
|
|
accessKey: 1,
|
|
action: 0,
|
|
allowFullScreen: 1,
|
|
alt: 0,
|
|
as: 0,
|
|
async: 0,
|
|
autoCapitalize: 1,
|
|
autoComplete: 1,
|
|
autoCorrect: 1,
|
|
autoFocus: 1,
|
|
autoPlay: 1,
|
|
autoSave: 1,
|
|
capture: 0,
|
|
cellPadding: 1,
|
|
cellSpacing: 1,
|
|
challenge: 0,
|
|
charSet: 1,
|
|
checked: 0,
|
|
children: 0,
|
|
cite: 0,
|
|
class: "className",
|
|
classID: 1,
|
|
className: 1,
|
|
cols: 0,
|
|
colSpan: 1,
|
|
content: 0,
|
|
contentEditable: 1,
|
|
contextMenu: 1,
|
|
controls: 0,
|
|
controlsList: 1,
|
|
coords: 0,
|
|
crossOrigin: 1,
|
|
dangerouslySetInnerHTML: 1,
|
|
data: 0,
|
|
dateTime: 1,
|
|
default: 0,
|
|
defaultChecked: 1,
|
|
defaultValue: 1,
|
|
defer: 0,
|
|
dir: 0,
|
|
disabled: 0,
|
|
disablePictureInPicture: 1,
|
|
disableRemotePlayback: 1,
|
|
download: 0,
|
|
draggable: 0,
|
|
encType: 1,
|
|
enterKeyHint: 1,
|
|
for: "htmlFor",
|
|
form: 0,
|
|
formMethod: 1,
|
|
formAction: 1,
|
|
formEncType: 1,
|
|
formNoValidate: 1,
|
|
formTarget: 1,
|
|
frameBorder: 1,
|
|
headers: 0,
|
|
height: 0,
|
|
hidden: 0,
|
|
high: 0,
|
|
href: 0,
|
|
hrefLang: 1,
|
|
htmlFor: 1,
|
|
httpEquiv: 1,
|
|
"http-equiv": "httpEquiv",
|
|
icon: 0,
|
|
id: 0,
|
|
innerHTML: 1,
|
|
inputMode: 1,
|
|
integrity: 0,
|
|
is: 0,
|
|
itemID: 1,
|
|
itemProp: 1,
|
|
itemRef: 1,
|
|
itemScope: 1,
|
|
itemType: 1,
|
|
keyParams: 1,
|
|
keyType: 1,
|
|
kind: 0,
|
|
label: 0,
|
|
lang: 0,
|
|
list: 0,
|
|
loop: 0,
|
|
low: 0,
|
|
manifest: 0,
|
|
marginWidth: 1,
|
|
marginHeight: 1,
|
|
max: 0,
|
|
maxLength: 1,
|
|
media: 0,
|
|
mediaGroup: 1,
|
|
method: 0,
|
|
min: 0,
|
|
minLength: 1,
|
|
multiple: 0,
|
|
muted: 0,
|
|
name: 0,
|
|
noModule: 1,
|
|
nonce: 0,
|
|
noValidate: 1,
|
|
open: 0,
|
|
optimum: 0,
|
|
pattern: 0,
|
|
placeholder: 0,
|
|
playsInline: 1,
|
|
poster: 0,
|
|
preload: 0,
|
|
profile: 0,
|
|
radioGroup: 1,
|
|
readOnly: 1,
|
|
referrerPolicy: 1,
|
|
rel: 0,
|
|
required: 0,
|
|
reversed: 0,
|
|
role: 0,
|
|
rows: 0,
|
|
rowSpan: 1,
|
|
sandbox: 0,
|
|
scope: 0,
|
|
scoped: 0,
|
|
scrolling: 0,
|
|
seamless: 0,
|
|
selected: 0,
|
|
shape: 0,
|
|
size: 0,
|
|
sizes: 0,
|
|
span: 0,
|
|
spellCheck: 1,
|
|
src: 0,
|
|
srcDoc: 1,
|
|
srcLang: 1,
|
|
srcSet: 1,
|
|
start: 0,
|
|
step: 0,
|
|
style: 0,
|
|
summary: 0,
|
|
tabIndex: 1,
|
|
target: 0,
|
|
title: 0,
|
|
type: 0,
|
|
useMap: 1,
|
|
value: 0,
|
|
width: 0,
|
|
wmode: 0,
|
|
wrap: 0,
|
|
about: 0,
|
|
accentHeight: 1,
|
|
"accent-height": "accentHeight",
|
|
accumulate: 0,
|
|
additive: 0,
|
|
alignmentBaseline: 1,
|
|
"alignment-baseline": "alignmentBaseline",
|
|
allowReorder: 1,
|
|
alphabetic: 0,
|
|
amplitude: 0,
|
|
arabicForm: 1,
|
|
"arabic-form": "arabicForm",
|
|
ascent: 0,
|
|
attributeName: 1,
|
|
attributeType: 1,
|
|
autoReverse: 1,
|
|
azimuth: 0,
|
|
baseFrequency: 1,
|
|
baselineShift: 1,
|
|
"baseline-shift": "baselineShift",
|
|
baseProfile: 1,
|
|
bbox: 0,
|
|
begin: 0,
|
|
bias: 0,
|
|
by: 0,
|
|
calcMode: 1,
|
|
capHeight: 1,
|
|
"cap-height": "capHeight",
|
|
clip: 0,
|
|
clipPath: 1,
|
|
"clip-path": "clipPath",
|
|
clipPathUnits: 1,
|
|
clipRule: 1,
|
|
"clip-rule": "clipRule",
|
|
color: 0,
|
|
colorInterpolation: 1,
|
|
"color-interpolation": "colorInterpolation",
|
|
colorInterpolationFilters: 1,
|
|
"color-interpolation-filters": "colorInterpolationFilters",
|
|
colorProfile: 1,
|
|
"color-profile": "colorProfile",
|
|
colorRendering: 1,
|
|
"color-rendering": "colorRendering",
|
|
contentScriptType: 1,
|
|
contentStyleType: 1,
|
|
cursor: 0,
|
|
cx: 0,
|
|
cy: 0,
|
|
d: 0,
|
|
datatype: 0,
|
|
decelerate: 0,
|
|
descent: 0,
|
|
diffuseConstant: 1,
|
|
direction: 0,
|
|
display: 0,
|
|
divisor: 0,
|
|
dominantBaseline: 1,
|
|
"dominant-baseline": "dominantBaseline",
|
|
dur: 0,
|
|
dx: 0,
|
|
dy: 0,
|
|
edgeMode: 1,
|
|
elevation: 0,
|
|
enableBackground: 1,
|
|
"enable-background": "enableBackground",
|
|
end: 0,
|
|
exponent: 0,
|
|
externalResourcesRequired: 1,
|
|
fill: 0,
|
|
fillOpacity: 1,
|
|
"fill-opacity": "fillOpacity",
|
|
fillRule: 1,
|
|
"fill-rule": "fillRule",
|
|
filter: 0,
|
|
filterRes: 1,
|
|
filterUnits: 1,
|
|
floodOpacity: 1,
|
|
"flood-opacity": "floodOpacity",
|
|
floodColor: 1,
|
|
"flood-color": "floodColor",
|
|
focusable: 0,
|
|
fontFamily: 1,
|
|
"font-family": "fontFamily",
|
|
fontSize: 1,
|
|
"font-size": "fontSize",
|
|
fontSizeAdjust: 1,
|
|
"font-size-adjust": "fontSizeAdjust",
|
|
fontStretch: 1,
|
|
"font-stretch": "fontStretch",
|
|
fontStyle: 1,
|
|
"font-style": "fontStyle",
|
|
fontVariant: 1,
|
|
"font-variant": "fontVariant",
|
|
fontWeight: 1,
|
|
"font-weight": "fontWeight",
|
|
format: 0,
|
|
from: 0,
|
|
fx: 0,
|
|
fy: 0,
|
|
g1: 0,
|
|
g2: 0,
|
|
glyphName: 1,
|
|
"glyph-name": "glyphName",
|
|
glyphOrientationHorizontal: 1,
|
|
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
glyphOrientationVertical: 1,
|
|
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
glyphRef: 1,
|
|
gradientTransform: 1,
|
|
gradientUnits: 1,
|
|
hanging: 0,
|
|
horizAdvX: 1,
|
|
"horiz-adv-x": "horizAdvX",
|
|
horizOriginX: 1,
|
|
"horiz-origin-x": "horizOriginX",
|
|
ideographic: 0,
|
|
imageRendering: 1,
|
|
"image-rendering": "imageRendering",
|
|
in2: 0,
|
|
in: 0,
|
|
inlist: 0,
|
|
intercept: 0,
|
|
k1: 0,
|
|
k2: 0,
|
|
k3: 0,
|
|
k4: 0,
|
|
k: 0,
|
|
kernelMatrix: 1,
|
|
kernelUnitLength: 1,
|
|
kerning: 0,
|
|
keyPoints: 1,
|
|
keySplines: 1,
|
|
keyTimes: 1,
|
|
lengthAdjust: 1,
|
|
letterSpacing: 1,
|
|
"letter-spacing": "letterSpacing",
|
|
lightingColor: 1,
|
|
"lighting-color": "lightingColor",
|
|
limitingConeAngle: 1,
|
|
local: 0,
|
|
markerEnd: 1,
|
|
"marker-end": "markerEnd",
|
|
markerHeight: 1,
|
|
markerMid: 1,
|
|
"marker-mid": "markerMid",
|
|
markerStart: 1,
|
|
"marker-start": "markerStart",
|
|
markerUnits: 1,
|
|
markerWidth: 1,
|
|
mask: 0,
|
|
maskContentUnits: 1,
|
|
maskUnits: 1,
|
|
mathematical: 0,
|
|
mode: 0,
|
|
numOctaves: 1,
|
|
offset: 0,
|
|
opacity: 0,
|
|
operator: 0,
|
|
order: 0,
|
|
orient: 0,
|
|
orientation: 0,
|
|
origin: 0,
|
|
overflow: 0,
|
|
overlinePosition: 1,
|
|
"overline-position": "overlinePosition",
|
|
overlineThickness: 1,
|
|
"overline-thickness": "overlineThickness",
|
|
paintOrder: 1,
|
|
"paint-order": "paintOrder",
|
|
panose1: 0,
|
|
"panose-1": "panose1",
|
|
pathLength: 1,
|
|
patternContentUnits: 1,
|
|
patternTransform: 1,
|
|
patternUnits: 1,
|
|
pointerEvents: 1,
|
|
"pointer-events": "pointerEvents",
|
|
points: 0,
|
|
pointsAtX: 1,
|
|
pointsAtY: 1,
|
|
pointsAtZ: 1,
|
|
prefix: 0,
|
|
preserveAlpha: 1,
|
|
preserveAspectRatio: 1,
|
|
primitiveUnits: 1,
|
|
property: 0,
|
|
r: 0,
|
|
radius: 0,
|
|
refX: 1,
|
|
refY: 1,
|
|
renderingIntent: 1,
|
|
"rendering-intent": "renderingIntent",
|
|
repeatCount: 1,
|
|
repeatDur: 1,
|
|
requiredExtensions: 1,
|
|
requiredFeatures: 1,
|
|
resource: 0,
|
|
restart: 0,
|
|
result: 0,
|
|
results: 0,
|
|
rotate: 0,
|
|
rx: 0,
|
|
ry: 0,
|
|
scale: 0,
|
|
security: 0,
|
|
seed: 0,
|
|
shapeRendering: 1,
|
|
"shape-rendering": "shapeRendering",
|
|
slope: 0,
|
|
spacing: 0,
|
|
specularConstant: 1,
|
|
specularExponent: 1,
|
|
speed: 0,
|
|
spreadMethod: 1,
|
|
startOffset: 1,
|
|
stdDeviation: 1,
|
|
stemh: 0,
|
|
stemv: 0,
|
|
stitchTiles: 1,
|
|
stopColor: 1,
|
|
"stop-color": "stopColor",
|
|
stopOpacity: 1,
|
|
"stop-opacity": "stopOpacity",
|
|
strikethroughPosition: 1,
|
|
"strikethrough-position": "strikethroughPosition",
|
|
strikethroughThickness: 1,
|
|
"strikethrough-thickness": "strikethroughThickness",
|
|
string: 0,
|
|
stroke: 0,
|
|
strokeDasharray: 1,
|
|
"stroke-dasharray": "strokeDasharray",
|
|
strokeDashoffset: 1,
|
|
"stroke-dashoffset": "strokeDashoffset",
|
|
strokeLinecap: 1,
|
|
"stroke-linecap": "strokeLinecap",
|
|
strokeLinejoin: 1,
|
|
"stroke-linejoin": "strokeLinejoin",
|
|
strokeMiterlimit: 1,
|
|
"stroke-miterlimit": "strokeMiterlimit",
|
|
strokeWidth: 1,
|
|
"stroke-width": "strokeWidth",
|
|
strokeOpacity: 1,
|
|
"stroke-opacity": "strokeOpacity",
|
|
suppressContentEditableWarning: 1,
|
|
suppressHydrationWarning: 1,
|
|
surfaceScale: 1,
|
|
systemLanguage: 1,
|
|
tableValues: 1,
|
|
targetX: 1,
|
|
targetY: 1,
|
|
textAnchor: 1,
|
|
"text-anchor": "textAnchor",
|
|
textDecoration: 1,
|
|
"text-decoration": "textDecoration",
|
|
textLength: 1,
|
|
textRendering: 1,
|
|
"text-rendering": "textRendering",
|
|
to: 0,
|
|
transform: 0,
|
|
typeof: 0,
|
|
u1: 0,
|
|
u2: 0,
|
|
underlinePosition: 1,
|
|
"underline-position": "underlinePosition",
|
|
underlineThickness: 1,
|
|
"underline-thickness": "underlineThickness",
|
|
unicode: 0,
|
|
unicodeBidi: 1,
|
|
"unicode-bidi": "unicodeBidi",
|
|
unicodeRange: 1,
|
|
"unicode-range": "unicodeRange",
|
|
unitsPerEm: 1,
|
|
"units-per-em": "unitsPerEm",
|
|
unselectable: 0,
|
|
vAlphabetic: 1,
|
|
"v-alphabetic": "vAlphabetic",
|
|
values: 0,
|
|
vectorEffect: 1,
|
|
"vector-effect": "vectorEffect",
|
|
version: 0,
|
|
vertAdvY: 1,
|
|
"vert-adv-y": "vertAdvY",
|
|
vertOriginX: 1,
|
|
"vert-origin-x": "vertOriginX",
|
|
vertOriginY: 1,
|
|
"vert-origin-y": "vertOriginY",
|
|
vHanging: 1,
|
|
"v-hanging": "vHanging",
|
|
vIdeographic: 1,
|
|
"v-ideographic": "vIdeographic",
|
|
viewBox: 1,
|
|
viewTarget: 1,
|
|
visibility: 0,
|
|
vMathematical: 1,
|
|
"v-mathematical": "vMathematical",
|
|
vocab: 0,
|
|
widths: 0,
|
|
wordSpacing: 1,
|
|
"word-spacing": "wordSpacing",
|
|
writingMode: 1,
|
|
"writing-mode": "writingMode",
|
|
x1: 0,
|
|
x2: 0,
|
|
x: 0,
|
|
xChannelSelector: 1,
|
|
xHeight: 1,
|
|
"x-height": "xHeight",
|
|
xlinkActuate: 1,
|
|
"xlink:actuate": "xlinkActuate",
|
|
xlinkArcrole: 1,
|
|
"xlink:arcrole": "xlinkArcrole",
|
|
xlinkHref: 1,
|
|
"xlink:href": "xlinkHref",
|
|
xlinkRole: 1,
|
|
"xlink:role": "xlinkRole",
|
|
xlinkShow: 1,
|
|
"xlink:show": "xlinkShow",
|
|
xlinkTitle: 1,
|
|
"xlink:title": "xlinkTitle",
|
|
xlinkType: 1,
|
|
"xlink:type": "xlinkType",
|
|
xmlBase: 1,
|
|
"xml:base": "xmlBase",
|
|
xmlLang: 1,
|
|
"xml:lang": "xmlLang",
|
|
xmlns: 0,
|
|
"xml:space": "xmlSpace",
|
|
xmlnsXlink: 1,
|
|
"xmlns:xlink": "xmlnsXlink",
|
|
xmlSpace: 1,
|
|
y1: 0,
|
|
y2: 0,
|
|
y: 0,
|
|
yChannelSelector: 1,
|
|
z: 0,
|
|
zoomAndPan: 1
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-property/lib/index.js
|
|
var require_lib = __commonJS({
|
|
"node_modules/react-property/lib/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function _slicedToArray(arr, i) {
|
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
}
|
|
function _arrayWithHoles(arr) {
|
|
if (Array.isArray(arr))
|
|
return arr;
|
|
}
|
|
function _iterableToArrayLimit(arr, i) {
|
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (_i == null)
|
|
return;
|
|
var _arr = [];
|
|
var _n = true;
|
|
var _d = false;
|
|
var _s, _e;
|
|
try {
|
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
_arr.push(_s.value);
|
|
if (i && _arr.length === i)
|
|
break;
|
|
}
|
|
} catch (err) {
|
|
_d = true;
|
|
_e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && _i["return"] != null)
|
|
_i["return"]();
|
|
} finally {
|
|
if (_d)
|
|
throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
function _unsupportedIterableToArray(o, minLen) {
|
|
if (!o)
|
|
return;
|
|
if (typeof o === "string")
|
|
return _arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor)
|
|
n = o.constructor.name;
|
|
if (n === "Map" || n === "Set")
|
|
return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
return _arrayLikeToArray(o, minLen);
|
|
}
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length)
|
|
len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
arr2[i] = arr[i];
|
|
return arr2;
|
|
}
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
var RESERVED = 0;
|
|
var STRING = 1;
|
|
var BOOLEANISH_STRING = 2;
|
|
var BOOLEAN = 3;
|
|
var OVERLOADED_BOOLEAN = 4;
|
|
var NUMERIC = 5;
|
|
var POSITIVE_NUMERIC = 6;
|
|
function getPropertyInfo(name) {
|
|
return properties.hasOwnProperty(name) ? properties[name] : null;
|
|
}
|
|
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
|
|
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
this.attributeName = attributeName;
|
|
this.attributeNamespace = attributeNamespace;
|
|
this.mustUseProperty = mustUseProperty;
|
|
this.propertyName = name;
|
|
this.type = type;
|
|
this.sanitizeURL = sanitizeURL;
|
|
this.removeEmptyString = removeEmptyString;
|
|
}
|
|
var properties = {};
|
|
var reservedProps = [
|
|
"children",
|
|
"dangerouslySetInnerHTML",
|
|
"defaultValue",
|
|
"defaultChecked",
|
|
"innerHTML",
|
|
"suppressContentEditableWarning",
|
|
"suppressHydrationWarning",
|
|
"style"
|
|
];
|
|
reservedProps.forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, name, null, false, false);
|
|
});
|
|
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
|
|
var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], attributeName = _ref2[1];
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false);
|
|
});
|
|
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null, false, false);
|
|
});
|
|
[
|
|
"allowFullScreen",
|
|
"async",
|
|
"autoFocus",
|
|
"autoPlay",
|
|
"controls",
|
|
"default",
|
|
"defer",
|
|
"disabled",
|
|
"disablePictureInPicture",
|
|
"disableRemotePlayback",
|
|
"formNoValidate",
|
|
"hidden",
|
|
"loop",
|
|
"noModule",
|
|
"noValidate",
|
|
"open",
|
|
"playsInline",
|
|
"readOnly",
|
|
"required",
|
|
"reversed",
|
|
"scoped",
|
|
"seamless",
|
|
"itemScope"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
[
|
|
"checked",
|
|
"multiple",
|
|
"muted",
|
|
"selected"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name, null, false, false);
|
|
});
|
|
[
|
|
"capture",
|
|
"download"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name, null, false, false);
|
|
});
|
|
[
|
|
"cols",
|
|
"rows",
|
|
"size",
|
|
"span"
|
|
].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name, null, false, false);
|
|
});
|
|
["rowSpan", "start"].forEach(function(name) {
|
|
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null, false, false);
|
|
});
|
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
var capitalize = function capitalize2(token) {
|
|
return token[1].toUpperCase();
|
|
};
|
|
[
|
|
"accent-height",
|
|
"alignment-baseline",
|
|
"arabic-form",
|
|
"baseline-shift",
|
|
"cap-height",
|
|
"clip-path",
|
|
"clip-rule",
|
|
"color-interpolation",
|
|
"color-interpolation-filters",
|
|
"color-profile",
|
|
"color-rendering",
|
|
"dominant-baseline",
|
|
"enable-background",
|
|
"fill-opacity",
|
|
"fill-rule",
|
|
"flood-color",
|
|
"flood-opacity",
|
|
"font-family",
|
|
"font-size",
|
|
"font-size-adjust",
|
|
"font-stretch",
|
|
"font-style",
|
|
"font-variant",
|
|
"font-weight",
|
|
"glyph-name",
|
|
"glyph-orientation-horizontal",
|
|
"glyph-orientation-vertical",
|
|
"horiz-adv-x",
|
|
"horiz-origin-x",
|
|
"image-rendering",
|
|
"letter-spacing",
|
|
"lighting-color",
|
|
"marker-end",
|
|
"marker-mid",
|
|
"marker-start",
|
|
"overline-position",
|
|
"overline-thickness",
|
|
"paint-order",
|
|
"panose-1",
|
|
"pointer-events",
|
|
"rendering-intent",
|
|
"shape-rendering",
|
|
"stop-color",
|
|
"stop-opacity",
|
|
"strikethrough-position",
|
|
"strikethrough-thickness",
|
|
"stroke-dasharray",
|
|
"stroke-dashoffset",
|
|
"stroke-linecap",
|
|
"stroke-linejoin",
|
|
"stroke-miterlimit",
|
|
"stroke-opacity",
|
|
"stroke-width",
|
|
"text-anchor",
|
|
"text-decoration",
|
|
"text-rendering",
|
|
"underline-position",
|
|
"underline-thickness",
|
|
"unicode-bidi",
|
|
"unicode-range",
|
|
"units-per-em",
|
|
"v-alphabetic",
|
|
"v-hanging",
|
|
"v-ideographic",
|
|
"v-mathematical",
|
|
"vector-effect",
|
|
"vert-adv-y",
|
|
"vert-origin-x",
|
|
"vert-origin-y",
|
|
"word-spacing",
|
|
"writing-mode",
|
|
"xmlns:xlink",
|
|
"x-height"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false);
|
|
});
|
|
[
|
|
"xlink:actuate",
|
|
"xlink:arcrole",
|
|
"xlink:role",
|
|
"xlink:show",
|
|
"xlink:title",
|
|
"xlink:type"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/1999/xlink", false, false);
|
|
});
|
|
[
|
|
"xml:base",
|
|
"xml:lang",
|
|
"xml:space"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/XML/1998/namespace", false, false);
|
|
});
|
|
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
|
|
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false, false);
|
|
});
|
|
var xlinkHref = "xlinkHref";
|
|
properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false);
|
|
["src", "href", "action", "formAction"].forEach(function(attributeName) {
|
|
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true, true);
|
|
});
|
|
var _require = require_possibleStandardNamesOptimized();
|
|
var CAMELCASE = _require.CAMELCASE;
|
|
var SAME = _require.SAME;
|
|
var possibleStandardNamesOptimized = _require.possibleStandardNames;
|
|
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$"));
|
|
var possibleStandardNames = Object.keys(possibleStandardNamesOptimized).reduce(function(accumulator, standardName) {
|
|
var propName = possibleStandardNamesOptimized[standardName];
|
|
if (propName === SAME) {
|
|
accumulator[standardName] = standardName;
|
|
} else if (propName === CAMELCASE) {
|
|
accumulator[standardName.toLowerCase()] = standardName;
|
|
} else {
|
|
accumulator[standardName] = propName;
|
|
}
|
|
return accumulator;
|
|
}, {});
|
|
exports.BOOLEAN = BOOLEAN;
|
|
exports.BOOLEANISH_STRING = BOOLEANISH_STRING;
|
|
exports.NUMERIC = NUMERIC;
|
|
exports.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
|
|
exports.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
|
|
exports.RESERVED = RESERVED;
|
|
exports.STRING = STRING;
|
|
exports.getPropertyInfo = getPropertyInfo;
|
|
exports.isCustomAttribute = isCustomAttribute;
|
|
exports.possibleStandardNames = possibleStandardNames;
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-parser/index.js
|
|
var require_inline_style_parser = __commonJS({
|
|
"node_modules/inline-style-parser/index.js"(exports, module2) {
|
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
var NEWLINE_REGEX = /\n/g;
|
|
var WHITESPACE_REGEX = /^\s*/;
|
|
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
var COLON_REGEX = /^:\s*/;
|
|
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
|
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
var NEWLINE = "\n";
|
|
var FORWARD_SLASH = "/";
|
|
var ASTERISK = "*";
|
|
var EMPTY_STRING = "";
|
|
var TYPE_COMMENT = "comment";
|
|
var TYPE_DECLARATION = "declaration";
|
|
module2.exports = function(style, options) {
|
|
if (typeof style !== "string") {
|
|
throw new TypeError("First argument must be a string");
|
|
}
|
|
if (!style)
|
|
return [];
|
|
options = options || {};
|
|
var lineno = 1;
|
|
var column = 1;
|
|
function updatePosition(str) {
|
|
var lines = str.match(NEWLINE_REGEX);
|
|
if (lines)
|
|
lineno += lines.length;
|
|
var i = str.lastIndexOf(NEWLINE);
|
|
column = ~i ? str.length - i : column + str.length;
|
|
}
|
|
function position() {
|
|
var start = { line: lineno, column };
|
|
return function(node) {
|
|
node.position = new Position(start);
|
|
whitespace();
|
|
return node;
|
|
};
|
|
}
|
|
function Position(start) {
|
|
this.start = start;
|
|
this.end = { line: lineno, column };
|
|
this.source = options.source;
|
|
}
|
|
Position.prototype.content = style;
|
|
var errorsList = [];
|
|
function error(msg) {
|
|
var err = new Error(options.source + ":" + lineno + ":" + column + ": " + msg);
|
|
err.reason = msg;
|
|
err.filename = options.source;
|
|
err.line = lineno;
|
|
err.column = column;
|
|
err.source = style;
|
|
if (options.silent) {
|
|
errorsList.push(err);
|
|
} else {
|
|
throw err;
|
|
}
|
|
}
|
|
function match(re) {
|
|
var m = re.exec(style);
|
|
if (!m)
|
|
return;
|
|
var str = m[0];
|
|
updatePosition(str);
|
|
style = style.slice(str.length);
|
|
return m;
|
|
}
|
|
function whitespace() {
|
|
match(WHITESPACE_REGEX);
|
|
}
|
|
function comments(rules) {
|
|
var c;
|
|
rules = rules || [];
|
|
while (c = comment()) {
|
|
if (c !== false) {
|
|
rules.push(c);
|
|
}
|
|
}
|
|
return rules;
|
|
}
|
|
function comment() {
|
|
var pos = position();
|
|
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1))
|
|
return;
|
|
var i = 2;
|
|
while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
|
|
++i;
|
|
}
|
|
i += 2;
|
|
if (EMPTY_STRING === style.charAt(i - 1)) {
|
|
return error("End of comment missing");
|
|
}
|
|
var str = style.slice(2, i - 2);
|
|
column += 2;
|
|
updatePosition(str);
|
|
style = style.slice(i);
|
|
column += 2;
|
|
return pos({
|
|
type: TYPE_COMMENT,
|
|
comment: str
|
|
});
|
|
}
|
|
function declaration() {
|
|
var pos = position();
|
|
var prop = match(PROPERTY_REGEX);
|
|
if (!prop)
|
|
return;
|
|
comment();
|
|
if (!match(COLON_REGEX))
|
|
return error("property missing ':'");
|
|
var val = match(VALUE_REGEX);
|
|
var ret = pos({
|
|
type: TYPE_DECLARATION,
|
|
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
|
value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
|
|
});
|
|
match(SEMICOLON_REGEX);
|
|
return ret;
|
|
}
|
|
function declarations() {
|
|
var decls = [];
|
|
comments(decls);
|
|
var decl;
|
|
while (decl = declaration()) {
|
|
if (decl !== false) {
|
|
decls.push(decl);
|
|
comments(decls);
|
|
}
|
|
}
|
|
return decls;
|
|
}
|
|
whitespace();
|
|
return declarations();
|
|
};
|
|
function trim(str) {
|
|
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-object/index.js
|
|
var require_style_to_object = __commonJS({
|
|
"node_modules/style-to-object/index.js"(exports, module2) {
|
|
var parse = require_inline_style_parser();
|
|
function StyleToObject(style, iterator) {
|
|
var output = null;
|
|
if (!style || typeof style !== "string") {
|
|
return output;
|
|
}
|
|
var declaration;
|
|
var declarations = parse(style);
|
|
var hasIterator = typeof iterator === "function";
|
|
var property;
|
|
var value;
|
|
for (var i = 0, len = declarations.length; i < len; i++) {
|
|
declaration = declarations[i];
|
|
property = declaration.property;
|
|
value = declaration.value;
|
|
if (hasIterator) {
|
|
iterator(property, value, declaration);
|
|
} else if (value) {
|
|
output || (output = {});
|
|
output[property] = value;
|
|
}
|
|
}
|
|
return output;
|
|
}
|
|
module2.exports = StyleToObject;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/utilities.js
|
|
var require_utilities = __commonJS({
|
|
"node_modules/style-to-js/cjs/utilities.js"(exports) {
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
exports.camelCase = void 0;
|
|
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;
|
|
var HYPHEN_REGEX = /-([a-z])/g;
|
|
var NO_HYPHEN_REGEX = /^[^-]+$/;
|
|
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
|
|
var skipCamelCase = function(property) {
|
|
return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
|
|
};
|
|
var capitalize = function(match, character) {
|
|
return character.toUpperCase();
|
|
};
|
|
var trimHyphen = function(match, prefix) {
|
|
return prefix + "-";
|
|
};
|
|
var camelCase = function(property, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
if (skipCamelCase(property)) {
|
|
return property;
|
|
}
|
|
property = property.toLowerCase();
|
|
if (!options.reactCompat) {
|
|
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
|
|
}
|
|
return property.replace(HYPHEN_REGEX, capitalize);
|
|
};
|
|
exports.camelCase = camelCase;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/index.js
|
|
var require_cjs = __commonJS({
|
|
"node_modules/style-to-js/cjs/index.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
exports.__esModule = true;
|
|
var style_to_object_1 = __importDefault(require_style_to_object());
|
|
var utilities_1 = require_utilities();
|
|
function StyleToJS(style, options) {
|
|
var output = {};
|
|
if (!style || typeof style !== "string") {
|
|
return output;
|
|
}
|
|
style_to_object_1["default"](style, function(property, value) {
|
|
if (property && value) {
|
|
output[utilities_1.camelCase(property, options)] = value;
|
|
}
|
|
});
|
|
return output;
|
|
}
|
|
exports["default"] = StyleToJS;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/utilities.js
|
|
var require_utilities2 = __commonJS({
|
|
"node_modules/html-react-parser/lib/utilities.js"(exports, module2) {
|
|
var React31 = require_react();
|
|
var styleToJS = require_cjs().default;
|
|
function invertObject(obj, override) {
|
|
if (!obj || typeof obj !== "object") {
|
|
throw new TypeError("First argument must be an object");
|
|
}
|
|
var key;
|
|
var value;
|
|
var isOverridePresent = typeof override === "function";
|
|
var overrides = {};
|
|
var result = {};
|
|
for (key in obj) {
|
|
value = obj[key];
|
|
if (isOverridePresent) {
|
|
overrides = override(key, value);
|
|
if (overrides && overrides.length === 2) {
|
|
result[overrides[0]] = overrides[1];
|
|
continue;
|
|
}
|
|
}
|
|
if (typeof value === "string") {
|
|
result[value] = key;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function isCustomComponent(tagName, props) {
|
|
if (tagName.indexOf("-") === -1) {
|
|
return props && typeof props.is === "string";
|
|
}
|
|
switch (tagName) {
|
|
case "annotation-xml":
|
|
case "color-profile":
|
|
case "font-face":
|
|
case "font-face-src":
|
|
case "font-face-uri":
|
|
case "font-face-format":
|
|
case "font-face-name":
|
|
case "missing-glyph":
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
var styleToJSOptions = { reactCompat: true };
|
|
function setStyleProp(style, props) {
|
|
if (style === null || style === void 0) {
|
|
return;
|
|
}
|
|
try {
|
|
props.style = styleToJS(style, styleToJSOptions);
|
|
} catch (err) {
|
|
props.style = {};
|
|
}
|
|
}
|
|
var PRESERVE_CUSTOM_ATTRIBUTES = React31.version.split(".")[0] >= 16;
|
|
var elementsWithNoTextChildren = new Set([
|
|
"tr",
|
|
"tbody",
|
|
"thead",
|
|
"tfoot",
|
|
"colgroup",
|
|
"table",
|
|
"head",
|
|
"html",
|
|
"frameset"
|
|
]);
|
|
function canTextBeChildOfNode(node) {
|
|
return !elementsWithNoTextChildren.has(node.name);
|
|
}
|
|
module2.exports = {
|
|
PRESERVE_CUSTOM_ATTRIBUTES,
|
|
invertObject,
|
|
isCustomComponent,
|
|
setStyleProp,
|
|
canTextBeChildOfNode,
|
|
elementsWithNoTextChildren
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/attributes-to-props.js
|
|
var require_attributes_to_props = __commonJS({
|
|
"node_modules/html-react-parser/lib/attributes-to-props.js"(exports, module2) {
|
|
var reactProperty = require_lib();
|
|
var utilities = require_utilities2();
|
|
module2.exports = function attributesToProps2(attributes) {
|
|
attributes = attributes || {};
|
|
var valueOnlyInputs = {
|
|
reset: true,
|
|
submit: true
|
|
};
|
|
var attributeName;
|
|
var attributeNameLowerCased;
|
|
var attributeValue;
|
|
var propName;
|
|
var propertyInfo;
|
|
var props = {};
|
|
var inputIsValueOnly = attributes.type && valueOnlyInputs[attributes.type];
|
|
for (attributeName in attributes) {
|
|
attributeValue = attributes[attributeName];
|
|
if (reactProperty.isCustomAttribute(attributeName)) {
|
|
props[attributeName] = attributeValue;
|
|
continue;
|
|
}
|
|
attributeNameLowerCased = attributeName.toLowerCase();
|
|
propName = getPropName(attributeNameLowerCased);
|
|
if (propName) {
|
|
propertyInfo = reactProperty.getPropertyInfo(propName);
|
|
if ((propName === "checked" || propName === "value") && !inputIsValueOnly) {
|
|
propName = getPropName("default" + attributeNameLowerCased);
|
|
}
|
|
props[propName] = attributeValue;
|
|
switch (propertyInfo && propertyInfo.type) {
|
|
case reactProperty.BOOLEAN:
|
|
props[propName] = true;
|
|
break;
|
|
case reactProperty.OVERLOADED_BOOLEAN:
|
|
if (attributeValue === "") {
|
|
props[propName] = true;
|
|
}
|
|
break;
|
|
}
|
|
continue;
|
|
}
|
|
if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
|
|
props[attributeName] = attributeValue;
|
|
}
|
|
}
|
|
utilities.setStyleProp(attributes.style, props);
|
|
return props;
|
|
};
|
|
function getPropName(attributeName) {
|
|
return reactProperty.possibleStandardNames[attributeName];
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/dom-to-react.js
|
|
var require_dom_to_react = __commonJS({
|
|
"node_modules/html-react-parser/lib/dom-to-react.js"(exports, module2) {
|
|
var React31 = require_react();
|
|
var attributesToProps2 = require_attributes_to_props();
|
|
var utilities = require_utilities2();
|
|
var setStyleProp = utilities.setStyleProp;
|
|
var canTextBeChildOfNode = utilities.canTextBeChildOfNode;
|
|
function domToReact2(nodes, options) {
|
|
options = options || {};
|
|
var library = options.library || React31;
|
|
var cloneElement = library.cloneElement;
|
|
var createElement = library.createElement;
|
|
var isValidElement = library.isValidElement;
|
|
var result = [];
|
|
var node;
|
|
var isWhitespace;
|
|
var hasReplace = typeof options.replace === "function";
|
|
var replaceElement;
|
|
var props;
|
|
var children;
|
|
var trim = options.trim;
|
|
for (var i = 0, len = nodes.length; i < len; i++) {
|
|
node = nodes[i];
|
|
if (hasReplace) {
|
|
replaceElement = options.replace(node);
|
|
if (isValidElement(replaceElement)) {
|
|
if (len > 1) {
|
|
replaceElement = cloneElement(replaceElement, {
|
|
key: replaceElement.key || i
|
|
});
|
|
}
|
|
result.push(replaceElement);
|
|
continue;
|
|
}
|
|
}
|
|
if (node.type === "text") {
|
|
isWhitespace = !node.data.trim().length;
|
|
if (isWhitespace && node.parent && !canTextBeChildOfNode(node.parent)) {
|
|
continue;
|
|
}
|
|
if (trim && isWhitespace) {
|
|
continue;
|
|
}
|
|
result.push(node.data);
|
|
continue;
|
|
}
|
|
props = node.attribs;
|
|
if (skipAttributesToProps(node)) {
|
|
setStyleProp(props.style, props);
|
|
} else if (props) {
|
|
props = attributesToProps2(props);
|
|
}
|
|
children = null;
|
|
switch (node.type) {
|
|
case "script":
|
|
case "style":
|
|
if (node.children[0]) {
|
|
props.dangerouslySetInnerHTML = {
|
|
__html: node.children[0].data
|
|
};
|
|
}
|
|
break;
|
|
case "tag":
|
|
if (node.name === "textarea" && node.children[0]) {
|
|
props.defaultValue = node.children[0].data;
|
|
} else if (node.children && node.children.length) {
|
|
children = domToReact2(node.children, options);
|
|
}
|
|
break;
|
|
default:
|
|
continue;
|
|
}
|
|
if (len > 1) {
|
|
props.key = i;
|
|
}
|
|
result.push(createElement(node.name, props, children));
|
|
}
|
|
return result.length === 1 ? result[0] : result;
|
|
}
|
|
function skipAttributesToProps(node) {
|
|
return utilities.PRESERVE_CUSTOM_ATTRIBUTES && node.type === "tag" && utilities.isCustomComponent(node.name, node.attribs);
|
|
}
|
|
module2.exports = domToReact2;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/entities/lib/decode_codepoint.js
|
|
var require_decode_codepoint = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/entities/lib/decode_codepoint.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var decodeMap = new Map([
|
|
[0, 65533],
|
|
[128, 8364],
|
|
[130, 8218],
|
|
[131, 402],
|
|
[132, 8222],
|
|
[133, 8230],
|
|
[134, 8224],
|
|
[135, 8225],
|
|
[136, 710],
|
|
[137, 8240],
|
|
[138, 352],
|
|
[139, 8249],
|
|
[140, 338],
|
|
[142, 381],
|
|
[145, 8216],
|
|
[146, 8217],
|
|
[147, 8220],
|
|
[148, 8221],
|
|
[149, 8226],
|
|
[150, 8211],
|
|
[151, 8212],
|
|
[152, 732],
|
|
[153, 8482],
|
|
[154, 353],
|
|
[155, 8250],
|
|
[156, 339],
|
|
[158, 382],
|
|
[159, 376]
|
|
]);
|
|
var fromCodePoint = String.fromCodePoint || function(codePoint) {
|
|
var output = "";
|
|
if (codePoint > 65535) {
|
|
codePoint -= 65536;
|
|
output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
|
|
codePoint = 56320 | codePoint & 1023;
|
|
}
|
|
output += String.fromCharCode(codePoint);
|
|
return output;
|
|
};
|
|
function decodeCodePoint(codePoint) {
|
|
var _a;
|
|
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
|
|
return "\uFFFD";
|
|
}
|
|
return fromCodePoint((_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint);
|
|
}
|
|
exports.default = decodeCodePoint;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/entities/lib/generated/decode-data-html.js
|
|
var require_decode_data_html = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/entities/lib/generated/decode-data-html.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = new Uint16Array([14866, 60, 237, 340, 721, 1312, 1562, 1654, 1838, 1957, 2183, 2239, 2301, 2958, 3037, 3893, 4123, 4298, 4330, 4801, 5191, 5395, 5752, 5903, 5943, 5972, 6050, 0, 0, 0, 0, 0, 0, 6135, 6565, 7422, 8183, 8738, 9242, 9503, 9938, 10189, 10573, 10637, 10715, 11950, 12246, 13539, 13950, 14445, 14533, 15364, 16514, 16980, 17390, 17763, 17849, 18036, 18125, 4096, 69, 77, 97, 98, 99, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 92, 100, 106, 115, 122, 137, 142, 151, 157, 163, 167, 182, 196, 204, 220, 229, 108, 105, 103, 33024, 198, 59, 32768, 198, 80, 33024, 38, 59, 32768, 38, 99, 117, 116, 101, 33024, 193, 59, 32768, 193, 114, 101, 118, 101, 59, 32768, 258, 512, 105, 121, 127, 134, 114, 99, 33024, 194, 59, 32768, 194, 59, 32768, 1040, 114, 59, 32896, 55349, 56580, 114, 97, 118, 101, 33024, 192, 59, 32768, 192, 112, 104, 97, 59, 32768, 913, 97, 99, 114, 59, 32768, 256, 100, 59, 32768, 10835, 512, 103, 112, 172, 177, 111, 110, 59, 32768, 260, 102, 59, 32896, 55349, 56632, 112, 108, 121, 70, 117, 110, 99, 116, 105, 111, 110, 59, 32768, 8289, 105, 110, 103, 33024, 197, 59, 32768, 197, 512, 99, 115, 209, 214, 114, 59, 32896, 55349, 56476, 105, 103, 110, 59, 32768, 8788, 105, 108, 100, 101, 33024, 195, 59, 32768, 195, 109, 108, 33024, 196, 59, 32768, 196, 2048, 97, 99, 101, 102, 111, 114, 115, 117, 253, 278, 282, 310, 315, 321, 327, 332, 512, 99, 114, 258, 267, 107, 115, 108, 97, 115, 104, 59, 32768, 8726, 583, 271, 274, 59, 32768, 10983, 101, 100, 59, 32768, 8966, 121, 59, 32768, 1041, 768, 99, 114, 116, 289, 296, 306, 97, 117, 115, 101, 59, 32768, 8757, 110, 111, 117, 108, 108, 105, 115, 59, 32768, 8492, 97, 59, 32768, 914, 114, 59, 32896, 55349, 56581, 112, 102, 59, 32896, 55349, 56633, 101, 118, 101, 59, 32768, 728, 99, 114, 59, 32768, 8492, 109, 112, 101, 113, 59, 32768, 8782, 3584, 72, 79, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 117, 368, 373, 380, 426, 461, 466, 487, 491, 495, 533, 593, 695, 701, 707, 99, 121, 59, 32768, 1063, 80, 89, 33024, 169, 59, 32768, 169, 768, 99, 112, 121, 387, 393, 419, 117, 116, 101, 59, 32768, 262, 512, 59, 105, 398, 400, 32768, 8914, 116, 97, 108, 68, 105, 102, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 32768, 8517, 108, 101, 121, 115, 59, 32768, 8493, 1024, 97, 101, 105, 111, 435, 441, 449, 454, 114, 111, 110, 59, 32768, 268, 100, 105, 108, 33024, 199, 59, 32768, 199, 114, 99, 59, 32768, 264, 110, 105, 110, 116, 59, 32768, 8752, 111, 116, 59, 32768, 266, 512, 100, 110, 471, 478, 105, 108, 108, 97, 59, 32768, 184, 116, 101, 114, 68, 111, 116, 59, 32768, 183, 114, 59, 32768, 8493, 105, 59, 32768, 935, 114, 99, 108, 101, 1024, 68, 77, 80, 84, 508, 513, 520, 526, 111, 116, 59, 32768, 8857, 105, 110, 117, 115, 59, 32768, 8854, 108, 117, 115, 59, 32768, 8853, 105, 109, 101, 115, 59, 32768, 8855, 111, 512, 99, 115, 539, 562, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8754, 101, 67, 117, 114, 108, 121, 512, 68, 81, 573, 586, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 32768, 8221, 117, 111, 116, 101, 59, 32768, 8217, 1024, 108, 110, 112, 117, 602, 614, 648, 664, 111, 110, 512, 59, 101, 609, 611, 32768, 8759, 59, 32768, 10868, 768, 103, 105, 116, 621, 629, 634, 114, 117, 101, 110, 116, 59, 32768, 8801, 110, 116, 59, 32768, 8751, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8750, 512, 102, 114, 653, 656, 59, 32768, 8450, 111, 100, 117, 99, 116, 59, 32768, 8720, 110, 116, 101, 114, 67, 108, 111, 99, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8755, 111, 115, 115, 59, 32768, 10799, 99, 114, 59, 32896, 55349, 56478, 112, 512, 59, 67, 713, 715, 32768, 8915, 97, 112, 59, 32768, 8781, 2816, 68, 74, 83, 90, 97, 99, 101, 102, 105, 111, 115, 743, 758, 763, 768, 773, 795, 809, 821, 826, 910, 1295, 512, 59, 111, 748, 750, 32768, 8517, 116, 114, 97, 104, 100, 59, 32768, 10513, 99, 121, 59, 32768, 1026, 99, 121, 59, 32768, 1029, 99, 121, 59, 32768, 1039, 768, 103, 114, 115, 780, 786, 790, 103, 101, 114, 59, 32768, 8225, 114, 59, 32768, 8609, 104, 118, 59, 32768, 10980, 512, 97, 121, 800, 806, 114, 111, 110, 59, 32768, 270, 59, 32768, 1044, 108, 512, 59, 116, 815, 817, 32768, 8711, 97, 59, 32768, 916, 114, 59, 32896, 55349, 56583, 512, 97, 102, 831, 897, 512, 99, 109, 836, 891, 114, 105, 116, 105, 99, 97, 108, 1024, 65, 68, 71, 84, 852, 859, 877, 884, 99, 117, 116, 101, 59, 32768, 180, 111, 581, 864, 867, 59, 32768, 729, 98, 108, 101, 65, 99, 117, 116, 101, 59, 32768, 733, 114, 97, 118, 101, 59, 32768, 96, 105, 108, 100, 101, 59, 32768, 732, 111, 110, 100, 59, 32768, 8900, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 32768, 8518, 2113, 920, 0, 0, 0, 925, 946, 0, 1139, 102, 59, 32896, 55349, 56635, 768, 59, 68, 69, 931, 933, 938, 32768, 168, 111, 116, 59, 32768, 8412, 113, 117, 97, 108, 59, 32768, 8784, 98, 108, 101, 1536, 67, 68, 76, 82, 85, 86, 961, 978, 996, 1080, 1101, 1125, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8751, 111, 1093, 985, 0, 0, 988, 59, 32768, 168, 110, 65, 114, 114, 111, 119, 59, 32768, 8659, 512, 101, 111, 1001, 1034, 102, 116, 768, 65, 82, 84, 1010, 1017, 1029, 114, 114, 111, 119, 59, 32768, 8656, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8660, 101, 101, 59, 32768, 10980, 110, 103, 512, 76, 82, 1041, 1068, 101, 102, 116, 512, 65, 82, 1049, 1056, 114, 114, 111, 119, 59, 32768, 10232, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10234, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10233, 105, 103, 104, 116, 512, 65, 84, 1089, 1096, 114, 114, 111, 119, 59, 32768, 8658, 101, 101, 59, 32768, 8872, 112, 1042, 1108, 0, 0, 1115, 114, 114, 111, 119, 59, 32768, 8657, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8661, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8741, 110, 1536, 65, 66, 76, 82, 84, 97, 1152, 1179, 1186, 1236, 1272, 1288, 114, 114, 111, 119, 768, 59, 66, 85, 1163, 1165, 1170, 32768, 8595, 97, 114, 59, 32768, 10515, 112, 65, 114, 114, 111, 119, 59, 32768, 8693, 114, 101, 118, 101, 59, 32768, 785, 101, 102, 116, 1315, 1196, 0, 1209, 0, 1220, 105, 103, 104, 116, 86, 101, 99, 116, 111, 114, 59, 32768, 10576, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10590, 101, 99, 116, 111, 114, 512, 59, 66, 1229, 1231, 32768, 8637, 97, 114, 59, 32768, 10582, 105, 103, 104, 116, 805, 1245, 0, 1256, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10591, 101, 99, 116, 111, 114, 512, 59, 66, 1265, 1267, 32768, 8641, 97, 114, 59, 32768, 10583, 101, 101, 512, 59, 65, 1279, 1281, 32768, 8868, 114, 114, 111, 119, 59, 32768, 8615, 114, 114, 111, 119, 59, 32768, 8659, 512, 99, 116, 1300, 1305, 114, 59, 32896, 55349, 56479, 114, 111, 107, 59, 32768, 272, 4096, 78, 84, 97, 99, 100, 102, 103, 108, 109, 111, 112, 113, 115, 116, 117, 120, 1344, 1348, 1354, 1363, 1386, 1391, 1396, 1405, 1413, 1460, 1475, 1483, 1514, 1527, 1531, 1538, 71, 59, 32768, 330, 72, 33024, 208, 59, 32768, 208, 99, 117, 116, 101, 33024, 201, 59, 32768, 201, 768, 97, 105, 121, 1370, 1376, 1383, 114, 111, 110, 59, 32768, 282, 114, 99, 33024, 202, 59, 32768, 202, 59, 32768, 1069, 111, 116, 59, 32768, 278, 114, 59, 32896, 55349, 56584, 114, 97, 118, 101, 33024, 200, 59, 32768, 200, 101, 109, 101, 110, 116, 59, 32768, 8712, 512, 97, 112, 1418, 1423, 99, 114, 59, 32768, 274, 116, 121, 1060, 1431, 0, 0, 1444, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9723, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9643, 512, 103, 112, 1465, 1470, 111, 110, 59, 32768, 280, 102, 59, 32896, 55349, 56636, 115, 105, 108, 111, 110, 59, 32768, 917, 117, 512, 97, 105, 1489, 1504, 108, 512, 59, 84, 1495, 1497, 32768, 10869, 105, 108, 100, 101, 59, 32768, 8770, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 8652, 512, 99, 105, 1519, 1523, 114, 59, 32768, 8496, 109, 59, 32768, 10867, 97, 59, 32768, 919, 109, 108, 33024, 203, 59, 32768, 203, 512, 105, 112, 1543, 1549, 115, 116, 115, 59, 32768, 8707, 111, 110, 101, 110, 116, 105, 97, 108, 69, 59, 32768, 8519, 1280, 99, 102, 105, 111, 115, 1572, 1576, 1581, 1620, 1648, 121, 59, 32768, 1060, 114, 59, 32896, 55349, 56585, 108, 108, 101, 100, 1060, 1591, 0, 0, 1604, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9724, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9642, 1601, 1628, 0, 1633, 0, 0, 1639, 102, 59, 32896, 55349, 56637, 65, 108, 108, 59, 32768, 8704, 114, 105, 101, 114, 116, 114, 102, 59, 32768, 8497, 99, 114, 59, 32768, 8497, 3072, 74, 84, 97, 98, 99, 100, 102, 103, 111, 114, 115, 116, 1678, 1683, 1688, 1701, 1708, 1729, 1734, 1739, 1742, 1748, 1828, 1834, 99, 121, 59, 32768, 1027, 33024, 62, 59, 32768, 62, 109, 109, 97, 512, 59, 100, 1696, 1698, 32768, 915, 59, 32768, 988, 114, 101, 118, 101, 59, 32768, 286, 768, 101, 105, 121, 1715, 1721, 1726, 100, 105, 108, 59, 32768, 290, 114, 99, 59, 32768, 284, 59, 32768, 1043, 111, 116, 59, 32768, 288, 114, 59, 32896, 55349, 56586, 59, 32768, 8921, 112, 102, 59, 32896, 55349, 56638, 101, 97, 116, 101, 114, 1536, 69, 70, 71, 76, 83, 84, 1766, 1783, 1794, 1803, 1809, 1821, 113, 117, 97, 108, 512, 59, 76, 1775, 1777, 32768, 8805, 101, 115, 115, 59, 32768, 8923, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8807, 114, 101, 97, 116, 101, 114, 59, 32768, 10914, 101, 115, 115, 59, 32768, 8823, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 10878, 105, 108, 100, 101, 59, 32768, 8819, 99, 114, 59, 32896, 55349, 56482, 59, 32768, 8811, 2048, 65, 97, 99, 102, 105, 111, 115, 117, 1854, 1861, 1874, 1880, 1884, 1897, 1919, 1934, 82, 68, 99, 121, 59, 32768, 1066, 512, 99, 116, 1866, 1871, 101, 107, 59, 32768, 711, 59, 32768, 94, 105, 114, 99, 59, 32768, 292, 114, 59, 32768, 8460, 108, 98, 101, 114, 116, 83, 112, 97, 99, 101, 59, 32768, 8459, 833, 1902, 0, 1906, 102, 59, 32768, 8461, 105, 122, 111, 110, 116, 97, 108, 76, 105, 110, 101, 59, 32768, 9472, 512, 99, 116, 1924, 1928, 114, 59, 32768, 8459, 114, 111, 107, 59, 32768, 294, 109, 112, 533, 1940, 1950, 111, 119, 110, 72, 117, 109, 112, 59, 32768, 8782, 113, 117, 97, 108, 59, 32768, 8783, 3584, 69, 74, 79, 97, 99, 100, 102, 103, 109, 110, 111, 115, 116, 117, 1985, 1990, 1996, 2001, 2010, 2025, 2030, 2034, 2043, 2077, 2134, 2155, 2160, 2167, 99, 121, 59, 32768, 1045, 108, 105, 103, 59, 32768, 306, 99, 121, 59, 32768, 1025, 99, 117, 116, 101, 33024, 205, 59, 32768, 205, 512, 105, 121, 2015, 2022, 114, 99, 33024, 206, 59, 32768, 206, 59, 32768, 1048, 111, 116, 59, 32768, 304, 114, 59, 32768, 8465, 114, 97, 118, 101, 33024, 204, 59, 32768, 204, 768, 59, 97, 112, 2050, 2052, 2070, 32768, 8465, 512, 99, 103, 2057, 2061, 114, 59, 32768, 298, 105, 110, 97, 114, 121, 73, 59, 32768, 8520, 108, 105, 101, 115, 59, 32768, 8658, 837, 2082, 0, 2110, 512, 59, 101, 2086, 2088, 32768, 8748, 512, 103, 114, 2093, 2099, 114, 97, 108, 59, 32768, 8747, 115, 101, 99, 116, 105, 111, 110, 59, 32768, 8898, 105, 115, 105, 98, 108, 101, 512, 67, 84, 2120, 2127, 111, 109, 109, 97, 59, 32768, 8291, 105, 109, 101, 115, 59, 32768, 8290, 768, 103, 112, 116, 2141, 2146, 2151, 111, 110, 59, 32768, 302, 102, 59, 32896, 55349, 56640, 97, 59, 32768, 921, 99, 114, 59, 32768, 8464, 105, 108, 100, 101, 59, 32768, 296, 828, 2172, 0, 2177, 99, 121, 59, 32768, 1030, 108, 33024, 207, 59, 32768, 207, 1280, 99, 102, 111, 115, 117, 2193, 2206, 2211, 2217, 2232, 512, 105, 121, 2198, 2203, 114, 99, 59, 32768, 308, 59, 32768, 1049, 114, 59, 32896, 55349, 56589, 112, 102, 59, 32896, 55349, 56641, 820, 2222, 0, 2227, 114, 59, 32896, 55349, 56485, 114, 99, 121, 59, 32768, 1032, 107, 99, 121, 59, 32768, 1028, 1792, 72, 74, 97, 99, 102, 111, 115, 2253, 2258, 2263, 2269, 2283, 2288, 2294, 99, 121, 59, 32768, 1061, 99, 121, 59, 32768, 1036, 112, 112, 97, 59, 32768, 922, 512, 101, 121, 2274, 2280, 100, 105, 108, 59, 32768, 310, 59, 32768, 1050, 114, 59, 32896, 55349, 56590, 112, 102, 59, 32896, 55349, 56642, 99, 114, 59, 32896, 55349, 56486, 2816, 74, 84, 97, 99, 101, 102, 108, 109, 111, 115, 116, 2323, 2328, 2333, 2374, 2396, 2775, 2780, 2797, 2804, 2934, 2954, 99, 121, 59, 32768, 1033, 33024, 60, 59, 32768, 60, 1280, 99, 109, 110, 112, 114, 2344, 2350, 2356, 2360, 2370, 117, 116, 101, 59, 32768, 313, 98, 100, 97, 59, 32768, 923, 103, 59, 32768, 10218, 108, 97, 99, 101, 116, 114, 102, 59, 32768, 8466, 114, 59, 32768, 8606, 768, 97, 101, 121, 2381, 2387, 2393, 114, 111, 110, 59, 32768, 317, 100, 105, 108, 59, 32768, 315, 59, 32768, 1051, 512, 102, 115, 2401, 2702, 116, 2560, 65, 67, 68, 70, 82, 84, 85, 86, 97, 114, 2423, 2470, 2479, 2530, 2537, 2561, 2618, 2666, 2683, 2690, 512, 110, 114, 2428, 2441, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10216, 114, 111, 119, 768, 59, 66, 82, 2451, 2453, 2458, 32768, 8592, 97, 114, 59, 32768, 8676, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8646, 101, 105, 108, 105, 110, 103, 59, 32768, 8968, 111, 838, 2485, 0, 2498, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10214, 110, 805, 2503, 0, 2514, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10593, 101, 99, 116, 111, 114, 512, 59, 66, 2523, 2525, 32768, 8643, 97, 114, 59, 32768, 10585, 108, 111, 111, 114, 59, 32768, 8970, 105, 103, 104, 116, 512, 65, 86, 2546, 2553, 114, 114, 111, 119, 59, 32768, 8596, 101, 99, 116, 111, 114, 59, 32768, 10574, 512, 101, 114, 2566, 2591, 101, 768, 59, 65, 86, 2574, 2576, 2583, 32768, 8867, 114, 114, 111, 119, 59, 32768, 8612, 101, 99, 116, 111, 114, 59, 32768, 10586, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 2604, 2606, 2611, 32768, 8882, 97, 114, 59, 32768, 10703, 113, 117, 97, 108, 59, 32768, 8884, 112, 768, 68, 84, 86, 2626, 2638, 2649, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 32768, 10577, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10592, 101, 99, 116, 111, 114, 512, 59, 66, 2659, 2661, 32768, 8639, 97, 114, 59, 32768, 10584, 101, 99, 116, 111, 114, 512, 59, 66, 2676, 2678, 32768, 8636, 97, 114, 59, 32768, 10578, 114, 114, 111, 119, 59, 32768, 8656, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8660, 115, 1536, 69, 70, 71, 76, 83, 84, 2716, 2730, 2741, 2750, 2756, 2768, 113, 117, 97, 108, 71, 114, 101, 97, 116, 101, 114, 59, 32768, 8922, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8806, 114, 101, 97, 116, 101, 114, 59, 32768, 8822, 101, 115, 115, 59, 32768, 10913, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 10877, 105, 108, 100, 101, 59, 32768, 8818, 114, 59, 32896, 55349, 56591, 512, 59, 101, 2785, 2787, 32768, 8920, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8666, 105, 100, 111, 116, 59, 32768, 319, 768, 110, 112, 119, 2811, 2899, 2904, 103, 1024, 76, 82, 108, 114, 2821, 2848, 2860, 2887, 101, 102, 116, 512, 65, 82, 2829, 2836, 114, 114, 111, 119, 59, 32768, 10229, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10231, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10230, 101, 102, 116, 512, 97, 114, 2868, 2875, 114, 114, 111, 119, 59, 32768, 10232, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10234, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10233, 102, 59, 32896, 55349, 56643, 101, 114, 512, 76, 82, 2911, 2922, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8601, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8600, 768, 99, 104, 116, 2941, 2945, 2948, 114, 59, 32768, 8466, 59, 32768, 8624, 114, 111, 107, 59, 32768, 321, 59, 32768, 8810, 2048, 97, 99, 101, 102, 105, 111, 115, 117, 2974, 2978, 2982, 3007, 3012, 3022, 3028, 3033, 112, 59, 32768, 10501, 121, 59, 32768, 1052, 512, 100, 108, 2987, 2998, 105, 117, 109, 83, 112, 97, 99, 101, 59, 32768, 8287, 108, 105, 110, 116, 114, 102, 59, 32768, 8499, 114, 59, 32896, 55349, 56592, 110, 117, 115, 80, 108, 117, 115, 59, 32768, 8723, 112, 102, 59, 32896, 55349, 56644, 99, 114, 59, 32768, 8499, 59, 32768, 924, 2304, 74, 97, 99, 101, 102, 111, 115, 116, 117, 3055, 3060, 3067, 3089, 3201, 3206, 3874, 3880, 3889, 99, 121, 59, 32768, 1034, 99, 117, 116, 101, 59, 32768, 323, 768, 97, 101, 121, 3074, 3080, 3086, 114, 111, 110, 59, 32768, 327, 100, 105, 108, 59, 32768, 325, 59, 32768, 1053, 768, 103, 115, 119, 3096, 3160, 3194, 97, 116, 105, 118, 101, 768, 77, 84, 86, 3108, 3121, 3145, 101, 100, 105, 117, 109, 83, 112, 97, 99, 101, 59, 32768, 8203, 104, 105, 512, 99, 110, 3128, 3137, 107, 83, 112, 97, 99, 101, 59, 32768, 8203, 83, 112, 97, 99, 101, 59, 32768, 8203, 101, 114, 121, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 32768, 8203, 116, 101, 100, 512, 71, 76, 3168, 3184, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 32768, 8811, 101, 115, 115, 76, 101, 115, 115, 59, 32768, 8810, 76, 105, 110, 101, 59, 32768, 10, 114, 59, 32896, 55349, 56593, 1024, 66, 110, 112, 116, 3215, 3222, 3238, 3242, 114, 101, 97, 107, 59, 32768, 8288, 66, 114, 101, 97, 107, 105, 110, 103, 83, 112, 97, 99, 101, 59, 32768, 160, 102, 59, 32768, 8469, 3328, 59, 67, 68, 69, 71, 72, 76, 78, 80, 82, 83, 84, 86, 3269, 3271, 3293, 3312, 3352, 3430, 3455, 3551, 3589, 3625, 3678, 3821, 3861, 32768, 10988, 512, 111, 117, 3276, 3286, 110, 103, 114, 117, 101, 110, 116, 59, 32768, 8802, 112, 67, 97, 112, 59, 32768, 8813, 111, 117, 98, 108, 101, 86, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8742, 768, 108, 113, 120, 3319, 3327, 3345, 101, 109, 101, 110, 116, 59, 32768, 8713, 117, 97, 108, 512, 59, 84, 3335, 3337, 32768, 8800, 105, 108, 100, 101, 59, 32896, 8770, 824, 105, 115, 116, 115, 59, 32768, 8708, 114, 101, 97, 116, 101, 114, 1792, 59, 69, 70, 71, 76, 83, 84, 3373, 3375, 3382, 3394, 3404, 3410, 3423, 32768, 8815, 113, 117, 97, 108, 59, 32768, 8817, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32896, 8807, 824, 114, 101, 97, 116, 101, 114, 59, 32896, 8811, 824, 101, 115, 115, 59, 32768, 8825, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32896, 10878, 824, 105, 108, 100, 101, 59, 32768, 8821, 117, 109, 112, 533, 3437, 3448, 111, 119, 110, 72, 117, 109, 112, 59, 32896, 8782, 824, 113, 117, 97, 108, 59, 32896, 8783, 824, 101, 512, 102, 115, 3461, 3492, 116, 84, 114, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 3477, 3479, 3485, 32768, 8938, 97, 114, 59, 32896, 10703, 824, 113, 117, 97, 108, 59, 32768, 8940, 115, 1536, 59, 69, 71, 76, 83, 84, 3506, 3508, 3515, 3524, 3531, 3544, 32768, 8814, 113, 117, 97, 108, 59, 32768, 8816, 114, 101, 97, 116, 101, 114, 59, 32768, 8824, 101, 115, 115, 59, 32896, 8810, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32896, 10877, 824, 105, 108, 100, 101, 59, 32768, 8820, 101, 115, 116, 101, 100, 512, 71, 76, 3561, 3578, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 32896, 10914, 824, 101, 115, 115, 76, 101, 115, 115, 59, 32896, 10913, 824, 114, 101, 99, 101, 100, 101, 115, 768, 59, 69, 83, 3603, 3605, 3613, 32768, 8832, 113, 117, 97, 108, 59, 32896, 10927, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8928, 512, 101, 105, 3630, 3645, 118, 101, 114, 115, 101, 69, 108, 101, 109, 101, 110, 116, 59, 32768, 8716, 103, 104, 116, 84, 114, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 3663, 3665, 3671, 32768, 8939, 97, 114, 59, 32896, 10704, 824, 113, 117, 97, 108, 59, 32768, 8941, 512, 113, 117, 3683, 3732, 117, 97, 114, 101, 83, 117, 512, 98, 112, 3694, 3712, 115, 101, 116, 512, 59, 69, 3702, 3705, 32896, 8847, 824, 113, 117, 97, 108, 59, 32768, 8930, 101, 114, 115, 101, 116, 512, 59, 69, 3722, 3725, 32896, 8848, 824, 113, 117, 97, 108, 59, 32768, 8931, 768, 98, 99, 112, 3739, 3757, 3801, 115, 101, 116, 512, 59, 69, 3747, 3750, 32896, 8834, 8402, 113, 117, 97, 108, 59, 32768, 8840, 99, 101, 101, 100, 115, 1024, 59, 69, 83, 84, 3771, 3773, 3781, 3793, 32768, 8833, 113, 117, 97, 108, 59, 32896, 10928, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8929, 105, 108, 100, 101, 59, 32896, 8831, 824, 101, 114, 115, 101, 116, 512, 59, 69, 3811, 3814, 32896, 8835, 8402, 113, 117, 97, 108, 59, 32768, 8841, 105, 108, 100, 101, 1024, 59, 69, 70, 84, 3834, 3836, 3843, 3854, 32768, 8769, 113, 117, 97, 108, 59, 32768, 8772, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8775, 105, 108, 100, 101, 59, 32768, 8777, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8740, 99, 114, 59, 32896, 55349, 56489, 105, 108, 100, 101, 33024, 209, 59, 32768, 209, 59, 32768, 925, 3584, 69, 97, 99, 100, 102, 103, 109, 111, 112, 114, 115, 116, 117, 118, 3921, 3927, 3936, 3951, 3958, 3963, 3972, 3996, 4002, 4034, 4037, 4055, 4071, 4078, 108, 105, 103, 59, 32768, 338, 99, 117, 116, 101, 33024, 211, 59, 32768, 211, 512, 105, 121, 3941, 3948, 114, 99, 33024, 212, 59, 32768, 212, 59, 32768, 1054, 98, 108, 97, 99, 59, 32768, 336, 114, 59, 32896, 55349, 56594, 114, 97, 118, 101, 33024, 210, 59, 32768, 210, 768, 97, 101, 105, 3979, 3984, 3989, 99, 114, 59, 32768, 332, 103, 97, 59, 32768, 937, 99, 114, 111, 110, 59, 32768, 927, 112, 102, 59, 32896, 55349, 56646, 101, 110, 67, 117, 114, 108, 121, 512, 68, 81, 4014, 4027, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 32768, 8220, 117, 111, 116, 101, 59, 32768, 8216, 59, 32768, 10836, 512, 99, 108, 4042, 4047, 114, 59, 32896, 55349, 56490, 97, 115, 104, 33024, 216, 59, 32768, 216, 105, 573, 4060, 4067, 100, 101, 33024, 213, 59, 32768, 213, 101, 115, 59, 32768, 10807, 109, 108, 33024, 214, 59, 32768, 214, 101, 114, 512, 66, 80, 4085, 4109, 512, 97, 114, 4090, 4094, 114, 59, 32768, 8254, 97, 99, 512, 101, 107, 4101, 4104, 59, 32768, 9182, 101, 116, 59, 32768, 9140, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 32768, 9180, 2304, 97, 99, 102, 104, 105, 108, 111, 114, 115, 4141, 4150, 4154, 4159, 4163, 4166, 4176, 4198, 4284, 114, 116, 105, 97, 108, 68, 59, 32768, 8706, 121, 59, 32768, 1055, 114, 59, 32896, 55349, 56595, 105, 59, 32768, 934, 59, 32768, 928, 117, 115, 77, 105, 110, 117, 115, 59, 32768, 177, 512, 105, 112, 4181, 4194, 110, 99, 97, 114, 101, 112, 108, 97, 110, 101, 59, 32768, 8460, 102, 59, 32768, 8473, 1024, 59, 101, 105, 111, 4207, 4209, 4251, 4256, 32768, 10939, 99, 101, 100, 101, 115, 1024, 59, 69, 83, 84, 4223, 4225, 4232, 4244, 32768, 8826, 113, 117, 97, 108, 59, 32768, 10927, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8828, 105, 108, 100, 101, 59, 32768, 8830, 109, 101, 59, 32768, 8243, 512, 100, 112, 4261, 4267, 117, 99, 116, 59, 32768, 8719, 111, 114, 116, 105, 111, 110, 512, 59, 97, 4278, 4280, 32768, 8759, 108, 59, 32768, 8733, 512, 99, 105, 4289, 4294, 114, 59, 32896, 55349, 56491, 59, 32768, 936, 1024, 85, 102, 111, 115, 4306, 4313, 4318, 4323, 79, 84, 33024, 34, 59, 32768, 34, 114, 59, 32896, 55349, 56596, 112, 102, 59, 32768, 8474, 99, 114, 59, 32896, 55349, 56492, 3072, 66, 69, 97, 99, 101, 102, 104, 105, 111, 114, 115, 117, 4354, 4360, 4366, 4395, 4417, 4473, 4477, 4481, 4743, 4764, 4776, 4788, 97, 114, 114, 59, 32768, 10512, 71, 33024, 174, 59, 32768, 174, 768, 99, 110, 114, 4373, 4379, 4383, 117, 116, 101, 59, 32768, 340, 103, 59, 32768, 10219, 114, 512, 59, 116, 4389, 4391, 32768, 8608, 108, 59, 32768, 10518, 768, 97, 101, 121, 4402, 4408, 4414, 114, 111, 110, 59, 32768, 344, 100, 105, 108, 59, 32768, 342, 59, 32768, 1056, 512, 59, 118, 4422, 4424, 32768, 8476, 101, 114, 115, 101, 512, 69, 85, 4433, 4458, 512, 108, 113, 4438, 4446, 101, 109, 101, 110, 116, 59, 32768, 8715, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 8651, 112, 69, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 10607, 114, 59, 32768, 8476, 111, 59, 32768, 929, 103, 104, 116, 2048, 65, 67, 68, 70, 84, 85, 86, 97, 4501, 4547, 4556, 4607, 4614, 4671, 4719, 4736, 512, 110, 114, 4506, 4519, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10217, 114, 111, 119, 768, 59, 66, 76, 4529, 4531, 4536, 32768, 8594, 97, 114, 59, 32768, 8677, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8644, 101, 105, 108, 105, 110, 103, 59, 32768, 8969, 111, 838, 4562, 0, 4575, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10215, 110, 805, 4580, 0, 4591, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10589, 101, 99, 116, 111, 114, 512, 59, 66, 4600, 4602, 32768, 8642, 97, 114, 59, 32768, 10581, 108, 111, 111, 114, 59, 32768, 8971, 512, 101, 114, 4619, 4644, 101, 768, 59, 65, 86, 4627, 4629, 4636, 32768, 8866, 114, 114, 111, 119, 59, 32768, 8614, 101, 99, 116, 111, 114, 59, 32768, 10587, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 4657, 4659, 4664, 32768, 8883, 97, 114, 59, 32768, 10704, 113, 117, 97, 108, 59, 32768, 8885, 112, 768, 68, 84, 86, 4679, 4691, 4702, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 32768, 10575, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10588, 101, 99, 116, 111, 114, 512, 59, 66, 4712, 4714, 32768, 8638, 97, 114, 59, 32768, 10580, 101, 99, 116, 111, 114, 512, 59, 66, 4729, 4731, 32768, 8640, 97, 114, 59, 32768, 10579, 114, 114, 111, 119, 59, 32768, 8658, 512, 112, 117, 4748, 4752, 102, 59, 32768, 8477, 110, 100, 73, 109, 112, 108, 105, 101, 115, 59, 32768, 10608, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8667, 512, 99, 104, 4781, 4785, 114, 59, 32768, 8475, 59, 32768, 8625, 108, 101, 68, 101, 108, 97, 121, 101, 100, 59, 32768, 10740, 3328, 72, 79, 97, 99, 102, 104, 105, 109, 111, 113, 115, 116, 117, 4827, 4842, 4849, 4856, 4889, 4894, 4949, 4955, 4967, 4973, 5059, 5065, 5070, 512, 67, 99, 4832, 4838, 72, 99, 121, 59, 32768, 1065, 121, 59, 32768, 1064, 70, 84, 99, 121, 59, 32768, 1068, 99, 117, 116, 101, 59, 32768, 346, 1280, 59, 97, 101, 105, 121, 4867, 4869, 4875, 4881, 4886, 32768, 10940, 114, 111, 110, 59, 32768, 352, 100, 105, 108, 59, 32768, 350, 114, 99, 59, 32768, 348, 59, 32768, 1057, 114, 59, 32896, 55349, 56598, 111, 114, 116, 1024, 68, 76, 82, 85, 4906, 4917, 4928, 4940, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8595, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8592, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8594, 112, 65, 114, 114, 111, 119, 59, 32768, 8593, 103, 109, 97, 59, 32768, 931, 97, 108, 108, 67, 105, 114, 99, 108, 101, 59, 32768, 8728, 112, 102, 59, 32896, 55349, 56650, 1091, 4979, 0, 0, 4983, 116, 59, 32768, 8730, 97, 114, 101, 1024, 59, 73, 83, 85, 4994, 4996, 5010, 5052, 32768, 9633, 110, 116, 101, 114, 115, 101, 99, 116, 105, 111, 110, 59, 32768, 8851, 117, 512, 98, 112, 5016, 5033, 115, 101, 116, 512, 59, 69, 5024, 5026, 32768, 8847, 113, 117, 97, 108, 59, 32768, 8849, 101, 114, 115, 101, 116, 512, 59, 69, 5043, 5045, 32768, 8848, 113, 117, 97, 108, 59, 32768, 8850, 110, 105, 111, 110, 59, 32768, 8852, 99, 114, 59, 32896, 55349, 56494, 97, 114, 59, 32768, 8902, 1024, 98, 99, 109, 112, 5079, 5102, 5155, 5158, 512, 59, 115, 5084, 5086, 32768, 8912, 101, 116, 512, 59, 69, 5093, 5095, 32768, 8912, 113, 117, 97, 108, 59, 32768, 8838, 512, 99, 104, 5107, 5148, 101, 101, 100, 115, 1024, 59, 69, 83, 84, 5120, 5122, 5129, 5141, 32768, 8827, 113, 117, 97, 108, 59, 32768, 10928, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8829, 105, 108, 100, 101, 59, 32768, 8831, 84, 104, 97, 116, 59, 32768, 8715, 59, 32768, 8721, 768, 59, 101, 115, 5165, 5167, 5185, 32768, 8913, 114, 115, 101, 116, 512, 59, 69, 5176, 5178, 32768, 8835, 113, 117, 97, 108, 59, 32768, 8839, 101, 116, 59, 32768, 8913, 2816, 72, 82, 83, 97, 99, 102, 104, 105, 111, 114, 115, 5213, 5221, 5227, 5241, 5252, 5274, 5279, 5323, 5362, 5368, 5378, 79, 82, 78, 33024, 222, 59, 32768, 222, 65, 68, 69, 59, 32768, 8482, 512, 72, 99, 5232, 5237, 99, 121, 59, 32768, 1035, 121, 59, 32768, 1062, 512, 98, 117, 5246, 5249, 59, 32768, 9, 59, 32768, 932, 768, 97, 101, 121, 5259, 5265, 5271, 114, 111, 110, 59, 32768, 356, 100, 105, 108, 59, 32768, 354, 59, 32768, 1058, 114, 59, 32896, 55349, 56599, 512, 101, 105, 5284, 5300, 835, 5289, 0, 5297, 101, 102, 111, 114, 101, 59, 32768, 8756, 97, 59, 32768, 920, 512, 99, 110, 5305, 5315, 107, 83, 112, 97, 99, 101, 59, 32896, 8287, 8202, 83, 112, 97, 99, 101, 59, 32768, 8201, 108, 100, 101, 1024, 59, 69, 70, 84, 5335, 5337, 5344, 5355, 32768, 8764, 113, 117, 97, 108, 59, 32768, 8771, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8773, 105, 108, 100, 101, 59, 32768, 8776, 112, 102, 59, 32896, 55349, 56651, 105, 112, 108, 101, 68, 111, 116, 59, 32768, 8411, 512, 99, 116, 5383, 5388, 114, 59, 32896, 55349, 56495, 114, 111, 107, 59, 32768, 358, 5426, 5417, 5444, 5458, 5473, 0, 5480, 5485, 0, 0, 0, 0, 0, 5494, 5500, 5564, 5579, 0, 5726, 5732, 5738, 5745, 512, 99, 114, 5421, 5429, 117, 116, 101, 33024, 218, 59, 32768, 218, 114, 512, 59, 111, 5435, 5437, 32768, 8607, 99, 105, 114, 59, 32768, 10569, 114, 820, 5449, 0, 5453, 121, 59, 32768, 1038, 118, 101, 59, 32768, 364, 512, 105, 121, 5462, 5469, 114, 99, 33024, 219, 59, 32768, 219, 59, 32768, 1059, 98, 108, 97, 99, 59, 32768, 368, 114, 59, 32896, 55349, 56600, 114, 97, 118, 101, 33024, 217, 59, 32768, 217, 97, 99, 114, 59, 32768, 362, 512, 100, 105, 5504, 5548, 101, 114, 512, 66, 80, 5511, 5535, 512, 97, 114, 5516, 5520, 114, 59, 32768, 95, 97, 99, 512, 101, 107, 5527, 5530, 59, 32768, 9183, 101, 116, 59, 32768, 9141, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 32768, 9181, 111, 110, 512, 59, 80, 5555, 5557, 32768, 8899, 108, 117, 115, 59, 32768, 8846, 512, 103, 112, 5568, 5573, 111, 110, 59, 32768, 370, 102, 59, 32896, 55349, 56652, 2048, 65, 68, 69, 84, 97, 100, 112, 115, 5595, 5624, 5635, 5648, 5664, 5671, 5682, 5712, 114, 114, 111, 119, 768, 59, 66, 68, 5606, 5608, 5613, 32768, 8593, 97, 114, 59, 32768, 10514, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8645, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8597, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 10606, 101, 101, 512, 59, 65, 5655, 5657, 32768, 8869, 114, 114, 111, 119, 59, 32768, 8613, 114, 114, 111, 119, 59, 32768, 8657, 111, 119, 110, 97, 114, 114, 111, 119, 59, 32768, 8661, 101, 114, 512, 76, 82, 5689, 5700, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8598, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8599, 105, 512, 59, 108, 5718, 5720, 32768, 978, 111, 110, 59, 32768, 933, 105, 110, 103, 59, 32768, 366, 99, 114, 59, 32896, 55349, 56496, 105, 108, 100, 101, 59, 32768, 360, 109, 108, 33024, 220, 59, 32768, 220, 2304, 68, 98, 99, 100, 101, 102, 111, 115, 118, 5770, 5776, 5781, 5785, 5798, 5878, 5883, 5889, 5895, 97, 115, 104, 59, 32768, 8875, 97, 114, 59, 32768, 10987, 121, 59, 32768, 1042, 97, 115, 104, 512, 59, 108, 5793, 5795, 32768, 8873, 59, 32768, 10982, 512, 101, 114, 5803, 5806, 59, 32768, 8897, 768, 98, 116, 121, 5813, 5818, 5866, 97, 114, 59, 32768, 8214, 512, 59, 105, 5823, 5825, 32768, 8214, 99, 97, 108, 1024, 66, 76, 83, 84, 5837, 5842, 5848, 5859, 97, 114, 59, 32768, 8739, 105, 110, 101, 59, 32768, 124, 101, 112, 97, 114, 97, 116, 111, 114, 59, 32768, 10072, 105, 108, 100, 101, 59, 32768, 8768, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 32768, 8202, 114, 59, 32896, 55349, 56601, 112, 102, 59, 32896, 55349, 56653, 99, 114, 59, 32896, 55349, 56497, 100, 97, 115, 104, 59, 32768, 8874, 1280, 99, 101, 102, 111, 115, 5913, 5919, 5925, 5930, 5936, 105, 114, 99, 59, 32768, 372, 100, 103, 101, 59, 32768, 8896, 114, 59, 32896, 55349, 56602, 112, 102, 59, 32896, 55349, 56654, 99, 114, 59, 32896, 55349, 56498, 1024, 102, 105, 111, 115, 5951, 5956, 5959, 5965, 114, 59, 32896, 55349, 56603, 59, 32768, 926, 112, 102, 59, 32896, 55349, 56655, 99, 114, 59, 32896, 55349, 56499, 2304, 65, 73, 85, 97, 99, 102, 111, 115, 117, 5990, 5995, 6e3, 6005, 6014, 6027, 6032, 6038, 6044, 99, 121, 59, 32768, 1071, 99, 121, 59, 32768, 1031, 99, 121, 59, 32768, 1070, 99, 117, 116, 101, 33024, 221, 59, 32768, 221, 512, 105, 121, 6019, 6024, 114, 99, 59, 32768, 374, 59, 32768, 1067, 114, 59, 32896, 55349, 56604, 112, 102, 59, 32896, 55349, 56656, 99, 114, 59, 32896, 55349, 56500, 109, 108, 59, 32768, 376, 2048, 72, 97, 99, 100, 101, 102, 111, 115, 6066, 6071, 6078, 6092, 6097, 6119, 6123, 6128, 99, 121, 59, 32768, 1046, 99, 117, 116, 101, 59, 32768, 377, 512, 97, 121, 6083, 6089, 114, 111, 110, 59, 32768, 381, 59, 32768, 1047, 111, 116, 59, 32768, 379, 835, 6102, 0, 6116, 111, 87, 105, 100, 116, 104, 83, 112, 97, 99, 101, 59, 32768, 8203, 97, 59, 32768, 918, 114, 59, 32768, 8488, 112, 102, 59, 32768, 8484, 99, 114, 59, 32896, 55349, 56501, 5938, 6159, 6168, 6175, 0, 6214, 6222, 6233, 0, 0, 0, 0, 6242, 6267, 6290, 6429, 6444, 0, 6495, 6503, 6531, 6540, 0, 6547, 99, 117, 116, 101, 33024, 225, 59, 32768, 225, 114, 101, 118, 101, 59, 32768, 259, 1536, 59, 69, 100, 105, 117, 121, 6187, 6189, 6193, 6196, 6203, 6210, 32768, 8766, 59, 32896, 8766, 819, 59, 32768, 8767, 114, 99, 33024, 226, 59, 32768, 226, 116, 101, 33024, 180, 59, 32768, 180, 59, 32768, 1072, 108, 105, 103, 33024, 230, 59, 32768, 230, 512, 59, 114, 6226, 6228, 32768, 8289, 59, 32896, 55349, 56606, 114, 97, 118, 101, 33024, 224, 59, 32768, 224, 512, 101, 112, 6246, 6261, 512, 102, 112, 6251, 6257, 115, 121, 109, 59, 32768, 8501, 104, 59, 32768, 8501, 104, 97, 59, 32768, 945, 512, 97, 112, 6271, 6284, 512, 99, 108, 6276, 6280, 114, 59, 32768, 257, 103, 59, 32768, 10815, 33024, 38, 59, 32768, 38, 1077, 6295, 0, 0, 6326, 1280, 59, 97, 100, 115, 118, 6305, 6307, 6312, 6315, 6322, 32768, 8743, 110, 100, 59, 32768, 10837, 59, 32768, 10844, 108, 111, 112, 101, 59, 32768, 10840, 59, 32768, 10842, 1792, 59, 101, 108, 109, 114, 115, 122, 6340, 6342, 6345, 6349, 6391, 6410, 6422, 32768, 8736, 59, 32768, 10660, 101, 59, 32768, 8736, 115, 100, 512, 59, 97, 6356, 6358, 32768, 8737, 2098, 6368, 6371, 6374, 6377, 6380, 6383, 6386, 6389, 59, 32768, 10664, 59, 32768, 10665, 59, 32768, 10666, 59, 32768, 10667, 59, 32768, 10668, 59, 32768, 10669, 59, 32768, 10670, 59, 32768, 10671, 116, 512, 59, 118, 6397, 6399, 32768, 8735, 98, 512, 59, 100, 6405, 6407, 32768, 8894, 59, 32768, 10653, 512, 112, 116, 6415, 6419, 104, 59, 32768, 8738, 59, 32768, 197, 97, 114, 114, 59, 32768, 9084, 512, 103, 112, 6433, 6438, 111, 110, 59, 32768, 261, 102, 59, 32896, 55349, 56658, 1792, 59, 69, 97, 101, 105, 111, 112, 6458, 6460, 6463, 6469, 6472, 6476, 6480, 32768, 8776, 59, 32768, 10864, 99, 105, 114, 59, 32768, 10863, 59, 32768, 8778, 100, 59, 32768, 8779, 115, 59, 32768, 39, 114, 111, 120, 512, 59, 101, 6488, 6490, 32768, 8776, 113, 59, 32768, 8778, 105, 110, 103, 33024, 229, 59, 32768, 229, 768, 99, 116, 121, 6509, 6514, 6517, 114, 59, 32896, 55349, 56502, 59, 32768, 42, 109, 112, 512, 59, 101, 6524, 6526, 32768, 8776, 113, 59, 32768, 8781, 105, 108, 100, 101, 33024, 227, 59, 32768, 227, 109, 108, 33024, 228, 59, 32768, 228, 512, 99, 105, 6551, 6559, 111, 110, 105, 110, 116, 59, 32768, 8755, 110, 116, 59, 32768, 10769, 4096, 78, 97, 98, 99, 100, 101, 102, 105, 107, 108, 110, 111, 112, 114, 115, 117, 6597, 6602, 6673, 6688, 6701, 6707, 6768, 6773, 6891, 6898, 6999, 7023, 7309, 7316, 7334, 7383, 111, 116, 59, 32768, 10989, 512, 99, 114, 6607, 6652, 107, 1024, 99, 101, 112, 115, 6617, 6623, 6632, 6639, 111, 110, 103, 59, 32768, 8780, 112, 115, 105, 108, 111, 110, 59, 32768, 1014, 114, 105, 109, 101, 59, 32768, 8245, 105, 109, 512, 59, 101, 6646, 6648, 32768, 8765, 113, 59, 32768, 8909, 583, 6656, 6661, 101, 101, 59, 32768, 8893, 101, 100, 512, 59, 103, 6667, 6669, 32768, 8965, 101, 59, 32768, 8965, 114, 107, 512, 59, 116, 6680, 6682, 32768, 9141, 98, 114, 107, 59, 32768, 9142, 512, 111, 121, 6693, 6698, 110, 103, 59, 32768, 8780, 59, 32768, 1073, 113, 117, 111, 59, 32768, 8222, 1280, 99, 109, 112, 114, 116, 6718, 6731, 6738, 6743, 6749, 97, 117, 115, 512, 59, 101, 6726, 6728, 32768, 8757, 59, 32768, 8757, 112, 116, 121, 118, 59, 32768, 10672, 115, 105, 59, 32768, 1014, 110, 111, 117, 59, 32768, 8492, 768, 97, 104, 119, 6756, 6759, 6762, 59, 32768, 946, 59, 32768, 8502, 101, 101, 110, 59, 32768, 8812, 114, 59, 32896, 55349, 56607, 103, 1792, 99, 111, 115, 116, 117, 118, 119, 6789, 6809, 6834, 6850, 6872, 6879, 6884, 768, 97, 105, 117, 6796, 6800, 6805, 112, 59, 32768, 8898, 114, 99, 59, 32768, 9711, 112, 59, 32768, 8899, 768, 100, 112, 116, 6816, 6821, 6827, 111, 116, 59, 32768, 10752, 108, 117, 115, 59, 32768, 10753, 105, 109, 101, 115, 59, 32768, 10754, 1090, 6840, 0, 0, 6846, 99, 117, 112, 59, 32768, 10758, 97, 114, 59, 32768, 9733, 114, 105, 97, 110, 103, 108, 101, 512, 100, 117, 6862, 6868, 111, 119, 110, 59, 32768, 9661, 112, 59, 32768, 9651, 112, 108, 117, 115, 59, 32768, 10756, 101, 101, 59, 32768, 8897, 101, 100, 103, 101, 59, 32768, 8896, 97, 114, 111, 119, 59, 32768, 10509, 768, 97, 107, 111, 6905, 6976, 6994, 512, 99, 110, 6910, 6972, 107, 768, 108, 115, 116, 6918, 6927, 6935, 111, 122, 101, 110, 103, 101, 59, 32768, 10731, 113, 117, 97, 114, 101, 59, 32768, 9642, 114, 105, 97, 110, 103, 108, 101, 1024, 59, 100, 108, 114, 6951, 6953, 6959, 6965, 32768, 9652, 111, 119, 110, 59, 32768, 9662, 101, 102, 116, 59, 32768, 9666, 105, 103, 104, 116, 59, 32768, 9656, 107, 59, 32768, 9251, 770, 6981, 0, 6991, 771, 6985, 0, 6988, 59, 32768, 9618, 59, 32768, 9617, 52, 59, 32768, 9619, 99, 107, 59, 32768, 9608, 512, 101, 111, 7004, 7019, 512, 59, 113, 7009, 7012, 32896, 61, 8421, 117, 105, 118, 59, 32896, 8801, 8421, 116, 59, 32768, 8976, 1024, 112, 116, 119, 120, 7032, 7037, 7049, 7055, 102, 59, 32896, 55349, 56659, 512, 59, 116, 7042, 7044, 32768, 8869, 111, 109, 59, 32768, 8869, 116, 105, 101, 59, 32768, 8904, 3072, 68, 72, 85, 86, 98, 100, 104, 109, 112, 116, 117, 118, 7080, 7101, 7126, 7147, 7182, 7187, 7208, 7233, 7240, 7246, 7253, 7274, 1024, 76, 82, 108, 114, 7089, 7092, 7095, 7098, 59, 32768, 9559, 59, 32768, 9556, 59, 32768, 9558, 59, 32768, 9555, 1280, 59, 68, 85, 100, 117, 7112, 7114, 7117, 7120, 7123, 32768, 9552, 59, 32768, 9574, 59, 32768, 9577, 59, 32768, 9572, 59, 32768, 9575, 1024, 76, 82, 108, 114, 7135, 7138, 7141, 7144, 59, 32768, 9565, 59, 32768, 9562, 59, 32768, 9564, 59, 32768, 9561, 1792, 59, 72, 76, 82, 104, 108, 114, 7162, 7164, 7167, 7170, 7173, 7176, 7179, 32768, 9553, 59, 32768, 9580, 59, 32768, 9571, 59, 32768, 9568, 59, 32768, 9579, 59, 32768, 9570, 59, 32768, 9567, 111, 120, 59, 32768, 10697, 1024, 76, 82, 108, 114, 7196, 7199, 7202, 7205, 59, 32768, 9557, 59, 32768, 9554, 59, 32768, 9488, 59, 32768, 9484, 1280, 59, 68, 85, 100, 117, 7219, 7221, 7224, 7227, 7230, 32768, 9472, 59, 32768, 9573, 59, 32768, 9576, 59, 32768, 9516, 59, 32768, 9524, 105, 110, 117, 115, 59, 32768, 8863, 108, 117, 115, 59, 32768, 8862, 105, 109, 101, 115, 59, 32768, 8864, 1024, 76, 82, 108, 114, 7262, 7265, 7268, 7271, 59, 32768, 9563, 59, 32768, 9560, 59, 32768, 9496, 59, 32768, 9492, 1792, 59, 72, 76, 82, 104, 108, 114, 7289, 7291, 7294, 7297, 7300, 7303, 7306, 32768, 9474, 59, 32768, 9578, 59, 32768, 9569, 59, 32768, 9566, 59, 32768, 9532, 59, 32768, 9508, 59, 32768, 9500, 114, 105, 109, 101, 59, 32768, 8245, 512, 101, 118, 7321, 7326, 118, 101, 59, 32768, 728, 98, 97, 114, 33024, 166, 59, 32768, 166, 1024, 99, 101, 105, 111, 7343, 7348, 7353, 7364, 114, 59, 32896, 55349, 56503, 109, 105, 59, 32768, 8271, 109, 512, 59, 101, 7359, 7361, 32768, 8765, 59, 32768, 8909, 108, 768, 59, 98, 104, 7372, 7374, 7377, 32768, 92, 59, 32768, 10693, 115, 117, 98, 59, 32768, 10184, 573, 7387, 7399, 108, 512, 59, 101, 7392, 7394, 32768, 8226, 116, 59, 32768, 8226, 112, 768, 59, 69, 101, 7406, 7408, 7411, 32768, 8782, 59, 32768, 10926, 512, 59, 113, 7416, 7418, 32768, 8783, 59, 32768, 8783, 6450, 7448, 0, 7523, 7571, 7576, 7613, 0, 7618, 7647, 0, 0, 7764, 0, 0, 7779, 0, 0, 7899, 7914, 7949, 7955, 0, 8158, 0, 8176, 768, 99, 112, 114, 7454, 7460, 7509, 117, 116, 101, 59, 32768, 263, 1536, 59, 97, 98, 99, 100, 115, 7473, 7475, 7480, 7487, 7500, 7505, 32768, 8745, 110, 100, 59, 32768, 10820, 114, 99, 117, 112, 59, 32768, 10825, 512, 97, 117, 7492, 7496, 112, 59, 32768, 10827, 112, 59, 32768, 10823, 111, 116, 59, 32768, 10816, 59, 32896, 8745, 65024, 512, 101, 111, 7514, 7518, 116, 59, 32768, 8257, 110, 59, 32768, 711, 1024, 97, 101, 105, 117, 7531, 7544, 7552, 7557, 833, 7536, 0, 7540, 115, 59, 32768, 10829, 111, 110, 59, 32768, 269, 100, 105, 108, 33024, 231, 59, 32768, 231, 114, 99, 59, 32768, 265, 112, 115, 512, 59, 115, 7564, 7566, 32768, 10828, 109, 59, 32768, 10832, 111, 116, 59, 32768, 267, 768, 100, 109, 110, 7582, 7589, 7596, 105, 108, 33024, 184, 59, 32768, 184, 112, 116, 121, 118, 59, 32768, 10674, 116, 33280, 162, 59, 101, 7603, 7605, 32768, 162, 114, 100, 111, 116, 59, 32768, 183, 114, 59, 32896, 55349, 56608, 768, 99, 101, 105, 7624, 7628, 7643, 121, 59, 32768, 1095, 99, 107, 512, 59, 109, 7635, 7637, 32768, 10003, 97, 114, 107, 59, 32768, 10003, 59, 32768, 967, 114, 1792, 59, 69, 99, 101, 102, 109, 115, 7662, 7664, 7667, 7742, 7745, 7752, 7757, 32768, 9675, 59, 32768, 10691, 768, 59, 101, 108, 7674, 7676, 7680, 32768, 710, 113, 59, 32768, 8791, 101, 1074, 7687, 0, 0, 7709, 114, 114, 111, 119, 512, 108, 114, 7695, 7701, 101, 102, 116, 59, 32768, 8634, 105, 103, 104, 116, 59, 32768, 8635, 1280, 82, 83, 97, 99, 100, 7719, 7722, 7725, 7730, 7736, 59, 32768, 174, 59, 32768, 9416, 115, 116, 59, 32768, 8859, 105, 114, 99, 59, 32768, 8858, 97, 115, 104, 59, 32768, 8861, 59, 32768, 8791, 110, 105, 110, 116, 59, 32768, 10768, 105, 100, 59, 32768, 10991, 99, 105, 114, 59, 32768, 10690, 117, 98, 115, 512, 59, 117, 7771, 7773, 32768, 9827, 105, 116, 59, 32768, 9827, 1341, 7785, 7804, 7850, 0, 7871, 111, 110, 512, 59, 101, 7791, 7793, 32768, 58, 512, 59, 113, 7798, 7800, 32768, 8788, 59, 32768, 8788, 1086, 7809, 0, 0, 7820, 97, 512, 59, 116, 7814, 7816, 32768, 44, 59, 32768, 64, 768, 59, 102, 108, 7826, 7828, 7832, 32768, 8705, 110, 59, 32768, 8728, 101, 512, 109, 120, 7838, 7844, 101, 110, 116, 59, 32768, 8705, 101, 115, 59, 32768, 8450, 824, 7854, 0, 7866, 512, 59, 100, 7858, 7860, 32768, 8773, 111, 116, 59, 32768, 10861, 110, 116, 59, 32768, 8750, 768, 102, 114, 121, 7877, 7881, 7886, 59, 32896, 55349, 56660, 111, 100, 59, 32768, 8720, 33280, 169, 59, 115, 7892, 7894, 32768, 169, 114, 59, 32768, 8471, 512, 97, 111, 7903, 7908, 114, 114, 59, 32768, 8629, 115, 115, 59, 32768, 10007, 512, 99, 117, 7918, 7923, 114, 59, 32896, 55349, 56504, 512, 98, 112, 7928, 7938, 512, 59, 101, 7933, 7935, 32768, 10959, 59, 32768, 10961, 512, 59, 101, 7943, 7945, 32768, 10960, 59, 32768, 10962, 100, 111, 116, 59, 32768, 8943, 1792, 100, 101, 108, 112, 114, 118, 119, 7969, 7983, 7996, 8009, 8057, 8147, 8152, 97, 114, 114, 512, 108, 114, 7977, 7980, 59, 32768, 10552, 59, 32768, 10549, 1089, 7989, 0, 0, 7993, 114, 59, 32768, 8926, 99, 59, 32768, 8927, 97, 114, 114, 512, 59, 112, 8004, 8006, 32768, 8630, 59, 32768, 10557, 1536, 59, 98, 99, 100, 111, 115, 8022, 8024, 8031, 8044, 8049, 8053, 32768, 8746, 114, 99, 97, 112, 59, 32768, 10824, 512, 97, 117, 8036, 8040, 112, 59, 32768, 10822, 112, 59, 32768, 10826, 111, 116, 59, 32768, 8845, 114, 59, 32768, 10821, 59, 32896, 8746, 65024, 1024, 97, 108, 114, 118, 8066, 8078, 8116, 8123, 114, 114, 512, 59, 109, 8073, 8075, 32768, 8631, 59, 32768, 10556, 121, 768, 101, 118, 119, 8086, 8104, 8109, 113, 1089, 8093, 0, 0, 8099, 114, 101, 99, 59, 32768, 8926, 117, 99, 99, 59, 32768, 8927, 101, 101, 59, 32768, 8910, 101, 100, 103, 101, 59, 32768, 8911, 101, 110, 33024, 164, 59, 32768, 164, 101, 97, 114, 114, 111, 119, 512, 108, 114, 8134, 8140, 101, 102, 116, 59, 32768, 8630, 105, 103, 104, 116, 59, 32768, 8631, 101, 101, 59, 32768, 8910, 101, 100, 59, 32768, 8911, 512, 99, 105, 8162, 8170, 111, 110, 105, 110, 116, 59, 32768, 8754, 110, 116, 59, 32768, 8753, 108, 99, 116, 121, 59, 32768, 9005, 4864, 65, 72, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 111, 114, 115, 116, 117, 119, 122, 8221, 8226, 8231, 8267, 8282, 8296, 8327, 8351, 8366, 8379, 8466, 8471, 8487, 8621, 8647, 8676, 8697, 8712, 8720, 114, 114, 59, 32768, 8659, 97, 114, 59, 32768, 10597, 1024, 103, 108, 114, 115, 8240, 8246, 8252, 8256, 103, 101, 114, 59, 32768, 8224, 101, 116, 104, 59, 32768, 8504, 114, 59, 32768, 8595, 104, 512, 59, 118, 8262, 8264, 32768, 8208, 59, 32768, 8867, 572, 8271, 8278, 97, 114, 111, 119, 59, 32768, 10511, 97, 99, 59, 32768, 733, 512, 97, 121, 8287, 8293, 114, 111, 110, 59, 32768, 271, 59, 32768, 1076, 768, 59, 97, 111, 8303, 8305, 8320, 32768, 8518, 512, 103, 114, 8310, 8316, 103, 101, 114, 59, 32768, 8225, 114, 59, 32768, 8650, 116, 115, 101, 113, 59, 32768, 10871, 768, 103, 108, 109, 8334, 8339, 8344, 33024, 176, 59, 32768, 176, 116, 97, 59, 32768, 948, 112, 116, 121, 118, 59, 32768, 10673, 512, 105, 114, 8356, 8362, 115, 104, 116, 59, 32768, 10623, 59, 32896, 55349, 56609, 97, 114, 512, 108, 114, 8373, 8376, 59, 32768, 8643, 59, 32768, 8642, 1280, 97, 101, 103, 115, 118, 8390, 8418, 8421, 8428, 8433, 109, 768, 59, 111, 115, 8398, 8400, 8415, 32768, 8900, 110, 100, 512, 59, 115, 8407, 8409, 32768, 8900, 117, 105, 116, 59, 32768, 9830, 59, 32768, 9830, 59, 32768, 168, 97, 109, 109, 97, 59, 32768, 989, 105, 110, 59, 32768, 8946, 768, 59, 105, 111, 8440, 8442, 8461, 32768, 247, 100, 101, 33280, 247, 59, 111, 8450, 8452, 32768, 247, 110, 116, 105, 109, 101, 115, 59, 32768, 8903, 110, 120, 59, 32768, 8903, 99, 121, 59, 32768, 1106, 99, 1088, 8478, 0, 0, 8483, 114, 110, 59, 32768, 8990, 111, 112, 59, 32768, 8973, 1280, 108, 112, 116, 117, 119, 8498, 8504, 8509, 8556, 8570, 108, 97, 114, 59, 32768, 36, 102, 59, 32896, 55349, 56661, 1280, 59, 101, 109, 112, 115, 8520, 8522, 8535, 8542, 8548, 32768, 729, 113, 512, 59, 100, 8528, 8530, 32768, 8784, 111, 116, 59, 32768, 8785, 105, 110, 117, 115, 59, 32768, 8760, 108, 117, 115, 59, 32768, 8724, 113, 117, 97, 114, 101, 59, 32768, 8865, 98, 108, 101, 98, 97, 114, 119, 101, 100, 103, 101, 59, 32768, 8966, 110, 768, 97, 100, 104, 8578, 8585, 8597, 114, 114, 111, 119, 59, 32768, 8595, 111, 119, 110, 97, 114, 114, 111, 119, 115, 59, 32768, 8650, 97, 114, 112, 111, 111, 110, 512, 108, 114, 8608, 8614, 101, 102, 116, 59, 32768, 8643, 105, 103, 104, 116, 59, 32768, 8642, 563, 8625, 8633, 107, 97, 114, 111, 119, 59, 32768, 10512, 1088, 8638, 0, 0, 8643, 114, 110, 59, 32768, 8991, 111, 112, 59, 32768, 8972, 768, 99, 111, 116, 8654, 8666, 8670, 512, 114, 121, 8659, 8663, 59, 32896, 55349, 56505, 59, 32768, 1109, 108, 59, 32768, 10742, 114, 111, 107, 59, 32768, 273, 512, 100, 114, 8681, 8686, 111, 116, 59, 32768, 8945, 105, 512, 59, 102, 8692, 8694, 32768, 9663, 59, 32768, 9662, 512, 97, 104, 8702, 8707, 114, 114, 59, 32768, 8693, 97, 114, 59, 32768, 10607, 97, 110, 103, 108, 101, 59, 32768, 10662, 512, 99, 105, 8725, 8729, 121, 59, 32768, 1119, 103, 114, 97, 114, 114, 59, 32768, 10239, 4608, 68, 97, 99, 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 120, 8774, 8788, 8807, 8844, 8849, 8852, 8866, 8895, 8929, 8977, 8989, 9004, 9046, 9136, 9151, 9171, 9184, 9199, 512, 68, 111, 8779, 8784, 111, 116, 59, 32768, 10871, 116, 59, 32768, 8785, 512, 99, 115, 8793, 8801, 117, 116, 101, 33024, 233, 59, 32768, 233, 116, 101, 114, 59, 32768, 10862, 1024, 97, 105, 111, 121, 8816, 8822, 8835, 8841, 114, 111, 110, 59, 32768, 283, 114, 512, 59, 99, 8828, 8830, 32768, 8790, 33024, 234, 59, 32768, 234, 108, 111, 110, 59, 32768, 8789, 59, 32768, 1101, 111, 116, 59, 32768, 279, 59, 32768, 8519, 512, 68, 114, 8857, 8862, 111, 116, 59, 32768, 8786, 59, 32896, 55349, 56610, 768, 59, 114, 115, 8873, 8875, 8883, 32768, 10906, 97, 118, 101, 33024, 232, 59, 32768, 232, 512, 59, 100, 8888, 8890, 32768, 10902, 111, 116, 59, 32768, 10904, 1024, 59, 105, 108, 115, 8904, 8906, 8914, 8917, 32768, 10905, 110, 116, 101, 114, 115, 59, 32768, 9191, 59, 32768, 8467, 512, 59, 100, 8922, 8924, 32768, 10901, 111, 116, 59, 32768, 10903, 768, 97, 112, 115, 8936, 8941, 8960, 99, 114, 59, 32768, 275, 116, 121, 768, 59, 115, 118, 8950, 8952, 8957, 32768, 8709, 101, 116, 59, 32768, 8709, 59, 32768, 8709, 112, 512, 49, 59, 8966, 8975, 516, 8970, 8973, 59, 32768, 8196, 59, 32768, 8197, 32768, 8195, 512, 103, 115, 8982, 8985, 59, 32768, 331, 112, 59, 32768, 8194, 512, 103, 112, 8994, 8999, 111, 110, 59, 32768, 281, 102, 59, 32896, 55349, 56662, 768, 97, 108, 115, 9011, 9023, 9028, 114, 512, 59, 115, 9017, 9019, 32768, 8917, 108, 59, 32768, 10723, 117, 115, 59, 32768, 10865, 105, 768, 59, 108, 118, 9036, 9038, 9043, 32768, 949, 111, 110, 59, 32768, 949, 59, 32768, 1013, 1024, 99, 115, 117, 118, 9055, 9071, 9099, 9128, 512, 105, 111, 9060, 9065, 114, 99, 59, 32768, 8790, 108, 111, 110, 59, 32768, 8789, 1082, 9077, 0, 0, 9081, 109, 59, 32768, 8770, 97, 110, 116, 512, 103, 108, 9088, 9093, 116, 114, 59, 32768, 10902, 101, 115, 115, 59, 32768, 10901, 768, 97, 101, 105, 9106, 9111, 9116, 108, 115, 59, 32768, 61, 115, 116, 59, 32768, 8799, 118, 512, 59, 68, 9122, 9124, 32768, 8801, 68, 59, 32768, 10872, 112, 97, 114, 115, 108, 59, 32768, 10725, 512, 68, 97, 9141, 9146, 111, 116, 59, 32768, 8787, 114, 114, 59, 32768, 10609, 768, 99, 100, 105, 9158, 9162, 9167, 114, 59, 32768, 8495, 111, 116, 59, 32768, 8784, 109, 59, 32768, 8770, 512, 97, 104, 9176, 9179, 59, 32768, 951, 33024, 240, 59, 32768, 240, 512, 109, 114, 9189, 9195, 108, 33024, 235, 59, 32768, 235, 111, 59, 32768, 8364, 768, 99, 105, 112, 9206, 9210, 9215, 108, 59, 32768, 33, 115, 116, 59, 32768, 8707, 512, 101, 111, 9220, 9230, 99, 116, 97, 116, 105, 111, 110, 59, 32768, 8496, 110, 101, 110, 116, 105, 97, 108, 101, 59, 32768, 8519, 4914, 9262, 0, 9276, 0, 9280, 9287, 0, 0, 9318, 9324, 0, 9331, 0, 9352, 9357, 9386, 0, 9395, 9497, 108, 108, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 32768, 8786, 121, 59, 32768, 1092, 109, 97, 108, 101, 59, 32768, 9792, 768, 105, 108, 114, 9293, 9299, 9313, 108, 105, 103, 59, 32768, 64259, 1082, 9305, 0, 0, 9309, 103, 59, 32768, 64256, 105, 103, 59, 32768, 64260, 59, 32896, 55349, 56611, 108, 105, 103, 59, 32768, 64257, 108, 105, 103, 59, 32896, 102, 106, 768, 97, 108, 116, 9337, 9341, 9346, 116, 59, 32768, 9837, 105, 103, 59, 32768, 64258, 110, 115, 59, 32768, 9649, 111, 102, 59, 32768, 402, 833, 9361, 0, 9366, 102, 59, 32896, 55349, 56663, 512, 97, 107, 9370, 9375, 108, 108, 59, 32768, 8704, 512, 59, 118, 9380, 9382, 32768, 8916, 59, 32768, 10969, 97, 114, 116, 105, 110, 116, 59, 32768, 10765, 512, 97, 111, 9399, 9491, 512, 99, 115, 9404, 9487, 1794, 9413, 9443, 9453, 9470, 9474, 0, 9484, 1795, 9421, 9426, 9429, 9434, 9437, 0, 9440, 33024, 189, 59, 32768, 189, 59, 32768, 8531, 33024, 188, 59, 32768, 188, 59, 32768, 8533, 59, 32768, 8537, 59, 32768, 8539, 772, 9447, 0, 9450, 59, 32768, 8532, 59, 32768, 8534, 1285, 9459, 9464, 0, 0, 9467, 33024, 190, 59, 32768, 190, 59, 32768, 8535, 59, 32768, 8540, 53, 59, 32768, 8536, 775, 9478, 0, 9481, 59, 32768, 8538, 59, 32768, 8541, 56, 59, 32768, 8542, 108, 59, 32768, 8260, 119, 110, 59, 32768, 8994, 99, 114, 59, 32896, 55349, 56507, 4352, 69, 97, 98, 99, 100, 101, 102, 103, 105, 106, 108, 110, 111, 114, 115, 116, 118, 9537, 9547, 9575, 9582, 9595, 9600, 9679, 9684, 9694, 9700, 9705, 9725, 9773, 9779, 9785, 9810, 9917, 512, 59, 108, 9542, 9544, 32768, 8807, 59, 32768, 10892, 768, 99, 109, 112, 9554, 9560, 9572, 117, 116, 101, 59, 32768, 501, 109, 97, 512, 59, 100, 9567, 9569, 32768, 947, 59, 32768, 989, 59, 32768, 10886, 114, 101, 118, 101, 59, 32768, 287, 512, 105, 121, 9587, 9592, 114, 99, 59, 32768, 285, 59, 32768, 1075, 111, 116, 59, 32768, 289, 1024, 59, 108, 113, 115, 9609, 9611, 9614, 9633, 32768, 8805, 59, 32768, 8923, 768, 59, 113, 115, 9621, 9623, 9626, 32768, 8805, 59, 32768, 8807, 108, 97, 110, 116, 59, 32768, 10878, 1024, 59, 99, 100, 108, 9642, 9644, 9648, 9667, 32768, 10878, 99, 59, 32768, 10921, 111, 116, 512, 59, 111, 9655, 9657, 32768, 10880, 512, 59, 108, 9662, 9664, 32768, 10882, 59, 32768, 10884, 512, 59, 101, 9672, 9675, 32896, 8923, 65024, 115, 59, 32768, 10900, 114, 59, 32896, 55349, 56612, 512, 59, 103, 9689, 9691, 32768, 8811, 59, 32768, 8921, 109, 101, 108, 59, 32768, 8503, 99, 121, 59, 32768, 1107, 1024, 59, 69, 97, 106, 9714, 9716, 9719, 9722, 32768, 8823, 59, 32768, 10898, 59, 32768, 10917, 59, 32768, 10916, 1024, 69, 97, 101, 115, 9734, 9737, 9751, 9768, 59, 32768, 8809, 112, 512, 59, 112, 9743, 9745, 32768, 10890, 114, 111, 120, 59, 32768, 10890, 512, 59, 113, 9756, 9758, 32768, 10888, 512, 59, 113, 9763, 9765, 32768, 10888, 59, 32768, 8809, 105, 109, 59, 32768, 8935, 112, 102, 59, 32896, 55349, 56664, 97, 118, 101, 59, 32768, 96, 512, 99, 105, 9790, 9794, 114, 59, 32768, 8458, 109, 768, 59, 101, 108, 9802, 9804, 9807, 32768, 8819, 59, 32768, 10894, 59, 32768, 10896, 34304, 62, 59, 99, 100, 108, 113, 114, 9824, 9826, 9838, 9843, 9849, 9856, 32768, 62, 512, 99, 105, 9831, 9834, 59, 32768, 10919, 114, 59, 32768, 10874, 111, 116, 59, 32768, 8919, 80, 97, 114, 59, 32768, 10645, 117, 101, 115, 116, 59, 32768, 10876, 1280, 97, 100, 101, 108, 115, 9867, 9882, 9887, 9906, 9912, 833, 9872, 0, 9879, 112, 114, 111, 120, 59, 32768, 10886, 114, 59, 32768, 10616, 111, 116, 59, 32768, 8919, 113, 512, 108, 113, 9893, 9899, 101, 115, 115, 59, 32768, 8923, 108, 101, 115, 115, 59, 32768, 10892, 101, 115, 115, 59, 32768, 8823, 105, 109, 59, 32768, 8819, 512, 101, 110, 9922, 9932, 114, 116, 110, 101, 113, 113, 59, 32896, 8809, 65024, 69, 59, 32896, 8809, 65024, 2560, 65, 97, 98, 99, 101, 102, 107, 111, 115, 121, 9958, 9963, 10015, 10020, 10026, 10060, 10065, 10085, 10147, 10171, 114, 114, 59, 32768, 8660, 1024, 105, 108, 109, 114, 9972, 9978, 9982, 9988, 114, 115, 112, 59, 32768, 8202, 102, 59, 32768, 189, 105, 108, 116, 59, 32768, 8459, 512, 100, 114, 9993, 9998, 99, 121, 59, 32768, 1098, 768, 59, 99, 119, 10005, 10007, 10012, 32768, 8596, 105, 114, 59, 32768, 10568, 59, 32768, 8621, 97, 114, 59, 32768, 8463, 105, 114, 99, 59, 32768, 293, 768, 97, 108, 114, 10033, 10048, 10054, 114, 116, 115, 512, 59, 117, 10041, 10043, 32768, 9829, 105, 116, 59, 32768, 9829, 108, 105, 112, 59, 32768, 8230, 99, 111, 110, 59, 32768, 8889, 114, 59, 32896, 55349, 56613, 115, 512, 101, 119, 10071, 10078, 97, 114, 111, 119, 59, 32768, 10533, 97, 114, 111, 119, 59, 32768, 10534, 1280, 97, 109, 111, 112, 114, 10096, 10101, 10107, 10136, 10141, 114, 114, 59, 32768, 8703, 116, 104, 116, 59, 32768, 8763, 107, 512, 108, 114, 10113, 10124, 101, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8617, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8618, 102, 59, 32896, 55349, 56665, 98, 97, 114, 59, 32768, 8213, 768, 99, 108, 116, 10154, 10159, 10165, 114, 59, 32896, 55349, 56509, 97, 115, 104, 59, 32768, 8463, 114, 111, 107, 59, 32768, 295, 512, 98, 112, 10176, 10182, 117, 108, 108, 59, 32768, 8259, 104, 101, 110, 59, 32768, 8208, 5426, 10211, 0, 10220, 0, 10239, 10255, 10267, 0, 10276, 10312, 0, 0, 10318, 10371, 10458, 10485, 10491, 0, 10500, 10545, 10558, 99, 117, 116, 101, 33024, 237, 59, 32768, 237, 768, 59, 105, 121, 10226, 10228, 10235, 32768, 8291, 114, 99, 33024, 238, 59, 32768, 238, 59, 32768, 1080, 512, 99, 120, 10243, 10247, 121, 59, 32768, 1077, 99, 108, 33024, 161, 59, 32768, 161, 512, 102, 114, 10259, 10262, 59, 32768, 8660, 59, 32896, 55349, 56614, 114, 97, 118, 101, 33024, 236, 59, 32768, 236, 1024, 59, 105, 110, 111, 10284, 10286, 10300, 10306, 32768, 8520, 512, 105, 110, 10291, 10296, 110, 116, 59, 32768, 10764, 116, 59, 32768, 8749, 102, 105, 110, 59, 32768, 10716, 116, 97, 59, 32768, 8489, 108, 105, 103, 59, 32768, 307, 768, 97, 111, 112, 10324, 10361, 10365, 768, 99, 103, 116, 10331, 10335, 10357, 114, 59, 32768, 299, 768, 101, 108, 112, 10342, 10345, 10351, 59, 32768, 8465, 105, 110, 101, 59, 32768, 8464, 97, 114, 116, 59, 32768, 8465, 104, 59, 32768, 305, 102, 59, 32768, 8887, 101, 100, 59, 32768, 437, 1280, 59, 99, 102, 111, 116, 10381, 10383, 10389, 10403, 10409, 32768, 8712, 97, 114, 101, 59, 32768, 8453, 105, 110, 512, 59, 116, 10396, 10398, 32768, 8734, 105, 101, 59, 32768, 10717, 100, 111, 116, 59, 32768, 305, 1280, 59, 99, 101, 108, 112, 10420, 10422, 10427, 10444, 10451, 32768, 8747, 97, 108, 59, 32768, 8890, 512, 103, 114, 10432, 10438, 101, 114, 115, 59, 32768, 8484, 99, 97, 108, 59, 32768, 8890, 97, 114, 104, 107, 59, 32768, 10775, 114, 111, 100, 59, 32768, 10812, 1024, 99, 103, 112, 116, 10466, 10470, 10475, 10480, 121, 59, 32768, 1105, 111, 110, 59, 32768, 303, 102, 59, 32896, 55349, 56666, 97, 59, 32768, 953, 114, 111, 100, 59, 32768, 10812, 117, 101, 115, 116, 33024, 191, 59, 32768, 191, 512, 99, 105, 10504, 10509, 114, 59, 32896, 55349, 56510, 110, 1280, 59, 69, 100, 115, 118, 10521, 10523, 10526, 10531, 10541, 32768, 8712, 59, 32768, 8953, 111, 116, 59, 32768, 8949, 512, 59, 118, 10536, 10538, 32768, 8948, 59, 32768, 8947, 59, 32768, 8712, 512, 59, 105, 10549, 10551, 32768, 8290, 108, 100, 101, 59, 32768, 297, 828, 10562, 0, 10567, 99, 121, 59, 32768, 1110, 108, 33024, 239, 59, 32768, 239, 1536, 99, 102, 109, 111, 115, 117, 10585, 10598, 10603, 10609, 10615, 10630, 512, 105, 121, 10590, 10595, 114, 99, 59, 32768, 309, 59, 32768, 1081, 114, 59, 32896, 55349, 56615, 97, 116, 104, 59, 32768, 567, 112, 102, 59, 32896, 55349, 56667, 820, 10620, 0, 10625, 114, 59, 32896, 55349, 56511, 114, 99, 121, 59, 32768, 1112, 107, 99, 121, 59, 32768, 1108, 2048, 97, 99, 102, 103, 104, 106, 111, 115, 10653, 10666, 10680, 10685, 10692, 10697, 10702, 10708, 112, 112, 97, 512, 59, 118, 10661, 10663, 32768, 954, 59, 32768, 1008, 512, 101, 121, 10671, 10677, 100, 105, 108, 59, 32768, 311, 59, 32768, 1082, 114, 59, 32896, 55349, 56616, 114, 101, 101, 110, 59, 32768, 312, 99, 121, 59, 32768, 1093, 99, 121, 59, 32768, 1116, 112, 102, 59, 32896, 55349, 56668, 99, 114, 59, 32896, 55349, 56512, 5888, 65, 66, 69, 72, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 10761, 10783, 10789, 10799, 10804, 10957, 11011, 11047, 11094, 11349, 11372, 11382, 11409, 11414, 11451, 11478, 11526, 11698, 11711, 11755, 11823, 11910, 11929, 768, 97, 114, 116, 10768, 10773, 10777, 114, 114, 59, 32768, 8666, 114, 59, 32768, 8656, 97, 105, 108, 59, 32768, 10523, 97, 114, 114, 59, 32768, 10510, 512, 59, 103, 10794, 10796, 32768, 8806, 59, 32768, 10891, 97, 114, 59, 32768, 10594, 4660, 10824, 0, 10830, 0, 10838, 0, 0, 0, 0, 0, 10844, 10850, 0, 10867, 10870, 10877, 0, 10933, 117, 116, 101, 59, 32768, 314, 109, 112, 116, 121, 118, 59, 32768, 10676, 114, 97, 110, 59, 32768, 8466, 98, 100, 97, 59, 32768, 955, 103, 768, 59, 100, 108, 10857, 10859, 10862, 32768, 10216, 59, 32768, 10641, 101, 59, 32768, 10216, 59, 32768, 10885, 117, 111, 33024, 171, 59, 32768, 171, 114, 2048, 59, 98, 102, 104, 108, 112, 115, 116, 10894, 10896, 10907, 10911, 10915, 10919, 10923, 10928, 32768, 8592, 512, 59, 102, 10901, 10903, 32768, 8676, 115, 59, 32768, 10527, 115, 59, 32768, 10525, 107, 59, 32768, 8617, 112, 59, 32768, 8619, 108, 59, 32768, 10553, 105, 109, 59, 32768, 10611, 108, 59, 32768, 8610, 768, 59, 97, 101, 10939, 10941, 10946, 32768, 10923, 105, 108, 59, 32768, 10521, 512, 59, 115, 10951, 10953, 32768, 10925, 59, 32896, 10925, 65024, 768, 97, 98, 114, 10964, 10969, 10974, 114, 114, 59, 32768, 10508, 114, 107, 59, 32768, 10098, 512, 97, 107, 10979, 10991, 99, 512, 101, 107, 10985, 10988, 59, 32768, 123, 59, 32768, 91, 512, 101, 115, 10996, 10999, 59, 32768, 10635, 108, 512, 100, 117, 11005, 11008, 59, 32768, 10639, 59, 32768, 10637, 1024, 97, 101, 117, 121, 11020, 11026, 11040, 11044, 114, 111, 110, 59, 32768, 318, 512, 100, 105, 11031, 11036, 105, 108, 59, 32768, 316, 108, 59, 32768, 8968, 98, 59, 32768, 123, 59, 32768, 1083, 1024, 99, 113, 114, 115, 11056, 11060, 11072, 11090, 97, 59, 32768, 10550, 117, 111, 512, 59, 114, 11067, 11069, 32768, 8220, 59, 32768, 8222, 512, 100, 117, 11077, 11083, 104, 97, 114, 59, 32768, 10599, 115, 104, 97, 114, 59, 32768, 10571, 104, 59, 32768, 8626, 1280, 59, 102, 103, 113, 115, 11105, 11107, 11228, 11231, 11250, 32768, 8804, 116, 1280, 97, 104, 108, 114, 116, 11119, 11136, 11157, 11169, 11216, 114, 114, 111, 119, 512, 59, 116, 11128, 11130, 32768, 8592, 97, 105, 108, 59, 32768, 8610, 97, 114, 112, 111, 111, 110, 512, 100, 117, 11147, 11153, 111, 119, 110, 59, 32768, 8637, 112, 59, 32768, 8636, 101, 102, 116, 97, 114, 114, 111, 119, 115, 59, 32768, 8647, 105, 103, 104, 116, 768, 97, 104, 115, 11180, 11194, 11204, 114, 114, 111, 119, 512, 59, 115, 11189, 11191, 32768, 8596, 59, 32768, 8646, 97, 114, 112, 111, 111, 110, 115, 59, 32768, 8651, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 32768, 8621, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 32768, 8907, 59, 32768, 8922, 768, 59, 113, 115, 11238, 11240, 11243, 32768, 8804, 59, 32768, 8806, 108, 97, 110, 116, 59, 32768, 10877, 1280, 59, 99, 100, 103, 115, 11261, 11263, 11267, 11286, 11298, 32768, 10877, 99, 59, 32768, 10920, 111, 116, 512, 59, 111, 11274, 11276, 32768, 10879, 512, 59, 114, 11281, 11283, 32768, 10881, 59, 32768, 10883, 512, 59, 101, 11291, 11294, 32896, 8922, 65024, 115, 59, 32768, 10899, 1280, 97, 100, 101, 103, 115, 11309, 11317, 11322, 11339, 11344, 112, 112, 114, 111, 120, 59, 32768, 10885, 111, 116, 59, 32768, 8918, 113, 512, 103, 113, 11328, 11333, 116, 114, 59, 32768, 8922, 103, 116, 114, 59, 32768, 10891, 116, 114, 59, 32768, 8822, 105, 109, 59, 32768, 8818, 768, 105, 108, 114, 11356, 11362, 11368, 115, 104, 116, 59, 32768, 10620, 111, 111, 114, 59, 32768, 8970, 59, 32896, 55349, 56617, 512, 59, 69, 11377, 11379, 32768, 8822, 59, 32768, 10897, 562, 11386, 11405, 114, 512, 100, 117, 11391, 11394, 59, 32768, 8637, 512, 59, 108, 11399, 11401, 32768, 8636, 59, 32768, 10602, 108, 107, 59, 32768, 9604, 99, 121, 59, 32768, 1113, 1280, 59, 97, 99, 104, 116, 11425, 11427, 11432, 11440, 11446, 32768, 8810, 114, 114, 59, 32768, 8647, 111, 114, 110, 101, 114, 59, 32768, 8990, 97, 114, 100, 59, 32768, 10603, 114, 105, 59, 32768, 9722, 512, 105, 111, 11456, 11462, 100, 111, 116, 59, 32768, 320, 117, 115, 116, 512, 59, 97, 11470, 11472, 32768, 9136, 99, 104, 101, 59, 32768, 9136, 1024, 69, 97, 101, 115, 11487, 11490, 11504, 11521, 59, 32768, 8808, 112, 512, 59, 112, 11496, 11498, 32768, 10889, 114, 111, 120, 59, 32768, 10889, 512, 59, 113, 11509, 11511, 32768, 10887, 512, 59, 113, 11516, 11518, 32768, 10887, 59, 32768, 8808, 105, 109, 59, 32768, 8934, 2048, 97, 98, 110, 111, 112, 116, 119, 122, 11543, 11556, 11561, 11616, 11640, 11660, 11667, 11680, 512, 110, 114, 11548, 11552, 103, 59, 32768, 10220, 114, 59, 32768, 8701, 114, 107, 59, 32768, 10214, 103, 768, 108, 109, 114, 11569, 11596, 11604, 101, 102, 116, 512, 97, 114, 11577, 11584, 114, 114, 111, 119, 59, 32768, 10229, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10231, 97, 112, 115, 116, 111, 59, 32768, 10236, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10230, 112, 97, 114, 114, 111, 119, 512, 108, 114, 11627, 11633, 101, 102, 116, 59, 32768, 8619, 105, 103, 104, 116, 59, 32768, 8620, 768, 97, 102, 108, 11647, 11651, 11655, 114, 59, 32768, 10629, 59, 32896, 55349, 56669, 117, 115, 59, 32768, 10797, 105, 109, 101, 115, 59, 32768, 10804, 562, 11671, 11676, 115, 116, 59, 32768, 8727, 97, 114, 59, 32768, 95, 768, 59, 101, 102, 11687, 11689, 11695, 32768, 9674, 110, 103, 101, 59, 32768, 9674, 59, 32768, 10731, 97, 114, 512, 59, 108, 11705, 11707, 32768, 40, 116, 59, 32768, 10643, 1280, 97, 99, 104, 109, 116, 11722, 11727, 11735, 11747, 11750, 114, 114, 59, 32768, 8646, 111, 114, 110, 101, 114, 59, 32768, 8991, 97, 114, 512, 59, 100, 11742, 11744, 32768, 8651, 59, 32768, 10605, 59, 32768, 8206, 114, 105, 59, 32768, 8895, 1536, 97, 99, 104, 105, 113, 116, 11768, 11774, 11779, 11782, 11798, 11817, 113, 117, 111, 59, 32768, 8249, 114, 59, 32896, 55349, 56513, 59, 32768, 8624, 109, 768, 59, 101, 103, 11790, 11792, 11795, 32768, 8818, 59, 32768, 10893, 59, 32768, 10895, 512, 98, 117, 11803, 11806, 59, 32768, 91, 111, 512, 59, 114, 11812, 11814, 32768, 8216, 59, 32768, 8218, 114, 111, 107, 59, 32768, 322, 34816, 60, 59, 99, 100, 104, 105, 108, 113, 114, 11841, 11843, 11855, 11860, 11866, 11872, 11878, 11885, 32768, 60, 512, 99, 105, 11848, 11851, 59, 32768, 10918, 114, 59, 32768, 10873, 111, 116, 59, 32768, 8918, 114, 101, 101, 59, 32768, 8907, 109, 101, 115, 59, 32768, 8905, 97, 114, 114, 59, 32768, 10614, 117, 101, 115, 116, 59, 32768, 10875, 512, 80, 105, 11890, 11895, 97, 114, 59, 32768, 10646, 768, 59, 101, 102, 11902, 11904, 11907, 32768, 9667, 59, 32768, 8884, 59, 32768, 9666, 114, 512, 100, 117, 11916, 11923, 115, 104, 97, 114, 59, 32768, 10570, 104, 97, 114, 59, 32768, 10598, 512, 101, 110, 11934, 11944, 114, 116, 110, 101, 113, 113, 59, 32896, 8808, 65024, 69, 59, 32896, 8808, 65024, 3584, 68, 97, 99, 100, 101, 102, 104, 105, 108, 110, 111, 112, 115, 117, 11978, 11984, 12061, 12075, 12081, 12095, 12100, 12104, 12170, 12181, 12188, 12204, 12207, 12223, 68, 111, 116, 59, 32768, 8762, 1024, 99, 108, 112, 114, 11993, 11999, 12019, 12055, 114, 33024, 175, 59, 32768, 175, 512, 101, 116, 12004, 12007, 59, 32768, 9794, 512, 59, 101, 12012, 12014, 32768, 10016, 115, 101, 59, 32768, 10016, 512, 59, 115, 12024, 12026, 32768, 8614, 116, 111, 1024, 59, 100, 108, 117, 12037, 12039, 12045, 12051, 32768, 8614, 111, 119, 110, 59, 32768, 8615, 101, 102, 116, 59, 32768, 8612, 112, 59, 32768, 8613, 107, 101, 114, 59, 32768, 9646, 512, 111, 121, 12066, 12072, 109, 109, 97, 59, 32768, 10793, 59, 32768, 1084, 97, 115, 104, 59, 32768, 8212, 97, 115, 117, 114, 101, 100, 97, 110, 103, 108, 101, 59, 32768, 8737, 114, 59, 32896, 55349, 56618, 111, 59, 32768, 8487, 768, 99, 100, 110, 12111, 12118, 12146, 114, 111, 33024, 181, 59, 32768, 181, 1024, 59, 97, 99, 100, 12127, 12129, 12134, 12139, 32768, 8739, 115, 116, 59, 32768, 42, 105, 114, 59, 32768, 10992, 111, 116, 33024, 183, 59, 32768, 183, 117, 115, 768, 59, 98, 100, 12155, 12157, 12160, 32768, 8722, 59, 32768, 8863, 512, 59, 117, 12165, 12167, 32768, 8760, 59, 32768, 10794, 564, 12174, 12178, 112, 59, 32768, 10971, 114, 59, 32768, 8230, 112, 108, 117, 115, 59, 32768, 8723, 512, 100, 112, 12193, 12199, 101, 108, 115, 59, 32768, 8871, 102, 59, 32896, 55349, 56670, 59, 32768, 8723, 512, 99, 116, 12212, 12217, 114, 59, 32896, 55349, 56514, 112, 111, 115, 59, 32768, 8766, 768, 59, 108, 109, 12230, 12232, 12240, 32768, 956, 116, 105, 109, 97, 112, 59, 32768, 8888, 97, 112, 59, 32768, 8888, 6144, 71, 76, 82, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 111, 112, 114, 115, 116, 117, 118, 119, 12294, 12315, 12364, 12376, 12393, 12472, 12496, 12547, 12553, 12636, 12641, 12703, 12725, 12747, 12752, 12876, 12881, 12957, 13033, 13089, 13294, 13359, 13384, 13499, 512, 103, 116, 12299, 12303, 59, 32896, 8921, 824, 512, 59, 118, 12308, 12311, 32896, 8811, 8402, 59, 32896, 8811, 824, 768, 101, 108, 116, 12322, 12348, 12352, 102, 116, 512, 97, 114, 12329, 12336, 114, 114, 111, 119, 59, 32768, 8653, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8654, 59, 32896, 8920, 824, 512, 59, 118, 12357, 12360, 32896, 8810, 8402, 59, 32896, 8810, 824, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8655, 512, 68, 100, 12381, 12387, 97, 115, 104, 59, 32768, 8879, 97, 115, 104, 59, 32768, 8878, 1280, 98, 99, 110, 112, 116, 12404, 12409, 12415, 12420, 12452, 108, 97, 59, 32768, 8711, 117, 116, 101, 59, 32768, 324, 103, 59, 32896, 8736, 8402, 1280, 59, 69, 105, 111, 112, 12431, 12433, 12437, 12442, 12446, 32768, 8777, 59, 32896, 10864, 824, 100, 59, 32896, 8779, 824, 115, 59, 32768, 329, 114, 111, 120, 59, 32768, 8777, 117, 114, 512, 59, 97, 12459, 12461, 32768, 9838, 108, 512, 59, 115, 12467, 12469, 32768, 9838, 59, 32768, 8469, 836, 12477, 0, 12483, 112, 33024, 160, 59, 32768, 160, 109, 112, 512, 59, 101, 12489, 12492, 32896, 8782, 824, 59, 32896, 8783, 824, 1280, 97, 101, 111, 117, 121, 12507, 12519, 12525, 12540, 12544, 833, 12512, 0, 12515, 59, 32768, 10819, 111, 110, 59, 32768, 328, 100, 105, 108, 59, 32768, 326, 110, 103, 512, 59, 100, 12532, 12534, 32768, 8775, 111, 116, 59, 32896, 10861, 824, 112, 59, 32768, 10818, 59, 32768, 1085, 97, 115, 104, 59, 32768, 8211, 1792, 59, 65, 97, 100, 113, 115, 120, 12568, 12570, 12575, 12596, 12602, 12608, 12623, 32768, 8800, 114, 114, 59, 32768, 8663, 114, 512, 104, 114, 12581, 12585, 107, 59, 32768, 10532, 512, 59, 111, 12590, 12592, 32768, 8599, 119, 59, 32768, 8599, 111, 116, 59, 32896, 8784, 824, 117, 105, 118, 59, 32768, 8802, 512, 101, 105, 12613, 12618, 97, 114, 59, 32768, 10536, 109, 59, 32896, 8770, 824, 105, 115, 116, 512, 59, 115, 12631, 12633, 32768, 8708, 59, 32768, 8708, 114, 59, 32896, 55349, 56619, 1024, 69, 101, 115, 116, 12650, 12654, 12688, 12693, 59, 32896, 8807, 824, 768, 59, 113, 115, 12661, 12663, 12684, 32768, 8817, 768, 59, 113, 115, 12670, 12672, 12676, 32768, 8817, 59, 32896, 8807, 824, 108, 97, 110, 116, 59, 32896, 10878, 824, 59, 32896, 10878, 824, 105, 109, 59, 32768, 8821, 512, 59, 114, 12698, 12700, 32768, 8815, 59, 32768, 8815, 768, 65, 97, 112, 12710, 12715, 12720, 114, 114, 59, 32768, 8654, 114, 114, 59, 32768, 8622, 97, 114, 59, 32768, 10994, 768, 59, 115, 118, 12732, 12734, 12744, 32768, 8715, 512, 59, 100, 12739, 12741, 32768, 8956, 59, 32768, 8954, 59, 32768, 8715, 99, 121, 59, 32768, 1114, 1792, 65, 69, 97, 100, 101, 115, 116, 12767, 12772, 12776, 12781, 12785, 12853, 12858, 114, 114, 59, 32768, 8653, 59, 32896, 8806, 824, 114, 114, 59, 32768, 8602, 114, 59, 32768, 8229, 1024, 59, 102, 113, 115, 12794, 12796, 12821, 12842, 32768, 8816, 116, 512, 97, 114, 12802, 12809, 114, 114, 111, 119, 59, 32768, 8602, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8622, 768, 59, 113, 115, 12828, 12830, 12834, 32768, 8816, 59, 32896, 8806, 824, 108, 97, 110, 116, 59, 32896, 10877, 824, 512, 59, 115, 12847, 12850, 32896, 10877, 824, 59, 32768, 8814, 105, 109, 59, 32768, 8820, 512, 59, 114, 12863, 12865, 32768, 8814, 105, 512, 59, 101, 12871, 12873, 32768, 8938, 59, 32768, 8940, 105, 100, 59, 32768, 8740, 512, 112, 116, 12886, 12891, 102, 59, 32896, 55349, 56671, 33536, 172, 59, 105, 110, 12899, 12901, 12936, 32768, 172, 110, 1024, 59, 69, 100, 118, 12911, 12913, 12917, 12923, 32768, 8713, 59, 32896, 8953, 824, 111, 116, 59, 32896, 8949, 824, 818, 12928, 12931, 12934, 59, 32768, 8713, 59, 32768, 8951, 59, 32768, 8950, 105, 512, 59, 118, 12942, 12944, 32768, 8716, 818, 12949, 12952, 12955, 59, 32768, 8716, 59, 32768, 8958, 59, 32768, 8957, 768, 97, 111, 114, 12964, 12992, 12999, 114, 1024, 59, 97, 115, 116, 12974, 12976, 12983, 12988, 32768, 8742, 108, 108, 101, 108, 59, 32768, 8742, 108, 59, 32896, 11005, 8421, 59, 32896, 8706, 824, 108, 105, 110, 116, 59, 32768, 10772, 768, 59, 99, 101, 13006, 13008, 13013, 32768, 8832, 117, 101, 59, 32768, 8928, 512, 59, 99, 13018, 13021, 32896, 10927, 824, 512, 59, 101, 13026, 13028, 32768, 8832, 113, 59, 32896, 10927, 824, 1024, 65, 97, 105, 116, 13042, 13047, 13066, 13077, 114, 114, 59, 32768, 8655, 114, 114, 768, 59, 99, 119, 13056, 13058, 13062, 32768, 8603, 59, 32896, 10547, 824, 59, 32896, 8605, 824, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8603, 114, 105, 512, 59, 101, 13084, 13086, 32768, 8939, 59, 32768, 8941, 1792, 99, 104, 105, 109, 112, 113, 117, 13104, 13128, 13151, 13169, 13174, 13179, 13194, 1024, 59, 99, 101, 114, 13113, 13115, 13120, 13124, 32768, 8833, 117, 101, 59, 32768, 8929, 59, 32896, 10928, 824, 59, 32896, 55349, 56515, 111, 114, 116, 1086, 13137, 0, 0, 13142, 105, 100, 59, 32768, 8740, 97, 114, 97, 108, 108, 101, 108, 59, 32768, 8742, 109, 512, 59, 101, 13157, 13159, 32768, 8769, 512, 59, 113, 13164, 13166, 32768, 8772, 59, 32768, 8772, 105, 100, 59, 32768, 8740, 97, 114, 59, 32768, 8742, 115, 117, 512, 98, 112, 13186, 13190, 101, 59, 32768, 8930, 101, 59, 32768, 8931, 768, 98, 99, 112, 13201, 13241, 13254, 1024, 59, 69, 101, 115, 13210, 13212, 13216, 13219, 32768, 8836, 59, 32896, 10949, 824, 59, 32768, 8840, 101, 116, 512, 59, 101, 13226, 13229, 32896, 8834, 8402, 113, 512, 59, 113, 13235, 13237, 32768, 8840, 59, 32896, 10949, 824, 99, 512, 59, 101, 13247, 13249, 32768, 8833, 113, 59, 32896, 10928, 824, 1024, 59, 69, 101, 115, 13263, 13265, 13269, 13272, 32768, 8837, 59, 32896, 10950, 824, 59, 32768, 8841, 101, 116, 512, 59, 101, 13279, 13282, 32896, 8835, 8402, 113, 512, 59, 113, 13288, 13290, 32768, 8841, 59, 32896, 10950, 824, 1024, 103, 105, 108, 114, 13303, 13307, 13315, 13319, 108, 59, 32768, 8825, 108, 100, 101, 33024, 241, 59, 32768, 241, 103, 59, 32768, 8824, 105, 97, 110, 103, 108, 101, 512, 108, 114, 13330, 13344, 101, 102, 116, 512, 59, 101, 13338, 13340, 32768, 8938, 113, 59, 32768, 8940, 105, 103, 104, 116, 512, 59, 101, 13353, 13355, 32768, 8939, 113, 59, 32768, 8941, 512, 59, 109, 13364, 13366, 32768, 957, 768, 59, 101, 115, 13373, 13375, 13380, 32768, 35, 114, 111, 59, 32768, 8470, 112, 59, 32768, 8199, 2304, 68, 72, 97, 100, 103, 105, 108, 114, 115, 13403, 13409, 13415, 13420, 13426, 13439, 13446, 13476, 13493, 97, 115, 104, 59, 32768, 8877, 97, 114, 114, 59, 32768, 10500, 112, 59, 32896, 8781, 8402, 97, 115, 104, 59, 32768, 8876, 512, 101, 116, 13431, 13435, 59, 32896, 8805, 8402, 59, 32896, 62, 8402, 110, 102, 105, 110, 59, 32768, 10718, 768, 65, 101, 116, 13453, 13458, 13462, 114, 114, 59, 32768, 10498, 59, 32896, 8804, 8402, 512, 59, 114, 13467, 13470, 32896, 60, 8402, 105, 101, 59, 32896, 8884, 8402, 512, 65, 116, 13481, 13486, 114, 114, 59, 32768, 10499, 114, 105, 101, 59, 32896, 8885, 8402, 105, 109, 59, 32896, 8764, 8402, 768, 65, 97, 110, 13506, 13511, 13532, 114, 114, 59, 32768, 8662, 114, 512, 104, 114, 13517, 13521, 107, 59, 32768, 10531, 512, 59, 111, 13526, 13528, 32768, 8598, 119, 59, 32768, 8598, 101, 97, 114, 59, 32768, 10535, 9252, 13576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13579, 0, 13596, 13617, 13653, 13659, 13673, 13695, 13708, 0, 0, 13713, 13750, 0, 13788, 13794, 0, 13815, 13890, 13913, 13937, 13944, 59, 32768, 9416, 512, 99, 115, 13583, 13591, 117, 116, 101, 33024, 243, 59, 32768, 243, 116, 59, 32768, 8859, 512, 105, 121, 13600, 13613, 114, 512, 59, 99, 13606, 13608, 32768, 8858, 33024, 244, 59, 32768, 244, 59, 32768, 1086, 1280, 97, 98, 105, 111, 115, 13627, 13632, 13638, 13642, 13646, 115, 104, 59, 32768, 8861, 108, 97, 99, 59, 32768, 337, 118, 59, 32768, 10808, 116, 59, 32768, 8857, 111, 108, 100, 59, 32768, 10684, 108, 105, 103, 59, 32768, 339, 512, 99, 114, 13663, 13668, 105, 114, 59, 32768, 10687, 59, 32896, 55349, 56620, 1600, 13680, 0, 0, 13684, 0, 13692, 110, 59, 32768, 731, 97, 118, 101, 33024, 242, 59, 32768, 242, 59, 32768, 10689, 512, 98, 109, 13699, 13704, 97, 114, 59, 32768, 10677, 59, 32768, 937, 110, 116, 59, 32768, 8750, 1024, 97, 99, 105, 116, 13721, 13726, 13741, 13746, 114, 114, 59, 32768, 8634, 512, 105, 114, 13731, 13735, 114, 59, 32768, 10686, 111, 115, 115, 59, 32768, 10683, 110, 101, 59, 32768, 8254, 59, 32768, 10688, 768, 97, 101, 105, 13756, 13761, 13766, 99, 114, 59, 32768, 333, 103, 97, 59, 32768, 969, 768, 99, 100, 110, 13773, 13779, 13782, 114, 111, 110, 59, 32768, 959, 59, 32768, 10678, 117, 115, 59, 32768, 8854, 112, 102, 59, 32896, 55349, 56672, 768, 97, 101, 108, 13800, 13804, 13809, 114, 59, 32768, 10679, 114, 112, 59, 32768, 10681, 117, 115, 59, 32768, 8853, 1792, 59, 97, 100, 105, 111, 115, 118, 13829, 13831, 13836, 13869, 13875, 13879, 13886, 32768, 8744, 114, 114, 59, 32768, 8635, 1024, 59, 101, 102, 109, 13845, 13847, 13859, 13864, 32768, 10845, 114, 512, 59, 111, 13853, 13855, 32768, 8500, 102, 59, 32768, 8500, 33024, 170, 59, 32768, 170, 33024, 186, 59, 32768, 186, 103, 111, 102, 59, 32768, 8886, 114, 59, 32768, 10838, 108, 111, 112, 101, 59, 32768, 10839, 59, 32768, 10843, 768, 99, 108, 111, 13896, 13900, 13908, 114, 59, 32768, 8500, 97, 115, 104, 33024, 248, 59, 32768, 248, 108, 59, 32768, 8856, 105, 573, 13917, 13924, 100, 101, 33024, 245, 59, 32768, 245, 101, 115, 512, 59, 97, 13930, 13932, 32768, 8855, 115, 59, 32768, 10806, 109, 108, 33024, 246, 59, 32768, 246, 98, 97, 114, 59, 32768, 9021, 5426, 13972, 0, 14013, 0, 14017, 14053, 0, 14058, 14086, 0, 0, 14107, 14199, 0, 14202, 0, 0, 14229, 14425, 0, 14438, 114, 1024, 59, 97, 115, 116, 13981, 13983, 13997, 14009, 32768, 8741, 33280, 182, 59, 108, 13989, 13991, 32768, 182, 108, 101, 108, 59, 32768, 8741, 1082, 14003, 0, 0, 14007, 109, 59, 32768, 10995, 59, 32768, 11005, 59, 32768, 8706, 121, 59, 32768, 1087, 114, 1280, 99, 105, 109, 112, 116, 14028, 14033, 14038, 14043, 14046, 110, 116, 59, 32768, 37, 111, 100, 59, 32768, 46, 105, 108, 59, 32768, 8240, 59, 32768, 8869, 101, 110, 107, 59, 32768, 8241, 114, 59, 32896, 55349, 56621, 768, 105, 109, 111, 14064, 14074, 14080, 512, 59, 118, 14069, 14071, 32768, 966, 59, 32768, 981, 109, 97, 116, 59, 32768, 8499, 110, 101, 59, 32768, 9742, 768, 59, 116, 118, 14092, 14094, 14103, 32768, 960, 99, 104, 102, 111, 114, 107, 59, 32768, 8916, 59, 32768, 982, 512, 97, 117, 14111, 14132, 110, 512, 99, 107, 14117, 14128, 107, 512, 59, 104, 14123, 14125, 32768, 8463, 59, 32768, 8462, 118, 59, 32768, 8463, 115, 2304, 59, 97, 98, 99, 100, 101, 109, 115, 116, 14152, 14154, 14160, 14163, 14168, 14179, 14182, 14188, 14193, 32768, 43, 99, 105, 114, 59, 32768, 10787, 59, 32768, 8862, 105, 114, 59, 32768, 10786, 512, 111, 117, 14173, 14176, 59, 32768, 8724, 59, 32768, 10789, 59, 32768, 10866, 110, 33024, 177, 59, 32768, 177, 105, 109, 59, 32768, 10790, 119, 111, 59, 32768, 10791, 59, 32768, 177, 768, 105, 112, 117, 14208, 14216, 14221, 110, 116, 105, 110, 116, 59, 32768, 10773, 102, 59, 32896, 55349, 56673, 110, 100, 33024, 163, 59, 32768, 163, 2560, 59, 69, 97, 99, 101, 105, 110, 111, 115, 117, 14249, 14251, 14254, 14258, 14263, 14336, 14348, 14367, 14413, 14418, 32768, 8826, 59, 32768, 10931, 112, 59, 32768, 10935, 117, 101, 59, 32768, 8828, 512, 59, 99, 14268, 14270, 32768, 10927, 1536, 59, 97, 99, 101, 110, 115, 14283, 14285, 14293, 14302, 14306, 14331, 32768, 8826, 112, 112, 114, 111, 120, 59, 32768, 10935, 117, 114, 108, 121, 101, 113, 59, 32768, 8828, 113, 59, 32768, 10927, 768, 97, 101, 115, 14313, 14321, 14326, 112, 112, 114, 111, 120, 59, 32768, 10937, 113, 113, 59, 32768, 10933, 105, 109, 59, 32768, 8936, 105, 109, 59, 32768, 8830, 109, 101, 512, 59, 115, 14343, 14345, 32768, 8242, 59, 32768, 8473, 768, 69, 97, 115, 14355, 14358, 14362, 59, 32768, 10933, 112, 59, 32768, 10937, 105, 109, 59, 32768, 8936, 768, 100, 102, 112, 14374, 14377, 14402, 59, 32768, 8719, 768, 97, 108, 115, 14384, 14390, 14396, 108, 97, 114, 59, 32768, 9006, 105, 110, 101, 59, 32768, 8978, 117, 114, 102, 59, 32768, 8979, 512, 59, 116, 14407, 14409, 32768, 8733, 111, 59, 32768, 8733, 105, 109, 59, 32768, 8830, 114, 101, 108, 59, 32768, 8880, 512, 99, 105, 14429, 14434, 114, 59, 32896, 55349, 56517, 59, 32768, 968, 110, 99, 115, 112, 59, 32768, 8200, 1536, 102, 105, 111, 112, 115, 117, 14457, 14462, 14467, 14473, 14480, 14486, 114, 59, 32896, 55349, 56622, 110, 116, 59, 32768, 10764, 112, 102, 59, 32896, 55349, 56674, 114, 105, 109, 101, 59, 32768, 8279, 99, 114, 59, 32896, 55349, 56518, 768, 97, 101, 111, 14493, 14513, 14526, 116, 512, 101, 105, 14499, 14508, 114, 110, 105, 111, 110, 115, 59, 32768, 8461, 110, 116, 59, 32768, 10774, 115, 116, 512, 59, 101, 14520, 14522, 32768, 63, 113, 59, 32768, 8799, 116, 33024, 34, 59, 32768, 34, 5376, 65, 66, 72, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 110, 111, 112, 114, 115, 116, 117, 120, 14575, 14597, 14603, 14608, 14775, 14829, 14865, 14901, 14943, 14966, 15e3, 15139, 15159, 15176, 15182, 15236, 15261, 15267, 15309, 15352, 15360, 768, 97, 114, 116, 14582, 14587, 14591, 114, 114, 59, 32768, 8667, 114, 59, 32768, 8658, 97, 105, 108, 59, 32768, 10524, 97, 114, 114, 59, 32768, 10511, 97, 114, 59, 32768, 10596, 1792, 99, 100, 101, 110, 113, 114, 116, 14623, 14637, 14642, 14650, 14672, 14679, 14751, 512, 101, 117, 14628, 14632, 59, 32896, 8765, 817, 116, 101, 59, 32768, 341, 105, 99, 59, 32768, 8730, 109, 112, 116, 121, 118, 59, 32768, 10675, 103, 1024, 59, 100, 101, 108, 14660, 14662, 14665, 14668, 32768, 10217, 59, 32768, 10642, 59, 32768, 10661, 101, 59, 32768, 10217, 117, 111, 33024, 187, 59, 32768, 187, 114, 2816, 59, 97, 98, 99, 102, 104, 108, 112, 115, 116, 119, 14703, 14705, 14709, 14720, 14723, 14727, 14731, 14735, 14739, 14744, 14748, 32768, 8594, 112, 59, 32768, 10613, 512, 59, 102, 14714, 14716, 32768, 8677, 115, 59, 32768, 10528, 59, 32768, 10547, 115, 59, 32768, 10526, 107, 59, 32768, 8618, 112, 59, 32768, 8620, 108, 59, 32768, 10565, 105, 109, 59, 32768, 10612, 108, 59, 32768, 8611, 59, 32768, 8605, 512, 97, 105, 14756, 14761, 105, 108, 59, 32768, 10522, 111, 512, 59, 110, 14767, 14769, 32768, 8758, 97, 108, 115, 59, 32768, 8474, 768, 97, 98, 114, 14782, 14787, 14792, 114, 114, 59, 32768, 10509, 114, 107, 59, 32768, 10099, 512, 97, 107, 14797, 14809, 99, 512, 101, 107, 14803, 14806, 59, 32768, 125, 59, 32768, 93, 512, 101, 115, 14814, 14817, 59, 32768, 10636, 108, 512, 100, 117, 14823, 14826, 59, 32768, 10638, 59, 32768, 10640, 1024, 97, 101, 117, 121, 14838, 14844, 14858, 14862, 114, 111, 110, 59, 32768, 345, 512, 100, 105, 14849, 14854, 105, 108, 59, 32768, 343, 108, 59, 32768, 8969, 98, 59, 32768, 125, 59, 32768, 1088, 1024, 99, 108, 113, 115, 14874, 14878, 14885, 14897, 97, 59, 32768, 10551, 100, 104, 97, 114, 59, 32768, 10601, 117, 111, 512, 59, 114, 14892, 14894, 32768, 8221, 59, 32768, 8221, 104, 59, 32768, 8627, 768, 97, 99, 103, 14908, 14934, 14938, 108, 1024, 59, 105, 112, 115, 14918, 14920, 14925, 14931, 32768, 8476, 110, 101, 59, 32768, 8475, 97, 114, 116, 59, 32768, 8476, 59, 32768, 8477, 116, 59, 32768, 9645, 33024, 174, 59, 32768, 174, 768, 105, 108, 114, 14950, 14956, 14962, 115, 104, 116, 59, 32768, 10621, 111, 111, 114, 59, 32768, 8971, 59, 32896, 55349, 56623, 512, 97, 111, 14971, 14990, 114, 512, 100, 117, 14977, 14980, 59, 32768, 8641, 512, 59, 108, 14985, 14987, 32768, 8640, 59, 32768, 10604, 512, 59, 118, 14995, 14997, 32768, 961, 59, 32768, 1009, 768, 103, 110, 115, 15007, 15123, 15127, 104, 116, 1536, 97, 104, 108, 114, 115, 116, 15022, 15039, 15060, 15086, 15099, 15111, 114, 114, 111, 119, 512, 59, 116, 15031, 15033, 32768, 8594, 97, 105, 108, 59, 32768, 8611, 97, 114, 112, 111, 111, 110, 512, 100, 117, 15050, 15056, 111, 119, 110, 59, 32768, 8641, 112, 59, 32768, 8640, 101, 102, 116, 512, 97, 104, 15068, 15076, 114, 114, 111, 119, 115, 59, 32768, 8644, 97, 114, 112, 111, 111, 110, 115, 59, 32768, 8652, 105, 103, 104, 116, 97, 114, 114, 111, 119, 115, 59, 32768, 8649, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 32768, 8605, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 32768, 8908, 103, 59, 32768, 730, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 32768, 8787, 768, 97, 104, 109, 15146, 15151, 15156, 114, 114, 59, 32768, 8644, 97, 114, 59, 32768, 8652, 59, 32768, 8207, 111, 117, 115, 116, 512, 59, 97, 15168, 15170, 32768, 9137, 99, 104, 101, 59, 32768, 9137, 109, 105, 100, 59, 32768, 10990, 1024, 97, 98, 112, 116, 15191, 15204, 15209, 15229, 512, 110, 114, 15196, 15200, 103, 59, 32768, 10221, 114, 59, 32768, 8702, 114, 107, 59, 32768, 10215, 768, 97, 102, 108, 15216, 15220, 15224, 114, 59, 32768, 10630, 59, 32896, 55349, 56675, 117, 115, 59, 32768, 10798, 105, 109, 101, 115, 59, 32768, 10805, 512, 97, 112, 15241, 15253, 114, 512, 59, 103, 15247, 15249, 32768, 41, 116, 59, 32768, 10644, 111, 108, 105, 110, 116, 59, 32768, 10770, 97, 114, 114, 59, 32768, 8649, 1024, 97, 99, 104, 113, 15276, 15282, 15287, 15290, 113, 117, 111, 59, 32768, 8250, 114, 59, 32896, 55349, 56519, 59, 32768, 8625, 512, 98, 117, 15295, 15298, 59, 32768, 93, 111, 512, 59, 114, 15304, 15306, 32768, 8217, 59, 32768, 8217, 768, 104, 105, 114, 15316, 15322, 15328, 114, 101, 101, 59, 32768, 8908, 109, 101, 115, 59, 32768, 8906, 105, 1024, 59, 101, 102, 108, 15338, 15340, 15343, 15346, 32768, 9657, 59, 32768, 8885, 59, 32768, 9656, 116, 114, 105, 59, 32768, 10702, 108, 117, 104, 97, 114, 59, 32768, 10600, 59, 32768, 8478, 6706, 15391, 15398, 15404, 15499, 15516, 15592, 0, 15606, 15660, 0, 0, 15752, 15758, 0, 15827, 15863, 15886, 16e3, 16006, 16038, 16086, 0, 16467, 0, 0, 16506, 99, 117, 116, 101, 59, 32768, 347, 113, 117, 111, 59, 32768, 8218, 2560, 59, 69, 97, 99, 101, 105, 110, 112, 115, 121, 15424, 15426, 15429, 15441, 15446, 15458, 15463, 15482, 15490, 15495, 32768, 8827, 59, 32768, 10932, 833, 15434, 0, 15437, 59, 32768, 10936, 111, 110, 59, 32768, 353, 117, 101, 59, 32768, 8829, 512, 59, 100, 15451, 15453, 32768, 10928, 105, 108, 59, 32768, 351, 114, 99, 59, 32768, 349, 768, 69, 97, 115, 15470, 15473, 15477, 59, 32768, 10934, 112, 59, 32768, 10938, 105, 109, 59, 32768, 8937, 111, 108, 105, 110, 116, 59, 32768, 10771, 105, 109, 59, 32768, 8831, 59, 32768, 1089, 111, 116, 768, 59, 98, 101, 15507, 15509, 15512, 32768, 8901, 59, 32768, 8865, 59, 32768, 10854, 1792, 65, 97, 99, 109, 115, 116, 120, 15530, 15535, 15556, 15562, 15566, 15572, 15587, 114, 114, 59, 32768, 8664, 114, 512, 104, 114, 15541, 15545, 107, 59, 32768, 10533, 512, 59, 111, 15550, 15552, 32768, 8600, 119, 59, 32768, 8600, 116, 33024, 167, 59, 32768, 167, 105, 59, 32768, 59, 119, 97, 114, 59, 32768, 10537, 109, 512, 105, 110, 15578, 15584, 110, 117, 115, 59, 32768, 8726, 59, 32768, 8726, 116, 59, 32768, 10038, 114, 512, 59, 111, 15597, 15600, 32896, 55349, 56624, 119, 110, 59, 32768, 8994, 1024, 97, 99, 111, 121, 15614, 15619, 15632, 15654, 114, 112, 59, 32768, 9839, 512, 104, 121, 15624, 15629, 99, 121, 59, 32768, 1097, 59, 32768, 1096, 114, 116, 1086, 15640, 0, 0, 15645, 105, 100, 59, 32768, 8739, 97, 114, 97, 108, 108, 101, 108, 59, 32768, 8741, 33024, 173, 59, 32768, 173, 512, 103, 109, 15664, 15681, 109, 97, 768, 59, 102, 118, 15673, 15675, 15678, 32768, 963, 59, 32768, 962, 59, 32768, 962, 2048, 59, 100, 101, 103, 108, 110, 112, 114, 15698, 15700, 15705, 15715, 15725, 15735, 15739, 15745, 32768, 8764, 111, 116, 59, 32768, 10858, 512, 59, 113, 15710, 15712, 32768, 8771, 59, 32768, 8771, 512, 59, 69, 15720, 15722, 32768, 10910, 59, 32768, 10912, 512, 59, 69, 15730, 15732, 32768, 10909, 59, 32768, 10911, 101, 59, 32768, 8774, 108, 117, 115, 59, 32768, 10788, 97, 114, 114, 59, 32768, 10610, 97, 114, 114, 59, 32768, 8592, 1024, 97, 101, 105, 116, 15766, 15788, 15796, 15808, 512, 108, 115, 15771, 15783, 108, 115, 101, 116, 109, 105, 110, 117, 115, 59, 32768, 8726, 104, 112, 59, 32768, 10803, 112, 97, 114, 115, 108, 59, 32768, 10724, 512, 100, 108, 15801, 15804, 59, 32768, 8739, 101, 59, 32768, 8995, 512, 59, 101, 15813, 15815, 32768, 10922, 512, 59, 115, 15820, 15822, 32768, 10924, 59, 32896, 10924, 65024, 768, 102, 108, 112, 15833, 15839, 15857, 116, 99, 121, 59, 32768, 1100, 512, 59, 98, 15844, 15846, 32768, 47, 512, 59, 97, 15851, 15853, 32768, 10692, 114, 59, 32768, 9023, 102, 59, 32896, 55349, 56676, 97, 512, 100, 114, 15868, 15882, 101, 115, 512, 59, 117, 15875, 15877, 32768, 9824, 105, 116, 59, 32768, 9824, 59, 32768, 8741, 768, 99, 115, 117, 15892, 15921, 15977, 512, 97, 117, 15897, 15909, 112, 512, 59, 115, 15903, 15905, 32768, 8851, 59, 32896, 8851, 65024, 112, 512, 59, 115, 15915, 15917, 32768, 8852, 59, 32896, 8852, 65024, 117, 512, 98, 112, 15927, 15952, 768, 59, 101, 115, 15934, 15936, 15939, 32768, 8847, 59, 32768, 8849, 101, 116, 512, 59, 101, 15946, 15948, 32768, 8847, 113, 59, 32768, 8849, 768, 59, 101, 115, 15959, 15961, 15964, 32768, 8848, 59, 32768, 8850, 101, 116, 512, 59, 101, 15971, 15973, 32768, 8848, 113, 59, 32768, 8850, 768, 59, 97, 102, 15984, 15986, 15996, 32768, 9633, 114, 566, 15991, 15994, 59, 32768, 9633, 59, 32768, 9642, 59, 32768, 9642, 97, 114, 114, 59, 32768, 8594, 1024, 99, 101, 109, 116, 16014, 16019, 16025, 16031, 114, 59, 32896, 55349, 56520, 116, 109, 110, 59, 32768, 8726, 105, 108, 101, 59, 32768, 8995, 97, 114, 102, 59, 32768, 8902, 512, 97, 114, 16042, 16053, 114, 512, 59, 102, 16048, 16050, 32768, 9734, 59, 32768, 9733, 512, 97, 110, 16058, 16081, 105, 103, 104, 116, 512, 101, 112, 16067, 16076, 112, 115, 105, 108, 111, 110, 59, 32768, 1013, 104, 105, 59, 32768, 981, 115, 59, 32768, 175, 1280, 98, 99, 109, 110, 112, 16096, 16221, 16288, 16291, 16295, 2304, 59, 69, 100, 101, 109, 110, 112, 114, 115, 16115, 16117, 16120, 16125, 16137, 16143, 16154, 16160, 16166, 32768, 8834, 59, 32768, 10949, 111, 116, 59, 32768, 10941, 512, 59, 100, 16130, 16132, 32768, 8838, 111, 116, 59, 32768, 10947, 117, 108, 116, 59, 32768, 10945, 512, 69, 101, 16148, 16151, 59, 32768, 10955, 59, 32768, 8842, 108, 117, 115, 59, 32768, 10943, 97, 114, 114, 59, 32768, 10617, 768, 101, 105, 117, 16173, 16206, 16210, 116, 768, 59, 101, 110, 16181, 16183, 16194, 32768, 8834, 113, 512, 59, 113, 16189, 16191, 32768, 8838, 59, 32768, 10949, 101, 113, 512, 59, 113, 16201, 16203, 32768, 8842, 59, 32768, 10955, 109, 59, 32768, 10951, 512, 98, 112, 16215, 16218, 59, 32768, 10965, 59, 32768, 10963, 99, 1536, 59, 97, 99, 101, 110, 115, 16235, 16237, 16245, 16254, 16258, 16283, 32768, 8827, 112, 112, 114, 111, 120, 59, 32768, 10936, 117, 114, 108, 121, 101, 113, 59, 32768, 8829, 113, 59, 32768, 10928, 768, 97, 101, 115, 16265, 16273, 16278, 112, 112, 114, 111, 120, 59, 32768, 10938, 113, 113, 59, 32768, 10934, 105, 109, 59, 32768, 8937, 105, 109, 59, 32768, 8831, 59, 32768, 8721, 103, 59, 32768, 9834, 3328, 49, 50, 51, 59, 69, 100, 101, 104, 108, 109, 110, 112, 115, 16322, 16327, 16332, 16337, 16339, 16342, 16356, 16368, 16382, 16388, 16394, 16405, 16411, 33024, 185, 59, 32768, 185, 33024, 178, 59, 32768, 178, 33024, 179, 59, 32768, 179, 32768, 8835, 59, 32768, 10950, 512, 111, 115, 16347, 16351, 116, 59, 32768, 10942, 117, 98, 59, 32768, 10968, 512, 59, 100, 16361, 16363, 32768, 8839, 111, 116, 59, 32768, 10948, 115, 512, 111, 117, 16374, 16378, 108, 59, 32768, 10185, 98, 59, 32768, 10967, 97, 114, 114, 59, 32768, 10619, 117, 108, 116, 59, 32768, 10946, 512, 69, 101, 16399, 16402, 59, 32768, 10956, 59, 32768, 8843, 108, 117, 115, 59, 32768, 10944, 768, 101, 105, 117, 16418, 16451, 16455, 116, 768, 59, 101, 110, 16426, 16428, 16439, 32768, 8835, 113, 512, 59, 113, 16434, 16436, 32768, 8839, 59, 32768, 10950, 101, 113, 512, 59, 113, 16446, 16448, 32768, 8843, 59, 32768, 10956, 109, 59, 32768, 10952, 512, 98, 112, 16460, 16463, 59, 32768, 10964, 59, 32768, 10966, 768, 65, 97, 110, 16473, 16478, 16499, 114, 114, 59, 32768, 8665, 114, 512, 104, 114, 16484, 16488, 107, 59, 32768, 10534, 512, 59, 111, 16493, 16495, 32768, 8601, 119, 59, 32768, 8601, 119, 97, 114, 59, 32768, 10538, 108, 105, 103, 33024, 223, 59, 32768, 223, 5938, 16538, 16552, 16557, 16579, 16584, 16591, 0, 16596, 16692, 0, 0, 0, 0, 0, 16731, 16780, 0, 16787, 16908, 0, 0, 0, 16938, 1091, 16543, 0, 0, 16549, 103, 101, 116, 59, 32768, 8982, 59, 32768, 964, 114, 107, 59, 32768, 9140, 768, 97, 101, 121, 16563, 16569, 16575, 114, 111, 110, 59, 32768, 357, 100, 105, 108, 59, 32768, 355, 59, 32768, 1090, 111, 116, 59, 32768, 8411, 108, 114, 101, 99, 59, 32768, 8981, 114, 59, 32896, 55349, 56625, 1024, 101, 105, 107, 111, 16604, 16641, 16670, 16684, 835, 16609, 0, 16624, 101, 512, 52, 102, 16614, 16617, 59, 32768, 8756, 111, 114, 101, 59, 32768, 8756, 97, 768, 59, 115, 118, 16631, 16633, 16638, 32768, 952, 121, 109, 59, 32768, 977, 59, 32768, 977, 512, 99, 110, 16646, 16665, 107, 512, 97, 115, 16652, 16660, 112, 112, 114, 111, 120, 59, 32768, 8776, 105, 109, 59, 32768, 8764, 115, 112, 59, 32768, 8201, 512, 97, 115, 16675, 16679, 112, 59, 32768, 8776, 105, 109, 59, 32768, 8764, 114, 110, 33024, 254, 59, 32768, 254, 829, 16696, 16701, 16727, 100, 101, 59, 32768, 732, 101, 115, 33536, 215, 59, 98, 100, 16710, 16712, 16723, 32768, 215, 512, 59, 97, 16717, 16719, 32768, 8864, 114, 59, 32768, 10801, 59, 32768, 10800, 116, 59, 32768, 8749, 768, 101, 112, 115, 16737, 16741, 16775, 97, 59, 32768, 10536, 1024, 59, 98, 99, 102, 16750, 16752, 16757, 16762, 32768, 8868, 111, 116, 59, 32768, 9014, 105, 114, 59, 32768, 10993, 512, 59, 111, 16767, 16770, 32896, 55349, 56677, 114, 107, 59, 32768, 10970, 97, 59, 32768, 10537, 114, 105, 109, 101, 59, 32768, 8244, 768, 97, 105, 112, 16793, 16798, 16899, 100, 101, 59, 32768, 8482, 1792, 97, 100, 101, 109, 112, 115, 116, 16813, 16868, 16873, 16876, 16883, 16889, 16893, 110, 103, 108, 101, 1280, 59, 100, 108, 113, 114, 16828, 16830, 16836, 16850, 16853, 32768, 9653, 111, 119, 110, 59, 32768, 9663, 101, 102, 116, 512, 59, 101, 16844, 16846, 32768, 9667, 113, 59, 32768, 8884, 59, 32768, 8796, 105, 103, 104, 116, 512, 59, 101, 16862, 16864, 32768, 9657, 113, 59, 32768, 8885, 111, 116, 59, 32768, 9708, 59, 32768, 8796, 105, 110, 117, 115, 59, 32768, 10810, 108, 117, 115, 59, 32768, 10809, 98, 59, 32768, 10701, 105, 109, 101, 59, 32768, 10811, 101, 122, 105, 117, 109, 59, 32768, 9186, 768, 99, 104, 116, 16914, 16926, 16931, 512, 114, 121, 16919, 16923, 59, 32896, 55349, 56521, 59, 32768, 1094, 99, 121, 59, 32768, 1115, 114, 111, 107, 59, 32768, 359, 512, 105, 111, 16942, 16947, 120, 116, 59, 32768, 8812, 104, 101, 97, 100, 512, 108, 114, 16956, 16967, 101, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8606, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8608, 4608, 65, 72, 97, 98, 99, 100, 102, 103, 104, 108, 109, 111, 112, 114, 115, 116, 117, 119, 17016, 17021, 17026, 17043, 17057, 17072, 17095, 17110, 17119, 17139, 17172, 17187, 17202, 17290, 17330, 17336, 17365, 17381, 114, 114, 59, 32768, 8657, 97, 114, 59, 32768, 10595, 512, 99, 114, 17031, 17039, 117, 116, 101, 33024, 250, 59, 32768, 250, 114, 59, 32768, 8593, 114, 820, 17049, 0, 17053, 121, 59, 32768, 1118, 118, 101, 59, 32768, 365, 512, 105, 121, 17062, 17069, 114, 99, 33024, 251, 59, 32768, 251, 59, 32768, 1091, 768, 97, 98, 104, 17079, 17084, 17090, 114, 114, 59, 32768, 8645, 108, 97, 99, 59, 32768, 369, 97, 114, 59, 32768, 10606, 512, 105, 114, 17100, 17106, 115, 104, 116, 59, 32768, 10622, 59, 32896, 55349, 56626, 114, 97, 118, 101, 33024, 249, 59, 32768, 249, 562, 17123, 17135, 114, 512, 108, 114, 17128, 17131, 59, 32768, 8639, 59, 32768, 8638, 108, 107, 59, 32768, 9600, 512, 99, 116, 17144, 17167, 1088, 17150, 0, 0, 17163, 114, 110, 512, 59, 101, 17156, 17158, 32768, 8988, 114, 59, 32768, 8988, 111, 112, 59, 32768, 8975, 114, 105, 59, 32768, 9720, 512, 97, 108, 17177, 17182, 99, 114, 59, 32768, 363, 33024, 168, 59, 32768, 168, 512, 103, 112, 17192, 17197, 111, 110, 59, 32768, 371, 102, 59, 32896, 55349, 56678, 1536, 97, 100, 104, 108, 115, 117, 17215, 17222, 17233, 17257, 17262, 17280, 114, 114, 111, 119, 59, 32768, 8593, 111, 119, 110, 97, 114, 114, 111, 119, 59, 32768, 8597, 97, 114, 112, 111, 111, 110, 512, 108, 114, 17244, 17250, 101, 102, 116, 59, 32768, 8639, 105, 103, 104, 116, 59, 32768, 8638, 117, 115, 59, 32768, 8846, 105, 768, 59, 104, 108, 17270, 17272, 17275, 32768, 965, 59, 32768, 978, 111, 110, 59, 32768, 965, 112, 97, 114, 114, 111, 119, 115, 59, 32768, 8648, 768, 99, 105, 116, 17297, 17320, 17325, 1088, 17303, 0, 0, 17316, 114, 110, 512, 59, 101, 17309, 17311, 32768, 8989, 114, 59, 32768, 8989, 111, 112, 59, 32768, 8974, 110, 103, 59, 32768, 367, 114, 105, 59, 32768, 9721, 99, 114, 59, 32896, 55349, 56522, 768, 100, 105, 114, 17343, 17348, 17354, 111, 116, 59, 32768, 8944, 108, 100, 101, 59, 32768, 361, 105, 512, 59, 102, 17360, 17362, 32768, 9653, 59, 32768, 9652, 512, 97, 109, 17370, 17375, 114, 114, 59, 32768, 8648, 108, 33024, 252, 59, 32768, 252, 97, 110, 103, 108, 101, 59, 32768, 10663, 3840, 65, 66, 68, 97, 99, 100, 101, 102, 108, 110, 111, 112, 114, 115, 122, 17420, 17425, 17437, 17443, 17613, 17617, 17623, 17667, 17672, 17678, 17693, 17699, 17705, 17711, 17754, 114, 114, 59, 32768, 8661, 97, 114, 512, 59, 118, 17432, 17434, 32768, 10984, 59, 32768, 10985, 97, 115, 104, 59, 32768, 8872, 512, 110, 114, 17448, 17454, 103, 114, 116, 59, 32768, 10652, 1792, 101, 107, 110, 112, 114, 115, 116, 17469, 17478, 17485, 17494, 17515, 17526, 17578, 112, 115, 105, 108, 111, 110, 59, 32768, 1013, 97, 112, 112, 97, 59, 32768, 1008, 111, 116, 104, 105, 110, 103, 59, 32768, 8709, 768, 104, 105, 114, 17501, 17505, 17508, 105, 59, 32768, 981, 59, 32768, 982, 111, 112, 116, 111, 59, 32768, 8733, 512, 59, 104, 17520, 17522, 32768, 8597, 111, 59, 32768, 1009, 512, 105, 117, 17531, 17537, 103, 109, 97, 59, 32768, 962, 512, 98, 112, 17542, 17560, 115, 101, 116, 110, 101, 113, 512, 59, 113, 17553, 17556, 32896, 8842, 65024, 59, 32896, 10955, 65024, 115, 101, 116, 110, 101, 113, 512, 59, 113, 17571, 17574, 32896, 8843, 65024, 59, 32896, 10956, 65024, 512, 104, 114, 17583, 17589, 101, 116, 97, 59, 32768, 977, 105, 97, 110, 103, 108, 101, 512, 108, 114, 17600, 17606, 101, 102, 116, 59, 32768, 8882, 105, 103, 104, 116, 59, 32768, 8883, 121, 59, 32768, 1074, 97, 115, 104, 59, 32768, 8866, 768, 101, 108, 114, 17630, 17648, 17654, 768, 59, 98, 101, 17637, 17639, 17644, 32768, 8744, 97, 114, 59, 32768, 8891, 113, 59, 32768, 8794, 108, 105, 112, 59, 32768, 8942, 512, 98, 116, 17659, 17664, 97, 114, 59, 32768, 124, 59, 32768, 124, 114, 59, 32896, 55349, 56627, 116, 114, 105, 59, 32768, 8882, 115, 117, 512, 98, 112, 17685, 17689, 59, 32896, 8834, 8402, 59, 32896, 8835, 8402, 112, 102, 59, 32896, 55349, 56679, 114, 111, 112, 59, 32768, 8733, 116, 114, 105, 59, 32768, 8883, 512, 99, 117, 17716, 17721, 114, 59, 32896, 55349, 56523, 512, 98, 112, 17726, 17740, 110, 512, 69, 101, 17732, 17736, 59, 32896, 10955, 65024, 59, 32896, 8842, 65024, 110, 512, 69, 101, 17746, 17750, 59, 32896, 10956, 65024, 59, 32896, 8843, 65024, 105, 103, 122, 97, 103, 59, 32768, 10650, 1792, 99, 101, 102, 111, 112, 114, 115, 17777, 17783, 17815, 17820, 17826, 17829, 17842, 105, 114, 99, 59, 32768, 373, 512, 100, 105, 17788, 17809, 512, 98, 103, 17793, 17798, 97, 114, 59, 32768, 10847, 101, 512, 59, 113, 17804, 17806, 32768, 8743, 59, 32768, 8793, 101, 114, 112, 59, 32768, 8472, 114, 59, 32896, 55349, 56628, 112, 102, 59, 32896, 55349, 56680, 59, 32768, 8472, 512, 59, 101, 17834, 17836, 32768, 8768, 97, 116, 104, 59, 32768, 8768, 99, 114, 59, 32896, 55349, 56524, 5428, 17871, 17891, 0, 17897, 0, 17902, 17917, 0, 0, 17920, 17935, 17940, 17945, 0, 0, 17977, 17992, 0, 18008, 18024, 18029, 768, 97, 105, 117, 17877, 17881, 17886, 112, 59, 32768, 8898, 114, 99, 59, 32768, 9711, 112, 59, 32768, 8899, 116, 114, 105, 59, 32768, 9661, 114, 59, 32896, 55349, 56629, 512, 65, 97, 17906, 17911, 114, 114, 59, 32768, 10234, 114, 114, 59, 32768, 10231, 59, 32768, 958, 512, 65, 97, 17924, 17929, 114, 114, 59, 32768, 10232, 114, 114, 59, 32768, 10229, 97, 112, 59, 32768, 10236, 105, 115, 59, 32768, 8955, 768, 100, 112, 116, 17951, 17956, 17970, 111, 116, 59, 32768, 10752, 512, 102, 108, 17961, 17965, 59, 32896, 55349, 56681, 117, 115, 59, 32768, 10753, 105, 109, 101, 59, 32768, 10754, 512, 65, 97, 17981, 17986, 114, 114, 59, 32768, 10233, 114, 114, 59, 32768, 10230, 512, 99, 113, 17996, 18001, 114, 59, 32896, 55349, 56525, 99, 117, 112, 59, 32768, 10758, 512, 112, 116, 18012, 18018, 108, 117, 115, 59, 32768, 10756, 114, 105, 59, 32768, 9651, 101, 101, 59, 32768, 8897, 101, 100, 103, 101, 59, 32768, 8896, 2048, 97, 99, 101, 102, 105, 111, 115, 117, 18052, 18068, 18081, 18087, 18092, 18097, 18103, 18109, 99, 512, 117, 121, 18058, 18065, 116, 101, 33024, 253, 59, 32768, 253, 59, 32768, 1103, 512, 105, 121, 18073, 18078, 114, 99, 59, 32768, 375, 59, 32768, 1099, 110, 33024, 165, 59, 32768, 165, 114, 59, 32896, 55349, 56630, 99, 121, 59, 32768, 1111, 112, 102, 59, 32896, 55349, 56682, 99, 114, 59, 32896, 55349, 56526, 512, 99, 109, 18114, 18118, 121, 59, 32768, 1102, 108, 33024, 255, 59, 32768, 255, 2560, 97, 99, 100, 101, 102, 104, 105, 111, 115, 119, 18145, 18152, 18166, 18171, 18186, 18191, 18196, 18204, 18210, 18216, 99, 117, 116, 101, 59, 32768, 378, 512, 97, 121, 18157, 18163, 114, 111, 110, 59, 32768, 382, 59, 32768, 1079, 111, 116, 59, 32768, 380, 512, 101, 116, 18176, 18182, 116, 114, 102, 59, 32768, 8488, 97, 59, 32768, 950, 114, 59, 32896, 55349, 56631, 99, 121, 59, 32768, 1078, 103, 114, 97, 114, 114, 59, 32768, 8669, 112, 102, 59, 32896, 55349, 56683, 99, 114, 59, 32896, 55349, 56527, 512, 106, 110, 18221, 18224, 59, 32768, 8205, 106, 59, 32768, 8204]);
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/entities/lib/generated/decode-data-xml.js
|
|
var require_decode_data_xml = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/entities/lib/generated/decode-data-xml.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = new Uint16Array([1024, 97, 103, 108, 113, 9, 23, 27, 31, 1086, 15, 0, 0, 19, 112, 59, 32768, 38, 111, 115, 59, 32768, 39, 116, 59, 32768, 62, 116, 59, 32768, 60, 117, 111, 116, 59, 32768, 34]);
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/entities/lib/decode.js
|
|
var require_decode = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/entities/lib/decode.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTML = exports.determineBranch = exports.JUMP_OFFSET_BASE = exports.BinTrieFlags = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0;
|
|
var decode_data_html_1 = __importDefault(require_decode_data_html());
|
|
exports.htmlDecodeTree = decode_data_html_1.default;
|
|
var decode_data_xml_1 = __importDefault(require_decode_data_xml());
|
|
exports.xmlDecodeTree = decode_data_xml_1.default;
|
|
var decode_codepoint_1 = __importDefault(require_decode_codepoint());
|
|
var BinTrieFlags;
|
|
(function(BinTrieFlags2) {
|
|
BinTrieFlags2[BinTrieFlags2["HAS_VALUE"] = 32768] = "HAS_VALUE";
|
|
BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 32512] = "BRANCH_LENGTH";
|
|
BinTrieFlags2[BinTrieFlags2["MULTI_BYTE"] = 128] = "MULTI_BYTE";
|
|
BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
|
})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {}));
|
|
exports.JUMP_OFFSET_BASE = 48 - 1;
|
|
function getDecoder(decodeTree) {
|
|
return function decodeHTMLBinary(str, strict) {
|
|
var ret = "";
|
|
var lastIdx = 0;
|
|
var strIdx = 0;
|
|
while ((strIdx = str.indexOf("&", strIdx)) >= 0) {
|
|
ret += str.slice(lastIdx, strIdx);
|
|
lastIdx = strIdx;
|
|
strIdx += 1;
|
|
if (str.charCodeAt(strIdx) === 35) {
|
|
var start = strIdx + 1;
|
|
var base = 10;
|
|
var cp = str.charCodeAt(start);
|
|
if ((cp | 32) === 120) {
|
|
base = 16;
|
|
strIdx += 1;
|
|
start += 1;
|
|
}
|
|
while ((cp = str.charCodeAt(++strIdx)) >= 48 && cp <= 57 || base === 16 && (cp | 32) >= 97 && (cp | 32) <= 102)
|
|
;
|
|
if (start !== strIdx) {
|
|
var entity = str.substring(start, strIdx);
|
|
var parsed = parseInt(entity, base);
|
|
if (str.charCodeAt(strIdx) === 59) {
|
|
strIdx += 1;
|
|
} else if (strict) {
|
|
continue;
|
|
}
|
|
ret += decode_codepoint_1.default(parsed);
|
|
lastIdx = strIdx;
|
|
}
|
|
continue;
|
|
}
|
|
var result = null;
|
|
var excess = 1;
|
|
var treeIdx = 0;
|
|
var current = decodeTree[treeIdx];
|
|
for (; strIdx < str.length; strIdx++, excess++) {
|
|
treeIdx = determineBranch(decodeTree, current, treeIdx + 1, str.charCodeAt(strIdx));
|
|
if (treeIdx < 0)
|
|
break;
|
|
current = decodeTree[treeIdx];
|
|
if (current & BinTrieFlags.HAS_VALUE) {
|
|
if (strict && str.charCodeAt(strIdx) !== 59) {
|
|
treeIdx += 1;
|
|
} else {
|
|
result = current & BinTrieFlags.MULTI_BYTE ? String.fromCharCode(decodeTree[++treeIdx], decodeTree[++treeIdx]) : String.fromCharCode(decodeTree[++treeIdx]);
|
|
excess = 0;
|
|
}
|
|
}
|
|
}
|
|
if (result != null) {
|
|
ret += result;
|
|
lastIdx = strIdx - excess + 1;
|
|
}
|
|
}
|
|
return ret + str.slice(lastIdx);
|
|
};
|
|
}
|
|
function determineBranch(decodeTree, current, nodeIdx, char) {
|
|
if (current <= 128) {
|
|
return char === current ? nodeIdx : -1;
|
|
}
|
|
var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 8;
|
|
if (branchCount === 0) {
|
|
return -1;
|
|
}
|
|
if (branchCount === 1) {
|
|
return char === decodeTree[nodeIdx] ? nodeIdx + 1 : -1;
|
|
}
|
|
var jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
|
if (jumpOffset) {
|
|
var value = char - exports.JUMP_OFFSET_BASE - jumpOffset;
|
|
return value < 0 || value > branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
|
|
}
|
|
var lo = nodeIdx;
|
|
var hi = lo + branchCount - 1;
|
|
while (lo <= hi) {
|
|
var mid = lo + hi >>> 1;
|
|
var midVal = decodeTree[mid];
|
|
if (midVal < char) {
|
|
lo = mid + 1;
|
|
} else if (midVal > char) {
|
|
hi = mid - 1;
|
|
} else {
|
|
return decodeTree[mid + branchCount];
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
exports.determineBranch = determineBranch;
|
|
var htmlDecoder = getDecoder(decode_data_html_1.default);
|
|
var xmlDecoder = getDecoder(decode_data_xml_1.default);
|
|
function decodeHTML(str) {
|
|
return htmlDecoder(str, false);
|
|
}
|
|
exports.decodeHTML = decodeHTML;
|
|
function decodeHTMLStrict(str) {
|
|
return htmlDecoder(str, true);
|
|
}
|
|
exports.decodeHTMLStrict = decodeHTMLStrict;
|
|
function decodeXML(str) {
|
|
return xmlDecoder(str, true);
|
|
}
|
|
exports.decodeXML = decodeXML;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/htmlparser2/lib/Tokenizer.js
|
|
var require_Tokenizer = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/htmlparser2/lib/Tokenizer.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var decode_codepoint_1 = __importDefault(require_decode_codepoint());
|
|
var decode_1 = require_decode();
|
|
function isWhitespace(c) {
|
|
return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
|
|
}
|
|
function isEndOfTagSection(c) {
|
|
return c === 47 || c === 62 || isWhitespace(c);
|
|
}
|
|
function isNumber2(c) {
|
|
return c >= 48 && c <= 57;
|
|
}
|
|
function isASCIIAlpha(c) {
|
|
return c >= 97 && c <= 122 || c >= 65 && c <= 90;
|
|
}
|
|
var Sequences = {
|
|
Cdata: new Uint16Array([67, 68, 65, 84, 65, 91]),
|
|
CdataEnd: new Uint16Array([93, 93, 62]),
|
|
CommentEnd: new Uint16Array([45, 45, 62]),
|
|
ScriptEnd: new Uint16Array([
|
|
60,
|
|
47,
|
|
115,
|
|
99,
|
|
114,
|
|
105,
|
|
112,
|
|
116
|
|
]),
|
|
StyleEnd: new Uint16Array([60, 47, 115, 116, 121, 108, 101]),
|
|
TitleEnd: new Uint16Array([60, 47, 116, 105, 116, 108, 101])
|
|
};
|
|
var Tokenizer = function() {
|
|
function Tokenizer2(_a, cbs) {
|
|
var _b = _a.xmlMode, xmlMode = _b === void 0 ? false : _b, _c = _a.decodeEntities, decodeEntities = _c === void 0 ? true : _c;
|
|
this.cbs = cbs;
|
|
this._state = 1;
|
|
this.buffer = "";
|
|
this.sectionStart = 0;
|
|
this._index = 0;
|
|
this.bufferOffset = 0;
|
|
this.baseState = 1;
|
|
this.isSpecial = false;
|
|
this.running = true;
|
|
this.ended = false;
|
|
this.sequenceIndex = 0;
|
|
this.trieIndex = 0;
|
|
this.trieCurrent = 0;
|
|
this.trieResult = null;
|
|
this.entityExcess = 0;
|
|
this.xmlMode = xmlMode;
|
|
this.decodeEntities = decodeEntities;
|
|
this.entityTrie = xmlMode ? decode_1.xmlDecodeTree : decode_1.htmlDecodeTree;
|
|
}
|
|
Tokenizer2.prototype.reset = function() {
|
|
this._state = 1;
|
|
this.buffer = "";
|
|
this.sectionStart = 0;
|
|
this._index = 0;
|
|
this.bufferOffset = 0;
|
|
this.baseState = 1;
|
|
this.currentSequence = void 0;
|
|
this.running = true;
|
|
this.ended = false;
|
|
};
|
|
Tokenizer2.prototype.write = function(chunk) {
|
|
if (this.ended)
|
|
return this.cbs.onerror(Error(".write() after done!"));
|
|
this.buffer += chunk;
|
|
this.parse();
|
|
};
|
|
Tokenizer2.prototype.end = function(chunk) {
|
|
if (this.ended)
|
|
return this.cbs.onerror(Error(".end() after done!"));
|
|
if (chunk)
|
|
this.write(chunk);
|
|
this.ended = true;
|
|
if (this.running)
|
|
this.finish();
|
|
};
|
|
Tokenizer2.prototype.pause = function() {
|
|
this.running = false;
|
|
};
|
|
Tokenizer2.prototype.resume = function() {
|
|
this.running = true;
|
|
if (this._index < this.buffer.length) {
|
|
this.parse();
|
|
}
|
|
if (this.ended) {
|
|
this.finish();
|
|
}
|
|
};
|
|
Tokenizer2.prototype.getAbsoluteSectionStart = function() {
|
|
return this.sectionStart + this.bufferOffset;
|
|
};
|
|
Tokenizer2.prototype.getAbsoluteIndex = function() {
|
|
return this.bufferOffset + this._index;
|
|
};
|
|
Tokenizer2.prototype.stateText = function(c) {
|
|
if (c === 60 || !this.decodeEntities && this.fastForwardTo(60)) {
|
|
if (this._index > this.sectionStart) {
|
|
this.cbs.ontext(this.getSection());
|
|
}
|
|
this._state = 2;
|
|
this.sectionStart = this._index;
|
|
} else if (this.decodeEntities && c === 38) {
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateSpecialStartSequence = function(c) {
|
|
var isEnd = this.sequenceIndex === this.currentSequence.length;
|
|
var isMatch = isEnd ? isEndOfTagSection(c) : (c | 32) === this.currentSequence[this.sequenceIndex];
|
|
if (!isMatch) {
|
|
this.isSpecial = false;
|
|
} else if (!isEnd) {
|
|
this.sequenceIndex++;
|
|
return;
|
|
}
|
|
this.sequenceIndex = 0;
|
|
this._state = 3;
|
|
this.stateInTagName(c);
|
|
};
|
|
Tokenizer2.prototype.stateInSpecialTag = function(c) {
|
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
if (c === 62 || isWhitespace(c)) {
|
|
var endOfText = this._index - this.currentSequence.length;
|
|
if (this.sectionStart < endOfText) {
|
|
var actualIndex = this._index;
|
|
this._index = endOfText;
|
|
this.cbs.ontext(this.getSection());
|
|
this._index = actualIndex;
|
|
}
|
|
this.isSpecial = false;
|
|
this.sectionStart = endOfText + 2;
|
|
this.stateInClosingTagName(c);
|
|
return;
|
|
}
|
|
this.sequenceIndex = 0;
|
|
}
|
|
if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
|
|
this.sequenceIndex += 1;
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.currentSequence === Sequences.TitleEnd) {
|
|
if (this.decodeEntities && c === 38) {
|
|
this._state = 25;
|
|
}
|
|
} else if (this.fastForwardTo(60)) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = Number(c === 60);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateCDATASequence = function(c) {
|
|
if (c === Sequences.Cdata[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === Sequences.Cdata.length) {
|
|
this._state = 21;
|
|
this.currentSequence = Sequences.CdataEnd;
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = 0;
|
|
this._state = 16;
|
|
this.stateInDeclaration(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.fastForwardTo = function(c) {
|
|
while (++this._index < this.buffer.length) {
|
|
if (this.buffer.charCodeAt(this._index) === c) {
|
|
return true;
|
|
}
|
|
}
|
|
this._index = this.buffer.length - 1;
|
|
return false;
|
|
};
|
|
Tokenizer2.prototype.stateInCommentLike = function(c) {
|
|
if (c === this.currentSequence[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === this.currentSequence.length) {
|
|
var section = this.buffer.slice(this.sectionStart, this._index - 2);
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
this.cbs.oncdata(section);
|
|
} else {
|
|
this.cbs.oncomment(section);
|
|
}
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this._index + 1;
|
|
this._state = 1;
|
|
}
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.fastForwardTo(this.currentSequence[0])) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
|
|
this.sequenceIndex = 0;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.isTagStartChar = function(c) {
|
|
return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
|
|
};
|
|
Tokenizer2.prototype.startSpecial = function(sequence, offset) {
|
|
this.isSpecial = true;
|
|
this.currentSequence = sequence;
|
|
this.sequenceIndex = offset;
|
|
this._state = 23;
|
|
};
|
|
Tokenizer2.prototype.stateBeforeTagName = function(c) {
|
|
if (c === 33) {
|
|
this._state = 15;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c === 63) {
|
|
this._state = 17;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (this.isTagStartChar(c)) {
|
|
var lower = c | 32;
|
|
this.sectionStart = this._index;
|
|
if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {
|
|
this.startSpecial(Sequences.TitleEnd, 3);
|
|
} else {
|
|
this._state = !this.xmlMode && lower === Sequences.ScriptEnd[2] ? 22 : 3;
|
|
}
|
|
} else if (c === 47) {
|
|
this._state = 5;
|
|
} else {
|
|
this._state = 1;
|
|
this.stateText(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInTagName = function(c) {
|
|
if (isEndOfTagSection(c)) {
|
|
this.cbs.onopentagname(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeClosingTagName = function(c) {
|
|
if (isWhitespace(c)) {
|
|
} else if (c === 62) {
|
|
this._state = 1;
|
|
} else {
|
|
this._state = this.isTagStartChar(c) ? 6 : 20;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInClosingTagName = function(c) {
|
|
if (c === 62 || isWhitespace(c)) {
|
|
this.cbs.onclosetag(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 7;
|
|
this.stateAfterClosingTagName(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateAfterClosingTagName = function(c) {
|
|
if (c === 62 || this.fastForwardTo(62)) {
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeAttributeName = function(c) {
|
|
if (c === 62) {
|
|
this.cbs.onopentagend();
|
|
if (this.isSpecial) {
|
|
this._state = 24;
|
|
this.sequenceIndex = 0;
|
|
} else {
|
|
this._state = 1;
|
|
}
|
|
this.baseState = this._state;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c === 47) {
|
|
this._state = 4;
|
|
} else if (!isWhitespace(c)) {
|
|
this._state = 9;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInSelfClosingTag = function(c) {
|
|
if (c === 62) {
|
|
this.cbs.onselfclosingtag();
|
|
this._state = 1;
|
|
this.baseState = 1;
|
|
this.sectionStart = this._index + 1;
|
|
this.isSpecial = false;
|
|
} else if (!isWhitespace(c)) {
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeName = function(c) {
|
|
if (c === 61 || isEndOfTagSection(c)) {
|
|
this.cbs.onattribname(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 10;
|
|
this.stateAfterAttributeName(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateAfterAttributeName = function(c) {
|
|
if (c === 61) {
|
|
this._state = 11;
|
|
} else if (c === 47 || c === 62) {
|
|
this.cbs.onattribend(void 0);
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c);
|
|
} else if (!isWhitespace(c)) {
|
|
this.cbs.onattribend(void 0);
|
|
this._state = 9;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeAttributeValue = function(c) {
|
|
if (c === 34) {
|
|
this._state = 12;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c === 39) {
|
|
this._state = 13;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (!isWhitespace(c)) {
|
|
this.sectionStart = this._index;
|
|
this._state = 14;
|
|
this.stateInAttributeValueNoQuotes(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.handleInAttributeValue = function(c, quote) {
|
|
if (c === quote || !this.decodeEntities && this.fastForwardTo(quote)) {
|
|
this.cbs.onattribdata(this.getSection());
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(String.fromCharCode(quote));
|
|
this._state = 8;
|
|
} else if (this.decodeEntities && c === 38) {
|
|
this.baseState = this._state;
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueDoubleQuotes = function(c) {
|
|
this.handleInAttributeValue(c, 34);
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueSingleQuotes = function(c) {
|
|
this.handleInAttributeValue(c, 39);
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueNoQuotes = function(c) {
|
|
if (isWhitespace(c) || c === 62) {
|
|
this.cbs.onattribdata(this.getSection());
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(null);
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c);
|
|
} else if (this.decodeEntities && c === 38) {
|
|
this.baseState = this._state;
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeDeclaration = function(c) {
|
|
if (c === 91) {
|
|
this._state = 19;
|
|
this.sequenceIndex = 0;
|
|
} else {
|
|
this._state = c === 45 ? 18 : 16;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInDeclaration = function(c) {
|
|
if (c === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.ondeclaration(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInProcessingInstruction = function(c) {
|
|
if (c === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.onprocessinginstruction(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeComment = function(c) {
|
|
if (c === 45) {
|
|
this._state = 21;
|
|
this.currentSequence = Sequences.CommentEnd;
|
|
this.sequenceIndex = 2;
|
|
this.sectionStart = this._index + 1;
|
|
} else {
|
|
this._state = 16;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInSpecialComment = function(c) {
|
|
if (c === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.oncomment(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeSpecialS = function(c) {
|
|
var lower = c | 32;
|
|
if (lower === Sequences.ScriptEnd[3]) {
|
|
this.startSpecial(Sequences.ScriptEnd, 4);
|
|
} else if (lower === Sequences.StyleEnd[3]) {
|
|
this.startSpecial(Sequences.StyleEnd, 4);
|
|
} else {
|
|
this._state = 3;
|
|
this.stateInTagName(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeEntity = function(c) {
|
|
this.entityExcess = 1;
|
|
if (c === 35) {
|
|
this._state = 26;
|
|
} else if (c === 38) {
|
|
} else {
|
|
this.trieIndex = 0;
|
|
this.trieCurrent = this.entityTrie[0];
|
|
this.trieResult = null;
|
|
this._state = 27;
|
|
this.stateInNamedEntity(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInNamedEntity = function(c) {
|
|
this.entityExcess += 1;
|
|
this.trieIndex = (0, decode_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);
|
|
if (this.trieIndex < 0) {
|
|
this.emitNamedEntity();
|
|
this._index--;
|
|
return;
|
|
}
|
|
this.trieCurrent = this.entityTrie[this.trieIndex];
|
|
if (this.trieCurrent & decode_1.BinTrieFlags.HAS_VALUE) {
|
|
if (!this.allowLegacyEntity() && c !== 59) {
|
|
this.trieIndex += 1;
|
|
} else {
|
|
var entityStart = this._index - this.entityExcess + 1;
|
|
if (entityStart > this.sectionStart) {
|
|
this.emitPartial(this.buffer.substring(this.sectionStart, entityStart));
|
|
}
|
|
this.trieResult = this.trieCurrent & decode_1.BinTrieFlags.MULTI_BYTE ? String.fromCharCode(this.entityTrie[++this.trieIndex], this.entityTrie[++this.trieIndex]) : String.fromCharCode(this.entityTrie[++this.trieIndex]);
|
|
this.entityExcess = 0;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
}
|
|
};
|
|
Tokenizer2.prototype.emitNamedEntity = function() {
|
|
if (this.trieResult) {
|
|
this.emitPartial(this.trieResult);
|
|
}
|
|
this._state = this.baseState;
|
|
};
|
|
Tokenizer2.prototype.stateBeforeNumericEntity = function(c) {
|
|
if ((c | 32) === 120) {
|
|
this.entityExcess++;
|
|
this._state = 29;
|
|
} else {
|
|
this._state = 28;
|
|
this.stateInNumericEntity(c);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.decodeNumericEntity = function(base, strict) {
|
|
var entityStart = this._index - this.entityExcess - 1;
|
|
var numberStart = entityStart + 2 + (base >> 4);
|
|
if (numberStart !== this._index) {
|
|
if (entityStart > this.sectionStart) {
|
|
this.emitPartial(this.buffer.substring(this.sectionStart, entityStart));
|
|
}
|
|
var entity = this.buffer.substring(numberStart, this._index);
|
|
var parsed = parseInt(entity, base);
|
|
this.emitPartial((0, decode_codepoint_1.default)(parsed));
|
|
this.sectionStart = this._index + Number(strict);
|
|
}
|
|
this._state = this.baseState;
|
|
};
|
|
Tokenizer2.prototype.stateInNumericEntity = function(c) {
|
|
if (c === 59) {
|
|
this.decodeNumericEntity(10, true);
|
|
} else if (!isNumber2(c)) {
|
|
if (this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(10, false);
|
|
} else {
|
|
this._state = this.baseState;
|
|
}
|
|
this._index--;
|
|
} else {
|
|
this.entityExcess++;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInHexEntity = function(c) {
|
|
if (c === 59) {
|
|
this.decodeNumericEntity(16, true);
|
|
} else if ((c < 97 || c > 102) && (c < 65 || c > 70) && !isNumber2(c)) {
|
|
if (this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(16, false);
|
|
} else {
|
|
this._state = this.baseState;
|
|
}
|
|
this._index--;
|
|
} else {
|
|
this.entityExcess++;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.allowLegacyEntity = function() {
|
|
return !this.xmlMode && (this.baseState === 1 || this.baseState === 24);
|
|
};
|
|
Tokenizer2.prototype.cleanup = function() {
|
|
if (this.running && this.sectionStart !== this._index && (this._state === 1 || this._state === 24 && this.sequenceIndex === 0)) {
|
|
this.cbs.ontext(this.buffer.substr(this.sectionStart));
|
|
this.sectionStart = this._index;
|
|
}
|
|
var start = this.sectionStart < 0 ? this._index : this.sectionStart;
|
|
this.buffer = start === this.buffer.length ? "" : this.buffer.substr(start);
|
|
this._index -= start;
|
|
this.bufferOffset += start;
|
|
if (this.sectionStart > 0) {
|
|
this.sectionStart = 0;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.shouldContinue = function() {
|
|
return this._index < this.buffer.length && this.running;
|
|
};
|
|
Tokenizer2.prototype.parse = function() {
|
|
while (this.shouldContinue()) {
|
|
var c = this.buffer.charCodeAt(this._index);
|
|
if (this._state === 1) {
|
|
this.stateText(c);
|
|
} else if (this._state === 23) {
|
|
this.stateSpecialStartSequence(c);
|
|
} else if (this._state === 24) {
|
|
this.stateInSpecialTag(c);
|
|
} else if (this._state === 19) {
|
|
this.stateCDATASequence(c);
|
|
} else if (this._state === 12) {
|
|
this.stateInAttributeValueDoubleQuotes(c);
|
|
} else if (this._state === 9) {
|
|
this.stateInAttributeName(c);
|
|
} else if (this._state === 21) {
|
|
this.stateInCommentLike(c);
|
|
} else if (this._state === 20) {
|
|
this.stateInSpecialComment(c);
|
|
} else if (this._state === 8) {
|
|
this.stateBeforeAttributeName(c);
|
|
} else if (this._state === 3) {
|
|
this.stateInTagName(c);
|
|
} else if (this._state === 6) {
|
|
this.stateInClosingTagName(c);
|
|
} else if (this._state === 2) {
|
|
this.stateBeforeTagName(c);
|
|
} else if (this._state === 10) {
|
|
this.stateAfterAttributeName(c);
|
|
} else if (this._state === 13) {
|
|
this.stateInAttributeValueSingleQuotes(c);
|
|
} else if (this._state === 11) {
|
|
this.stateBeforeAttributeValue(c);
|
|
} else if (this._state === 5) {
|
|
this.stateBeforeClosingTagName(c);
|
|
} else if (this._state === 7) {
|
|
this.stateAfterClosingTagName(c);
|
|
} else if (this._state === 22) {
|
|
this.stateBeforeSpecialS(c);
|
|
} else if (this._state === 14) {
|
|
this.stateInAttributeValueNoQuotes(c);
|
|
} else if (this._state === 4) {
|
|
this.stateInSelfClosingTag(c);
|
|
} else if (this._state === 16) {
|
|
this.stateInDeclaration(c);
|
|
} else if (this._state === 15) {
|
|
this.stateBeforeDeclaration(c);
|
|
} else if (this._state === 18) {
|
|
this.stateBeforeComment(c);
|
|
} else if (this._state === 17) {
|
|
this.stateInProcessingInstruction(c);
|
|
} else if (this._state === 27) {
|
|
this.stateInNamedEntity(c);
|
|
} else if (this._state === 25) {
|
|
this.stateBeforeEntity(c);
|
|
} else if (this._state === 29) {
|
|
this.stateInHexEntity(c);
|
|
} else if (this._state === 28) {
|
|
this.stateInNumericEntity(c);
|
|
} else {
|
|
this.stateBeforeNumericEntity(c);
|
|
}
|
|
this._index++;
|
|
}
|
|
this.cleanup();
|
|
};
|
|
Tokenizer2.prototype.finish = function() {
|
|
if (this._state === 27) {
|
|
this.emitNamedEntity();
|
|
}
|
|
if (this.sectionStart < this._index) {
|
|
this.handleTrailingData();
|
|
}
|
|
this.cbs.onend();
|
|
};
|
|
Tokenizer2.prototype.handleTrailingData = function() {
|
|
var data = this.buffer.substr(this.sectionStart);
|
|
if (this._state === 21) {
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
this.cbs.oncdata(data);
|
|
} else {
|
|
this.cbs.oncomment(data);
|
|
}
|
|
} else if (this._state === 28 && this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(10, false);
|
|
} else if (this._state === 29 && this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(16, false);
|
|
} else if (this._state === 3 || this._state === 8 || this._state === 11 || this._state === 10 || this._state === 9 || this._state === 13 || this._state === 12 || this._state === 14 || this._state === 6) {
|
|
} else {
|
|
this.cbs.ontext(data);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.getSection = function() {
|
|
return this.buffer.substring(this.sectionStart, this._index);
|
|
};
|
|
Tokenizer2.prototype.emitPartial = function(value) {
|
|
if (this.baseState !== 1 && this.baseState !== 24) {
|
|
this.cbs.onattribdata(value);
|
|
} else {
|
|
this.cbs.ontext(value);
|
|
}
|
|
};
|
|
return Tokenizer2;
|
|
}();
|
|
exports.default = Tokenizer;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/node_modules/htmlparser2/lib/Parser.js
|
|
var require_Parser = __commonJS({
|
|
"node_modules/html-dom-parser/node_modules/htmlparser2/lib/Parser.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Parser = void 0;
|
|
var Tokenizer_1 = __importDefault(require_Tokenizer());
|
|
var formTags = new Set([
|
|
"input",
|
|
"option",
|
|
"optgroup",
|
|
"select",
|
|
"button",
|
|
"datalist",
|
|
"textarea"
|
|
]);
|
|
var pTag = new Set(["p"]);
|
|
var tableSectionTags = new Set(["thead", "tbody"]);
|
|
var ddtTags = new Set(["dd", "dt"]);
|
|
var rtpTags = new Set(["rt", "rp"]);
|
|
var openImpliesClose = new Map([
|
|
["tr", new Set(["tr", "th", "td"])],
|
|
["th", new Set(["th"])],
|
|
["td", new Set(["thead", "th", "td"])],
|
|
["body", new Set(["head", "link", "script"])],
|
|
["li", new Set(["li"])],
|
|
["p", pTag],
|
|
["h1", pTag],
|
|
["h2", pTag],
|
|
["h3", pTag],
|
|
["h4", pTag],
|
|
["h5", pTag],
|
|
["h6", pTag],
|
|
["select", formTags],
|
|
["input", formTags],
|
|
["output", formTags],
|
|
["button", formTags],
|
|
["datalist", formTags],
|
|
["textarea", formTags],
|
|
["option", new Set(["option"])],
|
|
["optgroup", new Set(["optgroup", "option"])],
|
|
["dd", ddtTags],
|
|
["dt", ddtTags],
|
|
["address", pTag],
|
|
["article", pTag],
|
|
["aside", pTag],
|
|
["blockquote", pTag],
|
|
["details", pTag],
|
|
["div", pTag],
|
|
["dl", pTag],
|
|
["fieldset", pTag],
|
|
["figcaption", pTag],
|
|
["figure", pTag],
|
|
["footer", pTag],
|
|
["form", pTag],
|
|
["header", pTag],
|
|
["hr", pTag],
|
|
["main", pTag],
|
|
["nav", pTag],
|
|
["ol", pTag],
|
|
["pre", pTag],
|
|
["section", pTag],
|
|
["table", pTag],
|
|
["ul", pTag],
|
|
["rt", rtpTags],
|
|
["rp", rtpTags],
|
|
["tbody", tableSectionTags],
|
|
["tfoot", tableSectionTags]
|
|
]);
|
|
var voidElements = new Set([
|
|
"area",
|
|
"base",
|
|
"basefont",
|
|
"br",
|
|
"col",
|
|
"command",
|
|
"embed",
|
|
"frame",
|
|
"hr",
|
|
"img",
|
|
"input",
|
|
"isindex",
|
|
"keygen",
|
|
"link",
|
|
"meta",
|
|
"param",
|
|
"source",
|
|
"track",
|
|
"wbr"
|
|
]);
|
|
var foreignContextElements = new Set(["math", "svg"]);
|
|
var htmlIntegrationElements = new Set([
|
|
"mi",
|
|
"mo",
|
|
"mn",
|
|
"ms",
|
|
"mtext",
|
|
"annotation-xml",
|
|
"foreignobject",
|
|
"desc",
|
|
"title"
|
|
]);
|
|
var reNameEnd = /\s|\//;
|
|
var Parser = function() {
|
|
function Parser2(cbs, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _a, _b, _c, _d, _e;
|
|
this.options = options;
|
|
this.startIndex = 0;
|
|
this.endIndex = 0;
|
|
this.openTagStart = 0;
|
|
this.tagname = "";
|
|
this.attribname = "";
|
|
this.attribvalue = "";
|
|
this.attribs = null;
|
|
this.stack = [];
|
|
this.foreignContext = [];
|
|
this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
|
|
this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;
|
|
this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;
|
|
this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this);
|
|
(_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);
|
|
}
|
|
Parser2.prototype.ontext = function(data) {
|
|
var _a, _b;
|
|
var idx = this.tokenizer.getAbsoluteIndex();
|
|
this.endIndex = idx - 1;
|
|
(_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
|
|
this.startIndex = idx;
|
|
};
|
|
Parser2.prototype.isVoidElement = function(name) {
|
|
return !this.options.xmlMode && voidElements.has(name);
|
|
};
|
|
Parser2.prototype.onopentagname = function(name) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
this.emitOpenTag(name);
|
|
};
|
|
Parser2.prototype.emitOpenTag = function(name) {
|
|
var _a, _b, _c, _d;
|
|
this.openTagStart = this.startIndex;
|
|
this.tagname = name;
|
|
var impliesClose = !this.options.xmlMode && openImpliesClose.get(name);
|
|
if (impliesClose) {
|
|
while (this.stack.length > 0 && impliesClose.has(this.stack[this.stack.length - 1])) {
|
|
var el = this.stack.pop();
|
|
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true);
|
|
}
|
|
}
|
|
if (!this.isVoidElement(name)) {
|
|
this.stack.push(name);
|
|
if (foreignContextElements.has(name)) {
|
|
this.foreignContext.push(true);
|
|
} else if (htmlIntegrationElements.has(name)) {
|
|
this.foreignContext.push(false);
|
|
}
|
|
}
|
|
(_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);
|
|
if (this.cbs.onopentag)
|
|
this.attribs = {};
|
|
};
|
|
Parser2.prototype.endOpenTag = function(isImplied) {
|
|
var _a, _b;
|
|
this.startIndex = this.openTagStart;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.attribs) {
|
|
(_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);
|
|
this.attribs = null;
|
|
}
|
|
if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
|
|
this.cbs.onclosetag(this.tagname, true);
|
|
}
|
|
this.tagname = "";
|
|
};
|
|
Parser2.prototype.onopentagend = function() {
|
|
this.endOpenTag(false);
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onclosetag = function(name) {
|
|
var _a, _b, _c, _d, _e, _f;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
if (foreignContextElements.has(name) || htmlIntegrationElements.has(name)) {
|
|
this.foreignContext.pop();
|
|
}
|
|
if (!this.isVoidElement(name)) {
|
|
var pos = this.stack.lastIndexOf(name);
|
|
if (pos !== -1) {
|
|
if (this.cbs.onclosetag) {
|
|
var count = this.stack.length - pos;
|
|
while (count--) {
|
|
this.cbs.onclosetag(this.stack.pop(), count !== 0);
|
|
}
|
|
} else
|
|
this.stack.length = pos;
|
|
} else if (!this.options.xmlMode && name === "p") {
|
|
this.emitOpenTag(name);
|
|
this.closeCurrentTag(true);
|
|
}
|
|
} else if (!this.options.xmlMode && name === "br") {
|
|
(_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, name);
|
|
(_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, name, {}, true);
|
|
(_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, name, false);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onselfclosingtag = function() {
|
|
if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) {
|
|
this.closeCurrentTag(false);
|
|
this.startIndex = this.endIndex + 1;
|
|
} else {
|
|
this.onopentagend();
|
|
}
|
|
};
|
|
Parser2.prototype.closeCurrentTag = function(isOpenImplied) {
|
|
var _a, _b;
|
|
var name = this.tagname;
|
|
this.endOpenTag(isOpenImplied);
|
|
if (this.stack[this.stack.length - 1] === name) {
|
|
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);
|
|
this.stack.pop();
|
|
}
|
|
};
|
|
Parser2.prototype.onattribname = function(name) {
|
|
this.startIndex = this.tokenizer.getAbsoluteSectionStart();
|
|
if (this.lowerCaseAttributeNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
this.attribname = name;
|
|
};
|
|
Parser2.prototype.onattribdata = function(value) {
|
|
this.attribvalue += value;
|
|
};
|
|
Parser2.prototype.onattribend = function(quote) {
|
|
var _a, _b;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
(_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote);
|
|
if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
|
|
this.attribs[this.attribname] = this.attribvalue;
|
|
}
|
|
this.attribname = "";
|
|
this.attribvalue = "";
|
|
};
|
|
Parser2.prototype.getInstructionName = function(value) {
|
|
var idx = value.search(reNameEnd);
|
|
var name = idx < 0 ? value : value.substr(0, idx);
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
return name;
|
|
};
|
|
Parser2.prototype.ondeclaration = function(value) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.cbs.onprocessinginstruction) {
|
|
var name_1 = this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction("!" + name_1, "!" + value);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onprocessinginstruction = function(value) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.cbs.onprocessinginstruction) {
|
|
var name_2 = this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction("?" + name_2, "?" + value);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.oncomment = function(value) {
|
|
var _a, _b, _c, _d;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
(_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
(_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.oncdata = function(value) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.options.xmlMode || this.options.recognizeCDATA) {
|
|
(_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
(_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
|
|
(_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
} else {
|
|
(_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, "[CDATA[" + value + "]]");
|
|
(_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onerror = function(err) {
|
|
var _a, _b;
|
|
(_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
};
|
|
Parser2.prototype.onend = function() {
|
|
var _a, _b;
|
|
if (this.cbs.onclosetag) {
|
|
this.endIndex = this.startIndex;
|
|
for (var i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], true))
|
|
;
|
|
}
|
|
(_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
};
|
|
Parser2.prototype.reset = function() {
|
|
var _a, _b, _c, _d;
|
|
(_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
this.tokenizer.reset();
|
|
this.tagname = "";
|
|
this.attribname = "";
|
|
this.attribs = null;
|
|
this.stack = [];
|
|
this.startIndex = 0;
|
|
this.endIndex = 0;
|
|
(_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
|
|
};
|
|
Parser2.prototype.parseComplete = function(data) {
|
|
this.reset();
|
|
this.end(data);
|
|
};
|
|
Parser2.prototype.write = function(chunk) {
|
|
this.tokenizer.write(chunk);
|
|
};
|
|
Parser2.prototype.end = function(chunk) {
|
|
this.tokenizer.end(chunk);
|
|
};
|
|
Parser2.prototype.pause = function() {
|
|
this.tokenizer.pause();
|
|
};
|
|
Parser2.prototype.resume = function() {
|
|
this.tokenizer.resume();
|
|
};
|
|
Parser2.prototype.parseChunk = function(chunk) {
|
|
this.write(chunk);
|
|
};
|
|
Parser2.prototype.done = function(chunk) {
|
|
this.end(chunk);
|
|
};
|
|
return Parser2;
|
|
}();
|
|
exports.Parser = Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/domelementtype/lib/index.js
|
|
var require_lib2 = __commonJS({
|
|
"node_modules/domelementtype/lib/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
var ElementType;
|
|
(function(ElementType2) {
|
|
ElementType2["Root"] = "root";
|
|
ElementType2["Text"] = "text";
|
|
ElementType2["Directive"] = "directive";
|
|
ElementType2["Comment"] = "comment";
|
|
ElementType2["Script"] = "script";
|
|
ElementType2["Style"] = "style";
|
|
ElementType2["Tag"] = "tag";
|
|
ElementType2["CDATA"] = "cdata";
|
|
ElementType2["Doctype"] = "doctype";
|
|
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|
|
function isTag2(elem) {
|
|
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
}
|
|
exports.isTag = isTag2;
|
|
exports.Root = ElementType.Root;
|
|
exports.Text = ElementType.Text;
|
|
exports.Directive = ElementType.Directive;
|
|
exports.Comment = ElementType.Comment;
|
|
exports.Script = ElementType.Script;
|
|
exports.Style = ElementType.Style;
|
|
exports.Tag = ElementType.Tag;
|
|
exports.CDATA = ElementType.CDATA;
|
|
exports.Doctype = ElementType.Doctype;
|
|
}
|
|
});
|
|
|
|
// node_modules/domhandler/lib/node.js
|
|
var require_node = __commonJS({
|
|
"node_modules/domhandler/lib/node.js"(exports) {
|
|
"use strict";
|
|
var __extends = exports && exports.__extends || function() {
|
|
var extendStatics = function(d, b) {
|
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
d2.__proto__ = b2;
|
|
} || function(d2, b2) {
|
|
for (var p in b2)
|
|
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
d2[p] = b2[p];
|
|
};
|
|
return extendStatics(d, b);
|
|
};
|
|
return function(d, b) {
|
|
if (typeof b !== "function" && b !== null)
|
|
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
extendStatics(d, b);
|
|
function __() {
|
|
this.constructor = d;
|
|
}
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
};
|
|
}();
|
|
var __assign = exports && exports.__assign || function() {
|
|
__assign = Object.assign || function(t) {
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
s = arguments[i];
|
|
for (var p in s)
|
|
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
t[p] = s[p];
|
|
}
|
|
return t;
|
|
};
|
|
return __assign.apply(this, arguments);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
|
|
var domelementtype_1 = require_lib2();
|
|
var nodeTypes = new Map([
|
|
[domelementtype_1.ElementType.Tag, 1],
|
|
[domelementtype_1.ElementType.Script, 1],
|
|
[domelementtype_1.ElementType.Style, 1],
|
|
[domelementtype_1.ElementType.Directive, 1],
|
|
[domelementtype_1.ElementType.Text, 3],
|
|
[domelementtype_1.ElementType.CDATA, 4],
|
|
[domelementtype_1.ElementType.Comment, 8],
|
|
[domelementtype_1.ElementType.Root, 9]
|
|
]);
|
|
var Node = function() {
|
|
function Node2(type) {
|
|
this.type = type;
|
|
this.parent = null;
|
|
this.prev = null;
|
|
this.next = null;
|
|
this.startIndex = null;
|
|
this.endIndex = null;
|
|
}
|
|
Object.defineProperty(Node2.prototype, "nodeType", {
|
|
get: function() {
|
|
var _a;
|
|
return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "parentNode", {
|
|
get: function() {
|
|
return this.parent;
|
|
},
|
|
set: function(parent) {
|
|
this.parent = parent;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "previousSibling", {
|
|
get: function() {
|
|
return this.prev;
|
|
},
|
|
set: function(prev) {
|
|
this.prev = prev;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "nextSibling", {
|
|
get: function() {
|
|
return this.next;
|
|
},
|
|
set: function(next) {
|
|
this.next = next;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Node2.prototype.cloneNode = function(recursive) {
|
|
if (recursive === void 0) {
|
|
recursive = false;
|
|
}
|
|
return cloneNode(this, recursive);
|
|
};
|
|
return Node2;
|
|
}();
|
|
exports.Node = Node;
|
|
var DataNode = function(_super) {
|
|
__extends(DataNode2, _super);
|
|
function DataNode2(type, data) {
|
|
var _this = _super.call(this, type) || this;
|
|
_this.data = data;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(DataNode2.prototype, "nodeValue", {
|
|
get: function() {
|
|
return this.data;
|
|
},
|
|
set: function(data) {
|
|
this.data = data;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return DataNode2;
|
|
}(Node);
|
|
exports.DataNode = DataNode;
|
|
var Text = function(_super) {
|
|
__extends(Text2, _super);
|
|
function Text2(data) {
|
|
return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
|
|
}
|
|
return Text2;
|
|
}(DataNode);
|
|
exports.Text = Text;
|
|
var Comment = function(_super) {
|
|
__extends(Comment2, _super);
|
|
function Comment2(data) {
|
|
return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
|
|
}
|
|
return Comment2;
|
|
}(DataNode);
|
|
exports.Comment = Comment;
|
|
var ProcessingInstruction = function(_super) {
|
|
__extends(ProcessingInstruction2, _super);
|
|
function ProcessingInstruction2(name, data) {
|
|
var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
|
|
_this.name = name;
|
|
return _this;
|
|
}
|
|
return ProcessingInstruction2;
|
|
}(DataNode);
|
|
exports.ProcessingInstruction = ProcessingInstruction;
|
|
var NodeWithChildren = function(_super) {
|
|
__extends(NodeWithChildren2, _super);
|
|
function NodeWithChildren2(type, children) {
|
|
var _this = _super.call(this, type) || this;
|
|
_this.children = children;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
|
|
get: function() {
|
|
var _a;
|
|
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
|
|
get: function() {
|
|
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
|
|
get: function() {
|
|
return this.children;
|
|
},
|
|
set: function(children) {
|
|
this.children = children;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return NodeWithChildren2;
|
|
}(Node);
|
|
exports.NodeWithChildren = NodeWithChildren;
|
|
var Document = function(_super) {
|
|
__extends(Document2, _super);
|
|
function Document2(children) {
|
|
return _super.call(this, domelementtype_1.ElementType.Root, children) || this;
|
|
}
|
|
return Document2;
|
|
}(NodeWithChildren);
|
|
exports.Document = Document;
|
|
var Element3 = function(_super) {
|
|
__extends(Element4, _super);
|
|
function Element4(name, attribs, children, type) {
|
|
if (children === void 0) {
|
|
children = [];
|
|
}
|
|
if (type === void 0) {
|
|
type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
|
|
}
|
|
var _this = _super.call(this, type, children) || this;
|
|
_this.name = name;
|
|
_this.attribs = attribs;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(Element4.prototype, "tagName", {
|
|
get: function() {
|
|
return this.name;
|
|
},
|
|
set: function(name) {
|
|
this.name = name;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Element4.prototype, "attributes", {
|
|
get: function() {
|
|
var _this = this;
|
|
return Object.keys(this.attribs).map(function(name) {
|
|
var _a, _b;
|
|
return {
|
|
name,
|
|
value: _this.attribs[name],
|
|
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
|
|
};
|
|
});
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return Element4;
|
|
}(NodeWithChildren);
|
|
exports.Element = Element3;
|
|
function isTag2(node) {
|
|
return (0, domelementtype_1.isTag)(node);
|
|
}
|
|
exports.isTag = isTag2;
|
|
function isCDATA(node) {
|
|
return node.type === domelementtype_1.ElementType.CDATA;
|
|
}
|
|
exports.isCDATA = isCDATA;
|
|
function isText(node) {
|
|
return node.type === domelementtype_1.ElementType.Text;
|
|
}
|
|
exports.isText = isText;
|
|
function isComment(node) {
|
|
return node.type === domelementtype_1.ElementType.Comment;
|
|
}
|
|
exports.isComment = isComment;
|
|
function isDirective(node) {
|
|
return node.type === domelementtype_1.ElementType.Directive;
|
|
}
|
|
exports.isDirective = isDirective;
|
|
function isDocument(node) {
|
|
return node.type === domelementtype_1.ElementType.Root;
|
|
}
|
|
exports.isDocument = isDocument;
|
|
function hasChildren(node) {
|
|
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
}
|
|
exports.hasChildren = hasChildren;
|
|
function cloneNode(node, recursive) {
|
|
if (recursive === void 0) {
|
|
recursive = false;
|
|
}
|
|
var result;
|
|
if (isText(node)) {
|
|
result = new Text(node.data);
|
|
} else if (isComment(node)) {
|
|
result = new Comment(node.data);
|
|
} else if (isTag2(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_1 = new Element3(node.name, __assign({}, node.attribs), children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_1;
|
|
});
|
|
if (node.namespace != null) {
|
|
clone_1.namespace = node.namespace;
|
|
}
|
|
if (node["x-attribsNamespace"]) {
|
|
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
|
}
|
|
if (node["x-attribsPrefix"]) {
|
|
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
|
}
|
|
result = clone_1;
|
|
} else if (isCDATA(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_2;
|
|
});
|
|
result = clone_2;
|
|
} else if (isDocument(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_3 = new Document(children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_3;
|
|
});
|
|
if (node["x-mode"]) {
|
|
clone_3["x-mode"] = node["x-mode"];
|
|
}
|
|
result = clone_3;
|
|
} else if (isDirective(node)) {
|
|
var instruction = new ProcessingInstruction(node.name, node.data);
|
|
if (node["x-name"] != null) {
|
|
instruction["x-name"] = node["x-name"];
|
|
instruction["x-publicId"] = node["x-publicId"];
|
|
instruction["x-systemId"] = node["x-systemId"];
|
|
}
|
|
result = instruction;
|
|
} else {
|
|
throw new Error("Not implemented yet: ".concat(node.type));
|
|
}
|
|
result.startIndex = node.startIndex;
|
|
result.endIndex = node.endIndex;
|
|
if (node.sourceCodeLocation != null) {
|
|
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
}
|
|
return result;
|
|
}
|
|
exports.cloneNode = cloneNode;
|
|
function cloneChildren(childs) {
|
|
var children = childs.map(function(child) {
|
|
return cloneNode(child, true);
|
|
});
|
|
for (var i = 1; i < children.length; i++) {
|
|
children[i].prev = children[i - 1];
|
|
children[i - 1].next = children[i];
|
|
}
|
|
return children;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/domhandler/lib/index.js
|
|
var require_lib3 = __commonJS({
|
|
"node_modules/domhandler/lib/index.js"(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m[k];
|
|
} };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
for (var p in m)
|
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
__createBinding(exports2, m, p);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.DomHandler = void 0;
|
|
var domelementtype_1 = require_lib2();
|
|
var node_1 = require_node();
|
|
__exportStar(require_node(), exports);
|
|
var reWhitespace = /\s+/g;
|
|
var defaultOpts = {
|
|
normalizeWhitespace: false,
|
|
withStartIndices: false,
|
|
withEndIndices: false,
|
|
xmlMode: false
|
|
};
|
|
var DomHandler = function() {
|
|
function DomHandler2(callback, options, elementCB) {
|
|
this.dom = [];
|
|
this.root = new node_1.Document(this.dom);
|
|
this.done = false;
|
|
this.tagStack = [this.root];
|
|
this.lastNode = null;
|
|
this.parser = null;
|
|
if (typeof options === "function") {
|
|
elementCB = options;
|
|
options = defaultOpts;
|
|
}
|
|
if (typeof callback === "object") {
|
|
options = callback;
|
|
callback = void 0;
|
|
}
|
|
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
|
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
|
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
|
}
|
|
DomHandler2.prototype.onparserinit = function(parser) {
|
|
this.parser = parser;
|
|
};
|
|
DomHandler2.prototype.onreset = function() {
|
|
this.dom = [];
|
|
this.root = new node_1.Document(this.dom);
|
|
this.done = false;
|
|
this.tagStack = [this.root];
|
|
this.lastNode = null;
|
|
this.parser = null;
|
|
};
|
|
DomHandler2.prototype.onend = function() {
|
|
if (this.done)
|
|
return;
|
|
this.done = true;
|
|
this.parser = null;
|
|
this.handleCallback(null);
|
|
};
|
|
DomHandler2.prototype.onerror = function(error) {
|
|
this.handleCallback(error);
|
|
};
|
|
DomHandler2.prototype.onclosetag = function() {
|
|
this.lastNode = null;
|
|
var elem = this.tagStack.pop();
|
|
if (this.options.withEndIndices) {
|
|
elem.endIndex = this.parser.endIndex;
|
|
}
|
|
if (this.elementCB)
|
|
this.elementCB(elem);
|
|
};
|
|
DomHandler2.prototype.onopentag = function(name, attribs) {
|
|
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
|
|
var element = new node_1.Element(name, attribs, void 0, type);
|
|
this.addNode(element);
|
|
this.tagStack.push(element);
|
|
};
|
|
DomHandler2.prototype.ontext = function(data) {
|
|
var normalizeWhitespace = this.options.normalizeWhitespace;
|
|
var lastNode = this.lastNode;
|
|
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
|
if (normalizeWhitespace) {
|
|
lastNode.data = (lastNode.data + data).replace(reWhitespace, " ");
|
|
} else {
|
|
lastNode.data += data;
|
|
}
|
|
if (this.options.withEndIndices) {
|
|
lastNode.endIndex = this.parser.endIndex;
|
|
}
|
|
} else {
|
|
if (normalizeWhitespace) {
|
|
data = data.replace(reWhitespace, " ");
|
|
}
|
|
var node = new node_1.Text(data);
|
|
this.addNode(node);
|
|
this.lastNode = node;
|
|
}
|
|
};
|
|
DomHandler2.prototype.oncomment = function(data) {
|
|
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
|
this.lastNode.data += data;
|
|
return;
|
|
}
|
|
var node = new node_1.Comment(data);
|
|
this.addNode(node);
|
|
this.lastNode = node;
|
|
};
|
|
DomHandler2.prototype.oncommentend = function() {
|
|
this.lastNode = null;
|
|
};
|
|
DomHandler2.prototype.oncdatastart = function() {
|
|
var text = new node_1.Text("");
|
|
var node = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text]);
|
|
this.addNode(node);
|
|
text.parent = node;
|
|
this.lastNode = text;
|
|
};
|
|
DomHandler2.prototype.oncdataend = function() {
|
|
this.lastNode = null;
|
|
};
|
|
DomHandler2.prototype.onprocessinginstruction = function(name, data) {
|
|
var node = new node_1.ProcessingInstruction(name, data);
|
|
this.addNode(node);
|
|
};
|
|
DomHandler2.prototype.handleCallback = function(error) {
|
|
if (typeof this.callback === "function") {
|
|
this.callback(error, this.dom);
|
|
} else if (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
DomHandler2.prototype.addNode = function(node) {
|
|
var parent = this.tagStack[this.tagStack.length - 1];
|
|
var previousSibling = parent.children[parent.children.length - 1];
|
|
if (this.options.withStartIndices) {
|
|
node.startIndex = this.parser.startIndex;
|
|
}
|
|
if (this.options.withEndIndices) {
|
|
node.endIndex = this.parser.endIndex;
|
|
}
|
|
parent.children.push(node);
|
|
if (previousSibling) {
|
|
node.prev = previousSibling;
|
|
previousSibling.next = node;
|
|
}
|
|
node.parent = parent;
|
|
this.lastNode = null;
|
|
};
|
|
return DomHandler2;
|
|
}();
|
|
exports.DomHandler = DomHandler;
|
|
exports.default = DomHandler;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/lib/server/utilities.js
|
|
var require_utilities3 = __commonJS({
|
|
"node_modules/html-dom-parser/lib/server/utilities.js"(exports, module2) {
|
|
function unsetRootParent(nodes) {
|
|
for (var index = 0, len = nodes.length; index < len; index++) {
|
|
var node = nodes[index];
|
|
node.parent = null;
|
|
}
|
|
return nodes;
|
|
}
|
|
module2.exports = {
|
|
unsetRootParent
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/lib/server/html-to-dom.js
|
|
var require_html_to_dom = __commonJS({
|
|
"node_modules/html-dom-parser/lib/server/html-to-dom.js"(exports, module2) {
|
|
var Parser = require_Parser().Parser;
|
|
var DomHandler = require_lib3().DomHandler;
|
|
var unsetRootParent = require_utilities3().unsetRootParent;
|
|
function HTMLDOMParser(html, options) {
|
|
if (typeof html !== "string") {
|
|
throw new TypeError("First argument must be a string.");
|
|
}
|
|
if (html === "") {
|
|
return [];
|
|
}
|
|
var handler = new DomHandler(void 0, options);
|
|
new Parser(handler, options).end(html);
|
|
return unsetRootParent(handler.dom);
|
|
}
|
|
module2.exports = HTMLDOMParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/index.js
|
|
var require_html_dom_parser = __commonJS({
|
|
"node_modules/html-dom-parser/index.js"(exports, module2) {
|
|
module2.exports = require_html_to_dom();
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/index.js
|
|
var require_html_react_parser = __commonJS({
|
|
"node_modules/html-react-parser/index.js"(exports, module2) {
|
|
var domToReact2 = require_dom_to_react();
|
|
var attributesToProps2 = require_attributes_to_props();
|
|
var htmlToDOM2 = require_html_dom_parser();
|
|
htmlToDOM2 = typeof htmlToDOM2.default === "function" ? htmlToDOM2.default : htmlToDOM2;
|
|
var domParserOptions = { lowerCaseAttributeNames: false };
|
|
function HTMLReactParser2(html, options) {
|
|
if (typeof html !== "string") {
|
|
throw new TypeError("First argument must be a string");
|
|
}
|
|
if (html === "") {
|
|
return [];
|
|
}
|
|
options = options || {};
|
|
return domToReact2(htmlToDOM2(html, options.htmlparser2 || domParserOptions), options);
|
|
}
|
|
HTMLReactParser2.domToReact = domToReact2;
|
|
HTMLReactParser2.htmlToDOM = htmlToDOM2;
|
|
HTMLReactParser2.attributesToProps = attributesToProps2;
|
|
HTMLReactParser2.Element = require_node().Element;
|
|
module2.exports = HTMLReactParser2;
|
|
module2.exports.default = HTMLReactParser2;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
|
var require_interopRequireDefault = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports, module2) {
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : {
|
|
"default": obj
|
|
};
|
|
}
|
|
module2.exports = _interopRequireDefault, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/className/ClassNameGenerator.js
|
|
var require_ClassNameGenerator = __commonJS({
|
|
"node_modules/@mui/base/node/className/ClassNameGenerator.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var defaultGenerator = (componentName) => componentName;
|
|
var createClassNameGenerator = () => {
|
|
let generate = defaultGenerator;
|
|
return {
|
|
configure(generator) {
|
|
generate = generator;
|
|
},
|
|
generate(componentName) {
|
|
return generate(componentName);
|
|
},
|
|
reset() {
|
|
generate = defaultGenerator;
|
|
}
|
|
};
|
|
};
|
|
var ClassNameGenerator = createClassNameGenerator();
|
|
var _default = ClassNameGenerator;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/className/index.js
|
|
var require_className = __commonJS({
|
|
"node_modules/@mui/base/node/className/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "unstable_ClassNameGenerator", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ClassNameGenerator.default;
|
|
}
|
|
});
|
|
var _ClassNameGenerator = _interopRequireDefault(require_ClassNameGenerator());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/chainPropTypes.js
|
|
var require_chainPropTypes = __commonJS({
|
|
"node_modules/@mui/utils/chainPropTypes.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = chainPropTypes;
|
|
function chainPropTypes(propType1, propType2) {
|
|
if (false) {
|
|
return () => null;
|
|
}
|
|
return function validate2(...args) {
|
|
return propType1(...args) || propType2(...args);
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/extends.js
|
|
var require_extends = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/extends.js"(exports, module2) {
|
|
function _extends() {
|
|
module2.exports = _extends = Object.assign || function(target) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
var source = arguments[i];
|
|
for (var key in source) {
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
return _extends.apply(this, arguments);
|
|
}
|
|
module2.exports = _extends, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/deepmerge.js
|
|
var require_deepmerge = __commonJS({
|
|
"node_modules/@mui/utils/deepmerge.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = deepmerge;
|
|
exports.isPlainObject = isPlainObject;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
function isPlainObject(item) {
|
|
return item !== null && typeof item === "object" && item.constructor === Object;
|
|
}
|
|
function deepmerge(target, source, options = {
|
|
clone: true
|
|
}) {
|
|
const output = options.clone ? (0, _extends2.default)({}, target) : target;
|
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
Object.keys(source).forEach((key) => {
|
|
if (key === "__proto__") {
|
|
return;
|
|
}
|
|
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
output[key] = deepmerge(target[key], source[key], options);
|
|
} else {
|
|
output[key] = source[key];
|
|
}
|
|
});
|
|
}
|
|
return output;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
function isValidElementType(type) {
|
|
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_ASYNC_MODE_TYPE:
|
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
var Fragment = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
}
|
|
}
|
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
}
|
|
function isContextConsumer(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
exports.AsyncMode = AsyncMode;
|
|
exports.ConcurrentMode = ConcurrentMode;
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef;
|
|
exports.Fragment = Fragment;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isValidElementType = isValidElementType;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/index.js
|
|
var require_react_is = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
var require_ReactPropTypesSecret = __commonJS({
|
|
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
module2.exports = ReactPropTypesSecret;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/has.js
|
|
var require_has = __commonJS({
|
|
"node_modules/prop-types/lib/has.js"(exports, module2) {
|
|
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/checkPropTypes.js
|
|
var require_checkPropTypes = __commonJS({
|
|
"node_modules/prop-types/checkPropTypes.js"(exports, module2) {
|
|
"use strict";
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
loggedTypeFailures = {};
|
|
has = require_has();
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
};
|
|
}
|
|
var ReactPropTypesSecret;
|
|
var loggedTypeFailures;
|
|
var has;
|
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
if (true) {
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
if (error && !(error instanceof Error)) {
|
|
printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
|
|
}
|
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error.message] = true;
|
|
var stack = getStack ? getStack() : "";
|
|
printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : ""));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkPropTypes.resetWarningCache = function() {
|
|
if (true) {
|
|
loggedTypeFailures = {};
|
|
}
|
|
};
|
|
module2.exports = checkPropTypes;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
var require_factoryWithTypeCheckers = __commonJS({
|
|
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactIs = require_react_is();
|
|
var assign = require_object_assign();
|
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
var has = require_has();
|
|
var checkPropTypes = require_checkPropTypes();
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
};
|
|
}
|
|
function emptyFunctionThatReturnsNull() {
|
|
return null;
|
|
}
|
|
module2.exports = function(isValidElement, throwOnDirectAccess) {
|
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
if (typeof iteratorFn === "function") {
|
|
return iteratorFn;
|
|
}
|
|
}
|
|
var ANONYMOUS = "<<anonymous>>";
|
|
var ReactPropTypes = {
|
|
array: createPrimitiveTypeChecker("array"),
|
|
bigint: createPrimitiveTypeChecker("bigint"),
|
|
bool: createPrimitiveTypeChecker("boolean"),
|
|
func: createPrimitiveTypeChecker("function"),
|
|
number: createPrimitiveTypeChecker("number"),
|
|
object: createPrimitiveTypeChecker("object"),
|
|
string: createPrimitiveTypeChecker("string"),
|
|
symbol: createPrimitiveTypeChecker("symbol"),
|
|
any: createAnyTypeChecker(),
|
|
arrayOf: createArrayOfTypeChecker,
|
|
element: createElementTypeChecker(),
|
|
elementType: createElementTypeTypeChecker(),
|
|
instanceOf: createInstanceTypeChecker,
|
|
node: createNodeChecker(),
|
|
objectOf: createObjectOfTypeChecker,
|
|
oneOf: createEnumTypeChecker,
|
|
oneOfType: createUnionTypeChecker,
|
|
shape: createShapeTypeChecker,
|
|
exact: createStrictShapeTypeChecker
|
|
};
|
|
function is(x, y) {
|
|
if (x === y) {
|
|
return x !== 0 || 1 / x === 1 / y;
|
|
} else {
|
|
return x !== x && y !== y;
|
|
}
|
|
}
|
|
function PropTypeError(message, data) {
|
|
this.message = message;
|
|
this.data = data && typeof data === "object" ? data : {};
|
|
this.stack = "";
|
|
}
|
|
PropTypeError.prototype = Error.prototype;
|
|
function createChainableTypeChecker(validate2) {
|
|
if (true) {
|
|
var manualPropTypeCallCache = {};
|
|
var manualPropTypeWarningCount = 0;
|
|
}
|
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
componentName = componentName || ANONYMOUS;
|
|
propFullName = propFullName || propName;
|
|
if (secret !== ReactPropTypesSecret) {
|
|
if (throwOnDirectAccess) {
|
|
var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
} else if (typeof console !== "undefined") {
|
|
var cacheKey = componentName + ":" + propName;
|
|
if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
|
|
printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.");
|
|
manualPropTypeCallCache[cacheKey] = true;
|
|
manualPropTypeWarningCount++;
|
|
}
|
|
}
|
|
}
|
|
if (props[propName] == null) {
|
|
if (isRequired) {
|
|
if (props[propName] === null) {
|
|
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
}
|
|
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
}
|
|
return null;
|
|
} else {
|
|
return validate2(props, propName, componentName, location, propFullName);
|
|
}
|
|
}
|
|
var chainedCheckType = checkType.bind(null, false);
|
|
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
return chainedCheckType;
|
|
}
|
|
function createPrimitiveTypeChecker(expectedType) {
|
|
function validate2(props, propName, componentName, location, propFullName, secret) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== expectedType) {
|
|
var preciseType = getPreciseType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType });
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createAnyTypeChecker() {
|
|
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
}
|
|
function createArrayOfTypeChecker(typeChecker) {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
if (typeof typeChecker !== "function") {
|
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
}
|
|
var propValue = props[propName];
|
|
if (!Array.isArray(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
}
|
|
for (var i = 0; i < propValue.length; i++) {
|
|
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createElementTypeChecker() {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
if (!isValidElement(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createElementTypeTypeChecker() {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
if (!ReactIs.isValidElementType(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createInstanceTypeChecker(expectedClass) {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
if (!(props[propName] instanceof expectedClass)) {
|
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
var actualClassName = getClassName(props[propName]);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createEnumTypeChecker(expectedValues) {
|
|
if (!Array.isArray(expectedValues)) {
|
|
if (true) {
|
|
if (arguments.length > 1) {
|
|
printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).");
|
|
} else {
|
|
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
}
|
|
}
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
for (var i = 0; i < expectedValues.length; i++) {
|
|
if (is(propValue, expectedValues[i])) {
|
|
return null;
|
|
}
|
|
}
|
|
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
var type = getPreciseType(value);
|
|
if (type === "symbol") {
|
|
return String(value);
|
|
}
|
|
return value;
|
|
});
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createObjectOfTypeChecker(typeChecker) {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
if (typeof typeChecker !== "function") {
|
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
}
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
}
|
|
for (var key in propValue) {
|
|
if (has(propValue, key)) {
|
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
var checker = arrayOfTypeCheckers[i];
|
|
if (typeof checker !== "function") {
|
|
printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + ".");
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
}
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var expectedTypes = [];
|
|
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
var checker2 = arrayOfTypeCheckers[i2];
|
|
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
if (checkerResult == null) {
|
|
return null;
|
|
}
|
|
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
expectedTypes.push(checkerResult.data.expectedType);
|
|
}
|
|
}
|
|
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createNodeChecker() {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
if (!isNode(props[propName])) {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`.");
|
|
}
|
|
function createShapeTypeChecker(shapeTypes) {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
}
|
|
for (var key in shapeTypes) {
|
|
var checker = shapeTypes[key];
|
|
if (typeof checker !== "function") {
|
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
}
|
|
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function createStrictShapeTypeChecker(shapeTypes) {
|
|
function validate2(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
}
|
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
for (var key in allKeys) {
|
|
var checker = shapeTypes[key];
|
|
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
}
|
|
if (!checker) {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " "));
|
|
}
|
|
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate2);
|
|
}
|
|
function isNode(propValue) {
|
|
switch (typeof propValue) {
|
|
case "number":
|
|
case "string":
|
|
case "undefined":
|
|
return true;
|
|
case "boolean":
|
|
return !propValue;
|
|
case "object":
|
|
if (Array.isArray(propValue)) {
|
|
return propValue.every(isNode);
|
|
}
|
|
if (propValue === null || isValidElement(propValue)) {
|
|
return true;
|
|
}
|
|
var iteratorFn = getIteratorFn(propValue);
|
|
if (iteratorFn) {
|
|
var iterator = iteratorFn.call(propValue);
|
|
var step;
|
|
if (iteratorFn !== propValue.entries) {
|
|
while (!(step = iterator.next()).done) {
|
|
if (!isNode(step.value)) {
|
|
return false;
|
|
}
|
|
}
|
|
} else {
|
|
while (!(step = iterator.next()).done) {
|
|
var entry = step.value;
|
|
if (entry) {
|
|
if (!isNode(entry[1])) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function isSymbol(propType, propValue) {
|
|
if (propType === "symbol") {
|
|
return true;
|
|
}
|
|
if (!propValue) {
|
|
return false;
|
|
}
|
|
if (propValue["@@toStringTag"] === "Symbol") {
|
|
return true;
|
|
}
|
|
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function getPropType(propValue) {
|
|
var propType = typeof propValue;
|
|
if (Array.isArray(propValue)) {
|
|
return "array";
|
|
}
|
|
if (propValue instanceof RegExp) {
|
|
return "object";
|
|
}
|
|
if (isSymbol(propType, propValue)) {
|
|
return "symbol";
|
|
}
|
|
return propType;
|
|
}
|
|
function getPreciseType(propValue) {
|
|
if (typeof propValue === "undefined" || propValue === null) {
|
|
return "" + propValue;
|
|
}
|
|
var propType = getPropType(propValue);
|
|
if (propType === "object") {
|
|
if (propValue instanceof Date) {
|
|
return "date";
|
|
} else if (propValue instanceof RegExp) {
|
|
return "regexp";
|
|
}
|
|
}
|
|
return propType;
|
|
}
|
|
function getPostfixForTypeWarning(value) {
|
|
var type = getPreciseType(value);
|
|
switch (type) {
|
|
case "array":
|
|
case "object":
|
|
return "an " + type;
|
|
case "boolean":
|
|
case "date":
|
|
case "regexp":
|
|
return "a " + type;
|
|
default:
|
|
return type;
|
|
}
|
|
}
|
|
function getClassName(propValue) {
|
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
return ANONYMOUS;
|
|
}
|
|
return propValue.constructor.name;
|
|
}
|
|
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
return ReactPropTypes;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/index.js
|
|
var require_prop_types = __commonJS({
|
|
"node_modules/prop-types/index.js"(exports, module2) {
|
|
if (true) {
|
|
ReactIs = require_react_is();
|
|
throwOnDirectAccess = true;
|
|
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
} else {
|
|
module2.exports = null();
|
|
}
|
|
var ReactIs;
|
|
var throwOnDirectAccess;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/elementAcceptingRef.js
|
|
var require_elementAcceptingRef = __commonJS({
|
|
"node_modules/@mui/utils/elementAcceptingRef.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _chainPropTypes = _interopRequireDefault(require_chainPropTypes());
|
|
function isClassComponent(elementType) {
|
|
const {
|
|
prototype = {}
|
|
} = elementType;
|
|
return Boolean(prototype.isReactComponent);
|
|
}
|
|
function acceptingRef(props, propName, componentName, location, propFullName) {
|
|
const element = props[propName];
|
|
const safePropName = propFullName || propName;
|
|
if (element == null || typeof window === "undefined") {
|
|
return null;
|
|
}
|
|
let warningHint;
|
|
const elementType = element.type;
|
|
if (typeof elementType === "function" && !isClassComponent(elementType)) {
|
|
warningHint = "Did you accidentally use a plain function component for an element instead?";
|
|
}
|
|
if (warningHint !== void 0) {
|
|
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
|
|
}
|
|
return null;
|
|
}
|
|
var elementAcceptingRef = (0, _chainPropTypes.default)(_propTypes.default.element, acceptingRef);
|
|
elementAcceptingRef.isRequired = (0, _chainPropTypes.default)(_propTypes.default.element.isRequired, acceptingRef);
|
|
var _default = elementAcceptingRef;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/elementTypeAcceptingRef.js
|
|
var require_elementTypeAcceptingRef = __commonJS({
|
|
"node_modules/@mui/utils/elementTypeAcceptingRef.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _chainPropTypes = _interopRequireDefault(require_chainPropTypes());
|
|
function isClassComponent(elementType) {
|
|
const {
|
|
prototype = {}
|
|
} = elementType;
|
|
return Boolean(prototype.isReactComponent);
|
|
}
|
|
function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
|
|
const propValue = props[propName];
|
|
const safePropName = propFullName || propName;
|
|
if (propValue == null || typeof window === "undefined") {
|
|
return null;
|
|
}
|
|
let warningHint;
|
|
if (typeof propValue === "function" && !isClassComponent(propValue)) {
|
|
warningHint = "Did you accidentally provide a plain function component instead?";
|
|
}
|
|
if (warningHint !== void 0) {
|
|
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
|
|
}
|
|
return null;
|
|
}
|
|
var _default = (0, _chainPropTypes.default)(_propTypes.default.elementType, elementTypeAcceptingRef);
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/exactProp.js
|
|
var require_exactProp = __commonJS({
|
|
"node_modules/@mui/utils/exactProp.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = exactProp;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var specialProperty = "exact-prop: \u200B";
|
|
function exactProp(propTypes) {
|
|
if (false) {
|
|
return propTypes;
|
|
}
|
|
return (0, _extends2.default)({}, propTypes, {
|
|
[specialProperty]: (props) => {
|
|
const unsupportedProps = Object.keys(props).filter((prop) => !propTypes.hasOwnProperty(prop));
|
|
if (unsupportedProps.length > 0) {
|
|
return new Error(`The following props are not supported: ${unsupportedProps.map((prop) => `\`${prop}\``).join(", ")}. Please remove them.`);
|
|
}
|
|
return null;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/formatMuiErrorMessage.js
|
|
var require_formatMuiErrorMessage = __commonJS({
|
|
"node_modules/@mui/utils/formatMuiErrorMessage.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = formatMuiErrorMessage;
|
|
function formatMuiErrorMessage(code) {
|
|
let url = "https://mui.com/production-error/?code=" + code;
|
|
for (let i = 1; i < arguments.length; i += 1) {
|
|
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
}
|
|
return "Minified MUI error #" + code + "; visit " + url + " for the full message.";
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development2 = __commonJS({
|
|
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var REACT_ELEMENT_TYPE = 60103;
|
|
var REACT_PORTAL_TYPE = 60106;
|
|
var REACT_FRAGMENT_TYPE = 60107;
|
|
var REACT_STRICT_MODE_TYPE = 60108;
|
|
var REACT_PROFILER_TYPE = 60114;
|
|
var REACT_PROVIDER_TYPE = 60109;
|
|
var REACT_CONTEXT_TYPE = 60110;
|
|
var REACT_FORWARD_REF_TYPE = 60112;
|
|
var REACT_SUSPENSE_TYPE = 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
var REACT_MEMO_TYPE = 60115;
|
|
var REACT_LAZY_TYPE = 60116;
|
|
var REACT_BLOCK_TYPE = 60121;
|
|
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
var REACT_SCOPE_TYPE = 60119;
|
|
var REACT_OPAQUE_ID_TYPE = 60128;
|
|
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
var REACT_OFFSCREEN_TYPE = 60130;
|
|
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
|
|
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
}
|
|
var enableScopeAPI = false;
|
|
function isValidElementType(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
var Fragment = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isContextConsumer(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef;
|
|
exports.Fragment = Fragment;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isValidElementType = isValidElementType;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/index.js
|
|
var require_react_is2 = __commonJS({
|
|
"node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development2();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/getDisplayName.js
|
|
var require_getDisplayName = __commonJS({
|
|
"node_modules/@mui/utils/getDisplayName.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDisplayName;
|
|
exports.getFunctionName = getFunctionName;
|
|
var _reactIs = require_react_is2();
|
|
var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
function getFunctionName(fn) {
|
|
const match = `${fn}`.match(fnNameMatchRegex);
|
|
const name = match && match[1];
|
|
return name || "";
|
|
}
|
|
function getFunctionComponentName(Component, fallback = "") {
|
|
return Component.displayName || Component.name || getFunctionName(Component) || fallback;
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
const functionName = getFunctionComponentName(innerType);
|
|
return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
|
|
}
|
|
function getDisplayName(Component) {
|
|
if (Component == null) {
|
|
return void 0;
|
|
}
|
|
if (typeof Component === "string") {
|
|
return Component;
|
|
}
|
|
if (typeof Component === "function") {
|
|
return getFunctionComponentName(Component, "Component");
|
|
}
|
|
if (typeof Component === "object") {
|
|
switch (Component.$$typeof) {
|
|
case _reactIs.ForwardRef:
|
|
return getWrappedName(Component, Component.render, "ForwardRef");
|
|
case _reactIs.Memo:
|
|
return getWrappedName(Component, Component.type, "memo");
|
|
default:
|
|
return void 0;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/HTMLElementType.js
|
|
var require_HTMLElementType = __commonJS({
|
|
"node_modules/@mui/utils/HTMLElementType.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = HTMLElementType;
|
|
function HTMLElementType(props, propName, componentName, location, propFullName) {
|
|
if (false) {
|
|
return null;
|
|
}
|
|
const propValue = props[propName];
|
|
const safePropName = propFullName || propName;
|
|
if (propValue == null) {
|
|
return null;
|
|
}
|
|
if (propValue && propValue.nodeType !== 1) {
|
|
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an HTMLElement.`);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/ponyfillGlobal.js
|
|
var require_ponyfillGlobal = __commonJS({
|
|
"node_modules/@mui/utils/ponyfillGlobal.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _default = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")();
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/refType.js
|
|
var require_refType = __commonJS({
|
|
"node_modules/@mui/utils/refType.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var refType = _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]);
|
|
var _default = refType;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/capitalize.js
|
|
var require_capitalize = __commonJS({
|
|
"node_modules/@mui/utils/capitalize.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = capitalize;
|
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require_formatMuiErrorMessage());
|
|
function capitalize(string) {
|
|
if (typeof string !== "string") {
|
|
throw new Error(true ? `MUI: \`capitalize(string)\` expects a string argument.` : (0, _formatMuiErrorMessage2.default)(7));
|
|
}
|
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/createChainedFunction.js
|
|
var require_createChainedFunction = __commonJS({
|
|
"node_modules/@mui/utils/createChainedFunction.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createChainedFunction;
|
|
function createChainedFunction(...funcs) {
|
|
return funcs.reduce((acc, func) => {
|
|
if (func == null) {
|
|
return acc;
|
|
}
|
|
return function chainedFunction(...args) {
|
|
acc.apply(this, args);
|
|
func.apply(this, args);
|
|
};
|
|
}, () => {
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/debounce.js
|
|
var require_debounce = __commonJS({
|
|
"node_modules/@mui/utils/debounce.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = debounce;
|
|
function debounce(func, wait = 166) {
|
|
let timeout;
|
|
function debounced(...args) {
|
|
const later = () => {
|
|
func.apply(this, args);
|
|
};
|
|
clearTimeout(timeout);
|
|
timeout = setTimeout(later, wait);
|
|
}
|
|
debounced.clear = () => {
|
|
clearTimeout(timeout);
|
|
};
|
|
return debounced;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/deprecatedPropType.js
|
|
var require_deprecatedPropType = __commonJS({
|
|
"node_modules/@mui/utils/deprecatedPropType.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = deprecatedPropType;
|
|
function deprecatedPropType(validator, reason) {
|
|
if (false) {
|
|
return () => null;
|
|
}
|
|
return (props, propName, componentName, location, propFullName) => {
|
|
const componentNameSafe = componentName || "<<anonymous>>";
|
|
const propFullNameSafe = propFullName || propName;
|
|
if (typeof props[propName] !== "undefined") {
|
|
return new Error(`The ${location} \`${propFullNameSafe}\` of \`${componentNameSafe}\` is deprecated. ${reason}`);
|
|
}
|
|
return null;
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/isMuiElement.js
|
|
var require_isMuiElement = __commonJS({
|
|
"node_modules/@mui/utils/isMuiElement.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isMuiElement;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function isMuiElement(element, muiNames) {
|
|
return /* @__PURE__ */ React31.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/ownerDocument.js
|
|
var require_ownerDocument = __commonJS({
|
|
"node_modules/@mui/utils/ownerDocument.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = ownerDocument;
|
|
function ownerDocument(node) {
|
|
return node && node.ownerDocument || document;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/ownerWindow.js
|
|
var require_ownerWindow = __commonJS({
|
|
"node_modules/@mui/utils/ownerWindow.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = ownerWindow;
|
|
var _ownerDocument = _interopRequireDefault(require_ownerDocument());
|
|
function ownerWindow(node) {
|
|
const doc = (0, _ownerDocument.default)(node);
|
|
return doc.defaultView || window;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/requirePropFactory.js
|
|
var require_requirePropFactory = __commonJS({
|
|
"node_modules/@mui/utils/requirePropFactory.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = requirePropFactory;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
function requirePropFactory(componentNameInError, Component) {
|
|
if (false) {
|
|
return () => null;
|
|
}
|
|
const prevPropTypes = Component ? (0, _extends2.default)({}, Component.propTypes) : null;
|
|
const requireProp = (requiredProp) => (props, propName, componentName, location, propFullName, ...args) => {
|
|
const propFullNameSafe = propFullName || propName;
|
|
const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
|
|
if (defaultTypeChecker) {
|
|
const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);
|
|
if (typeCheckerResult) {
|
|
return typeCheckerResult;
|
|
}
|
|
}
|
|
if (typeof props[propName] !== "undefined" && !props[requiredProp]) {
|
|
return new Error(`The prop \`${propFullNameSafe}\` of \`${componentNameInError}\` can only be used together with the \`${requiredProp}\` prop.`);
|
|
}
|
|
return null;
|
|
};
|
|
return requireProp;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/setRef.js
|
|
var require_setRef = __commonJS({
|
|
"node_modules/@mui/utils/setRef.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setRef;
|
|
function setRef(ref, value) {
|
|
if (typeof ref === "function") {
|
|
ref(value);
|
|
} else if (ref) {
|
|
ref.current = value;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useEnhancedEffect.js
|
|
var require_useEnhancedEffect = __commonJS({
|
|
"node_modules/@mui/utils/useEnhancedEffect.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useEnhancedEffect = typeof window !== "undefined" ? React31.useLayoutEffect : React31.useEffect;
|
|
var _default = useEnhancedEffect;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useId.js
|
|
var require_useId = __commonJS({
|
|
"node_modules/@mui/utils/useId.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useId;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var globalId = 0;
|
|
function useGlobalId(idOverride) {
|
|
const [defaultId, setDefaultId] = React31.useState(idOverride);
|
|
const id = idOverride || defaultId;
|
|
React31.useEffect(() => {
|
|
if (defaultId == null) {
|
|
globalId += 1;
|
|
setDefaultId(`mui-${globalId}`);
|
|
}
|
|
}, [defaultId]);
|
|
return id;
|
|
}
|
|
var maybeReactUseId = React31["useId"];
|
|
function useId(idOverride) {
|
|
if (maybeReactUseId !== void 0) {
|
|
const reactId = maybeReactUseId();
|
|
return idOverride != null ? idOverride : reactId;
|
|
}
|
|
return useGlobalId(idOverride);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/unsupportedProp.js
|
|
var require_unsupportedProp = __commonJS({
|
|
"node_modules/@mui/utils/unsupportedProp.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = unsupportedProp;
|
|
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
if (false) {
|
|
return null;
|
|
}
|
|
const propFullNameSafe = propFullName || propName;
|
|
if (typeof props[propName] !== "undefined") {
|
|
return new Error(`The prop \`${propFullNameSafe}\` is not supported. Please remove it.`);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useControlled.js
|
|
var require_useControlled = __commonJS({
|
|
"node_modules/@mui/utils/useControlled.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useControlled;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useControlled({
|
|
controlled,
|
|
default: defaultProp,
|
|
name,
|
|
state = "value"
|
|
}) {
|
|
const {
|
|
current: isControlled
|
|
} = React31.useRef(controlled !== void 0);
|
|
const [valueState, setValue] = React31.useState(defaultProp);
|
|
const value = isControlled ? controlled : valueState;
|
|
if (true) {
|
|
React31.useEffect(() => {
|
|
if (isControlled !== (controlled !== void 0)) {
|
|
console.error([`MUI: A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
|
|
}
|
|
}, [state, name, controlled]);
|
|
const {
|
|
current: defaultValue
|
|
} = React31.useRef(defaultProp);
|
|
React31.useEffect(() => {
|
|
if (!isControlled && defaultValue !== defaultProp) {
|
|
console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
|
|
}
|
|
}, [JSON.stringify(defaultProp)]);
|
|
}
|
|
const setValueIfUncontrolled = React31.useCallback((newValue) => {
|
|
if (!isControlled) {
|
|
setValue(newValue);
|
|
}
|
|
}, []);
|
|
return [value, setValueIfUncontrolled];
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useEventCallback.js
|
|
var require_useEventCallback = __commonJS({
|
|
"node_modules/@mui/utils/useEventCallback.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useEventCallback;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _useEnhancedEffect = _interopRequireDefault(require_useEnhancedEffect());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useEventCallback(fn) {
|
|
const ref = React31.useRef(fn);
|
|
(0, _useEnhancedEffect.default)(() => {
|
|
ref.current = fn;
|
|
});
|
|
return React31.useCallback((...args) => (0, ref.current)(...args), []);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useForkRef.js
|
|
var require_useForkRef = __commonJS({
|
|
"node_modules/@mui/utils/useForkRef.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useForkRef;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _setRef = _interopRequireDefault(require_setRef());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useForkRef(refA, refB) {
|
|
return React31.useMemo(() => {
|
|
if (refA == null && refB == null) {
|
|
return null;
|
|
}
|
|
return (refValue) => {
|
|
(0, _setRef.default)(refA, refValue);
|
|
(0, _setRef.default)(refB, refValue);
|
|
};
|
|
}, [refA, refB]);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/useIsFocusVisible.js
|
|
var require_useIsFocusVisible = __commonJS({
|
|
"node_modules/@mui/utils/useIsFocusVisible.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useIsFocusVisible;
|
|
exports.teardown = teardown;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var hadKeyboardEvent = true;
|
|
var hadFocusVisibleRecently = false;
|
|
var hadFocusVisibleRecentlyTimeout;
|
|
var inputTypesWhitelist = {
|
|
text: true,
|
|
search: true,
|
|
url: true,
|
|
tel: true,
|
|
email: true,
|
|
password: true,
|
|
number: true,
|
|
date: true,
|
|
month: true,
|
|
week: true,
|
|
time: true,
|
|
datetime: true,
|
|
"datetime-local": true
|
|
};
|
|
function focusTriggersKeyboardModality(node) {
|
|
const {
|
|
type,
|
|
tagName
|
|
} = node;
|
|
if (tagName === "INPUT" && inputTypesWhitelist[type] && !node.readOnly) {
|
|
return true;
|
|
}
|
|
if (tagName === "TEXTAREA" && !node.readOnly) {
|
|
return true;
|
|
}
|
|
if (node.isContentEditable) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function handleKeyDown(event) {
|
|
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
return;
|
|
}
|
|
hadKeyboardEvent = true;
|
|
}
|
|
function handlePointerDown() {
|
|
hadKeyboardEvent = false;
|
|
}
|
|
function handleVisibilityChange() {
|
|
if (this.visibilityState === "hidden") {
|
|
if (hadFocusVisibleRecently) {
|
|
hadKeyboardEvent = true;
|
|
}
|
|
}
|
|
}
|
|
function prepare(doc) {
|
|
doc.addEventListener("keydown", handleKeyDown, true);
|
|
doc.addEventListener("mousedown", handlePointerDown, true);
|
|
doc.addEventListener("pointerdown", handlePointerDown, true);
|
|
doc.addEventListener("touchstart", handlePointerDown, true);
|
|
doc.addEventListener("visibilitychange", handleVisibilityChange, true);
|
|
}
|
|
function teardown(doc) {
|
|
doc.removeEventListener("keydown", handleKeyDown, true);
|
|
doc.removeEventListener("mousedown", handlePointerDown, true);
|
|
doc.removeEventListener("pointerdown", handlePointerDown, true);
|
|
doc.removeEventListener("touchstart", handlePointerDown, true);
|
|
doc.removeEventListener("visibilitychange", handleVisibilityChange, true);
|
|
}
|
|
function isFocusVisible(event) {
|
|
const {
|
|
target
|
|
} = event;
|
|
try {
|
|
return target.matches(":focus-visible");
|
|
} catch (error) {
|
|
}
|
|
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
}
|
|
function useIsFocusVisible() {
|
|
const ref = React31.useCallback((node) => {
|
|
if (node != null) {
|
|
prepare(node.ownerDocument);
|
|
}
|
|
}, []);
|
|
const isFocusVisibleRef = React31.useRef(false);
|
|
function handleBlurVisible() {
|
|
if (isFocusVisibleRef.current) {
|
|
hadFocusVisibleRecently = true;
|
|
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {
|
|
hadFocusVisibleRecently = false;
|
|
}, 100);
|
|
isFocusVisibleRef.current = false;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function handleFocusVisible(event) {
|
|
if (isFocusVisible(event)) {
|
|
isFocusVisibleRef.current = true;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
return {
|
|
isFocusVisibleRef,
|
|
onFocus: handleFocusVisible,
|
|
onBlur: handleBlurVisible,
|
|
ref
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/getScrollbarSize.js
|
|
var require_getScrollbarSize = __commonJS({
|
|
"node_modules/@mui/utils/getScrollbarSize.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getScrollbarSize;
|
|
function getScrollbarSize(doc) {
|
|
const documentWidth = doc.documentElement.clientWidth;
|
|
return Math.abs(window.innerWidth - documentWidth);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/scrollLeft.js
|
|
var require_scrollLeft = __commonJS({
|
|
"node_modules/@mui/utils/scrollLeft.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.detectScrollType = detectScrollType;
|
|
exports.getNormalizedScrollLeft = getNormalizedScrollLeft;
|
|
var cachedType;
|
|
function detectScrollType() {
|
|
if (cachedType) {
|
|
return cachedType;
|
|
}
|
|
const dummy = document.createElement("div");
|
|
const container = document.createElement("div");
|
|
container.style.width = "10px";
|
|
container.style.height = "1px";
|
|
dummy.appendChild(container);
|
|
dummy.dir = "rtl";
|
|
dummy.style.fontSize = "14px";
|
|
dummy.style.width = "4px";
|
|
dummy.style.height = "1px";
|
|
dummy.style.position = "absolute";
|
|
dummy.style.top = "-1000px";
|
|
dummy.style.overflow = "scroll";
|
|
document.body.appendChild(dummy);
|
|
cachedType = "reverse";
|
|
if (dummy.scrollLeft > 0) {
|
|
cachedType = "default";
|
|
} else {
|
|
dummy.scrollLeft = 1;
|
|
if (dummy.scrollLeft === 0) {
|
|
cachedType = "negative";
|
|
}
|
|
}
|
|
document.body.removeChild(dummy);
|
|
return cachedType;
|
|
}
|
|
function getNormalizedScrollLeft(element, direction) {
|
|
const scrollLeft = element.scrollLeft;
|
|
if (direction !== "rtl") {
|
|
return scrollLeft;
|
|
}
|
|
const type = detectScrollType();
|
|
switch (type) {
|
|
case "negative":
|
|
return element.scrollWidth - element.clientWidth + scrollLeft;
|
|
case "reverse":
|
|
return element.scrollWidth - element.clientWidth - scrollLeft;
|
|
default:
|
|
return scrollLeft;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/usePreviousProps.js
|
|
var require_usePreviousProps = __commonJS({
|
|
"node_modules/@mui/utils/usePreviousProps.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var usePreviousProps = (value) => {
|
|
const ref = React31.useRef({});
|
|
React31.useEffect(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref.current;
|
|
};
|
|
var _default = usePreviousProps;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/visuallyHidden.js
|
|
var require_visuallyHidden = __commonJS({
|
|
"node_modules/@mui/utils/visuallyHidden.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var visuallyHidden = {
|
|
border: 0,
|
|
clip: "rect(0 0 0 0)",
|
|
height: "1px",
|
|
margin: -1,
|
|
overflow: "hidden",
|
|
padding: 0,
|
|
position: "absolute",
|
|
whiteSpace: "nowrap",
|
|
width: "1px"
|
|
};
|
|
var _default = visuallyHidden;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/integerPropType.js
|
|
var require_integerPropType = __commonJS({
|
|
"node_modules/@mui/utils/integerPropType.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getTypeByValue = getTypeByValue;
|
|
function getTypeByValue(value) {
|
|
const valueType = typeof value;
|
|
switch (valueType) {
|
|
case "number":
|
|
if (Number.isNaN(value)) {
|
|
return "NaN";
|
|
}
|
|
if (!Number.isFinite(value)) {
|
|
return "Infinity";
|
|
}
|
|
if (value !== Math.floor(value)) {
|
|
return "float";
|
|
}
|
|
return "number";
|
|
case "object":
|
|
if (value === null) {
|
|
return "null";
|
|
}
|
|
return value.constructor.name;
|
|
default:
|
|
return valueType;
|
|
}
|
|
}
|
|
function ponyfillIsInteger(x) {
|
|
return typeof x === "number" && isFinite(x) && Math.floor(x) === x;
|
|
}
|
|
var isInteger = Number.isInteger || ponyfillIsInteger;
|
|
function requiredInteger(props, propName, componentName, location) {
|
|
const propValue = props[propName];
|
|
if (propValue == null || !isInteger(propValue)) {
|
|
const propType = getTypeByValue(propValue);
|
|
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
}
|
|
return null;
|
|
}
|
|
function validator(props, propName, ...other) {
|
|
const propValue = props[propName];
|
|
if (propValue === void 0) {
|
|
return null;
|
|
}
|
|
return requiredInteger(props, propName, ...other);
|
|
}
|
|
function validatorNoop() {
|
|
return null;
|
|
}
|
|
validator.isRequired = requiredInteger;
|
|
validatorNoop.isRequired = validatorNoop;
|
|
var _default = false ? validatorNoop : validator;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/resolveProps.js
|
|
var require_resolveProps = __commonJS({
|
|
"node_modules/@mui/utils/resolveProps.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = resolveProps;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
function resolveProps(defaultProps, props) {
|
|
const output = (0, _extends2.default)({}, props);
|
|
Object.keys(defaultProps).forEach((propName) => {
|
|
if (output[propName] === void 0) {
|
|
output[propName] = defaultProps[propName];
|
|
}
|
|
});
|
|
return output;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/utils/index.js
|
|
var require_utils = __commonJS({
|
|
"node_modules/@mui/utils/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "HTMLElementType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _HTMLElementType.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "chainPropTypes", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _chainPropTypes.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "deepmerge", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _deepmerge.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "elementAcceptingRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _elementAcceptingRef.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "elementTypeAcceptingRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _elementTypeAcceptingRef.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "exactProp", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _exactProp.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "formatMuiErrorMessage", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _formatMuiErrorMessage.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getDisplayName", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _getDisplayName.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "integerPropType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _integerPropType.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "internal_resolveProps", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _resolveProps.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "isPlainObject", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _deepmerge.isPlainObject;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ponyfillGlobal", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ponyfillGlobal.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "refType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _refType.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_capitalize", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _capitalize.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_createChainedFunction", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createChainedFunction.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_debounce", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _debounce.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_deprecatedPropType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _deprecatedPropType.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_detectScrollType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _scrollLeft.detectScrollType;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_getNormalizedScrollLeft", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _scrollLeft.getNormalizedScrollLeft;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_getScrollbarSize", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _getScrollbarSize.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_isMuiElement", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _isMuiElement.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_ownerDocument", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ownerDocument.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_ownerWindow", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ownerWindow.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_requirePropFactory", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _requirePropFactory.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_setRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _setRef.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_unsupportedProp", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _unsupportedProp.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useControlled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useControlled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useEnhancedEffect", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useEnhancedEffect.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useEventCallback", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useEventCallback.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useForkRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useForkRef.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useId", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useId.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useIsFocusVisible", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useIsFocusVisible.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "usePreviousProps", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _usePreviousProps.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "visuallyHidden", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _visuallyHidden.default;
|
|
}
|
|
});
|
|
var _chainPropTypes = _interopRequireDefault(require_chainPropTypes());
|
|
var _deepmerge = _interopRequireWildcard(require_deepmerge());
|
|
var _elementAcceptingRef = _interopRequireDefault(require_elementAcceptingRef());
|
|
var _elementTypeAcceptingRef = _interopRequireDefault(require_elementTypeAcceptingRef());
|
|
var _exactProp = _interopRequireDefault(require_exactProp());
|
|
var _formatMuiErrorMessage = _interopRequireDefault(require_formatMuiErrorMessage());
|
|
var _getDisplayName = _interopRequireDefault(require_getDisplayName());
|
|
var _HTMLElementType = _interopRequireDefault(require_HTMLElementType());
|
|
var _ponyfillGlobal = _interopRequireDefault(require_ponyfillGlobal());
|
|
var _refType = _interopRequireDefault(require_refType());
|
|
var _capitalize = _interopRequireDefault(require_capitalize());
|
|
var _createChainedFunction = _interopRequireDefault(require_createChainedFunction());
|
|
var _debounce = _interopRequireDefault(require_debounce());
|
|
var _deprecatedPropType = _interopRequireDefault(require_deprecatedPropType());
|
|
var _isMuiElement = _interopRequireDefault(require_isMuiElement());
|
|
var _ownerDocument = _interopRequireDefault(require_ownerDocument());
|
|
var _ownerWindow = _interopRequireDefault(require_ownerWindow());
|
|
var _requirePropFactory = _interopRequireDefault(require_requirePropFactory());
|
|
var _setRef = _interopRequireDefault(require_setRef());
|
|
var _useEnhancedEffect = _interopRequireDefault(require_useEnhancedEffect());
|
|
var _useId = _interopRequireDefault(require_useId());
|
|
var _unsupportedProp = _interopRequireDefault(require_unsupportedProp());
|
|
var _useControlled = _interopRequireDefault(require_useControlled());
|
|
var _useEventCallback = _interopRequireDefault(require_useEventCallback());
|
|
var _useForkRef = _interopRequireDefault(require_useForkRef());
|
|
var _useIsFocusVisible = _interopRequireDefault(require_useIsFocusVisible());
|
|
var _getScrollbarSize = _interopRequireDefault(require_getScrollbarSize());
|
|
var _scrollLeft = require_scrollLeft();
|
|
var _usePreviousProps = _interopRequireDefault(require_usePreviousProps());
|
|
var _visuallyHidden = _interopRequireDefault(require_visuallyHidden());
|
|
var _integerPropType = _interopRequireDefault(require_integerPropType());
|
|
var _resolveProps = _interopRequireDefault(require_resolveProps());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/capitalize.js
|
|
var require_capitalize2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/capitalize.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_capitalize;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/createChainedFunction.js
|
|
var require_createChainedFunction2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/createChainedFunction.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_createChainedFunction;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
|
|
var require_objectWithoutPropertiesLoose = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module2) {
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null)
|
|
return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0)
|
|
continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
module2.exports = _objectWithoutPropertiesLoose, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/clsx/dist/clsx.js
|
|
var require_clsx = __commonJS({
|
|
"node_modules/clsx/dist/clsx.js"(exports, module2) {
|
|
function toVal(mix) {
|
|
var k, y, str = "";
|
|
if (typeof mix === "string" || typeof mix === "number") {
|
|
str += mix;
|
|
} else if (typeof mix === "object") {
|
|
if (Array.isArray(mix)) {
|
|
for (k = 0; k < mix.length; k++) {
|
|
if (mix[k]) {
|
|
if (y = toVal(mix[k])) {
|
|
str && (str += " ");
|
|
str += y;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
for (k in mix) {
|
|
if (mix[k]) {
|
|
str && (str += " ");
|
|
str += k;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
module2.exports = function() {
|
|
var i = 0, tmp, x, str = "";
|
|
while (i < arguments.length) {
|
|
if (tmp = arguments[i++]) {
|
|
if (x = toVal(tmp)) {
|
|
str && (str += " ");
|
|
str += x;
|
|
}
|
|
}
|
|
}
|
|
return str;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/isHostComponent.js
|
|
var require_isHostComponent = __commonJS({
|
|
"node_modules/@mui/base/node/utils/isHostComponent.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
function isHostComponent(element) {
|
|
return typeof element === "string";
|
|
}
|
|
var _default = isHostComponent;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/appendOwnerState.js
|
|
var require_appendOwnerState = __commonJS({
|
|
"node_modules/@mui/base/node/utils/appendOwnerState.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = appendOwnerState;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
function appendOwnerState(elementType, existingProps = {}, ownerState) {
|
|
if ((0, _isHostComponent.default)(elementType)) {
|
|
return existingProps;
|
|
}
|
|
return (0, _extends2.default)({}, existingProps, {
|
|
ownerState: (0, _extends2.default)({}, existingProps.ownerState, ownerState)
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/areArraysEqual.js
|
|
var require_areArraysEqual = __commonJS({
|
|
"node_modules/@mui/base/node/utils/areArraysEqual.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = areArraysEqual;
|
|
function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
|
|
return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/extractEventHandlers.js
|
|
var require_extractEventHandlers = __commonJS({
|
|
"node_modules/@mui/base/node/utils/extractEventHandlers.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = extractEventHandlers;
|
|
function extractEventHandlers(object, excludeKeys = []) {
|
|
if (object === void 0) {
|
|
return {};
|
|
}
|
|
const result = {};
|
|
Object.keys(object).filter((prop) => prop.match(/^on[A-Z]/) && typeof object[prop] === "function" && !excludeKeys.includes(prop)).forEach((prop) => {
|
|
result[prop] = object[prop];
|
|
});
|
|
return result;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/types.js
|
|
var require_types = __commonJS({
|
|
"node_modules/@mui/base/node/utils/types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/utils/index.js
|
|
var require_utils2 = __commonJS({
|
|
"node_modules/@mui/base/node/utils/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
appendOwnerState: true,
|
|
areArraysEqual: true,
|
|
extractEventHandlers: true,
|
|
isHostComponent: true
|
|
};
|
|
Object.defineProperty(exports, "appendOwnerState", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _appendOwnerState.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "areArraysEqual", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _areArraysEqual.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "extractEventHandlers", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _extractEventHandlers.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "isHostComponent", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _isHostComponent.default;
|
|
}
|
|
});
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _areArraysEqual = _interopRequireDefault(require_areArraysEqual());
|
|
var _extractEventHandlers = _interopRequireDefault(require_extractEventHandlers());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
var _types = require_types();
|
|
Object.keys(_types).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _types[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _types[key];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/AutocompleteUnstyled/useAutocomplete.js
|
|
var require_useAutocomplete = __commonJS({
|
|
"node_modules/@mui/base/node/AutocompleteUnstyled/useAutocomplete.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.createFilterOptions = createFilterOptions;
|
|
exports.default = useAutocomplete;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function stripDiacritics(string) {
|
|
return typeof string.normalize !== "undefined" ? string.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : string;
|
|
}
|
|
function createFilterOptions(config = {}) {
|
|
const {
|
|
ignoreAccents = true,
|
|
ignoreCase = true,
|
|
limit,
|
|
matchFrom = "any",
|
|
stringify: stringify2,
|
|
trim = false
|
|
} = config;
|
|
return (options, {
|
|
inputValue,
|
|
getOptionLabel
|
|
}) => {
|
|
let input = trim ? inputValue.trim() : inputValue;
|
|
if (ignoreCase) {
|
|
input = input.toLowerCase();
|
|
}
|
|
if (ignoreAccents) {
|
|
input = stripDiacritics(input);
|
|
}
|
|
const filteredOptions = options.filter((option) => {
|
|
let candidate = (stringify2 || getOptionLabel)(option);
|
|
if (ignoreCase) {
|
|
candidate = candidate.toLowerCase();
|
|
}
|
|
if (ignoreAccents) {
|
|
candidate = stripDiacritics(candidate);
|
|
}
|
|
return matchFrom === "start" ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
|
|
});
|
|
return typeof limit === "number" ? filteredOptions.slice(0, limit) : filteredOptions;
|
|
};
|
|
}
|
|
function findIndex(array, comp) {
|
|
for (let i = 0; i < array.length; i += 1) {
|
|
if (comp(array[i])) {
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
var defaultFilterOptions = createFilterOptions();
|
|
var pageSize = 5;
|
|
function useAutocomplete(props) {
|
|
const {
|
|
autoComplete = false,
|
|
autoHighlight = false,
|
|
autoSelect = false,
|
|
blurOnSelect = false,
|
|
disabled: disabledProp,
|
|
clearOnBlur = !props.freeSolo,
|
|
clearOnEscape = false,
|
|
componentName = "useAutocomplete",
|
|
defaultValue = props.multiple ? [] : null,
|
|
disableClearable = false,
|
|
disableCloseOnSelect = false,
|
|
disabledItemsFocusable = false,
|
|
disableListWrap = false,
|
|
filterOptions = defaultFilterOptions,
|
|
filterSelectedOptions = false,
|
|
freeSolo = false,
|
|
getOptionDisabled,
|
|
getOptionLabel: getOptionLabelProp = (option) => {
|
|
var _option$label;
|
|
return (_option$label = option.label) != null ? _option$label : option;
|
|
},
|
|
isOptionEqualToValue = (option, value2) => option === value2,
|
|
groupBy,
|
|
handleHomeEndKeys = !props.freeSolo,
|
|
id: idProp,
|
|
includeInputInList = false,
|
|
inputValue: inputValueProp,
|
|
multiple = false,
|
|
onChange,
|
|
onClose,
|
|
onHighlightChange,
|
|
onInputChange,
|
|
onOpen,
|
|
open: openProp,
|
|
openOnFocus = false,
|
|
options,
|
|
readOnly = false,
|
|
selectOnFocus = !props.freeSolo,
|
|
value: valueProp
|
|
} = props;
|
|
const id = (0, _utils.unstable_useId)(idProp);
|
|
let getOptionLabel = getOptionLabelProp;
|
|
getOptionLabel = (option) => {
|
|
const optionLabel = getOptionLabelProp(option);
|
|
if (typeof optionLabel !== "string") {
|
|
if (true) {
|
|
const erroneousReturn = optionLabel === void 0 ? "undefined" : `${typeof optionLabel} (${optionLabel})`;
|
|
console.error(`MUI: The \`getOptionLabel\` method of ${componentName} returned ${erroneousReturn} instead of a string for ${JSON.stringify(option)}.`);
|
|
}
|
|
return String(optionLabel);
|
|
}
|
|
return optionLabel;
|
|
};
|
|
const ignoreFocus = React31.useRef(false);
|
|
const firstFocus = React31.useRef(true);
|
|
const inputRef = React31.useRef(null);
|
|
const listboxRef = React31.useRef(null);
|
|
const [anchorEl, setAnchorEl] = React31.useState(null);
|
|
const [focusedTag, setFocusedTag] = React31.useState(-1);
|
|
const defaultHighlighted = autoHighlight ? 0 : -1;
|
|
const highlightedIndexRef = React31.useRef(defaultHighlighted);
|
|
const [value, setValueState] = (0, _utils.unstable_useControlled)({
|
|
controlled: valueProp,
|
|
default: defaultValue,
|
|
name: componentName
|
|
});
|
|
const [inputValue, setInputValueState] = (0, _utils.unstable_useControlled)({
|
|
controlled: inputValueProp,
|
|
default: "",
|
|
name: componentName,
|
|
state: "inputValue"
|
|
});
|
|
const [focused, setFocused] = React31.useState(false);
|
|
const resetInputValue = React31.useCallback((event, newValue) => {
|
|
const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;
|
|
if (!isOptionSelected && !clearOnBlur) {
|
|
return;
|
|
}
|
|
let newInputValue;
|
|
if (multiple) {
|
|
newInputValue = "";
|
|
} else if (newValue == null) {
|
|
newInputValue = "";
|
|
} else {
|
|
const optionLabel = getOptionLabel(newValue);
|
|
newInputValue = typeof optionLabel === "string" ? optionLabel : "";
|
|
}
|
|
if (inputValue === newInputValue) {
|
|
return;
|
|
}
|
|
setInputValueState(newInputValue);
|
|
if (onInputChange) {
|
|
onInputChange(event, newInputValue, "reset");
|
|
}
|
|
}, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);
|
|
const prevValue = React31.useRef();
|
|
React31.useEffect(() => {
|
|
const valueChange = value !== prevValue.current;
|
|
prevValue.current = value;
|
|
if (focused && !valueChange) {
|
|
return;
|
|
}
|
|
if (freeSolo && !valueChange) {
|
|
return;
|
|
}
|
|
resetInputValue(null, value);
|
|
}, [value, resetInputValue, focused, prevValue, freeSolo]);
|
|
const [open, setOpenState] = (0, _utils.unstable_useControlled)({
|
|
controlled: openProp,
|
|
default: false,
|
|
name: componentName,
|
|
state: "open"
|
|
});
|
|
const [inputPristine, setInputPristine] = React31.useState(true);
|
|
const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
|
|
const popupOpen = open && !readOnly;
|
|
const filteredOptions = popupOpen ? filterOptions(options.filter((option) => {
|
|
if (filterSelectedOptions && (multiple ? value : [value]).some((value2) => value2 !== null && isOptionEqualToValue(option, value2))) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}), {
|
|
inputValue: inputValueIsSelectedValue && inputPristine ? "" : inputValue,
|
|
getOptionLabel
|
|
}) : [];
|
|
const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
|
|
if (true) {
|
|
if (value !== null && !freeSolo && options.length > 0) {
|
|
const missingValue = (multiple ? value : [value]).filter((value2) => !options.some((option) => isOptionEqualToValue(option, value2)));
|
|
if (missingValue.length > 0) {
|
|
console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join("\n"));
|
|
}
|
|
}
|
|
}
|
|
const focusTag = (0, _utils.unstable_useEventCallback)((tagToFocus) => {
|
|
if (tagToFocus === -1) {
|
|
inputRef.current.focus();
|
|
} else {
|
|
anchorEl.querySelector(`[data-tag-index="${tagToFocus}"]`).focus();
|
|
}
|
|
});
|
|
React31.useEffect(() => {
|
|
if (multiple && focusedTag > value.length - 1) {
|
|
setFocusedTag(-1);
|
|
focusTag(-1);
|
|
}
|
|
}, [value, multiple, focusedTag, focusTag]);
|
|
function validOptionIndex(index, direction) {
|
|
if (!listboxRef.current || index === -1) {
|
|
return -1;
|
|
}
|
|
let nextFocus = index;
|
|
while (true) {
|
|
if (direction === "next" && nextFocus === filteredOptions.length || direction === "previous" && nextFocus === -1) {
|
|
return -1;
|
|
}
|
|
const option = listboxRef.current.querySelector(`[data-option-index="${nextFocus}"]`);
|
|
const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute("aria-disabled") === "true";
|
|
if (option && !option.hasAttribute("tabindex") || nextFocusDisabled) {
|
|
nextFocus += direction === "next" ? 1 : -1;
|
|
} else {
|
|
return nextFocus;
|
|
}
|
|
}
|
|
}
|
|
const setHighlightedIndex = (0, _utils.unstable_useEventCallback)(({
|
|
event,
|
|
index,
|
|
reason = "auto"
|
|
}) => {
|
|
highlightedIndexRef.current = index;
|
|
if (index === -1) {
|
|
inputRef.current.removeAttribute("aria-activedescendant");
|
|
} else {
|
|
inputRef.current.setAttribute("aria-activedescendant", `${id}-option-${index}`);
|
|
}
|
|
if (onHighlightChange) {
|
|
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
|
}
|
|
if (!listboxRef.current) {
|
|
return;
|
|
}
|
|
const prev = listboxRef.current.querySelector('[role="option"].Mui-focused');
|
|
if (prev) {
|
|
prev.classList.remove("Mui-focused");
|
|
prev.classList.remove("Mui-focusVisible");
|
|
}
|
|
const listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]');
|
|
if (!listboxNode) {
|
|
return;
|
|
}
|
|
if (index === -1) {
|
|
listboxNode.scrollTop = 0;
|
|
return;
|
|
}
|
|
const option = listboxRef.current.querySelector(`[data-option-index="${index}"]`);
|
|
if (!option) {
|
|
return;
|
|
}
|
|
option.classList.add("Mui-focused");
|
|
if (reason === "keyboard") {
|
|
option.classList.add("Mui-focusVisible");
|
|
}
|
|
if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== "mouse") {
|
|
const element = option;
|
|
const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
|
|
const elementBottom = element.offsetTop + element.offsetHeight;
|
|
if (elementBottom > scrollBottom) {
|
|
listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
|
|
} else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
|
|
listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
|
|
}
|
|
}
|
|
});
|
|
const changeHighlightedIndex = (0, _utils.unstable_useEventCallback)(({
|
|
event,
|
|
diff,
|
|
direction = "next",
|
|
reason = "auto"
|
|
}) => {
|
|
if (!popupOpen) {
|
|
return;
|
|
}
|
|
const getNextIndex = () => {
|
|
const maxIndex = filteredOptions.length - 1;
|
|
if (diff === "reset") {
|
|
return defaultHighlighted;
|
|
}
|
|
if (diff === "start") {
|
|
return 0;
|
|
}
|
|
if (diff === "end") {
|
|
return maxIndex;
|
|
}
|
|
const newIndex = highlightedIndexRef.current + diff;
|
|
if (newIndex < 0) {
|
|
if (newIndex === -1 && includeInputInList) {
|
|
return -1;
|
|
}
|
|
if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
|
|
return 0;
|
|
}
|
|
return maxIndex;
|
|
}
|
|
if (newIndex > maxIndex) {
|
|
if (newIndex === maxIndex + 1 && includeInputInList) {
|
|
return -1;
|
|
}
|
|
if (disableListWrap || Math.abs(diff) > 1) {
|
|
return maxIndex;
|
|
}
|
|
return 0;
|
|
}
|
|
return newIndex;
|
|
};
|
|
const nextIndex = validOptionIndex(getNextIndex(), direction);
|
|
setHighlightedIndex({
|
|
index: nextIndex,
|
|
reason,
|
|
event
|
|
});
|
|
if (autoComplete && diff !== "reset") {
|
|
if (nextIndex === -1) {
|
|
inputRef.current.value = inputValue;
|
|
} else {
|
|
const option = getOptionLabel(filteredOptions[nextIndex]);
|
|
inputRef.current.value = option;
|
|
const index = option.toLowerCase().indexOf(inputValue.toLowerCase());
|
|
if (index === 0 && inputValue.length > 0) {
|
|
inputRef.current.setSelectionRange(inputValue.length, option.length);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
const syncHighlightedIndex = React31.useCallback(() => {
|
|
if (!popupOpen) {
|
|
return;
|
|
}
|
|
const valueItem = multiple ? value[0] : value;
|
|
if (filteredOptions.length === 0 || valueItem == null) {
|
|
changeHighlightedIndex({
|
|
diff: "reset"
|
|
});
|
|
return;
|
|
}
|
|
if (!listboxRef.current) {
|
|
return;
|
|
}
|
|
if (valueItem != null) {
|
|
const currentOption = filteredOptions[highlightedIndexRef.current];
|
|
if (multiple && currentOption && findIndex(value, (val) => isOptionEqualToValue(currentOption, val)) !== -1) {
|
|
return;
|
|
}
|
|
const itemIndex = findIndex(filteredOptions, (optionItem) => isOptionEqualToValue(optionItem, valueItem));
|
|
if (itemIndex === -1) {
|
|
changeHighlightedIndex({
|
|
diff: "reset"
|
|
});
|
|
} else {
|
|
setHighlightedIndex({
|
|
index: itemIndex
|
|
});
|
|
}
|
|
return;
|
|
}
|
|
if (highlightedIndexRef.current >= filteredOptions.length - 1) {
|
|
setHighlightedIndex({
|
|
index: filteredOptions.length - 1
|
|
});
|
|
return;
|
|
}
|
|
setHighlightedIndex({
|
|
index: highlightedIndexRef.current
|
|
});
|
|
}, [
|
|
filteredOptions.length,
|
|
multiple ? false : value,
|
|
filterSelectedOptions,
|
|
changeHighlightedIndex,
|
|
setHighlightedIndex,
|
|
popupOpen,
|
|
inputValue,
|
|
multiple
|
|
]);
|
|
const handleListboxRef = (0, _utils.unstable_useEventCallback)((node) => {
|
|
(0, _utils.unstable_setRef)(listboxRef, node);
|
|
if (!node) {
|
|
return;
|
|
}
|
|
syncHighlightedIndex();
|
|
});
|
|
if (true) {
|
|
React31.useEffect(() => {
|
|
if (!inputRef.current || inputRef.current.nodeName !== "INPUT") {
|
|
if (inputRef.current && inputRef.current.nodeName === "TEXTAREA") {
|
|
console.warn([`A textarea element was provided to ${componentName} where input was expected.`, `This is not a supported scenario but it may work under certain conditions.`, `A textarea keyboard navigation may conflict with Autocomplete controls (e.g. enter and arrow keys).`, `Make sure to test keyboard navigation and add custom event handlers if necessary.`].join("\n"));
|
|
} else {
|
|
console.error([`MUI: Unable to find the input element. It was resolved to ${inputRef.current} while an HTMLInputElement was expected.`, `Instead, ${componentName} expects an input element.`, "", componentName === "useAutocomplete" ? "Make sure you have binded getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join("\n"));
|
|
}
|
|
}
|
|
}, [componentName]);
|
|
}
|
|
React31.useEffect(() => {
|
|
syncHighlightedIndex();
|
|
}, [syncHighlightedIndex]);
|
|
const handleOpen = (event) => {
|
|
if (open) {
|
|
return;
|
|
}
|
|
setOpenState(true);
|
|
setInputPristine(true);
|
|
if (onOpen) {
|
|
onOpen(event);
|
|
}
|
|
};
|
|
const handleClose = (event, reason) => {
|
|
if (!open) {
|
|
return;
|
|
}
|
|
setOpenState(false);
|
|
if (onClose) {
|
|
onClose(event, reason);
|
|
}
|
|
};
|
|
const handleValue = (event, newValue, reason, details) => {
|
|
if (Array.isArray(value)) {
|
|
if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {
|
|
return;
|
|
}
|
|
} else if (value === newValue) {
|
|
return;
|
|
}
|
|
if (onChange) {
|
|
onChange(event, newValue, reason, details);
|
|
}
|
|
setValueState(newValue);
|
|
};
|
|
const isTouch = React31.useRef(false);
|
|
const selectNewValue = (event, option, reasonProp = "selectOption", origin = "options") => {
|
|
let reason = reasonProp;
|
|
let newValue = option;
|
|
if (multiple) {
|
|
newValue = Array.isArray(value) ? value.slice() : [];
|
|
if (true) {
|
|
const matches = newValue.filter((val) => isOptionEqualToValue(option, val));
|
|
if (matches.length > 1) {
|
|
console.error([`MUI: The \`isOptionEqualToValue\` method of ${componentName} do not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${matches.length} matches.`].join("\n"));
|
|
}
|
|
}
|
|
const itemIndex = findIndex(newValue, (valueItem) => isOptionEqualToValue(option, valueItem));
|
|
if (itemIndex === -1) {
|
|
newValue.push(option);
|
|
} else if (origin !== "freeSolo") {
|
|
newValue.splice(itemIndex, 1);
|
|
reason = "removeOption";
|
|
}
|
|
}
|
|
resetInputValue(event, newValue);
|
|
handleValue(event, newValue, reason, {
|
|
option
|
|
});
|
|
if (!disableCloseOnSelect && !event.ctrlKey && !event.metaKey) {
|
|
handleClose(event, reason);
|
|
}
|
|
if (blurOnSelect === true || blurOnSelect === "touch" && isTouch.current || blurOnSelect === "mouse" && !isTouch.current) {
|
|
inputRef.current.blur();
|
|
}
|
|
};
|
|
function validTagIndex(index, direction) {
|
|
if (index === -1) {
|
|
return -1;
|
|
}
|
|
let nextFocus = index;
|
|
while (true) {
|
|
if (direction === "next" && nextFocus === value.length || direction === "previous" && nextFocus === -1) {
|
|
return -1;
|
|
}
|
|
const option = anchorEl.querySelector(`[data-tag-index="${nextFocus}"]`);
|
|
if (!option || !option.hasAttribute("tabindex") || option.disabled || option.getAttribute("aria-disabled") === "true") {
|
|
nextFocus += direction === "next" ? 1 : -1;
|
|
} else {
|
|
return nextFocus;
|
|
}
|
|
}
|
|
}
|
|
const handleFocusTag = (event, direction) => {
|
|
if (!multiple) {
|
|
return;
|
|
}
|
|
handleClose(event, "toggleInput");
|
|
let nextTag = focusedTag;
|
|
if (focusedTag === -1) {
|
|
if (inputValue === "" && direction === "previous") {
|
|
nextTag = value.length - 1;
|
|
}
|
|
} else {
|
|
nextTag += direction === "next" ? 1 : -1;
|
|
if (nextTag < 0) {
|
|
nextTag = 0;
|
|
}
|
|
if (nextTag === value.length) {
|
|
nextTag = -1;
|
|
}
|
|
}
|
|
nextTag = validTagIndex(nextTag, direction);
|
|
setFocusedTag(nextTag);
|
|
focusTag(nextTag);
|
|
};
|
|
const handleClear = (event) => {
|
|
ignoreFocus.current = true;
|
|
setInputValueState("");
|
|
if (onInputChange) {
|
|
onInputChange(event, "", "clear");
|
|
}
|
|
handleValue(event, multiple ? [] : null, "clear");
|
|
};
|
|
const handleKeyDown = (other) => (event) => {
|
|
if (other.onKeyDown) {
|
|
other.onKeyDown(event);
|
|
}
|
|
if (event.defaultMuiPrevented) {
|
|
return;
|
|
}
|
|
if (focusedTag !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(event.key) === -1) {
|
|
setFocusedTag(-1);
|
|
focusTag(-1);
|
|
}
|
|
if (event.which !== 229) {
|
|
switch (event.key) {
|
|
case "Home":
|
|
if (popupOpen && handleHomeEndKeys) {
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: "start",
|
|
direction: "next",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
}
|
|
break;
|
|
case "End":
|
|
if (popupOpen && handleHomeEndKeys) {
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: "end",
|
|
direction: "previous",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
}
|
|
break;
|
|
case "PageUp":
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: -pageSize,
|
|
direction: "previous",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
handleOpen(event);
|
|
break;
|
|
case "PageDown":
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: pageSize,
|
|
direction: "next",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
handleOpen(event);
|
|
break;
|
|
case "ArrowDown":
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: 1,
|
|
direction: "next",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
handleOpen(event);
|
|
break;
|
|
case "ArrowUp":
|
|
event.preventDefault();
|
|
changeHighlightedIndex({
|
|
diff: -1,
|
|
direction: "previous",
|
|
reason: "keyboard",
|
|
event
|
|
});
|
|
handleOpen(event);
|
|
break;
|
|
case "ArrowLeft":
|
|
handleFocusTag(event, "previous");
|
|
break;
|
|
case "ArrowRight":
|
|
handleFocusTag(event, "next");
|
|
break;
|
|
case "Enter":
|
|
if (highlightedIndexRef.current !== -1 && popupOpen) {
|
|
const option = filteredOptions[highlightedIndexRef.current];
|
|
const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
|
event.preventDefault();
|
|
if (disabled) {
|
|
return;
|
|
}
|
|
selectNewValue(event, option, "selectOption");
|
|
if (autoComplete) {
|
|
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
|
}
|
|
} else if (freeSolo && inputValue !== "" && inputValueIsSelectedValue === false) {
|
|
if (multiple) {
|
|
event.preventDefault();
|
|
}
|
|
selectNewValue(event, inputValue, "createOption", "freeSolo");
|
|
}
|
|
break;
|
|
case "Escape":
|
|
if (popupOpen) {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
handleClose(event, "escape");
|
|
} else if (clearOnEscape && (inputValue !== "" || multiple && value.length > 0)) {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
handleClear(event);
|
|
}
|
|
break;
|
|
case "Backspace":
|
|
if (multiple && !readOnly && inputValue === "" && value.length > 0) {
|
|
const index = focusedTag === -1 ? value.length - 1 : focusedTag;
|
|
const newValue = value.slice();
|
|
newValue.splice(index, 1);
|
|
handleValue(event, newValue, "removeOption", {
|
|
option: value[index]
|
|
});
|
|
}
|
|
break;
|
|
default:
|
|
}
|
|
}
|
|
};
|
|
const handleFocus = (event) => {
|
|
setFocused(true);
|
|
if (openOnFocus && !ignoreFocus.current) {
|
|
handleOpen(event);
|
|
}
|
|
};
|
|
const handleBlur = (event) => {
|
|
if (listboxRef.current !== null && listboxRef.current.parentElement.contains(document.activeElement)) {
|
|
inputRef.current.focus();
|
|
return;
|
|
}
|
|
setFocused(false);
|
|
firstFocus.current = true;
|
|
ignoreFocus.current = false;
|
|
if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
|
|
selectNewValue(event, filteredOptions[highlightedIndexRef.current], "blur");
|
|
} else if (autoSelect && freeSolo && inputValue !== "") {
|
|
selectNewValue(event, inputValue, "blur", "freeSolo");
|
|
} else if (clearOnBlur) {
|
|
resetInputValue(event, value);
|
|
}
|
|
handleClose(event, "blur");
|
|
};
|
|
const handleInputChange = (event) => {
|
|
const newValue = event.target.value;
|
|
if (inputValue !== newValue) {
|
|
setInputValueState(newValue);
|
|
setInputPristine(false);
|
|
if (onInputChange) {
|
|
onInputChange(event, newValue, "input");
|
|
}
|
|
}
|
|
if (newValue === "") {
|
|
if (!disableClearable && !multiple) {
|
|
handleValue(event, null, "clear");
|
|
}
|
|
} else {
|
|
handleOpen(event);
|
|
}
|
|
};
|
|
const handleOptionMouseOver = (event) => {
|
|
setHighlightedIndex({
|
|
event,
|
|
index: Number(event.currentTarget.getAttribute("data-option-index")),
|
|
reason: "mouse"
|
|
});
|
|
};
|
|
const handleOptionTouchStart = () => {
|
|
isTouch.current = true;
|
|
};
|
|
const handleOptionClick = (event) => {
|
|
const index = Number(event.currentTarget.getAttribute("data-option-index"));
|
|
selectNewValue(event, filteredOptions[index], "selectOption");
|
|
isTouch.current = false;
|
|
};
|
|
const handleTagDelete = (index) => (event) => {
|
|
const newValue = value.slice();
|
|
newValue.splice(index, 1);
|
|
handleValue(event, newValue, "removeOption", {
|
|
option: value[index]
|
|
});
|
|
};
|
|
const handlePopupIndicator = (event) => {
|
|
if (open) {
|
|
handleClose(event, "toggleInput");
|
|
} else {
|
|
handleOpen(event);
|
|
}
|
|
};
|
|
const handleMouseDown = (event) => {
|
|
if (event.target.getAttribute("id") !== id) {
|
|
event.preventDefault();
|
|
}
|
|
};
|
|
const handleClick = () => {
|
|
inputRef.current.focus();
|
|
if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
|
|
inputRef.current.select();
|
|
}
|
|
firstFocus.current = false;
|
|
};
|
|
const handleInputMouseDown = (event) => {
|
|
if (inputValue === "" || !open) {
|
|
handlePopupIndicator(event);
|
|
}
|
|
};
|
|
let dirty = freeSolo && inputValue.length > 0;
|
|
dirty = dirty || (multiple ? value.length > 0 : value !== null);
|
|
let groupedOptions = filteredOptions;
|
|
if (groupBy) {
|
|
const indexBy = new Map();
|
|
let warn = false;
|
|
groupedOptions = filteredOptions.reduce((acc, option, index) => {
|
|
const group = groupBy(option);
|
|
if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
|
acc[acc.length - 1].options.push(option);
|
|
} else {
|
|
if (true) {
|
|
if (indexBy.get(group) && !warn) {
|
|
console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${componentName} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`.");
|
|
warn = true;
|
|
}
|
|
indexBy.set(group, true);
|
|
}
|
|
acc.push({
|
|
key: index,
|
|
index,
|
|
group,
|
|
options: [option]
|
|
});
|
|
}
|
|
return acc;
|
|
}, []);
|
|
}
|
|
if (disabledProp && focused) {
|
|
handleBlur();
|
|
}
|
|
return {
|
|
getRootProps: (other = {}) => (0, _extends2.default)({
|
|
"aria-owns": listboxAvailable ? `${id}-listbox` : null
|
|
}, other, {
|
|
onKeyDown: handleKeyDown(other),
|
|
onMouseDown: handleMouseDown,
|
|
onClick: handleClick
|
|
}),
|
|
getInputLabelProps: () => ({
|
|
id: `${id}-label`,
|
|
htmlFor: id
|
|
}),
|
|
getInputProps: () => ({
|
|
id,
|
|
value: inputValue,
|
|
onBlur: handleBlur,
|
|
onFocus: handleFocus,
|
|
onChange: handleInputChange,
|
|
onMouseDown: handleInputMouseDown,
|
|
"aria-activedescendant": popupOpen ? "" : null,
|
|
"aria-autocomplete": autoComplete ? "both" : "list",
|
|
"aria-controls": listboxAvailable ? `${id}-listbox` : void 0,
|
|
"aria-expanded": listboxAvailable,
|
|
autoComplete: "off",
|
|
ref: inputRef,
|
|
autoCapitalize: "none",
|
|
spellCheck: "false",
|
|
role: "combobox"
|
|
}),
|
|
getClearProps: () => ({
|
|
tabIndex: -1,
|
|
onClick: handleClear
|
|
}),
|
|
getPopupIndicatorProps: () => ({
|
|
tabIndex: -1,
|
|
onClick: handlePopupIndicator
|
|
}),
|
|
getTagProps: ({
|
|
index
|
|
}) => (0, _extends2.default)({
|
|
key: index,
|
|
"data-tag-index": index,
|
|
tabIndex: -1
|
|
}, !readOnly && {
|
|
onDelete: handleTagDelete(index)
|
|
}),
|
|
getListboxProps: () => ({
|
|
role: "listbox",
|
|
id: `${id}-listbox`,
|
|
"aria-labelledby": `${id}-label`,
|
|
ref: handleListboxRef,
|
|
onMouseDown: (event) => {
|
|
event.preventDefault();
|
|
}
|
|
}),
|
|
getOptionProps: ({
|
|
index,
|
|
option
|
|
}) => {
|
|
const selected = (multiple ? value : [value]).some((value2) => value2 != null && isOptionEqualToValue(option, value2));
|
|
const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
|
return {
|
|
key: getOptionLabel(option),
|
|
tabIndex: -1,
|
|
role: "option",
|
|
id: `${id}-option-${index}`,
|
|
onMouseOver: handleOptionMouseOver,
|
|
onClick: handleOptionClick,
|
|
onTouchStart: handleOptionTouchStart,
|
|
"data-option-index": index,
|
|
"aria-disabled": disabled,
|
|
"aria-selected": selected
|
|
};
|
|
},
|
|
id,
|
|
inputValue,
|
|
value,
|
|
dirty,
|
|
popupOpen,
|
|
focused: focused || focusedTag !== -1,
|
|
anchorEl,
|
|
setAnchorEl,
|
|
focusedTag,
|
|
groupedOptions
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/AutocompleteUnstyled/index.js
|
|
var require_AutocompleteUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/AutocompleteUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "createFilterOptions", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useAutocomplete.createFilterOptions;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useAutocomplete", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useAutocomplete.default;
|
|
}
|
|
});
|
|
var _useAutocomplete = _interopRequireWildcard(require_useAutocomplete());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/composeClasses/composeClasses.js
|
|
var require_composeClasses = __commonJS({
|
|
"node_modules/@mui/base/node/composeClasses/composeClasses.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = composeClasses;
|
|
function composeClasses(slots, getUtilityClass, classes) {
|
|
const output = {};
|
|
Object.keys(slots).forEach((slot) => {
|
|
output[slot] = slots[slot].reduce((acc, key) => {
|
|
if (key) {
|
|
if (classes && classes[key]) {
|
|
acc.push(classes[key]);
|
|
}
|
|
acc.push(getUtilityClass(key));
|
|
}
|
|
return acc;
|
|
}, []).join(" ");
|
|
});
|
|
return output;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/composeClasses/index.js
|
|
var require_composeClasses2 = __commonJS({
|
|
"node_modules/@mui/base/node/composeClasses/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _composeClasses.default;
|
|
}
|
|
});
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/generateUtilityClass/generateUtilityClass.js
|
|
var require_generateUtilityClass = __commonJS({
|
|
"node_modules/@mui/base/node/generateUtilityClass/generateUtilityClass.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = generateUtilityClass;
|
|
var _ClassNameGenerator = _interopRequireDefault(require_ClassNameGenerator());
|
|
var globalStateClassesMapping = {
|
|
active: "Mui-active",
|
|
checked: "Mui-checked",
|
|
completed: "Mui-completed",
|
|
disabled: "Mui-disabled",
|
|
error: "Mui-error",
|
|
expanded: "Mui-expanded",
|
|
focused: "Mui-focused",
|
|
focusVisible: "Mui-focusVisible",
|
|
required: "Mui-required",
|
|
selected: "Mui-selected"
|
|
};
|
|
function generateUtilityClass(componentName, slot) {
|
|
const globalStateClass = globalStateClassesMapping[slot];
|
|
return globalStateClass || `${_ClassNameGenerator.default.generate(componentName)}-${slot}`;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/generateUtilityClass/index.js
|
|
var require_generateUtilityClass2 = __commonJS({
|
|
"node_modules/@mui/base/node/generateUtilityClass/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClass.default;
|
|
}
|
|
});
|
|
var _generateUtilityClass = _interopRequireWildcard(require_generateUtilityClass());
|
|
Object.keys(_generateUtilityClass).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _generateUtilityClass[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClass[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/generateUtilityClasses/generateUtilityClasses.js
|
|
var require_generateUtilityClasses = __commonJS({
|
|
"node_modules/@mui/base/node/generateUtilityClasses/generateUtilityClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = generateUtilityClasses;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
function generateUtilityClasses(componentName, slots) {
|
|
const result = {};
|
|
slots.forEach((slot) => {
|
|
result[slot] = (0, _generateUtilityClass.default)(componentName, slot);
|
|
});
|
|
return result;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/generateUtilityClasses/index.js
|
|
var require_generateUtilityClasses2 = __commonJS({
|
|
"node_modules/@mui/base/node/generateUtilityClasses/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClasses.default;
|
|
}
|
|
});
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BackdropUnstyled/backdropUnstyledClasses.js
|
|
var require_backdropUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/BackdropUnstyled/backdropUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getBackdropUtilityClass = getBackdropUtilityClass;
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
function getBackdropUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiBackdrop", slot);
|
|
}
|
|
var backdropUnstyledClasses = (0, _generateUtilityClasses.default)("MuiBackdrop", ["root", "invisible"]);
|
|
var _default = backdropUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
var require_react_jsx_runtime_development = __commonJS({
|
|
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var React31 = require_react();
|
|
var _assign = require_object_assign();
|
|
var REACT_ELEMENT_TYPE = 60103;
|
|
var REACT_PORTAL_TYPE = 60106;
|
|
exports.Fragment = 60107;
|
|
var REACT_STRICT_MODE_TYPE = 60108;
|
|
var REACT_PROFILER_TYPE = 60114;
|
|
var REACT_PROVIDER_TYPE = 60109;
|
|
var REACT_CONTEXT_TYPE = 60110;
|
|
var REACT_FORWARD_REF_TYPE = 60112;
|
|
var REACT_SUSPENSE_TYPE = 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = 60120;
|
|
var REACT_MEMO_TYPE = 60115;
|
|
var REACT_LAZY_TYPE = 60116;
|
|
var REACT_BLOCK_TYPE = 60121;
|
|
var REACT_SERVER_BLOCK_TYPE = 60122;
|
|
var REACT_FUNDAMENTAL_TYPE = 60117;
|
|
var REACT_SCOPE_TYPE = 60119;
|
|
var REACT_OPAQUE_ID_TYPE = 60128;
|
|
var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
|
|
var REACT_OFFSCREEN_TYPE = 60130;
|
|
var REACT_LEGACY_HIDDEN_TYPE = 60131;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
REACT_ELEMENT_TYPE = symbolFor("react.element");
|
|
REACT_PORTAL_TYPE = symbolFor("react.portal");
|
|
exports.Fragment = symbolFor("react.fragment");
|
|
REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
|
|
REACT_PROFILER_TYPE = symbolFor("react.profiler");
|
|
REACT_PROVIDER_TYPE = symbolFor("react.provider");
|
|
REACT_CONTEXT_TYPE = symbolFor("react.context");
|
|
REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
|
|
REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
|
|
REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
|
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
REACT_BLOCK_TYPE = symbolFor("react.block");
|
|
REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
|
|
REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
|
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
}
|
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
return null;
|
|
}
|
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
if (typeof maybeIterator === "function") {
|
|
return maybeIterator;
|
|
}
|
|
return null;
|
|
}
|
|
var ReactSharedInternals = React31.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
function error(format) {
|
|
{
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
args[_key2 - 1] = arguments[_key2];
|
|
}
|
|
printWarning("error", format, args);
|
|
}
|
|
}
|
|
function printWarning(level, format, args) {
|
|
{
|
|
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
if (stack !== "") {
|
|
format += "%s";
|
|
args = args.concat([stack]);
|
|
}
|
|
var argsWithFormat = args.map(function(item) {
|
|
return "" + item;
|
|
});
|
|
argsWithFormat.unshift("Warning: " + format);
|
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
}
|
|
}
|
|
var enableScopeAPI = false;
|
|
function isValidElementType(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || "";
|
|
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
}
|
|
function getContextName(type) {
|
|
return type.displayName || "Context";
|
|
}
|
|
function getComponentName(type) {
|
|
if (type == null) {
|
|
return null;
|
|
}
|
|
{
|
|
if (typeof type.tag === "number") {
|
|
error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (typeof type === "function") {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
if (typeof type === "string") {
|
|
return type;
|
|
}
|
|
switch (type) {
|
|
case exports.Fragment:
|
|
return "Fragment";
|
|
case REACT_PORTAL_TYPE:
|
|
return "Portal";
|
|
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";
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
var context = type;
|
|
return getContextName(context) + ".Consumer";
|
|
case REACT_PROVIDER_TYPE:
|
|
var provider = type;
|
|
return getContextName(provider._context) + ".Provider";
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return getWrappedName(type, type.render, "ForwardRef");
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
case REACT_BLOCK_TYPE:
|
|
return getComponentName(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return getComponentName(init(payload));
|
|
} catch (x) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: _assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: _assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: _assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: _assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: _assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: _assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: _assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
prefix = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn, construct) {
|
|
if (!fn || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher.current;
|
|
ReactCurrentDispatcher.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
Reflect.construct(fn, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x) {
|
|
control = x;
|
|
}
|
|
fn();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s = sampleLines.length - 1;
|
|
var c = controlLines.length - 1;
|
|
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
c--;
|
|
}
|
|
for (; s >= 1 && c >= 0; s--, c--) {
|
|
if (sampleLines[s] !== controlLines[c]) {
|
|
if (s !== 1 || c !== 1) {
|
|
do {
|
|
s--;
|
|
c--;
|
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s >= 1 && c >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn ? fn.displayName || fn.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn === "function") {
|
|
componentFrameCache.set(fn, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case REACT_SUSPENSE_TYPE:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_BLOCK_TYPE:
|
|
return describeFunctionComponentFrame(type._render);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
{
|
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
var specialPropKeyWarningShown;
|
|
var specialPropRefWarningShown;
|
|
var didWarnAboutStringRefs;
|
|
{
|
|
didWarnAboutStringRefs = {};
|
|
}
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, "ref")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.ref !== void 0;
|
|
}
|
|
function hasValidKey(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, "key")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.key !== void 0;
|
|
}
|
|
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
{
|
|
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
didWarnAboutStringRefs[componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
{
|
|
var warnAboutAccessingKey = function() {
|
|
if (!specialPropKeyWarningShown) {
|
|
specialPropKeyWarningShown = true;
|
|
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://reactjs.org/link/special-props)", displayName);
|
|
}
|
|
};
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, "key", {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
function defineRefPropWarningGetter(props, displayName) {
|
|
{
|
|
var warnAboutAccessingRef = function() {
|
|
if (!specialPropRefWarningShown) {
|
|
specialPropRefWarningShown = true;
|
|
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
}
|
|
};
|
|
warnAboutAccessingRef.isReactWarning = true;
|
|
Object.defineProperty(props, "ref", {
|
|
get: warnAboutAccessingRef,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
var element = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
ref,
|
|
props,
|
|
_owner: owner
|
|
};
|
|
{
|
|
element._store = {};
|
|
Object.defineProperty(element._store, "validated", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: false
|
|
});
|
|
Object.defineProperty(element, "_self", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: self2
|
|
});
|
|
Object.defineProperty(element, "_source", {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: source
|
|
});
|
|
if (Object.freeze) {
|
|
Object.freeze(element.props);
|
|
Object.freeze(element);
|
|
}
|
|
}
|
|
return element;
|
|
};
|
|
function jsxDEV(type, config, maybeKey, source, self2) {
|
|
{
|
|
var propName;
|
|
var props = {};
|
|
var key = null;
|
|
var ref = null;
|
|
if (maybeKey !== void 0) {
|
|
key = "" + maybeKey;
|
|
}
|
|
if (hasValidKey(config)) {
|
|
key = "" + config.key;
|
|
}
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
}
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
for (propName in defaultProps) {
|
|
if (props[propName] === void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
if (key || ref) {
|
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
}
|
|
}
|
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement$1(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
var propTypesMisspellWarningShown;
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
function isValidElement(object) {
|
|
{
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
{
|
|
if (ReactCurrentOwner$1.current) {
|
|
var name = getComponentName(ReactCurrentOwner$1.current.type);
|
|
if (name) {
|
|
return "\n\nCheck the render method of `" + name + "`.";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
function getSourceInfoErrorAddendum(source) {
|
|
{
|
|
if (source !== void 0) {
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
var lineNumber = source.lineNumber;
|
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
var ownerHasKeyUseWarning = {};
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
{
|
|
var info = getDeclarationErrorAddendum();
|
|
if (!info) {
|
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
}
|
|
function validateExplicitKey(element, parentType) {
|
|
{
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
var childOwner = "";
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
}
|
|
setCurrentlyValidatingElement$1(element);
|
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
function validateChildKeys(node, parentType) {
|
|
{
|
|
if (typeof node !== "object") {
|
|
return;
|
|
}
|
|
if (Array.isArray(node)) {
|
|
for (var i = 0; i < node.length; i++) {
|
|
var child = node[i];
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
if (typeof iteratorFn === "function") {
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validatePropTypes(element) {
|
|
{
|
|
var type = element.type;
|
|
if (type === null || type === void 0 || typeof type === "string") {
|
|
return;
|
|
}
|
|
var propTypes;
|
|
if (typeof type === "function") {
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
if (propTypes) {
|
|
var name = getComponentName(type);
|
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
var _name = getComponentName(type);
|
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
}
|
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
}
|
|
}
|
|
}
|
|
function validateFragmentProps(fragment) {
|
|
{
|
|
var keys = Object.keys(fragment.props);
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if (key !== "children" && key !== "key") {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
setCurrentlyValidatingElement$1(null);
|
|
break;
|
|
}
|
|
}
|
|
if (fragment.ref !== null) {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
}
|
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
|
|
{
|
|
var validType = isValidElementType(type);
|
|
if (!validType) {
|
|
var info = "";
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
}
|
|
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
var typeString;
|
|
if (type === null) {
|
|
typeString = "null";
|
|
} else if (Array.isArray(type)) {
|
|
typeString = "array";
|
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = "<" + (getComponentName(type.type) || "Unknown") + " />";
|
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
}
|
|
var element = jsxDEV(type, props, key, source, self2);
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
if (validType) {
|
|
var children = props.children;
|
|
if (children !== void 0) {
|
|
if (isStaticChildren) {
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
validateChildKeys(children[i], type);
|
|
}
|
|
if (Object.freeze) {
|
|
Object.freeze(children);
|
|
}
|
|
} else {
|
|
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, type);
|
|
}
|
|
}
|
|
}
|
|
if (type === exports.Fragment) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
return element;
|
|
}
|
|
}
|
|
function jsxWithValidationStatic(type, props, key) {
|
|
{
|
|
return jsxWithValidation(type, props, key, true);
|
|
}
|
|
}
|
|
function jsxWithValidationDynamic(type, props, key) {
|
|
{
|
|
return jsxWithValidation(type, props, key, false);
|
|
}
|
|
}
|
|
var jsx = jsxWithValidationDynamic;
|
|
var jsxs = jsxWithValidationStatic;
|
|
exports.jsx = jsx;
|
|
exports.jsxs = jsxs;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react/jsx-runtime.js
|
|
var require_jsx_runtime = __commonJS({
|
|
"node_modules/react/jsx-runtime.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_jsx_runtime_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BackdropUnstyled/BackdropUnstyled.js
|
|
var require_BackdropUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/BackdropUnstyled/BackdropUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
var _backdropUnstyledClasses = require_backdropUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
classes,
|
|
invisible
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", invisible && "invisible"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _backdropUnstyledClasses.getBackdropUtilityClass, classes);
|
|
};
|
|
var BackdropUnstyled = /* @__PURE__ */ React31.forwardRef(function BackdropUnstyled2(props, ref) {
|
|
const {
|
|
classes: classesProp,
|
|
className,
|
|
invisible = false,
|
|
component = "div",
|
|
components = {},
|
|
componentsProps = {},
|
|
theme
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
classes: classesProp,
|
|
invisible
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const Root = components.Root || component;
|
|
const rootProps = componentsProps.root || {};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({
|
|
"aria-hidden": true
|
|
}, rootProps, !(0, _isHostComponent.default)(Root) && {
|
|
as: component,
|
|
ownerState: (0, _extends2.default)({}, ownerState, rootProps.ownerState),
|
|
theme
|
|
}, {
|
|
ref
|
|
}, other, {
|
|
className: (0, _clsx.default)(classes.root, rootProps.className, className)
|
|
}));
|
|
});
|
|
true ? BackdropUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
classes: _propTypes.default.object,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
invisible: _propTypes.default.bool
|
|
} : void 0;
|
|
var _default = BackdropUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BackdropUnstyled/index.js
|
|
var require_BackdropUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/BackdropUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "backdropUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _backdropUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BackdropUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getBackdropUtilityClass", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _backdropUnstyledClasses.getBackdropUtilityClass;
|
|
}
|
|
});
|
|
var _BackdropUnstyled = _interopRequireDefault(require_BackdropUnstyled());
|
|
var _backdropUnstyledClasses = _interopRequireWildcard(require_backdropUnstyledClasses());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BadgeUnstyled/useBadge.js
|
|
var require_useBadge = __commonJS({
|
|
"node_modules/@mui/base/node/BadgeUnstyled/useBadge.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useBadge;
|
|
var _utils = require_utils();
|
|
function useBadge(props) {
|
|
const {
|
|
anchorOrigin: anchorOriginProp = {
|
|
vertical: "top",
|
|
horizontal: "right"
|
|
},
|
|
badgeContent: badgeContentProp,
|
|
invisible: invisibleProp = false,
|
|
max: maxProp = 99,
|
|
showZero = false,
|
|
variant: variantProp = "standard"
|
|
} = props;
|
|
const prevProps = (0, _utils.usePreviousProps)({
|
|
anchorOrigin: anchorOriginProp,
|
|
badgeContent: badgeContentProp,
|
|
max: maxProp,
|
|
variant: variantProp
|
|
});
|
|
let invisible = invisibleProp;
|
|
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== "dot")) {
|
|
invisible = true;
|
|
}
|
|
const {
|
|
anchorOrigin = anchorOriginProp,
|
|
badgeContent,
|
|
max = maxProp,
|
|
variant = variantProp
|
|
} = invisible ? prevProps : props;
|
|
let displayValue = "";
|
|
if (variant !== "dot") {
|
|
displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;
|
|
}
|
|
return {
|
|
anchorOrigin,
|
|
badgeContent,
|
|
invisible,
|
|
max,
|
|
variant,
|
|
displayValue
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BadgeUnstyled/badgeUnstyledClasses.js
|
|
var require_badgeUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/BadgeUnstyled/badgeUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getBadgeUtilityClass = getBadgeUtilityClass;
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
function getBadgeUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiBadge", slot);
|
|
}
|
|
var badgeUnstyledClasses = (0, _generateUtilityClasses.default)("MuiBadge", ["root", "badge", "dot", "standard", "anchorOriginTopLeft", "anchorOriginTopRight", "anchorOriginBottomLeft", "anchorOriginBottomRight", "invisible"]);
|
|
var _default = badgeUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BadgeUnstyled/BadgeUnstyled.js
|
|
var require_BadgeUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/BadgeUnstyled/BadgeUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _useBadge = _interopRequireDefault(require_useBadge());
|
|
var _badgeUnstyledClasses = require_badgeUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "showZero", "variant"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
variant,
|
|
anchorOrigin,
|
|
invisible,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root"],
|
|
badge: ["badge", variant, `anchorOrigin${(0, _utils.unstable_capitalize)(anchorOrigin.vertical)}${(0, _utils.unstable_capitalize)(anchorOrigin.horizontal)}`, invisible && "invisible"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _badgeUnstyledClasses.getBadgeUtilityClass, classes);
|
|
};
|
|
var BadgeUnstyled = /* @__PURE__ */ React31.forwardRef(function BadgeUnstyled2(props, ref) {
|
|
const {
|
|
anchorOrigin: anchorOriginProp = {
|
|
vertical: "top",
|
|
horizontal: "right"
|
|
},
|
|
classes: classesProp,
|
|
component,
|
|
children,
|
|
className,
|
|
components = {},
|
|
componentsProps = {},
|
|
max: maxProp = 99,
|
|
showZero = false,
|
|
variant: variantProp = "standard"
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
anchorOrigin,
|
|
badgeContent,
|
|
max,
|
|
variant,
|
|
displayValue,
|
|
invisible
|
|
} = (0, _useBadge.default)((0, _extends2.default)({}, props, {
|
|
anchorOrigin: anchorOriginProp,
|
|
max: maxProp,
|
|
variant: variantProp
|
|
}));
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
anchorOrigin,
|
|
badgeContent,
|
|
classes: classesProp,
|
|
invisible,
|
|
max,
|
|
variant,
|
|
showZero
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const Root = component || components.Root || "span";
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
const Badge = components.Badge || "span";
|
|
const badgeProps = (0, _appendOwnerState.default)(Badge, componentsProps.badge, ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
|
|
ref
|
|
}, other, {
|
|
className: (0, _clsx.default)(classes.root, rootProps.className, className),
|
|
children: [children, /* @__PURE__ */ (0, _jsxRuntime.jsx)(Badge, (0, _extends2.default)({}, badgeProps, {
|
|
className: (0, _clsx.default)(classes.badge, badgeProps.className),
|
|
children: displayValue
|
|
}))]
|
|
}));
|
|
});
|
|
true ? BadgeUnstyled.propTypes = {
|
|
anchorOrigin: _propTypes.default.shape({
|
|
horizontal: _propTypes.default.oneOf(["left", "right"]).isRequired,
|
|
vertical: _propTypes.default.oneOf(["bottom", "top"]).isRequired
|
|
}),
|
|
badgeContent: _propTypes.default.node,
|
|
children: _propTypes.default.node,
|
|
classes: _propTypes.default.object,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Badge: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
badge: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
invisible: _propTypes.default.bool,
|
|
max: _propTypes.default.number,
|
|
showZero: _propTypes.default.bool,
|
|
variant: _propTypes.default.string
|
|
} : void 0;
|
|
var _default = BadgeUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/BadgeUnstyled/index.js
|
|
var require_BadgeUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/BadgeUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "badgeUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _badgeUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BadgeUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getBadgeUtilityClass", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _badgeUnstyledClasses.getBadgeUtilityClass;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useBadge", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useBadge.default;
|
|
}
|
|
});
|
|
var _BadgeUnstyled = _interopRequireDefault(require_BadgeUnstyled());
|
|
var _useBadge = _interopRequireDefault(require_useBadge());
|
|
var _badgeUnstyledClasses = _interopRequireWildcard(require_badgeUnstyledClasses());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/buttonUnstyledClasses.js
|
|
var require_buttonUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/buttonUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getButtonUnstyledUtilityClass = getButtonUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getButtonUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("ButtonUnstyled", slot);
|
|
}
|
|
var buttonUnstyledClasses = (0, _generateUtilityClasses.default)("ButtonUnstyled", ["root", "active", "disabled", "focusVisible"]);
|
|
var _default = buttonUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/useButton.js
|
|
var require_useButton = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/useButton.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useButton;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _extractEventHandlers = _interopRequireDefault(require_extractEventHandlers());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useButton(parameters) {
|
|
const {
|
|
component = "button",
|
|
disabled = false,
|
|
href,
|
|
ref,
|
|
tabIndex = 0,
|
|
to,
|
|
type
|
|
} = parameters;
|
|
const buttonRef = React31.useRef();
|
|
const [active, setActive] = React31.useState(false);
|
|
const {
|
|
isFocusVisibleRef,
|
|
onFocus: handleFocusVisible,
|
|
onBlur: handleBlurVisible,
|
|
ref: focusVisibleRef
|
|
} = (0, _utils.unstable_useIsFocusVisible)();
|
|
const [focusVisible, setFocusVisible] = React31.useState(false);
|
|
if (disabled && focusVisible) {
|
|
setFocusVisible(false);
|
|
}
|
|
React31.useEffect(() => {
|
|
isFocusVisibleRef.current = focusVisible;
|
|
}, [focusVisible, isFocusVisibleRef]);
|
|
const createHandleMouseLeave = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous;
|
|
if (focusVisible) {
|
|
event.preventDefault();
|
|
}
|
|
(_otherHandlers$onMous = otherHandlers.onMouseLeave) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);
|
|
};
|
|
const createHandleBlur = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onBlur;
|
|
handleBlurVisible(event);
|
|
if (isFocusVisibleRef.current === false) {
|
|
setFocusVisible(false);
|
|
}
|
|
(_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);
|
|
};
|
|
const createHandleFocus = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onFocu2;
|
|
if (!buttonRef.current) {
|
|
buttonRef.current = event.currentTarget;
|
|
}
|
|
handleFocusVisible(event);
|
|
if (isFocusVisibleRef.current === true) {
|
|
var _otherHandlers$onFocu;
|
|
setFocusVisible(true);
|
|
(_otherHandlers$onFocu = otherHandlers.onFocusVisible) == null ? void 0 : _otherHandlers$onFocu.call(otherHandlers, event);
|
|
}
|
|
(_otherHandlers$onFocu2 = otherHandlers.onFocus) == null ? void 0 : _otherHandlers$onFocu2.call(otherHandlers, event);
|
|
};
|
|
const isNonNativeButton = () => {
|
|
const button = buttonRef.current;
|
|
return component !== "button" && !((button == null ? void 0 : button.tagName) === "A" && button != null && button.href);
|
|
};
|
|
const createHandleClick = (otherHandlers) => (event) => {
|
|
if (!disabled) {
|
|
var _otherHandlers$onClic;
|
|
(_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);
|
|
}
|
|
};
|
|
const createHandleMouseDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous2;
|
|
if (event.target === event.currentTarget && !disabled) {
|
|
setActive(true);
|
|
}
|
|
(_otherHandlers$onMous2 = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous2.call(otherHandlers, event);
|
|
};
|
|
const createHandleMouseUp = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous3;
|
|
if (event.target === event.currentTarget) {
|
|
setActive(false);
|
|
}
|
|
(_otherHandlers$onMous3 = otherHandlers.onMouseUp) == null ? void 0 : _otherHandlers$onMous3.call(otherHandlers, event);
|
|
};
|
|
const createHandleKeyDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onKeyD;
|
|
(_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
if (event.target === event.currentTarget && isNonNativeButton() && event.key === " ") {
|
|
event.preventDefault();
|
|
}
|
|
if (event.target === event.currentTarget && event.key === " " && !disabled) {
|
|
setActive(true);
|
|
}
|
|
if (event.target === event.currentTarget && isNonNativeButton() && event.key === "Enter" && !disabled) {
|
|
var _otherHandlers$onClic2;
|
|
(_otherHandlers$onClic2 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic2.call(otherHandlers, event);
|
|
event.preventDefault();
|
|
}
|
|
};
|
|
const createHandleKeyUp = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onKeyU;
|
|
if (event.target === event.currentTarget) {
|
|
setActive(false);
|
|
}
|
|
(_otherHandlers$onKeyU = otherHandlers.onKeyUp) == null ? void 0 : _otherHandlers$onKeyU.call(otherHandlers, event);
|
|
if (event.target === event.currentTarget && isNonNativeButton() && !disabled && event.key === " " && !event.defaultPrevented) {
|
|
var _otherHandlers$onClic3;
|
|
(_otherHandlers$onClic3 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic3.call(otherHandlers, event);
|
|
}
|
|
};
|
|
const handleOwnRef = (0, _utils.unstable_useForkRef)(focusVisibleRef, buttonRef);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, handleOwnRef);
|
|
const [hostElementName, setHostElementName] = React31.useState("");
|
|
const updateRef = (instance) => {
|
|
var _instance$tagName;
|
|
setHostElementName((_instance$tagName = instance == null ? void 0 : instance.tagName) != null ? _instance$tagName : "");
|
|
(0, _utils.unstable_setRef)(handleRef, instance);
|
|
};
|
|
const buttonProps = {};
|
|
if (hostElementName === "BUTTON") {
|
|
buttonProps.type = type != null ? type : "button";
|
|
buttonProps.disabled = disabled;
|
|
} else if (hostElementName !== "") {
|
|
if (!href && !to) {
|
|
buttonProps.role = "button";
|
|
}
|
|
if (disabled) {
|
|
buttonProps["aria-disabled"] = disabled;
|
|
}
|
|
}
|
|
const getRootProps = (otherHandlers = {}) => {
|
|
const propsEventHandlers = (0, _extractEventHandlers.default)(parameters);
|
|
const externalEventHandlers = (0, _extends2.default)({}, propsEventHandlers, otherHandlers);
|
|
delete externalEventHandlers.onFocusVisible;
|
|
return (0, _extends2.default)({
|
|
tabIndex: disabled ? -1 : tabIndex,
|
|
type
|
|
}, externalEventHandlers, buttonProps, {
|
|
onBlur: createHandleBlur(externalEventHandlers),
|
|
onClick: createHandleClick(externalEventHandlers),
|
|
onFocus: createHandleFocus(externalEventHandlers),
|
|
onKeyDown: createHandleKeyDown(externalEventHandlers),
|
|
onKeyUp: createHandleKeyUp(externalEventHandlers),
|
|
onMouseDown: createHandleMouseDown(externalEventHandlers),
|
|
onMouseLeave: createHandleMouseLeave(externalEventHandlers),
|
|
onMouseUp: createHandleMouseUp(externalEventHandlers),
|
|
ref: updateRef
|
|
});
|
|
};
|
|
return {
|
|
getRootProps,
|
|
focusVisible,
|
|
setFocusVisible,
|
|
disabled,
|
|
active
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/ButtonUnstyled.js
|
|
var require_ButtonUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/ButtonUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _buttonUnstyledClasses = require_buttonUnstyledClasses();
|
|
var _useButton = _interopRequireDefault(require_useButton());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["className", "component", "components", "componentsProps", "children", "disabled", "action", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseLeave"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
active,
|
|
disabled,
|
|
focusVisible
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", focusVisible && "focusVisible", active && "active"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _buttonUnstyledClasses.getButtonUnstyledUtilityClass, {});
|
|
};
|
|
var ButtonUnstyled = /* @__PURE__ */ React31.forwardRef(function ButtonUnstyled2(props, forwardedRef) {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
children,
|
|
action
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const buttonRef = React31.useRef();
|
|
const handleRef = (0, _utils.unstable_useForkRef)(buttonRef, forwardedRef);
|
|
const ButtonRoot = (_ref = component != null ? component : components.Root) != null ? _ref : "button";
|
|
const {
|
|
active,
|
|
focusVisible,
|
|
setFocusVisible,
|
|
getRootProps
|
|
} = (0, _useButton.default)((0, _extends2.default)({}, props, {
|
|
component: ButtonRoot,
|
|
ref: handleRef
|
|
}));
|
|
React31.useImperativeHandle(action, () => ({
|
|
focusVisible: () => {
|
|
setFocusVisible(true);
|
|
buttonRef.current.focus();
|
|
}
|
|
}), [setFocusVisible]);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
active,
|
|
focusVisible
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const buttonRootProps = (0, _appendOwnerState.default)(ButtonRoot, (0, _extends2.default)({}, getRootProps(), other, componentsProps.root, {
|
|
className: (0, _clsx.default)(classes.root, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
}), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(ButtonRoot, (0, _extends2.default)({}, buttonRootProps, {
|
|
children
|
|
}));
|
|
});
|
|
true ? ButtonUnstyled.propTypes = {
|
|
action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
current: _propTypes.default.shape({
|
|
focusVisible: _propTypes.default.func.isRequired
|
|
})
|
|
})]),
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
disabled: _propTypes.default.bool,
|
|
onFocusVisible: _propTypes.default.func
|
|
} : void 0;
|
|
var _default = ButtonUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/ButtonUnstyled.types.js
|
|
var require_ButtonUnstyled_types = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/ButtonUnstyled.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/useButton.types.js
|
|
var require_useButton_types = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/useButton.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ButtonUnstyled/index.js
|
|
var require_ButtonUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/ButtonUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
buttonUnstyledClasses: true,
|
|
getButtonUnstyledUtilityClass: true,
|
|
useButton: true
|
|
};
|
|
Object.defineProperty(exports, "buttonUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _buttonUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ButtonUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getButtonUnstyledUtilityClass", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _buttonUnstyledClasses.getButtonUnstyledUtilityClass;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useButton", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useButton.default;
|
|
}
|
|
});
|
|
var _ButtonUnstyled = _interopRequireDefault(require_ButtonUnstyled());
|
|
var _buttonUnstyledClasses = _interopRequireWildcard(require_buttonUnstyledClasses());
|
|
var _ButtonUnstyled2 = require_ButtonUnstyled_types();
|
|
Object.keys(_ButtonUnstyled2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ButtonUnstyled2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ButtonUnstyled2[key];
|
|
}
|
|
});
|
|
});
|
|
var _useButton = _interopRequireDefault(require_useButton());
|
|
var _useButton2 = require_useButton_types();
|
|
Object.keys(_useButton2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useButton2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useButton2[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ClickAwayListener/ClickAwayListener.js
|
|
var require_ClickAwayListener = __commonJS({
|
|
"node_modules/@mui/base/node/ClickAwayListener/ClickAwayListener.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function mapEventPropToEvent(eventProp) {
|
|
return eventProp.substring(2).toLowerCase();
|
|
}
|
|
function clickedRootScrollbar(event, doc) {
|
|
return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;
|
|
}
|
|
function ClickAwayListener(props) {
|
|
const {
|
|
children,
|
|
disableReactTree = false,
|
|
mouseEvent = "onClick",
|
|
onClickAway,
|
|
touchEvent = "onTouchEnd"
|
|
} = props;
|
|
const movedRef = React31.useRef(false);
|
|
const nodeRef = React31.useRef(null);
|
|
const activatedRef = React31.useRef(false);
|
|
const syntheticEventRef = React31.useRef(false);
|
|
React31.useEffect(() => {
|
|
setTimeout(() => {
|
|
activatedRef.current = true;
|
|
}, 0);
|
|
return () => {
|
|
activatedRef.current = false;
|
|
};
|
|
}, []);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(children.ref, nodeRef);
|
|
const handleClickAway = (0, _utils.unstable_useEventCallback)((event) => {
|
|
const insideReactTree = syntheticEventRef.current;
|
|
syntheticEventRef.current = false;
|
|
const doc = (0, _utils.unstable_ownerDocument)(nodeRef.current);
|
|
if (!activatedRef.current || !nodeRef.current || "clientX" in event && clickedRootScrollbar(event, doc)) {
|
|
return;
|
|
}
|
|
if (movedRef.current) {
|
|
movedRef.current = false;
|
|
return;
|
|
}
|
|
let insideDOM;
|
|
if (event.composedPath) {
|
|
insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
|
|
} else {
|
|
insideDOM = !doc.documentElement.contains(event.target) || nodeRef.current.contains(event.target);
|
|
}
|
|
if (!insideDOM && (disableReactTree || !insideReactTree)) {
|
|
onClickAway(event);
|
|
}
|
|
});
|
|
const createHandleSynthetic = (handlerName) => (event) => {
|
|
syntheticEventRef.current = true;
|
|
const childrenPropsHandler = children.props[handlerName];
|
|
if (childrenPropsHandler) {
|
|
childrenPropsHandler(event);
|
|
}
|
|
};
|
|
const childrenProps = {
|
|
ref: handleRef
|
|
};
|
|
if (touchEvent !== false) {
|
|
childrenProps[touchEvent] = createHandleSynthetic(touchEvent);
|
|
}
|
|
React31.useEffect(() => {
|
|
if (touchEvent !== false) {
|
|
const mappedTouchEvent = mapEventPropToEvent(touchEvent);
|
|
const doc = (0, _utils.unstable_ownerDocument)(nodeRef.current);
|
|
const handleTouchMove = () => {
|
|
movedRef.current = true;
|
|
};
|
|
doc.addEventListener(mappedTouchEvent, handleClickAway);
|
|
doc.addEventListener("touchmove", handleTouchMove);
|
|
return () => {
|
|
doc.removeEventListener(mappedTouchEvent, handleClickAway);
|
|
doc.removeEventListener("touchmove", handleTouchMove);
|
|
};
|
|
}
|
|
return void 0;
|
|
}, [handleClickAway, touchEvent]);
|
|
if (mouseEvent !== false) {
|
|
childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);
|
|
}
|
|
React31.useEffect(() => {
|
|
if (mouseEvent !== false) {
|
|
const mappedMouseEvent = mapEventPropToEvent(mouseEvent);
|
|
const doc = (0, _utils.unstable_ownerDocument)(nodeRef.current);
|
|
doc.addEventListener(mappedMouseEvent, handleClickAway);
|
|
return () => {
|
|
doc.removeEventListener(mappedMouseEvent, handleClickAway);
|
|
};
|
|
}
|
|
return void 0;
|
|
}, [handleClickAway, mouseEvent]);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(React31.Fragment, {
|
|
children: /* @__PURE__ */ React31.cloneElement(children, childrenProps)
|
|
});
|
|
}
|
|
true ? ClickAwayListener.propTypes = {
|
|
children: _utils.elementAcceptingRef.isRequired,
|
|
disableReactTree: _propTypes.default.bool,
|
|
mouseEvent: _propTypes.default.oneOf(["onClick", "onMouseDown", "onMouseUp", false]),
|
|
onClickAway: _propTypes.default.func.isRequired,
|
|
touchEvent: _propTypes.default.oneOf(["onTouchEnd", "onTouchStart", false])
|
|
} : void 0;
|
|
if (true) {
|
|
ClickAwayListener["propTypes"] = (0, _utils.exactProp)(ClickAwayListener.propTypes);
|
|
}
|
|
var _default = ClickAwayListener;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ClickAwayListener/index.js
|
|
var require_ClickAwayListener2 = __commonJS({
|
|
"node_modules/@mui/base/node/ClickAwayListener/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ClickAwayListener.default;
|
|
}
|
|
});
|
|
var _ClickAwayListener = _interopRequireWildcard(require_ClickAwayListener());
|
|
Object.keys(_ClickAwayListener).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ClickAwayListener[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ClickAwayListener[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/FormControlUnstyled/FormControlContext.js
|
|
var require_FormControlContext = __commonJS({
|
|
"node_modules/@mui/base/node/FormControlUnstyled/FormControlContext.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var FormControlUnstyledContext = /* @__PURE__ */ React31.createContext(void 0);
|
|
if (true) {
|
|
FormControlUnstyledContext.displayName = "FormControlUnstyledContext";
|
|
}
|
|
var _default = FormControlUnstyledContext;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/FormControlUnstyled/formControlUnstyledClasses.js
|
|
var require_formControlUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/FormControlUnstyled/formControlUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getFormControlUnstyledUtilityClasses = getFormControlUnstyledUtilityClasses;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getFormControlUnstyledUtilityClasses(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiFormControl", slot);
|
|
}
|
|
var formControlUnstyledClasses = (0, _generateUtilityClasses.default)("MuiFormControl", ["root", "disabled"]);
|
|
var _default = formControlUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/FormControlUnstyled/FormControlUnstyled.js
|
|
var require_FormControlUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/FormControlUnstyled/FormControlUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _FormControlContext = _interopRequireDefault(require_FormControlContext());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _formControlUnstyledClasses = _interopRequireDefault(require_formControlUnstyledClasses());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["defaultValue", "children", "className", "component", "components", "componentsProps", "disabled", "error", "focused", "onChange", "required", "value"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function hasValue(value) {
|
|
return value != null && !(Array.isArray(value) && value.length === 0) && value !== "";
|
|
}
|
|
var FormControlUnstyled = /* @__PURE__ */ React31.forwardRef(function FormControlUnstyled2(props, ref) {
|
|
var _ref;
|
|
const {
|
|
defaultValue,
|
|
children,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
disabled = false,
|
|
error = false,
|
|
focused: visuallyFocused,
|
|
onChange,
|
|
required = false,
|
|
value: incomingValue
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const [value, setValue] = (0, _utils.unstable_useControlled)({
|
|
controlled: incomingValue,
|
|
default: defaultValue,
|
|
name: "FormControl",
|
|
state: "value"
|
|
});
|
|
const filled = hasValue(value);
|
|
const [focusedState, setFocused] = React31.useState(false);
|
|
if (disabled && focusedState) {
|
|
setFocused(false);
|
|
}
|
|
const focused = visuallyFocused !== void 0 && !disabled ? visuallyFocused : focusedState;
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
disabled,
|
|
error,
|
|
filled,
|
|
focused,
|
|
required
|
|
});
|
|
let registerEffect = () => {
|
|
};
|
|
if (true) {
|
|
const registeredInput = React31.useRef(false);
|
|
registerEffect = () => {
|
|
if (registeredInput.current) {
|
|
console.error(["MUI: There are multiple `Input` components inside a FormControl.", "This creates visual inconsistencies, only use one `Input`."].join("\n"));
|
|
}
|
|
registeredInput.current = true;
|
|
return () => {
|
|
registeredInput.current = false;
|
|
};
|
|
};
|
|
}
|
|
const handleChange = (event) => {
|
|
setValue(event.target.value);
|
|
onChange == null ? void 0 : onChange(event);
|
|
};
|
|
const childContext = {
|
|
disabled,
|
|
error,
|
|
filled,
|
|
focused,
|
|
onBlur: () => {
|
|
setFocused(false);
|
|
},
|
|
onChange: handleChange,
|
|
onFocus: () => {
|
|
setFocused(true);
|
|
},
|
|
registerEffect,
|
|
required,
|
|
value: value != null ? value : ""
|
|
};
|
|
const Root = (_ref = component != null ? component : components.Root) != null ? _ref : "div";
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_FormControlContext.default.Provider, {
|
|
value: childContext,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({
|
|
ref
|
|
}, rootProps, {
|
|
className: (0, _clsx.default)(_formControlUnstyledClasses.default.root, className, rootProps == null ? void 0 : rootProps.className, disabled && _formControlUnstyledClasses.default.disabled),
|
|
children
|
|
}))
|
|
});
|
|
});
|
|
true ? FormControlUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
defaultValue: _propTypes.default.any,
|
|
disabled: _propTypes.default.bool,
|
|
error: _propTypes.default.bool,
|
|
focused: _propTypes.default.bool,
|
|
onChange: _propTypes.default.func,
|
|
required: _propTypes.default.bool,
|
|
value: _propTypes.default.any
|
|
} : void 0;
|
|
var _default = FormControlUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/FormControlUnstyled/useFormControl.js
|
|
var require_useFormControl = __commonJS({
|
|
"node_modules/@mui/base/node/FormControlUnstyled/useFormControl.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useFormControlUnstyled;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _FormControlContext = _interopRequireDefault(require_FormControlContext());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useFormControlUnstyled() {
|
|
return React31.useContext(_FormControlContext.default);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/FormControlUnstyled/index.js
|
|
var require_FormControlUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/FormControlUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
FormControlUnstyledContext: true,
|
|
formControlUnstyledClasses: true,
|
|
useFormControlUnstyled: true
|
|
};
|
|
Object.defineProperty(exports, "FormControlUnstyledContext", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _FormControlContext.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _FormControlUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "formControlUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _formControlUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useFormControlUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useFormControl.default;
|
|
}
|
|
});
|
|
var _FormControlUnstyled = _interopRequireDefault(require_FormControlUnstyled());
|
|
var _FormControlContext = _interopRequireWildcard(require_FormControlContext());
|
|
Object.keys(_FormControlContext).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _FormControlContext[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _FormControlContext[key];
|
|
}
|
|
});
|
|
});
|
|
var _formControlUnstyledClasses = _interopRequireWildcard(require_formControlUnstyledClasses());
|
|
Object.keys(_formControlUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _formControlUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _formControlUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useFormControl = _interopRequireDefault(require_useFormControl());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/InputUnstyled/inputUnstyledClasses.js
|
|
var require_inputUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/InputUnstyled/inputUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getInputUnstyledUtilityClass = getInputUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getInputUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiInput", slot);
|
|
}
|
|
var inputBaseClasses = (0, _generateUtilityClasses.default)("MuiInput", ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
var _default = inputBaseClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/InputUnstyled/useInput.js
|
|
var require_useInput = __commonJS({
|
|
"node_modules/@mui/base/node/InputUnstyled/useInput.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useInput;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _utils = require_utils();
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _useFormControl = _interopRequireDefault(require_useFormControl());
|
|
var _extractEventHandlers = _interopRequireDefault(require_extractEventHandlers());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useInput(props, inputRef) {
|
|
const {
|
|
defaultValue,
|
|
disabled: disabledProp = false,
|
|
error: errorProp = false,
|
|
onBlur,
|
|
onChange,
|
|
onFocus,
|
|
required: requiredProp = false,
|
|
value: valueProp
|
|
} = props;
|
|
const formControlContext = (0, _useFormControl.default)();
|
|
let value;
|
|
let required;
|
|
let disabled;
|
|
let error;
|
|
if (formControlContext) {
|
|
var _formControlContext$d, _formControlContext$r, _formControlContext$e;
|
|
value = formControlContext.value;
|
|
disabled = (_formControlContext$d = formControlContext.disabled) != null ? _formControlContext$d : false;
|
|
required = (_formControlContext$r = formControlContext.required) != null ? _formControlContext$r : false;
|
|
error = (_formControlContext$e = formControlContext.error) != null ? _formControlContext$e : false;
|
|
} else {
|
|
value = valueProp;
|
|
disabled = disabledProp;
|
|
required = requiredProp;
|
|
error = errorProp;
|
|
}
|
|
const {
|
|
current: isControlled
|
|
} = React31.useRef(value != null);
|
|
const handleInputRefWarning = React31.useCallback((instance) => {
|
|
if (true) {
|
|
if (instance && instance.nodeName !== "INPUT" && !instance.focus) {
|
|
console.error(["MUI: You have provided a `components.Input` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join("\n"));
|
|
}
|
|
}
|
|
}, []);
|
|
const internalInputRef = React31.useRef(null);
|
|
const handleIncomingRef = (0, _utils.unstable_useForkRef)(inputRef, handleInputRefWarning);
|
|
const handleInputRef = (0, _utils.unstable_useForkRef)(internalInputRef, handleIncomingRef);
|
|
const [focused, setFocused] = React31.useState(false);
|
|
React31.useEffect(() => {
|
|
if (!formControlContext && disabled && focused) {
|
|
setFocused(false);
|
|
onBlur == null ? void 0 : onBlur();
|
|
}
|
|
}, [formControlContext, disabled, focused, onBlur]);
|
|
const handleFocus = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onFocu;
|
|
if (formControlContext != null && formControlContext.disabled) {
|
|
event.stopPropagation();
|
|
return;
|
|
}
|
|
(_otherHandlers$onFocu = otherHandlers.onFocus) == null ? void 0 : _otherHandlers$onFocu.call(otherHandlers, event);
|
|
if (formControlContext && formControlContext.onFocus) {
|
|
var _formControlContext$o;
|
|
formControlContext == null ? void 0 : (_formControlContext$o = formControlContext.onFocus) == null ? void 0 : _formControlContext$o.call(formControlContext);
|
|
} else {
|
|
setFocused(true);
|
|
}
|
|
};
|
|
const handleBlur = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onBlur;
|
|
(_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);
|
|
if (formControlContext && formControlContext.onBlur) {
|
|
formControlContext.onBlur();
|
|
} else {
|
|
setFocused(false);
|
|
}
|
|
};
|
|
const handleChange = (otherHandlers) => (event, ...args) => {
|
|
var _formControlContext$o2, _otherHandlers$onChan;
|
|
if (!isControlled) {
|
|
const element = event.target || internalInputRef.current;
|
|
if (element == null) {
|
|
throw new Error(true ? `MUI: Expected valid input target. Did you use a custom \`components.Input\` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info.` : (0, _utils.formatMuiErrorMessage)(17));
|
|
}
|
|
}
|
|
formControlContext == null ? void 0 : (_formControlContext$o2 = formControlContext.onChange) == null ? void 0 : _formControlContext$o2.call(formControlContext, event);
|
|
(_otherHandlers$onChan = otherHandlers.onChange) == null ? void 0 : _otherHandlers$onChan.call(otherHandlers, event, ...args);
|
|
};
|
|
const handleClick = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onClic;
|
|
if (internalInputRef.current && event.currentTarget === event.target) {
|
|
internalInputRef.current.focus();
|
|
}
|
|
(_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);
|
|
};
|
|
const getRootProps = (externalProps) => {
|
|
const propsEventHandlers = (0, _extractEventHandlers.default)(props, ["onBlur", "onChange", "onFocus"]);
|
|
const externalEventHandlers = (0, _extends2.default)({}, propsEventHandlers, (0, _extractEventHandlers.default)(externalProps));
|
|
return (0, _extends2.default)({}, externalProps, externalEventHandlers, {
|
|
onClick: handleClick(externalEventHandlers)
|
|
});
|
|
};
|
|
const getInputProps = (externalProps) => {
|
|
const propsEventHandlers = {
|
|
onBlur,
|
|
onChange,
|
|
onFocus
|
|
};
|
|
const externalEventHandlers = (0, _extends2.default)({}, propsEventHandlers, (0, _extractEventHandlers.default)(externalProps));
|
|
const mergedEventHandlers = (0, _extends2.default)({}, externalProps, externalEventHandlers, {
|
|
onBlur: handleBlur(externalEventHandlers),
|
|
onChange: handleChange(externalEventHandlers),
|
|
onFocus: handleFocus(externalEventHandlers)
|
|
});
|
|
return (0, _extends2.default)({}, mergedEventHandlers, {
|
|
"aria-invalid": error || void 0,
|
|
defaultValue,
|
|
ref: handleInputRef,
|
|
value,
|
|
required,
|
|
disabled
|
|
});
|
|
};
|
|
return {
|
|
disabled,
|
|
error,
|
|
focused,
|
|
formControlContext,
|
|
getInputProps,
|
|
getRootProps,
|
|
required,
|
|
value
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/InputUnstyled/InputUnstyled.js
|
|
var require_InputUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/InputUnstyled/InputUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
var _inputUnstyledClasses = _interopRequireDefault(require_inputUnstyledClasses());
|
|
var _useInput = _interopRequireDefault(require_useInput());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoFocus", "className", "component", "components", "componentsProps", "defaultValue", "disabled", "endAdornment", "error", "id", "maxRows", "minRows", "multiline", "name", "onClick", "onChange", "onKeyDown", "onKeyUp", "onFocus", "onBlur", "placeholder", "readOnly", "required", "rows", "type", "startAdornment", "value"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var InputUnstyled = /* @__PURE__ */ React31.forwardRef(function InputUnstyled2(props, ref) {
|
|
var _componentsProps$inpu, _ref, _componentsProps$root, _components$Input, _componentsProps$inpu2;
|
|
const {
|
|
"aria-describedby": ariaDescribedby,
|
|
"aria-label": ariaLabel,
|
|
"aria-labelledby": ariaLabelledby,
|
|
autoComplete,
|
|
autoFocus,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
defaultValue,
|
|
disabled,
|
|
endAdornment,
|
|
error,
|
|
id,
|
|
maxRows,
|
|
minRows,
|
|
multiline = false,
|
|
name,
|
|
onClick,
|
|
onChange,
|
|
onKeyDown,
|
|
onKeyUp,
|
|
onFocus,
|
|
onBlur,
|
|
placeholder,
|
|
readOnly,
|
|
required,
|
|
rows,
|
|
type = "text",
|
|
startAdornment,
|
|
value
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
getRootProps,
|
|
getInputProps,
|
|
focused,
|
|
formControlContext,
|
|
error: errorState,
|
|
disabled: disabledState
|
|
} = (0, _useInput.default)({
|
|
disabled,
|
|
defaultValue,
|
|
error,
|
|
onBlur,
|
|
onClick,
|
|
onChange,
|
|
onFocus,
|
|
required,
|
|
value
|
|
}, (_componentsProps$inpu = componentsProps.input) == null ? void 0 : _componentsProps$inpu.ref);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
disabled: disabledState,
|
|
error: errorState,
|
|
focused,
|
|
formControlContext,
|
|
multiline,
|
|
type
|
|
});
|
|
const rootStateClasses = (0, _clsx.default)(disabledState && _inputUnstyledClasses.default.disabled, errorState && _inputUnstyledClasses.default.error, focused && _inputUnstyledClasses.default.focused, Boolean(formControlContext) && _inputUnstyledClasses.default.formControl, multiline && _inputUnstyledClasses.default.multiline, Boolean(startAdornment) && _inputUnstyledClasses.default.adornedStart, Boolean(endAdornment) && _inputUnstyledClasses.default.adornedEnd);
|
|
const inputStateClasses = (0, _clsx.default)(disabledState && _inputUnstyledClasses.default.disabled, multiline && _inputUnstyledClasses.default.multiline);
|
|
const propsToForward = {
|
|
"aria-describedby": ariaDescribedby,
|
|
"aria-label": ariaLabel,
|
|
"aria-labelledby": ariaLabelledby,
|
|
autoComplete,
|
|
autoFocus,
|
|
id,
|
|
onKeyDown,
|
|
onKeyUp,
|
|
name,
|
|
placeholder,
|
|
readOnly,
|
|
type
|
|
};
|
|
const Root = (_ref = component != null ? component : components.Root) != null ? _ref : "div";
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, getRootProps((0, _extends2.default)({}, other, componentsProps.root)), {
|
|
className: (0, _clsx.default)(_inputUnstyledClasses.default.root, rootStateClasses, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
}), ownerState);
|
|
let Input = (_components$Input = components.Input) != null ? _components$Input : "input";
|
|
let inputProps = (0, _appendOwnerState.default)(Input, (0, _extends2.default)({}, getInputProps((0, _extends2.default)({}, componentsProps.input, propsToForward)), {
|
|
className: (0, _clsx.default)(_inputUnstyledClasses.default.input, inputStateClasses, (_componentsProps$inpu2 = componentsProps.input) == null ? void 0 : _componentsProps$inpu2.className)
|
|
}), ownerState);
|
|
if (multiline) {
|
|
var _components$Textarea, _components$Textarea2;
|
|
const hasHostTexarea = (0, _isHostComponent.default)((_components$Textarea = components.Textarea) != null ? _components$Textarea : "textarea");
|
|
if (rows) {
|
|
if (true) {
|
|
if (minRows || maxRows) {
|
|
console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set.");
|
|
}
|
|
}
|
|
inputProps = (0, _extends2.default)({
|
|
type: void 0,
|
|
minRows: hasHostTexarea ? void 0 : rows,
|
|
maxRows: hasHostTexarea ? void 0 : rows
|
|
}, inputProps);
|
|
} else {
|
|
inputProps = (0, _extends2.default)({
|
|
type: void 0,
|
|
maxRows: hasHostTexarea ? void 0 : maxRows,
|
|
minRows: hasHostTexarea ? void 0 : minRows
|
|
}, inputProps);
|
|
}
|
|
Input = (_components$Textarea2 = components.Textarea) != null ? _components$Textarea2 : "textarea";
|
|
}
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
|
|
ref,
|
|
children: [startAdornment, /* @__PURE__ */ (0, _jsxRuntime.jsx)(Input, (0, _extends2.default)({}, inputProps)), endAdornment]
|
|
}));
|
|
});
|
|
true ? InputUnstyled.propTypes = {
|
|
"aria-describedby": _propTypes.default.string,
|
|
"aria-label": _propTypes.default.string,
|
|
"aria-labelledby": _propTypes.default.string,
|
|
autoComplete: _propTypes.default.string,
|
|
autoFocus: _propTypes.default.bool,
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Input: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType,
|
|
Textarea: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
input: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
defaultValue: _propTypes.default.any,
|
|
disabled: _propTypes.default.bool,
|
|
endAdornment: _propTypes.default.node,
|
|
error: _propTypes.default.bool,
|
|
id: _propTypes.default.string,
|
|
maxRows: _propTypes.default.number,
|
|
minRows: _propTypes.default.number,
|
|
multiline: _propTypes.default.bool,
|
|
name: _propTypes.default.string,
|
|
onBlur: _propTypes.default.func,
|
|
onChange: _propTypes.default.func,
|
|
onClick: _propTypes.default.func,
|
|
onFocus: _propTypes.default.func,
|
|
onKeyDown: _propTypes.default.func,
|
|
onKeyUp: _propTypes.default.func,
|
|
placeholder: _propTypes.default.string,
|
|
readOnly: _propTypes.default.bool,
|
|
required: _propTypes.default.bool,
|
|
rows: _propTypes.default.number,
|
|
startAdornment: _propTypes.default.node,
|
|
type: _propTypes.default.string,
|
|
value: _propTypes.default.any
|
|
} : void 0;
|
|
var _default = InputUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/InputUnstyled/InputUnstyledProps.js
|
|
var require_InputUnstyledProps = __commonJS({
|
|
"node_modules/@mui/base/node/InputUnstyled/InputUnstyledProps.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/InputUnstyled/index.js
|
|
var require_InputUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/InputUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
useInput: true,
|
|
inputUnstyledClasses: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _InputUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "inputUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _inputUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useInput", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useInput.default;
|
|
}
|
|
});
|
|
var _InputUnstyled = _interopRequireDefault(require_InputUnstyled());
|
|
var _InputUnstyledProps = require_InputUnstyledProps();
|
|
Object.keys(_InputUnstyledProps).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _InputUnstyledProps[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _InputUnstyledProps[key];
|
|
}
|
|
});
|
|
});
|
|
var _useInput = _interopRequireDefault(require_useInput());
|
|
var _inputUnstyledClasses = _interopRequireWildcard(require_inputUnstyledClasses());
|
|
Object.keys(_inputUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _inputUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _inputUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ListboxUnstyled/useListbox.types.js
|
|
var require_useListbox_types = __commonJS({
|
|
"node_modules/@mui/base/node/ListboxUnstyled/useListbox.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ActionTypes = void 0;
|
|
var ActionTypes;
|
|
exports.ActionTypes = ActionTypes;
|
|
(function(ActionTypes2) {
|
|
ActionTypes2["blur"] = "blur";
|
|
ActionTypes2["focus"] = "focus";
|
|
ActionTypes2["keyDown"] = "keyDown";
|
|
ActionTypes2["optionClick"] = "optionClick";
|
|
ActionTypes2["optionHover"] = "optionHover";
|
|
ActionTypes2["optionsChange"] = "optionsChange";
|
|
ActionTypes2["setValue"] = "setValue";
|
|
ActionTypes2["setHighlight"] = "setHighlight";
|
|
})(ActionTypes || (exports.ActionTypes = ActionTypes = {}));
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ListboxUnstyled/defaultListboxReducer.js
|
|
var require_defaultListboxReducer = __commonJS({
|
|
"node_modules/@mui/base/node/ListboxUnstyled/defaultListboxReducer.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = defaultListboxReducer;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _useListbox = require_useListbox_types();
|
|
var pageSize = 5;
|
|
function findValidOptionToHighlight(index, lookupDirection, options, focusDisabled, isOptionDisabled, wrapAround) {
|
|
if (options.length === 0 || options.every((o, i) => isOptionDisabled(o, i))) {
|
|
return -1;
|
|
}
|
|
let nextFocus = index;
|
|
for (; ; ) {
|
|
if (!wrapAround && lookupDirection === "next" && nextFocus === options.length || !wrapAround && lookupDirection === "previous" && nextFocus === -1) {
|
|
return -1;
|
|
}
|
|
const nextFocusDisabled = focusDisabled ? false : isOptionDisabled(options[nextFocus], nextFocus);
|
|
if (nextFocusDisabled) {
|
|
nextFocus += lookupDirection === "next" ? 1 : -1;
|
|
if (wrapAround) {
|
|
nextFocus = (nextFocus + options.length) % options.length;
|
|
}
|
|
} else {
|
|
return nextFocus;
|
|
}
|
|
}
|
|
}
|
|
function getNewHighlightedOption(options, previouslyHighlightedOption, diff, lookupDirection, highlightDisabled, isOptionDisabled, wrapAround, optionComparer) {
|
|
var _options$nextIndex;
|
|
const maxIndex = options.length - 1;
|
|
const defaultHighlightedIndex = -1;
|
|
let nextIndexCandidate;
|
|
const previouslyHighlightedIndex = previouslyHighlightedOption == null ? -1 : options.findIndex((option) => optionComparer(option, previouslyHighlightedOption));
|
|
if (diff === "reset") {
|
|
var _options$defaultHighl;
|
|
return defaultHighlightedIndex === -1 ? null : (_options$defaultHighl = options[defaultHighlightedIndex]) != null ? _options$defaultHighl : null;
|
|
}
|
|
if (diff === "start") {
|
|
nextIndexCandidate = 0;
|
|
} else if (diff === "end") {
|
|
nextIndexCandidate = maxIndex;
|
|
} else {
|
|
const newIndex = previouslyHighlightedIndex + diff;
|
|
if (newIndex < 0) {
|
|
if (!wrapAround && previouslyHighlightedIndex !== -1 || Math.abs(diff) > 1) {
|
|
nextIndexCandidate = 0;
|
|
} else {
|
|
nextIndexCandidate = maxIndex;
|
|
}
|
|
} else if (newIndex > maxIndex) {
|
|
if (!wrapAround || Math.abs(diff) > 1) {
|
|
nextIndexCandidate = maxIndex;
|
|
} else {
|
|
nextIndexCandidate = 0;
|
|
}
|
|
} else {
|
|
nextIndexCandidate = newIndex;
|
|
}
|
|
}
|
|
const nextIndex = findValidOptionToHighlight(nextIndexCandidate, lookupDirection, options, highlightDisabled, isOptionDisabled, wrapAround);
|
|
return (_options$nextIndex = options[nextIndex]) != null ? _options$nextIndex : null;
|
|
}
|
|
function handleOptionSelection(option, state, props) {
|
|
const {
|
|
multiple,
|
|
optionComparer = (o, v) => o === v,
|
|
isOptionDisabled = () => false
|
|
} = props;
|
|
const {
|
|
selectedValue
|
|
} = state;
|
|
const optionIndex = props.options.indexOf(option);
|
|
if (isOptionDisabled(option, optionIndex)) {
|
|
return state;
|
|
}
|
|
if (multiple) {
|
|
var _ref, _ref2;
|
|
const selectedValues = (_ref = selectedValue) != null ? _ref : [];
|
|
const newSelectedValues = selectedValues.some((sv) => optionComparer(sv, option)) ? selectedValue.filter((v) => !optionComparer(v, option)) : [...(_ref2 = selectedValue) != null ? _ref2 : [], option];
|
|
return {
|
|
selectedValue: newSelectedValues,
|
|
highlightedValue: option
|
|
};
|
|
}
|
|
if (selectedValue != null && optionComparer(option, selectedValue)) {
|
|
return state;
|
|
}
|
|
return {
|
|
selectedValue: option,
|
|
highlightedValue: option
|
|
};
|
|
}
|
|
function handleKeyDown(event, state, props) {
|
|
const {
|
|
options,
|
|
isOptionDisabled,
|
|
disableListWrap,
|
|
disabledItemsFocusable,
|
|
optionComparer
|
|
} = props;
|
|
const moveHighlight = (diff, direction, wrapAround) => {
|
|
return getNewHighlightedOption(options, state.highlightedValue, diff, direction, disabledItemsFocusable != null ? disabledItemsFocusable : false, isOptionDisabled != null ? isOptionDisabled : () => false, wrapAround, optionComparer);
|
|
};
|
|
switch (event.key) {
|
|
case "Home":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight("start", "next", false)
|
|
});
|
|
case "End":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight("end", "previous", false)
|
|
});
|
|
case "PageUp":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight(-pageSize, "previous", false)
|
|
});
|
|
case "PageDown":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight(pageSize, "next", false)
|
|
});
|
|
case "ArrowUp":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight(-1, "previous", !(disableListWrap != null ? disableListWrap : false))
|
|
});
|
|
case "ArrowDown":
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: moveHighlight(1, "next", !(disableListWrap != null ? disableListWrap : false))
|
|
});
|
|
case "Enter":
|
|
case " ":
|
|
if (state.highlightedValue === null) {
|
|
return state;
|
|
}
|
|
return handleOptionSelection(state.highlightedValue, state, props);
|
|
default:
|
|
break;
|
|
}
|
|
return state;
|
|
}
|
|
function handleBlur(state) {
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: null
|
|
});
|
|
}
|
|
function handleOptionsChange(options, previousOptions, state, props) {
|
|
var _options$find, _options$find2;
|
|
const {
|
|
multiple,
|
|
optionComparer
|
|
} = props;
|
|
const newHighlightedOption = state.highlightedValue == null ? null : (_options$find = options.find((option) => optionComparer(option, state.highlightedValue))) != null ? _options$find : null;
|
|
if (multiple) {
|
|
var _ref3;
|
|
const selectedValues = (_ref3 = state.selectedValue) != null ? _ref3 : [];
|
|
const newSelectedValues = selectedValues.filter((selectedValue) => options.some((option) => optionComparer(option, selectedValue)));
|
|
return {
|
|
highlightedValue: newHighlightedOption,
|
|
selectedValue: newSelectedValues
|
|
};
|
|
}
|
|
const newSelectedValue = (_options$find2 = options.find((option) => optionComparer(option, state.selectedValue))) != null ? _options$find2 : null;
|
|
return {
|
|
highlightedValue: newHighlightedOption,
|
|
selectedValue: newSelectedValue
|
|
};
|
|
}
|
|
function defaultListboxReducer(state, action) {
|
|
const {
|
|
type
|
|
} = action;
|
|
switch (type) {
|
|
case _useListbox.ActionTypes.keyDown:
|
|
return handleKeyDown(action.event, state, action.props);
|
|
case _useListbox.ActionTypes.optionClick:
|
|
return handleOptionSelection(action.option, state, action.props);
|
|
case _useListbox.ActionTypes.blur:
|
|
return handleBlur(state);
|
|
case _useListbox.ActionTypes.setValue:
|
|
return (0, _extends2.default)({}, state, {
|
|
selectedValue: action.value
|
|
});
|
|
case _useListbox.ActionTypes.setHighlight:
|
|
return (0, _extends2.default)({}, state, {
|
|
highlightedValue: action.highlight
|
|
});
|
|
case _useListbox.ActionTypes.optionsChange:
|
|
return handleOptionsChange(action.options, action.previousOptions, state, action.props);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ListboxUnstyled/useControllableReducer.js
|
|
var require_useControllableReducer = __commonJS({
|
|
"node_modules/@mui/base/node/ListboxUnstyled/useControllableReducer.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useControllableReducer;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _useListbox = require_useListbox_types();
|
|
var _areArraysEqual = _interopRequireDefault(require_areArraysEqual());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useReducerReturnValueHandler(state, value, options, optionComparer, setValueState, onValueChange, onHighlightChange) {
|
|
const valueRef = React31.useRef(value);
|
|
valueRef.current = value;
|
|
const onValueChangeRef = React31.useRef(onValueChange);
|
|
React31.useEffect(() => {
|
|
onValueChangeRef.current = onValueChange;
|
|
}, [onValueChange]);
|
|
const onHighlightChangeRef = React31.useRef(onHighlightChange);
|
|
React31.useEffect(() => {
|
|
onHighlightChangeRef.current = onHighlightChange;
|
|
}, [onHighlightChange]);
|
|
React31.useEffect(() => {
|
|
if (Array.isArray(state.selectedValue)) {
|
|
if ((0, _areArraysEqual.default)(state.selectedValue, valueRef.current)) {
|
|
return;
|
|
}
|
|
} else if (state.selectedValue == null && valueRef.current == null || state.selectedValue != null && valueRef.current != null && optionComparer.current(state.selectedValue, valueRef.current)) {
|
|
return;
|
|
}
|
|
setValueState(state.selectedValue);
|
|
if (state.selectedValue != null) {
|
|
var _onValueChangeRef$cur;
|
|
(_onValueChangeRef$cur = onValueChangeRef.current) == null ? void 0 : _onValueChangeRef$cur.call(onValueChangeRef, state.selectedValue);
|
|
}
|
|
}, [state.selectedValue, setValueState, optionComparer]);
|
|
React31.useEffect(() => {
|
|
var _onHighlightChangeRef;
|
|
(_onHighlightChangeRef = onHighlightChangeRef.current) == null ? void 0 : _onHighlightChangeRef.call(onHighlightChangeRef, state.highlightedValue);
|
|
}, [state.highlightedValue]);
|
|
}
|
|
function useControllableReducer(internalReducer, externalReducer, props) {
|
|
const {
|
|
value: controlledValue,
|
|
defaultValue,
|
|
onChange: onValueChange,
|
|
onHighlightChange,
|
|
options,
|
|
optionComparer
|
|
} = props;
|
|
const propsRef = React31.useRef(props);
|
|
propsRef.current = props;
|
|
const [value, setValueState] = (0, _utils.unstable_useControlled)({
|
|
controlled: controlledValue,
|
|
default: defaultValue,
|
|
name: "useListbox"
|
|
});
|
|
const previousValueRef = React31.useRef(null);
|
|
const [state, dispatch] = React31.useReducer(externalReducer != null ? externalReducer : internalReducer, {
|
|
highlightedValue: null,
|
|
selectedValue: value
|
|
});
|
|
const optionComparerRef = React31.useRef(optionComparer);
|
|
optionComparerRef.current = optionComparer;
|
|
React31.useEffect(() => {
|
|
if (controlledValue === void 0) {
|
|
return;
|
|
}
|
|
if (Array.isArray(controlledValue) && Array.isArray(previousValueRef.current) && (0, _areArraysEqual.default)(previousValueRef.current, controlledValue, optionComparerRef.current)) {
|
|
return;
|
|
}
|
|
if (!Array.isArray(controlledValue) && controlledValue != null && previousValueRef.current != null && optionComparerRef.current(controlledValue, previousValueRef.current)) {
|
|
return;
|
|
}
|
|
previousValueRef.current = controlledValue;
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.setValue,
|
|
value: controlledValue
|
|
});
|
|
}, [controlledValue]);
|
|
useReducerReturnValueHandler(state, value, options, optionComparerRef, setValueState, onValueChange, onHighlightChange);
|
|
return [state, dispatch];
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ListboxUnstyled/useListbox.js
|
|
var require_useListbox = __commonJS({
|
|
"node_modules/@mui/base/node/ListboxUnstyled/useListbox.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useListbox;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _useListbox = require_useListbox_types();
|
|
var _defaultListboxReducer = _interopRequireDefault(require_defaultListboxReducer());
|
|
var _useControllableReducer = _interopRequireDefault(require_useControllableReducer());
|
|
var _areArraysEqual = _interopRequireDefault(require_areArraysEqual());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var defaultOptionComparer = (optionA, optionB) => optionA === optionB;
|
|
var defaultIsOptionDisabled = () => false;
|
|
function useListbox(props) {
|
|
var _props$optionIdGenera, _options$highlightedI;
|
|
const {
|
|
disabledItemsFocusable = false,
|
|
disableListWrap = false,
|
|
focusManagement = "activeDescendant",
|
|
id: idProp,
|
|
isOptionDisabled = defaultIsOptionDisabled,
|
|
listboxRef: externalListboxRef,
|
|
multiple = false,
|
|
optionComparer = defaultOptionComparer,
|
|
options,
|
|
stateReducer: externalReducer
|
|
} = props;
|
|
const id = (0, _utils.unstable_useId)(idProp);
|
|
function defaultIdGenerator(_, index) {
|
|
return `${id}-option-${index}`;
|
|
}
|
|
const optionIdGenerator = (_props$optionIdGenera = props.optionIdGenerator) != null ? _props$optionIdGenera : defaultIdGenerator;
|
|
const propsWithDefaults = (0, _extends2.default)({}, props, {
|
|
disabledItemsFocusable,
|
|
disableListWrap,
|
|
focusManagement,
|
|
isOptionDisabled,
|
|
multiple,
|
|
optionComparer
|
|
});
|
|
const listboxRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(externalListboxRef, listboxRef);
|
|
const [{
|
|
highlightedValue,
|
|
selectedValue
|
|
}, dispatch] = (0, _useControllableReducer.default)(_defaultListboxReducer.default, externalReducer, propsWithDefaults);
|
|
const highlightedIndex = React31.useMemo(() => {
|
|
return highlightedValue == null ? -1 : options.findIndex((option) => optionComparer(option, highlightedValue));
|
|
}, [highlightedValue, options, optionComparer]);
|
|
const previousOptions = React31.useRef([]);
|
|
React31.useEffect(() => {
|
|
if ((0, _areArraysEqual.default)(previousOptions.current, options, optionComparer)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.optionsChange,
|
|
options,
|
|
previousOptions: previousOptions.current,
|
|
props: propsWithDefaults
|
|
});
|
|
previousOptions.current = options;
|
|
}, [options, optionComparer, dispatch]);
|
|
const setSelectedValue = React31.useCallback((option) => {
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.setValue,
|
|
value: option
|
|
});
|
|
}, [dispatch]);
|
|
const setHighlightedValue = React31.useCallback((option) => {
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.setHighlight,
|
|
highlight: option
|
|
});
|
|
}, [dispatch]);
|
|
const createHandleOptionClick = (option, other) => (event) => {
|
|
var _other$onClick;
|
|
(_other$onClick = other.onClick) == null ? void 0 : _other$onClick.call(other, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
event.preventDefault();
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.optionClick,
|
|
option,
|
|
event,
|
|
props: propsWithDefaults
|
|
});
|
|
};
|
|
const createHandleOptionMouseOver = (option, other) => (event) => {
|
|
var _other$onMouseOver;
|
|
(_other$onMouseOver = other.onMouseOver) == null ? void 0 : _other$onMouseOver.call(other, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.optionHover,
|
|
option,
|
|
event,
|
|
props: propsWithDefaults
|
|
});
|
|
};
|
|
const createHandleKeyDown = (other) => (event) => {
|
|
var _other$onKeyDown;
|
|
(_other$onKeyDown = other.onKeyDown) == null ? void 0 : _other$onKeyDown.call(other, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
const keysToPreventDefault = [" ", "Enter", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"];
|
|
if (keysToPreventDefault.includes(event.key)) {
|
|
event.preventDefault();
|
|
}
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.keyDown,
|
|
event,
|
|
props: propsWithDefaults
|
|
});
|
|
};
|
|
const createHandleBlur = (other) => (event) => {
|
|
var _other$onBlur, _listboxRef$current;
|
|
(_other$onBlur = other.onBlur) == null ? void 0 : _other$onBlur.call(other, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
if ((_listboxRef$current = listboxRef.current) != null && _listboxRef$current.contains(document.activeElement)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: _useListbox.ActionTypes.blur,
|
|
event,
|
|
props: propsWithDefaults
|
|
});
|
|
};
|
|
const getRootProps = (otherHandlers = {}) => {
|
|
return (0, _extends2.default)({}, otherHandlers, {
|
|
"aria-activedescendant": focusManagement === "activeDescendant" && highlightedValue != null ? optionIdGenerator(highlightedValue, highlightedIndex) : void 0,
|
|
id,
|
|
onBlur: createHandleBlur(otherHandlers),
|
|
onKeyDown: createHandleKeyDown(otherHandlers),
|
|
role: "listbox",
|
|
tabIndex: focusManagement === "DOM" ? -1 : 0,
|
|
ref: handleRef
|
|
});
|
|
};
|
|
const getOptionState = (option) => {
|
|
let selected;
|
|
const index = options.findIndex((opt) => optionComparer(opt, option));
|
|
if (multiple) {
|
|
var _ref;
|
|
selected = ((_ref = selectedValue) != null ? _ref : []).some((value) => value != null && optionComparer(option, value));
|
|
} else {
|
|
selected = optionComparer(option, selectedValue);
|
|
}
|
|
const disabled = isOptionDisabled(option, index);
|
|
return {
|
|
selected,
|
|
disabled,
|
|
highlighted: highlightedIndex === index
|
|
};
|
|
};
|
|
const getOptionTabIndex = (optionState) => {
|
|
if (focusManagement === "activeDescendant") {
|
|
return void 0;
|
|
}
|
|
if (!optionState.highlighted) {
|
|
return -1;
|
|
}
|
|
if (optionState.disabled && !disabledItemsFocusable) {
|
|
return -1;
|
|
}
|
|
return 0;
|
|
};
|
|
const getOptionProps = (option, otherHandlers = {}) => {
|
|
const optionState = getOptionState(option);
|
|
const index = options.findIndex((opt) => optionComparer(opt, option));
|
|
return (0, _extends2.default)({}, otherHandlers, {
|
|
"aria-disabled": optionState.disabled || void 0,
|
|
"aria-selected": optionState.selected,
|
|
tabIndex: getOptionTabIndex(optionState),
|
|
id: optionIdGenerator(option, index),
|
|
onClick: createHandleOptionClick(option, otherHandlers),
|
|
onMouseOver: createHandleOptionMouseOver(option, otherHandlers),
|
|
role: "option"
|
|
});
|
|
};
|
|
React31.useDebugValue({
|
|
highlightedOption: options[highlightedIndex],
|
|
selectedOption: selectedValue
|
|
});
|
|
return {
|
|
getRootProps,
|
|
getOptionProps,
|
|
getOptionState,
|
|
highlightedOption: (_options$highlightedI = options[highlightedIndex]) != null ? _options$highlightedI : null,
|
|
selectedOption: selectedValue,
|
|
setSelectedValue,
|
|
setHighlightedValue
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ListboxUnstyled/index.js
|
|
var require_ListboxUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/ListboxUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
useListbox: true,
|
|
defaultListboxReducer: true
|
|
};
|
|
Object.defineProperty(exports, "defaultListboxReducer", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _defaultListboxReducer.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useListbox", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useListbox.default;
|
|
}
|
|
});
|
|
var _useListbox = _interopRequireDefault(require_useListbox());
|
|
var _defaultListboxReducer = _interopRequireDefault(require_defaultListboxReducer());
|
|
var _useListbox2 = require_useListbox_types();
|
|
Object.keys(_useListbox2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useListbox2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useListbox2[key];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/MenuUnstyledContext.js
|
|
var require_MenuUnstyledContext = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/MenuUnstyledContext.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var MenuUnstyledContext = /* @__PURE__ */ React31.createContext(null);
|
|
MenuUnstyledContext.displayName = "MenuUnstyledContext";
|
|
var _default = MenuUnstyledContext;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/menuUnstyledClasses.js
|
|
var require_menuUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/menuUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getMenuUnstyledUtilityClass = getMenuUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getMenuUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiMenuUnstyled", slot);
|
|
}
|
|
var menuUnstyledClasses = (0, _generateUtilityClasses.default)("MuiMenuUnstyled", ["root", "listbox", "expanded"]);
|
|
var _default = menuUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/useMenu.js
|
|
var require_useMenu = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/useMenu.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useMenu2;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _ListboxUnstyled = require_ListboxUnstyled();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function stateReducer(state, action) {
|
|
if (action.type === _ListboxUnstyled.ActionTypes.blur || action.type === _ListboxUnstyled.ActionTypes.optionHover || action.type === _ListboxUnstyled.ActionTypes.setValue) {
|
|
return state;
|
|
}
|
|
const newState = (0, _ListboxUnstyled.defaultListboxReducer)(state, action);
|
|
if (action.type !== _ListboxUnstyled.ActionTypes.setHighlight && newState.highlightedValue === null && action.props.options.length > 0) {
|
|
return (0, _extends2.default)({}, newState, {
|
|
highlightedValue: action.props.options[0]
|
|
});
|
|
}
|
|
return newState;
|
|
}
|
|
function useMenu2(parameters) {
|
|
const {
|
|
listboxRef: listboxRefProp,
|
|
open = false,
|
|
onClose,
|
|
listboxId
|
|
} = parameters;
|
|
const [menuItems, setMenuItems] = React31.useState({});
|
|
const listboxRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(listboxRef, listboxRefProp);
|
|
const registerItem = React31.useCallback((id, metadata) => {
|
|
setMenuItems((previousState) => {
|
|
const newState = (0, _extends2.default)({}, previousState);
|
|
newState[id] = metadata;
|
|
return newState;
|
|
});
|
|
}, []);
|
|
const unregisterItem = React31.useCallback((id) => {
|
|
setMenuItems((previousState) => {
|
|
const newState = (0, _extends2.default)({}, previousState);
|
|
delete newState[id];
|
|
return newState;
|
|
});
|
|
}, []);
|
|
const {
|
|
getOptionState,
|
|
getOptionProps,
|
|
getRootProps,
|
|
highlightedOption,
|
|
setHighlightedValue: setListboxHighlight
|
|
} = (0, _ListboxUnstyled.useListbox)({
|
|
options: Object.keys(menuItems),
|
|
isOptionDisabled: (id) => {
|
|
var _menuItems$id;
|
|
return (menuItems == null ? void 0 : (_menuItems$id = menuItems[id]) == null ? void 0 : _menuItems$id.disabled) || false;
|
|
},
|
|
listboxRef: handleRef,
|
|
focusManagement: "DOM",
|
|
id: listboxId,
|
|
stateReducer,
|
|
disabledItemsFocusable: true
|
|
});
|
|
const highlightFirstItem = React31.useCallback(() => {
|
|
if (Object.keys(menuItems).length > 0) {
|
|
setListboxHighlight(menuItems[Object.keys(menuItems)[0]].id);
|
|
}
|
|
}, [menuItems, setListboxHighlight]);
|
|
const highlightLastItem = React31.useCallback(() => {
|
|
if (Object.keys(menuItems).length > 0) {
|
|
setListboxHighlight(menuItems[Object.keys(menuItems)[Object.keys(menuItems).length - 1]].id);
|
|
}
|
|
}, [menuItems, setListboxHighlight]);
|
|
React31.useEffect(() => {
|
|
if (!open) {
|
|
highlightFirstItem();
|
|
}
|
|
}, [open, highlightFirstItem]);
|
|
const createHandleKeyDown = (otherHandlers) => (e) => {
|
|
var _otherHandlers$onKeyD;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, e);
|
|
if (e.defaultPrevented) {
|
|
return;
|
|
}
|
|
if (e.key === "Escape" && open) {
|
|
onClose == null ? void 0 : onClose();
|
|
}
|
|
};
|
|
const createHandleBlur = (otherHandlers) => (e) => {
|
|
var _listboxRef$current;
|
|
otherHandlers == null ? void 0 : otherHandlers.onBlur(e);
|
|
if (!((_listboxRef$current = listboxRef.current) != null && _listboxRef$current.contains(e.relatedTarget))) {
|
|
onClose == null ? void 0 : onClose();
|
|
}
|
|
};
|
|
React31.useEffect(() => {
|
|
var _listboxRef$current2;
|
|
if ((_listboxRef$current2 = listboxRef.current) != null && _listboxRef$current2.contains(document.activeElement) && highlightedOption !== null) {
|
|
var _menuItems$highlighte, _menuItems$highlighte2;
|
|
menuItems == null ? void 0 : (_menuItems$highlighte = menuItems[highlightedOption]) == null ? void 0 : (_menuItems$highlighte2 = _menuItems$highlighte.ref.current) == null ? void 0 : _menuItems$highlighte2.focus();
|
|
}
|
|
}, [highlightedOption, menuItems]);
|
|
const getListboxProps = (otherHandlers) => (0, _extends2.default)({}, otherHandlers, getRootProps((0, _extends2.default)({}, otherHandlers, {
|
|
onBlur: createHandleBlur(otherHandlers),
|
|
onKeyDown: createHandleKeyDown(otherHandlers)
|
|
})), {
|
|
role: "menu"
|
|
});
|
|
const getItemState = (id) => {
|
|
const {
|
|
disabled,
|
|
highlighted
|
|
} = getOptionState(id);
|
|
return {
|
|
disabled,
|
|
highlighted
|
|
};
|
|
};
|
|
React31.useDebugValue({
|
|
menuItems,
|
|
highlightedOption
|
|
});
|
|
return {
|
|
registerItem,
|
|
unregisterItem,
|
|
menuItems,
|
|
getListboxProps,
|
|
getItemState,
|
|
getItemProps: getOptionProps,
|
|
highlightedOption,
|
|
highlightFirstItem,
|
|
highlightLastItem
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@popperjs/core/dist/cjs/popper.js
|
|
var require_popper = __commonJS({
|
|
"node_modules/@popperjs/core/dist/cjs/popper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function getWindow(node) {
|
|
if (node == null) {
|
|
return window;
|
|
}
|
|
if (node.toString() !== "[object Window]") {
|
|
var ownerDocument = node.ownerDocument;
|
|
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
}
|
|
return node;
|
|
}
|
|
function isElement(node) {
|
|
var OwnElement = getWindow(node).Element;
|
|
return node instanceof OwnElement || node instanceof Element;
|
|
}
|
|
function isHTMLElement(node) {
|
|
var OwnElement = getWindow(node).HTMLElement;
|
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
}
|
|
function isShadowRoot(node) {
|
|
if (typeof ShadowRoot === "undefined") {
|
|
return false;
|
|
}
|
|
var OwnElement = getWindow(node).ShadowRoot;
|
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
}
|
|
var max = Math.max;
|
|
var min = Math.min;
|
|
var round = Math.round;
|
|
function getBoundingClientRect(element, includeScale) {
|
|
if (includeScale === void 0) {
|
|
includeScale = false;
|
|
}
|
|
var rect = element.getBoundingClientRect();
|
|
var scaleX = 1;
|
|
var scaleY = 1;
|
|
if (isHTMLElement(element) && includeScale) {
|
|
var offsetHeight = element.offsetHeight;
|
|
var offsetWidth = element.offsetWidth;
|
|
if (offsetWidth > 0) {
|
|
scaleX = round(rect.width) / offsetWidth || 1;
|
|
}
|
|
if (offsetHeight > 0) {
|
|
scaleY = round(rect.height) / offsetHeight || 1;
|
|
}
|
|
}
|
|
return {
|
|
width: rect.width / scaleX,
|
|
height: rect.height / scaleY,
|
|
top: rect.top / scaleY,
|
|
right: rect.right / scaleX,
|
|
bottom: rect.bottom / scaleY,
|
|
left: rect.left / scaleX,
|
|
x: rect.left / scaleX,
|
|
y: rect.top / scaleY
|
|
};
|
|
}
|
|
function getWindowScroll(node) {
|
|
var win = getWindow(node);
|
|
var scrollLeft = win.pageXOffset;
|
|
var scrollTop = win.pageYOffset;
|
|
return {
|
|
scrollLeft,
|
|
scrollTop
|
|
};
|
|
}
|
|
function getHTMLElementScroll(element) {
|
|
return {
|
|
scrollLeft: element.scrollLeft,
|
|
scrollTop: element.scrollTop
|
|
};
|
|
}
|
|
function getNodeScroll(node) {
|
|
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
return getWindowScroll(node);
|
|
} else {
|
|
return getHTMLElementScroll(node);
|
|
}
|
|
}
|
|
function getNodeName(element) {
|
|
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
}
|
|
function getDocumentElement(element) {
|
|
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
|
}
|
|
function getWindowScrollBarX(element) {
|
|
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
}
|
|
function getComputedStyle(element) {
|
|
return getWindow(element).getComputedStyle(element);
|
|
}
|
|
function isScrollParent(element) {
|
|
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
}
|
|
function isElementScaled(element) {
|
|
var rect = element.getBoundingClientRect();
|
|
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
return scaleX !== 1 || scaleY !== 1;
|
|
}
|
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
if (isFixed === void 0) {
|
|
isFixed = false;
|
|
}
|
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
var documentElement = getDocumentElement(offsetParent);
|
|
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
var scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
var offsets = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
|
scroll = getNodeScroll(offsetParent);
|
|
}
|
|
if (isHTMLElement(offsetParent)) {
|
|
offsets = getBoundingClientRect(offsetParent, true);
|
|
offsets.x += offsetParent.clientLeft;
|
|
offsets.y += offsetParent.clientTop;
|
|
} else if (documentElement) {
|
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
}
|
|
}
|
|
return {
|
|
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
y: rect.top + scroll.scrollTop - offsets.y,
|
|
width: rect.width,
|
|
height: rect.height
|
|
};
|
|
}
|
|
function getLayoutRect(element) {
|
|
var clientRect = getBoundingClientRect(element);
|
|
var width = element.offsetWidth;
|
|
var height = element.offsetHeight;
|
|
if (Math.abs(clientRect.width - width) <= 1) {
|
|
width = clientRect.width;
|
|
}
|
|
if (Math.abs(clientRect.height - height) <= 1) {
|
|
height = clientRect.height;
|
|
}
|
|
return {
|
|
x: element.offsetLeft,
|
|
y: element.offsetTop,
|
|
width,
|
|
height
|
|
};
|
|
}
|
|
function getParentNode(element) {
|
|
if (getNodeName(element) === "html") {
|
|
return element;
|
|
}
|
|
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
|
}
|
|
function getScrollParent(node) {
|
|
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
return node.ownerDocument.body;
|
|
}
|
|
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
return node;
|
|
}
|
|
return getScrollParent(getParentNode(node));
|
|
}
|
|
function listScrollParents(element, list) {
|
|
var _element$ownerDocumen;
|
|
if (list === void 0) {
|
|
list = [];
|
|
}
|
|
var scrollParent = getScrollParent(element);
|
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
var win = getWindow(scrollParent);
|
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
var updatedList = list.concat(target);
|
|
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
|
}
|
|
function isTableElement(element) {
|
|
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
}
|
|
function getTrueOffsetParent(element) {
|
|
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
return null;
|
|
}
|
|
return element.offsetParent;
|
|
}
|
|
function getContainingBlock(element) {
|
|
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
|
|
var isIE = navigator.userAgent.indexOf("Trident") !== -1;
|
|
if (isIE && isHTMLElement(element)) {
|
|
var elementCss = getComputedStyle(element);
|
|
if (elementCss.position === "fixed") {
|
|
return null;
|
|
}
|
|
}
|
|
var currentNode = getParentNode(element);
|
|
if (isShadowRoot(currentNode)) {
|
|
currentNode = currentNode.host;
|
|
}
|
|
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
var css = getComputedStyle(currentNode);
|
|
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
return currentNode;
|
|
} else {
|
|
currentNode = currentNode.parentNode;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getOffsetParent(element) {
|
|
var window2 = getWindow(element);
|
|
var offsetParent = getTrueOffsetParent(element);
|
|
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
}
|
|
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
return window2;
|
|
}
|
|
return offsetParent || getContainingBlock(element) || window2;
|
|
}
|
|
var top = "top";
|
|
var bottom = "bottom";
|
|
var right = "right";
|
|
var left = "left";
|
|
var auto = "auto";
|
|
var basePlacements = [top, bottom, right, left];
|
|
var start = "start";
|
|
var end = "end";
|
|
var clippingParents = "clippingParents";
|
|
var viewport = "viewport";
|
|
var popper = "popper";
|
|
var reference = "reference";
|
|
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
}, []);
|
|
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
}, []);
|
|
var beforeRead = "beforeRead";
|
|
var read = "read";
|
|
var afterRead = "afterRead";
|
|
var beforeMain = "beforeMain";
|
|
var main = "main";
|
|
var afterMain = "afterMain";
|
|
var beforeWrite = "beforeWrite";
|
|
var write = "write";
|
|
var afterWrite = "afterWrite";
|
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
function order(modifiers) {
|
|
var map = new Map();
|
|
var visited = new Set();
|
|
var result = [];
|
|
modifiers.forEach(function(modifier) {
|
|
map.set(modifier.name, modifier);
|
|
});
|
|
function sort(modifier) {
|
|
visited.add(modifier.name);
|
|
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
requires.forEach(function(dep) {
|
|
if (!visited.has(dep)) {
|
|
var depModifier = map.get(dep);
|
|
if (depModifier) {
|
|
sort(depModifier);
|
|
}
|
|
}
|
|
});
|
|
result.push(modifier);
|
|
}
|
|
modifiers.forEach(function(modifier) {
|
|
if (!visited.has(modifier.name)) {
|
|
sort(modifier);
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
function orderModifiers(modifiers) {
|
|
var orderedModifiers = order(modifiers);
|
|
return modifierPhases.reduce(function(acc, phase) {
|
|
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
return modifier.phase === phase;
|
|
}));
|
|
}, []);
|
|
}
|
|
function debounce(fn) {
|
|
var pending;
|
|
return function() {
|
|
if (!pending) {
|
|
pending = new Promise(function(resolve) {
|
|
Promise.resolve().then(function() {
|
|
pending = void 0;
|
|
resolve(fn());
|
|
});
|
|
});
|
|
}
|
|
return pending;
|
|
};
|
|
}
|
|
function format(str) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
return [].concat(args).reduce(function(p, c) {
|
|
return p.replace(/%s/, c);
|
|
}, str);
|
|
}
|
|
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
|
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
|
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
|
|
function validateModifiers(modifiers) {
|
|
modifiers.forEach(function(modifier) {
|
|
[].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self2) {
|
|
return self2.indexOf(value) === index;
|
|
}).forEach(function(key) {
|
|
switch (key) {
|
|
case "name":
|
|
if (typeof modifier.name !== "string") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
|
|
}
|
|
break;
|
|
case "enabled":
|
|
if (typeof modifier.enabled !== "boolean") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
|
|
}
|
|
break;
|
|
case "phase":
|
|
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
|
|
}
|
|
break;
|
|
case "fn":
|
|
if (typeof modifier.fn !== "function") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
}
|
|
break;
|
|
case "effect":
|
|
if (modifier.effect != null && typeof modifier.effect !== "function") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
}
|
|
break;
|
|
case "requires":
|
|
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
|
|
}
|
|
break;
|
|
case "requiresIfExists":
|
|
if (!Array.isArray(modifier.requiresIfExists)) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
|
|
}
|
|
break;
|
|
case "options":
|
|
case "data":
|
|
break;
|
|
default:
|
|
console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
|
|
return '"' + s + '"';
|
|
}).join(", ") + '; but "' + key + '" was provided.');
|
|
}
|
|
modifier.requires && modifier.requires.forEach(function(requirement) {
|
|
if (modifiers.find(function(mod) {
|
|
return mod.name === requirement;
|
|
}) == null) {
|
|
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function uniqueBy(arr, fn) {
|
|
var identifiers = new Set();
|
|
return arr.filter(function(item) {
|
|
var identifier = fn(item);
|
|
if (!identifiers.has(identifier)) {
|
|
identifiers.add(identifier);
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
function getBasePlacement(placement) {
|
|
return placement.split("-")[0];
|
|
}
|
|
function mergeByName(modifiers) {
|
|
var merged = modifiers.reduce(function(merged2, current) {
|
|
var existing = merged2[current.name];
|
|
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
options: Object.assign({}, existing.options, current.options),
|
|
data: Object.assign({}, existing.data, current.data)
|
|
}) : current;
|
|
return merged2;
|
|
}, {});
|
|
return Object.keys(merged).map(function(key) {
|
|
return merged[key];
|
|
});
|
|
}
|
|
function getViewportRect(element) {
|
|
var win = getWindow(element);
|
|
var html = getDocumentElement(element);
|
|
var visualViewport = win.visualViewport;
|
|
var width = html.clientWidth;
|
|
var height = html.clientHeight;
|
|
var x = 0;
|
|
var y = 0;
|
|
if (visualViewport) {
|
|
width = visualViewport.width;
|
|
height = visualViewport.height;
|
|
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
x = visualViewport.offsetLeft;
|
|
y = visualViewport.offsetTop;
|
|
}
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x: x + getWindowScrollBarX(element),
|
|
y
|
|
};
|
|
}
|
|
function getDocumentRect(element) {
|
|
var _element$ownerDocumen;
|
|
var html = getDocumentElement(element);
|
|
var winScroll = getWindowScroll(element);
|
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
var y = -winScroll.scrollTop;
|
|
if (getComputedStyle(body || html).direction === "rtl") {
|
|
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
function contains(parent, child) {
|
|
var rootNode = child.getRootNode && child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
var next = child;
|
|
do {
|
|
if (next && parent.isSameNode(next)) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
} while (next);
|
|
}
|
|
return false;
|
|
}
|
|
function rectToClientRect(rect) {
|
|
return Object.assign({}, rect, {
|
|
left: rect.x,
|
|
top: rect.y,
|
|
right: rect.x + rect.width,
|
|
bottom: rect.y + rect.height
|
|
});
|
|
}
|
|
function getInnerBoundingClientRect(element) {
|
|
var rect = getBoundingClientRect(element);
|
|
rect.top = rect.top + element.clientTop;
|
|
rect.left = rect.left + element.clientLeft;
|
|
rect.bottom = rect.top + element.clientHeight;
|
|
rect.right = rect.left + element.clientWidth;
|
|
rect.width = element.clientWidth;
|
|
rect.height = element.clientHeight;
|
|
rect.x = rect.left;
|
|
rect.y = rect.top;
|
|
return rect;
|
|
}
|
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
}
|
|
function getClippingParents(element) {
|
|
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
|
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
if (!isElement(clipperElement)) {
|
|
return [];
|
|
}
|
|
return clippingParents2.filter(function(clippingParent) {
|
|
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
});
|
|
}
|
|
function getClippingRect(element, boundary, rootBoundary) {
|
|
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
var firstClippingParent = clippingParents2[0];
|
|
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
accRect.top = max(rect.top, accRect.top);
|
|
accRect.right = min(rect.right, accRect.right);
|
|
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
accRect.left = max(rect.left, accRect.left);
|
|
return accRect;
|
|
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
clippingRect.x = clippingRect.left;
|
|
clippingRect.y = clippingRect.top;
|
|
return clippingRect;
|
|
}
|
|
function getVariation(placement) {
|
|
return placement.split("-")[1];
|
|
}
|
|
function getMainAxisFromPlacement(placement) {
|
|
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
}
|
|
function computeOffsets(_ref) {
|
|
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
var variation = placement ? getVariation(placement) : null;
|
|
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
|
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
|
var offsets;
|
|
switch (basePlacement) {
|
|
case top:
|
|
offsets = {
|
|
x: commonX,
|
|
y: reference2.y - element.height
|
|
};
|
|
break;
|
|
case bottom:
|
|
offsets = {
|
|
x: commonX,
|
|
y: reference2.y + reference2.height
|
|
};
|
|
break;
|
|
case right:
|
|
offsets = {
|
|
x: reference2.x + reference2.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
case left:
|
|
offsets = {
|
|
x: reference2.x - element.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
default:
|
|
offsets = {
|
|
x: reference2.x,
|
|
y: reference2.y
|
|
};
|
|
}
|
|
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
if (mainAxis != null) {
|
|
var len = mainAxis === "y" ? "height" : "width";
|
|
switch (variation) {
|
|
case start:
|
|
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
|
break;
|
|
case end:
|
|
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
|
break;
|
|
}
|
|
}
|
|
return offsets;
|
|
}
|
|
function getFreshSideObject() {
|
|
return {
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0
|
|
};
|
|
}
|
|
function mergePaddingObject(paddingObject) {
|
|
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
}
|
|
function expandToHashMap(value, keys) {
|
|
return keys.reduce(function(hashMap, key) {
|
|
hashMap[key] = value;
|
|
return hashMap;
|
|
}, {});
|
|
}
|
|
function detectOverflow(state, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
var altContext = elementContext === popper ? reference : popper;
|
|
var popperRect = state.rects.popper;
|
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
var popperOffsets2 = computeOffsets({
|
|
reference: referenceClientRect,
|
|
element: popperRect,
|
|
strategy: "absolute",
|
|
placement
|
|
});
|
|
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
var overflowOffsets = {
|
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
};
|
|
var offsetData = state.modifiersData.offset;
|
|
if (elementContext === popper && offsetData) {
|
|
var offset2 = offsetData[placement];
|
|
Object.keys(overflowOffsets).forEach(function(key) {
|
|
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
|
overflowOffsets[key] += offset2[axis] * multiply;
|
|
});
|
|
}
|
|
return overflowOffsets;
|
|
}
|
|
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
|
|
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
|
|
var DEFAULT_OPTIONS = {
|
|
placement: "bottom",
|
|
modifiers: [],
|
|
strategy: "absolute"
|
|
};
|
|
function areValidElements() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return !args.some(function(element) {
|
|
return !(element && typeof element.getBoundingClientRect === "function");
|
|
});
|
|
}
|
|
function popperGenerator(generatorOptions) {
|
|
if (generatorOptions === void 0) {
|
|
generatorOptions = {};
|
|
}
|
|
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
return function createPopper2(reference2, popper2, options) {
|
|
if (options === void 0) {
|
|
options = defaultOptions;
|
|
}
|
|
var state = {
|
|
placement: "bottom",
|
|
orderedModifiers: [],
|
|
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
modifiersData: {},
|
|
elements: {
|
|
reference: reference2,
|
|
popper: popper2
|
|
},
|
|
attributes: {},
|
|
styles: {}
|
|
};
|
|
var effectCleanupFns = [];
|
|
var isDestroyed = false;
|
|
var instance = {
|
|
state,
|
|
setOptions: function setOptions(setOptionsAction) {
|
|
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
cleanupModifierEffects();
|
|
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
state.scrollParents = {
|
|
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
popper: listScrollParents(popper2)
|
|
};
|
|
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
return m.enabled;
|
|
});
|
|
if (true) {
|
|
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
|
|
var name = _ref.name;
|
|
return name;
|
|
});
|
|
validateModifiers(modifiers);
|
|
if (getBasePlacement(state.options.placement) === auto) {
|
|
var flipModifier = state.orderedModifiers.find(function(_ref2) {
|
|
var name = _ref2.name;
|
|
return name === "flip";
|
|
});
|
|
if (!flipModifier) {
|
|
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
|
}
|
|
}
|
|
var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
|
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
|
|
return parseFloat(margin);
|
|
})) {
|
|
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
|
|
}
|
|
}
|
|
runModifierEffects();
|
|
return instance.update();
|
|
},
|
|
forceUpdate: function forceUpdate() {
|
|
if (isDestroyed) {
|
|
return;
|
|
}
|
|
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
if (!areValidElements(reference3, popper3)) {
|
|
if (true) {
|
|
console.error(INVALID_ELEMENT_ERROR);
|
|
}
|
|
return;
|
|
}
|
|
state.rects = {
|
|
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
popper: getLayoutRect(popper3)
|
|
};
|
|
state.reset = false;
|
|
state.placement = state.options.placement;
|
|
state.orderedModifiers.forEach(function(modifier) {
|
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
});
|
|
var __debug_loops__ = 0;
|
|
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
if (true) {
|
|
__debug_loops__ += 1;
|
|
if (__debug_loops__ > 100) {
|
|
console.error(INFINITE_LOOP_ERROR);
|
|
break;
|
|
}
|
|
}
|
|
if (state.reset === true) {
|
|
state.reset = false;
|
|
index = -1;
|
|
continue;
|
|
}
|
|
var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
if (typeof fn === "function") {
|
|
state = fn({
|
|
state,
|
|
options: _options,
|
|
name,
|
|
instance
|
|
}) || state;
|
|
}
|
|
}
|
|
},
|
|
update: debounce(function() {
|
|
return new Promise(function(resolve) {
|
|
instance.forceUpdate();
|
|
resolve(state);
|
|
});
|
|
}),
|
|
destroy: function destroy() {
|
|
cleanupModifierEffects();
|
|
isDestroyed = true;
|
|
}
|
|
};
|
|
if (!areValidElements(reference2, popper2)) {
|
|
if (true) {
|
|
console.error(INVALID_ELEMENT_ERROR);
|
|
}
|
|
return instance;
|
|
}
|
|
instance.setOptions(options).then(function(state2) {
|
|
if (!isDestroyed && options.onFirstUpdate) {
|
|
options.onFirstUpdate(state2);
|
|
}
|
|
});
|
|
function runModifierEffects() {
|
|
state.orderedModifiers.forEach(function(_ref3) {
|
|
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
|
if (typeof effect2 === "function") {
|
|
var cleanupFn = effect2({
|
|
state,
|
|
name,
|
|
instance,
|
|
options: options2
|
|
});
|
|
var noopFn = function noopFn2() {
|
|
};
|
|
effectCleanupFns.push(cleanupFn || noopFn);
|
|
}
|
|
});
|
|
}
|
|
function cleanupModifierEffects() {
|
|
effectCleanupFns.forEach(function(fn) {
|
|
return fn();
|
|
});
|
|
effectCleanupFns = [];
|
|
}
|
|
return instance;
|
|
};
|
|
}
|
|
var passive = {
|
|
passive: true
|
|
};
|
|
function effect$2(_ref) {
|
|
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
var window2 = getWindow(state.elements.popper);
|
|
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
if (scroll) {
|
|
scrollParents.forEach(function(scrollParent) {
|
|
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
});
|
|
}
|
|
if (resize) {
|
|
window2.addEventListener("resize", instance.update, passive);
|
|
}
|
|
return function() {
|
|
if (scroll) {
|
|
scrollParents.forEach(function(scrollParent) {
|
|
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
});
|
|
}
|
|
if (resize) {
|
|
window2.removeEventListener("resize", instance.update, passive);
|
|
}
|
|
};
|
|
}
|
|
var eventListeners = {
|
|
name: "eventListeners",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: function fn() {
|
|
},
|
|
effect: effect$2,
|
|
data: {}
|
|
};
|
|
function popperOffsets(_ref) {
|
|
var state = _ref.state, name = _ref.name;
|
|
state.modifiersData[name] = computeOffsets({
|
|
reference: state.rects.reference,
|
|
element: state.rects.popper,
|
|
strategy: "absolute",
|
|
placement: state.placement
|
|
});
|
|
}
|
|
var popperOffsets$1 = {
|
|
name: "popperOffsets",
|
|
enabled: true,
|
|
phase: "read",
|
|
fn: popperOffsets,
|
|
data: {}
|
|
};
|
|
var unsetSides = {
|
|
top: "auto",
|
|
right: "auto",
|
|
bottom: "auto",
|
|
left: "auto"
|
|
};
|
|
function roundOffsetsByDPR(_ref) {
|
|
var x = _ref.x, y = _ref.y;
|
|
var win = window;
|
|
var dpr = win.devicePixelRatio || 1;
|
|
return {
|
|
x: round(x * dpr) / dpr || 0,
|
|
y: round(y * dpr) / dpr || 0
|
|
};
|
|
}
|
|
function mapToStyles(_ref2) {
|
|
var _Object$assign2;
|
|
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
x,
|
|
y
|
|
}) : {
|
|
x,
|
|
y
|
|
};
|
|
x = _ref3.x;
|
|
y = _ref3.y;
|
|
var hasX = offsets.hasOwnProperty("x");
|
|
var hasY = offsets.hasOwnProperty("y");
|
|
var sideX = left;
|
|
var sideY = top;
|
|
var win = window;
|
|
if (adaptive) {
|
|
var offsetParent = getOffsetParent(popper2);
|
|
var heightProp = "clientHeight";
|
|
var widthProp = "clientWidth";
|
|
if (offsetParent === getWindow(popper2)) {
|
|
offsetParent = getDocumentElement(popper2);
|
|
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
|
heightProp = "scrollHeight";
|
|
widthProp = "scrollWidth";
|
|
}
|
|
}
|
|
offsetParent = offsetParent;
|
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
sideY = bottom;
|
|
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
|
y -= offsetY - popperRect.height;
|
|
y *= gpuAcceleration ? 1 : -1;
|
|
}
|
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
sideX = right;
|
|
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
|
x -= offsetX - popperRect.width;
|
|
x *= gpuAcceleration ? 1 : -1;
|
|
}
|
|
}
|
|
var commonStyles = Object.assign({
|
|
position
|
|
}, adaptive && unsetSides);
|
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
x,
|
|
y
|
|
}) : {
|
|
x,
|
|
y
|
|
};
|
|
x = _ref4.x;
|
|
y = _ref4.y;
|
|
if (gpuAcceleration) {
|
|
var _Object$assign;
|
|
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
}
|
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
}
|
|
function computeStyles(_ref5) {
|
|
var state = _ref5.state, options = _ref5.options;
|
|
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
if (true) {
|
|
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
|
|
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
|
return transitionProperty.indexOf(property) >= 0;
|
|
})) {
|
|
console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
|
|
}
|
|
}
|
|
var commonStyles = {
|
|
placement: getBasePlacement(state.placement),
|
|
variation: getVariation(state.placement),
|
|
popper: state.elements.popper,
|
|
popperRect: state.rects.popper,
|
|
gpuAcceleration,
|
|
isFixed: state.options.strategy === "fixed"
|
|
};
|
|
if (state.modifiersData.popperOffsets != null) {
|
|
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
offsets: state.modifiersData.popperOffsets,
|
|
position: state.options.strategy,
|
|
adaptive,
|
|
roundOffsets
|
|
})));
|
|
}
|
|
if (state.modifiersData.arrow != null) {
|
|
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
offsets: state.modifiersData.arrow,
|
|
position: "absolute",
|
|
adaptive: false,
|
|
roundOffsets
|
|
})));
|
|
}
|
|
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
"data-popper-placement": state.placement
|
|
});
|
|
}
|
|
var computeStyles$1 = {
|
|
name: "computeStyles",
|
|
enabled: true,
|
|
phase: "beforeWrite",
|
|
fn: computeStyles,
|
|
data: {}
|
|
};
|
|
function applyStyles(_ref) {
|
|
var state = _ref.state;
|
|
Object.keys(state.elements).forEach(function(name) {
|
|
var style = state.styles[name] || {};
|
|
var attributes = state.attributes[name] || {};
|
|
var element = state.elements[name];
|
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
return;
|
|
}
|
|
Object.assign(element.style, style);
|
|
Object.keys(attributes).forEach(function(name2) {
|
|
var value = attributes[name2];
|
|
if (value === false) {
|
|
element.removeAttribute(name2);
|
|
} else {
|
|
element.setAttribute(name2, value === true ? "" : value);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function effect$1(_ref2) {
|
|
var state = _ref2.state;
|
|
var initialStyles = {
|
|
popper: {
|
|
position: state.options.strategy,
|
|
left: "0",
|
|
top: "0",
|
|
margin: "0"
|
|
},
|
|
arrow: {
|
|
position: "absolute"
|
|
},
|
|
reference: {}
|
|
};
|
|
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
state.styles = initialStyles;
|
|
if (state.elements.arrow) {
|
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
}
|
|
return function() {
|
|
Object.keys(state.elements).forEach(function(name) {
|
|
var element = state.elements[name];
|
|
var attributes = state.attributes[name] || {};
|
|
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
var style = styleProperties.reduce(function(style2, property) {
|
|
style2[property] = "";
|
|
return style2;
|
|
}, {});
|
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
return;
|
|
}
|
|
Object.assign(element.style, style);
|
|
Object.keys(attributes).forEach(function(attribute) {
|
|
element.removeAttribute(attribute);
|
|
});
|
|
});
|
|
};
|
|
}
|
|
var applyStyles$1 = {
|
|
name: "applyStyles",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: applyStyles,
|
|
effect: effect$1,
|
|
requires: ["computeStyles"]
|
|
};
|
|
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
var basePlacement = getBasePlacement(placement);
|
|
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
|
placement
|
|
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
|
skidding = skidding || 0;
|
|
distance = (distance || 0) * invertDistance;
|
|
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
x: distance,
|
|
y: skidding
|
|
} : {
|
|
x: skidding,
|
|
y: distance
|
|
};
|
|
}
|
|
function offset(_ref2) {
|
|
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
var data = placements.reduce(function(acc, placement) {
|
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
return acc;
|
|
}, {});
|
|
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
|
if (state.modifiersData.popperOffsets != null) {
|
|
state.modifiersData.popperOffsets.x += x;
|
|
state.modifiersData.popperOffsets.y += y;
|
|
}
|
|
state.modifiersData[name] = data;
|
|
}
|
|
var offset$1 = {
|
|
name: "offset",
|
|
enabled: true,
|
|
phase: "main",
|
|
requires: ["popperOffsets"],
|
|
fn: offset
|
|
};
|
|
var hash$1 = {
|
|
left: "right",
|
|
right: "left",
|
|
bottom: "top",
|
|
top: "bottom"
|
|
};
|
|
function getOppositePlacement(placement) {
|
|
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
return hash$1[matched];
|
|
});
|
|
}
|
|
var hash = {
|
|
start: "end",
|
|
end: "start"
|
|
};
|
|
function getOppositeVariationPlacement(placement) {
|
|
return placement.replace(/start|end/g, function(matched) {
|
|
return hash[matched];
|
|
});
|
|
}
|
|
function computeAutoPlacement(state, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
var variation = getVariation(placement);
|
|
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
return getVariation(placement2) === variation;
|
|
}) : basePlacements;
|
|
var allowedPlacements = placements$1.filter(function(placement2) {
|
|
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
});
|
|
if (allowedPlacements.length === 0) {
|
|
allowedPlacements = placements$1;
|
|
if (true) {
|
|
console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" "));
|
|
}
|
|
}
|
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
acc[placement2] = detectOverflow(state, {
|
|
placement: placement2,
|
|
boundary,
|
|
rootBoundary,
|
|
padding
|
|
})[getBasePlacement(placement2)];
|
|
return acc;
|
|
}, {});
|
|
return Object.keys(overflows).sort(function(a, b) {
|
|
return overflows[a] - overflows[b];
|
|
});
|
|
}
|
|
function getExpandedFallbackPlacements(placement) {
|
|
if (getBasePlacement(placement) === auto) {
|
|
return [];
|
|
}
|
|
var oppositePlacement = getOppositePlacement(placement);
|
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
}
|
|
function flip(_ref) {
|
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
if (state.modifiersData[name]._skip) {
|
|
return;
|
|
}
|
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
|
var preferredPlacement = state.options.placement;
|
|
var basePlacement = getBasePlacement(preferredPlacement);
|
|
var isBasePlacement = basePlacement === preferredPlacement;
|
|
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
|
placement: placement2,
|
|
boundary,
|
|
rootBoundary,
|
|
padding,
|
|
flipVariations,
|
|
allowedAutoPlacements
|
|
}) : placement2);
|
|
}, []);
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var checksMap = new Map();
|
|
var makeFallbackChecks = true;
|
|
var firstFittingPlacement = placements2[0];
|
|
for (var i = 0; i < placements2.length; i++) {
|
|
var placement = placements2[i];
|
|
var _basePlacement = getBasePlacement(placement);
|
|
var isStartVariation = getVariation(placement) === start;
|
|
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
var len = isVertical ? "width" : "height";
|
|
var overflow = detectOverflow(state, {
|
|
placement,
|
|
boundary,
|
|
rootBoundary,
|
|
altBoundary,
|
|
padding
|
|
});
|
|
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
if (referenceRect[len] > popperRect[len]) {
|
|
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
}
|
|
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
var checks = [];
|
|
if (checkMainAxis) {
|
|
checks.push(overflow[_basePlacement] <= 0);
|
|
}
|
|
if (checkAltAxis) {
|
|
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
}
|
|
if (checks.every(function(check) {
|
|
return check;
|
|
})) {
|
|
firstFittingPlacement = placement;
|
|
makeFallbackChecks = false;
|
|
break;
|
|
}
|
|
checksMap.set(placement, checks);
|
|
}
|
|
if (makeFallbackChecks) {
|
|
var numberOfChecks = flipVariations ? 3 : 1;
|
|
var _loop = function _loop2(_i2) {
|
|
var fittingPlacement = placements2.find(function(placement2) {
|
|
var checks2 = checksMap.get(placement2);
|
|
if (checks2) {
|
|
return checks2.slice(0, _i2).every(function(check) {
|
|
return check;
|
|
});
|
|
}
|
|
});
|
|
if (fittingPlacement) {
|
|
firstFittingPlacement = fittingPlacement;
|
|
return "break";
|
|
}
|
|
};
|
|
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
var _ret = _loop(_i);
|
|
if (_ret === "break")
|
|
break;
|
|
}
|
|
}
|
|
if (state.placement !== firstFittingPlacement) {
|
|
state.modifiersData[name]._skip = true;
|
|
state.placement = firstFittingPlacement;
|
|
state.reset = true;
|
|
}
|
|
}
|
|
var flip$1 = {
|
|
name: "flip",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: flip,
|
|
requiresIfExists: ["offset"],
|
|
data: {
|
|
_skip: false
|
|
}
|
|
};
|
|
function getAltAxis(axis) {
|
|
return axis === "x" ? "y" : "x";
|
|
}
|
|
function within(min$1, value, max$1) {
|
|
return max(min$1, min(value, max$1));
|
|
}
|
|
function withinMaxClamp(min2, value, max2) {
|
|
var v = within(min2, value, max2);
|
|
return v > max2 ? max2 : v;
|
|
}
|
|
function preventOverflow(_ref) {
|
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
var overflow = detectOverflow(state, {
|
|
boundary,
|
|
rootBoundary,
|
|
padding,
|
|
altBoundary
|
|
});
|
|
var basePlacement = getBasePlacement(state.placement);
|
|
var variation = getVariation(state.placement);
|
|
var isBasePlacement = !variation;
|
|
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
var altAxis = getAltAxis(mainAxis);
|
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
|
placement: state.placement
|
|
})) : tetherOffset;
|
|
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
|
mainAxis: tetherOffsetValue,
|
|
altAxis: tetherOffsetValue
|
|
} : Object.assign({
|
|
mainAxis: 0,
|
|
altAxis: 0
|
|
}, tetherOffsetValue);
|
|
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
var data = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
if (!popperOffsets2) {
|
|
return;
|
|
}
|
|
if (checkMainAxis) {
|
|
var _offsetModifierState$;
|
|
var mainSide = mainAxis === "y" ? top : left;
|
|
var altSide = mainAxis === "y" ? bottom : right;
|
|
var len = mainAxis === "y" ? "height" : "width";
|
|
var offset2 = popperOffsets2[mainAxis];
|
|
var min$1 = offset2 + overflow[mainSide];
|
|
var max$1 = offset2 - overflow[altSide];
|
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
var arrowElement = state.elements.arrow;
|
|
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
|
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
var arrowPaddingMax = arrowPaddingObject[altSide];
|
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1);
|
|
popperOffsets2[mainAxis] = preventedOffset;
|
|
data[mainAxis] = preventedOffset - offset2;
|
|
}
|
|
if (checkAltAxis) {
|
|
var _offsetModifierState$2;
|
|
var _mainSide = mainAxis === "x" ? top : left;
|
|
var _altSide = mainAxis === "x" ? bottom : right;
|
|
var _offset = popperOffsets2[altAxis];
|
|
var _len = altAxis === "y" ? "height" : "width";
|
|
var _min = _offset + overflow[_mainSide];
|
|
var _max = _offset - overflow[_altSide];
|
|
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
popperOffsets2[altAxis] = _preventedOffset;
|
|
data[altAxis] = _preventedOffset - _offset;
|
|
}
|
|
state.modifiersData[name] = data;
|
|
}
|
|
var preventOverflow$1 = {
|
|
name: "preventOverflow",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: preventOverflow,
|
|
requiresIfExists: ["offset"]
|
|
};
|
|
var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
|
placement: state.placement
|
|
})) : padding;
|
|
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
|
};
|
|
function arrow(_ref) {
|
|
var _state$modifiersData$;
|
|
var state = _ref.state, name = _ref.name, options = _ref.options;
|
|
var arrowElement = state.elements.arrow;
|
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
var basePlacement = getBasePlacement(state.placement);
|
|
var axis = getMainAxisFromPlacement(basePlacement);
|
|
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
var len = isVertical ? "height" : "width";
|
|
if (!arrowElement || !popperOffsets2) {
|
|
return;
|
|
}
|
|
var paddingObject = toPaddingObject(options.padding, state);
|
|
var arrowRect = getLayoutRect(arrowElement);
|
|
var minProp = axis === "y" ? top : left;
|
|
var maxProp = axis === "y" ? bottom : right;
|
|
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
var min2 = paddingObject[minProp];
|
|
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
var offset2 = within(min2, center, max2);
|
|
var axisProp = axis;
|
|
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
|
}
|
|
function effect(_ref2) {
|
|
var state = _ref2.state, options = _ref2.options;
|
|
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
|
if (arrowElement == null) {
|
|
return;
|
|
}
|
|
if (typeof arrowElement === "string") {
|
|
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
if (!arrowElement) {
|
|
return;
|
|
}
|
|
}
|
|
if (true) {
|
|
if (!isHTMLElement(arrowElement)) {
|
|
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "));
|
|
}
|
|
}
|
|
if (!contains(state.elements.popper, arrowElement)) {
|
|
if (true) {
|
|
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
|
|
}
|
|
return;
|
|
}
|
|
state.elements.arrow = arrowElement;
|
|
}
|
|
var arrow$1 = {
|
|
name: "arrow",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: arrow,
|
|
effect,
|
|
requires: ["popperOffsets"],
|
|
requiresIfExists: ["preventOverflow"]
|
|
};
|
|
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
if (preventedOffsets === void 0) {
|
|
preventedOffsets = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
}
|
|
return {
|
|
top: overflow.top - rect.height - preventedOffsets.y,
|
|
right: overflow.right - rect.width + preventedOffsets.x,
|
|
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
left: overflow.left - rect.width - preventedOffsets.x
|
|
};
|
|
}
|
|
function isAnySideFullyClipped(overflow) {
|
|
return [top, right, bottom, left].some(function(side) {
|
|
return overflow[side] >= 0;
|
|
});
|
|
}
|
|
function hide(_ref) {
|
|
var state = _ref.state, name = _ref.name;
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
var referenceOverflow = detectOverflow(state, {
|
|
elementContext: "reference"
|
|
});
|
|
var popperAltOverflow = detectOverflow(state, {
|
|
altBoundary: true
|
|
});
|
|
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
state.modifiersData[name] = {
|
|
referenceClippingOffsets,
|
|
popperEscapeOffsets,
|
|
isReferenceHidden,
|
|
hasPopperEscaped
|
|
};
|
|
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
"data-popper-reference-hidden": isReferenceHidden,
|
|
"data-popper-escaped": hasPopperEscaped
|
|
});
|
|
}
|
|
var hide$1 = {
|
|
name: "hide",
|
|
enabled: true,
|
|
phase: "main",
|
|
requiresIfExists: ["preventOverflow"],
|
|
fn: hide
|
|
};
|
|
var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
|
var createPopper$1 = /* @__PURE__ */ popperGenerator({
|
|
defaultModifiers: defaultModifiers$1
|
|
});
|
|
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
defaultModifiers
|
|
});
|
|
exports.applyStyles = applyStyles$1;
|
|
exports.arrow = arrow$1;
|
|
exports.computeStyles = computeStyles$1;
|
|
exports.createPopper = createPopper;
|
|
exports.createPopperLite = createPopper$1;
|
|
exports.defaultModifiers = defaultModifiers;
|
|
exports.detectOverflow = detectOverflow;
|
|
exports.eventListeners = eventListeners;
|
|
exports.flip = flip$1;
|
|
exports.hide = hide$1;
|
|
exports.offset = offset$1;
|
|
exports.popperGenerator = popperGenerator;
|
|
exports.popperOffsets = popperOffsets$1;
|
|
exports.preventOverflow = preventOverflow$1;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/Portal/Portal.js
|
|
var require_Portal = __commonJS({
|
|
"node_modules/@mui/base/node/Portal/Portal.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var ReactDOM3 = _interopRequireWildcard(require_react_dom());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function getContainer(container) {
|
|
return typeof container === "function" ? container() : container;
|
|
}
|
|
var Portal = /* @__PURE__ */ React31.forwardRef(function Portal2(props, ref) {
|
|
const {
|
|
children,
|
|
container,
|
|
disablePortal = false
|
|
} = props;
|
|
const [mountNode, setMountNode] = React31.useState(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(/* @__PURE__ */ React31.isValidElement(children) ? children.ref : null, ref);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (!disablePortal) {
|
|
setMountNode(getContainer(container) || document.body);
|
|
}
|
|
}, [container, disablePortal]);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (mountNode && !disablePortal) {
|
|
(0, _utils.unstable_setRef)(ref, mountNode);
|
|
return () => {
|
|
(0, _utils.unstable_setRef)(ref, null);
|
|
};
|
|
}
|
|
return void 0;
|
|
}, [ref, mountNode, disablePortal]);
|
|
if (disablePortal) {
|
|
if (/* @__PURE__ */ React31.isValidElement(children)) {
|
|
return /* @__PURE__ */ React31.cloneElement(children, {
|
|
ref: handleRef
|
|
});
|
|
}
|
|
return children;
|
|
}
|
|
return mountNode ? /* @__PURE__ */ ReactDOM3.createPortal(children, mountNode) : mountNode;
|
|
});
|
|
true ? Portal.propTypes = {
|
|
children: _propTypes.default.node,
|
|
container: _propTypes.default.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
|
|
disablePortal: _propTypes.default.bool
|
|
} : void 0;
|
|
if (true) {
|
|
Portal["propTypes"] = (0, _utils.exactProp)(Portal.propTypes);
|
|
}
|
|
var _default = Portal;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/Portal/index.js
|
|
var require_Portal2 = __commonJS({
|
|
"node_modules/@mui/base/node/Portal/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Portal.default;
|
|
}
|
|
});
|
|
var _Portal = _interopRequireDefault(require_Portal());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/PopperUnstyled/PopperUnstyled.js
|
|
var require_PopperUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/PopperUnstyled/PopperUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _core = require_popper();
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _Portal = _interopRequireDefault(require_Portal2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "ownerState", "placement", "popperOptions", "popperRef", "TransitionProps"];
|
|
var _excluded2 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function flipPlacement(placement, direction) {
|
|
if (direction === "ltr") {
|
|
return placement;
|
|
}
|
|
switch (placement) {
|
|
case "bottom-end":
|
|
return "bottom-start";
|
|
case "bottom-start":
|
|
return "bottom-end";
|
|
case "top-end":
|
|
return "top-start";
|
|
case "top-start":
|
|
return "top-end";
|
|
default:
|
|
return placement;
|
|
}
|
|
}
|
|
function resolveAnchorEl(anchorEl) {
|
|
return typeof anchorEl === "function" ? anchorEl() : anchorEl;
|
|
}
|
|
var defaultPopperOptions = {};
|
|
var PopperTooltip = /* @__PURE__ */ React31.forwardRef(function PopperTooltip2(props, ref) {
|
|
const {
|
|
anchorEl,
|
|
children,
|
|
direction,
|
|
disablePortal,
|
|
modifiers,
|
|
open,
|
|
placement: initialPlacement,
|
|
popperOptions,
|
|
popperRef: popperRefProp,
|
|
TransitionProps
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const tooltipRef = React31.useRef(null);
|
|
const ownRef = (0, _utils.unstable_useForkRef)(tooltipRef, ref);
|
|
const popperRef = React31.useRef(null);
|
|
const handlePopperRef = (0, _utils.unstable_useForkRef)(popperRef, popperRefProp);
|
|
const handlePopperRefRef = React31.useRef(handlePopperRef);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
handlePopperRefRef.current = handlePopperRef;
|
|
}, [handlePopperRef]);
|
|
React31.useImperativeHandle(popperRefProp, () => popperRef.current, []);
|
|
const rtlPlacement = flipPlacement(initialPlacement, direction);
|
|
const [placement, setPlacement] = React31.useState(rtlPlacement);
|
|
React31.useEffect(() => {
|
|
if (popperRef.current) {
|
|
popperRef.current.forceUpdate();
|
|
}
|
|
});
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (!anchorEl || !open) {
|
|
return void 0;
|
|
}
|
|
const handlePopperUpdate = (data) => {
|
|
setPlacement(data.placement);
|
|
};
|
|
const resolvedAnchorEl = resolveAnchorEl(anchorEl);
|
|
if (true) {
|
|
if (resolvedAnchorEl && resolvedAnchorEl.nodeType === 1) {
|
|
const box = resolvedAnchorEl.getBoundingClientRect();
|
|
if (box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
|
console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
|
|
}
|
|
}
|
|
}
|
|
let popperModifiers = [{
|
|
name: "preventOverflow",
|
|
options: {
|
|
altBoundary: disablePortal
|
|
}
|
|
}, {
|
|
name: "flip",
|
|
options: {
|
|
altBoundary: disablePortal
|
|
}
|
|
}, {
|
|
name: "onUpdate",
|
|
enabled: true,
|
|
phase: "afterWrite",
|
|
fn: ({
|
|
state
|
|
}) => {
|
|
handlePopperUpdate(state);
|
|
}
|
|
}];
|
|
if (modifiers != null) {
|
|
popperModifiers = popperModifiers.concat(modifiers);
|
|
}
|
|
if (popperOptions && popperOptions.modifiers != null) {
|
|
popperModifiers = popperModifiers.concat(popperOptions.modifiers);
|
|
}
|
|
const popper = (0, _core.createPopper)(resolveAnchorEl(anchorEl), tooltipRef.current, (0, _extends2.default)({
|
|
placement: rtlPlacement
|
|
}, popperOptions, {
|
|
modifiers: popperModifiers
|
|
}));
|
|
handlePopperRefRef.current(popper);
|
|
return () => {
|
|
popper.destroy();
|
|
handlePopperRefRef.current(null);
|
|
};
|
|
}, [anchorEl, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
|
|
const childProps = {
|
|
placement
|
|
};
|
|
if (TransitionProps !== null) {
|
|
childProps.TransitionProps = TransitionProps;
|
|
}
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)("div", (0, _extends2.default)({
|
|
ref: ownRef,
|
|
role: "tooltip"
|
|
}, other, {
|
|
children: typeof children === "function" ? children(childProps) : children
|
|
}));
|
|
});
|
|
var PopperUnstyled = /* @__PURE__ */ React31.forwardRef(function PopperUnstyled2(props, ref) {
|
|
const {
|
|
anchorEl,
|
|
children,
|
|
container: containerProp,
|
|
direction = "ltr",
|
|
disablePortal = false,
|
|
keepMounted = false,
|
|
modifiers,
|
|
open,
|
|
placement = "bottom",
|
|
popperOptions = defaultPopperOptions,
|
|
popperRef,
|
|
style,
|
|
transition = false
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
const [exited, setExited] = React31.useState(true);
|
|
const handleEnter = () => {
|
|
setExited(false);
|
|
};
|
|
const handleExited = () => {
|
|
setExited(true);
|
|
};
|
|
if (!keepMounted && !open && (!transition || exited)) {
|
|
return null;
|
|
}
|
|
const container = containerProp || (anchorEl ? (0, _utils.unstable_ownerDocument)(resolveAnchorEl(anchorEl)).body : void 0);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_Portal.default, {
|
|
disablePortal,
|
|
container,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(PopperTooltip, (0, _extends2.default)({
|
|
anchorEl,
|
|
direction,
|
|
disablePortal,
|
|
modifiers,
|
|
ref,
|
|
open: transition ? !exited : open,
|
|
placement,
|
|
popperOptions,
|
|
popperRef
|
|
}, other, {
|
|
style: (0, _extends2.default)({
|
|
position: "fixed",
|
|
top: 0,
|
|
left: 0,
|
|
display: !open && keepMounted && (!transition || exited) ? "none" : null
|
|
}, style),
|
|
TransitionProps: transition ? {
|
|
in: open,
|
|
onEnter: handleEnter,
|
|
onExited: handleExited
|
|
} : null,
|
|
children
|
|
}))
|
|
});
|
|
});
|
|
true ? PopperUnstyled.propTypes = {
|
|
anchorEl: (0, _utils.chainPropTypes)(_propTypes.default.oneOfType([_utils.HTMLElementType, _propTypes.default.object, _propTypes.default.func]), (props) => {
|
|
if (props.open) {
|
|
const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
|
|
if (resolvedAnchorEl && resolvedAnchorEl.nodeType === 1) {
|
|
const box = resolvedAnchorEl.getBoundingClientRect();
|
|
if (box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
|
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
|
|
}
|
|
} else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== "function" || resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
|
|
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join("\n"));
|
|
}
|
|
}
|
|
return null;
|
|
}),
|
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
container: _propTypes.default.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
|
|
direction: _propTypes.default.oneOf(["ltr", "rtl"]),
|
|
disablePortal: _propTypes.default.bool,
|
|
keepMounted: _propTypes.default.bool,
|
|
modifiers: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
data: _propTypes.default.object,
|
|
effect: _propTypes.default.func,
|
|
enabled: _propTypes.default.bool,
|
|
fn: _propTypes.default.func,
|
|
name: _propTypes.default.any,
|
|
options: _propTypes.default.object,
|
|
phase: _propTypes.default.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
|
|
requires: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
requiresIfExists: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
})),
|
|
open: _propTypes.default.bool.isRequired,
|
|
placement: _propTypes.default.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
popperOptions: _propTypes.default.shape({
|
|
modifiers: _propTypes.default.array,
|
|
onFirstUpdate: _propTypes.default.func,
|
|
placement: _propTypes.default.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
strategy: _propTypes.default.oneOf(["absolute", "fixed"])
|
|
}),
|
|
popperRef: _utils.refType,
|
|
style: _propTypes.default.object,
|
|
transition: _propTypes.default.bool
|
|
} : void 0;
|
|
var _default = PopperUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/PopperUnstyled/index.js
|
|
var require_PopperUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/PopperUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _PopperUnstyled.default;
|
|
}
|
|
});
|
|
var _PopperUnstyled = _interopRequireDefault(require_PopperUnstyled());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/MenuUnstyled.js
|
|
var require_MenuUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/MenuUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _MenuUnstyledContext = _interopRequireDefault(require_MenuUnstyledContext());
|
|
var _menuUnstyledClasses = require_menuUnstyledClasses();
|
|
var _useMenu = _interopRequireDefault(require_useMenu());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _PopperUnstyled = _interopRequireDefault(require_PopperUnstyled2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["actions", "anchorEl", "children", "className", "component", "components", "componentsProps", "onClose", "open"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function getUtilityClasses(ownerState) {
|
|
const {
|
|
open
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", open && "expanded"],
|
|
listbox: ["listbox", open && "expanded"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _menuUnstyledClasses.getMenuUnstyledUtilityClass, {});
|
|
}
|
|
var MenuUnstyled = /* @__PURE__ */ React31.forwardRef(function MenuUnstyled2(props, forwardedRef) {
|
|
var _componentsProps$list, _componentsProps$list2, _ref, _componentsProps$root, _components$Listbox, _componentsProps$list3;
|
|
const {
|
|
actions,
|
|
anchorEl,
|
|
children,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
onClose,
|
|
open = false
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
registerItem,
|
|
unregisterItem,
|
|
getListboxProps,
|
|
getItemProps,
|
|
getItemState,
|
|
highlightFirstItem,
|
|
highlightLastItem
|
|
} = (0, _useMenu.default)({
|
|
open,
|
|
onClose,
|
|
listboxRef: (_componentsProps$list = componentsProps.listbox) == null ? void 0 : _componentsProps$list.ref,
|
|
listboxId: (_componentsProps$list2 = componentsProps.listbox) == null ? void 0 : _componentsProps$list2.id
|
|
});
|
|
React31.useImperativeHandle(actions, () => ({
|
|
highlightFirstItem,
|
|
highlightLastItem
|
|
}), [highlightFirstItem, highlightLastItem]);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
open
|
|
});
|
|
const classes = getUtilityClasses(ownerState);
|
|
const Popper = (_ref = component != null ? component : components.Root) != null ? _ref : _PopperUnstyled.default;
|
|
const popperProps = (0, _appendOwnerState.default)(Popper, (0, _extends2.default)({}, other, {
|
|
anchorEl,
|
|
open,
|
|
keepMounted: true,
|
|
role: void 0
|
|
}, componentsProps.root, {
|
|
className: (0, _clsx.default)(classes.root, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
}), ownerState);
|
|
const Listbox = (_components$Listbox = components.Listbox) != null ? _components$Listbox : "ul";
|
|
const listboxProps = (0, _appendOwnerState.default)(Listbox, (0, _extends2.default)({}, componentsProps.listbox, getListboxProps(), {
|
|
className: (0, _clsx.default)(classes.listbox, (_componentsProps$list3 = componentsProps.listbox) == null ? void 0 : _componentsProps$list3.className)
|
|
}), ownerState);
|
|
const contextValue = {
|
|
registerItem,
|
|
unregisterItem,
|
|
getItemState,
|
|
getItemProps,
|
|
open
|
|
};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(Popper, (0, _extends2.default)({}, popperProps, {
|
|
ref: forwardedRef,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(Listbox, (0, _extends2.default)({}, listboxProps, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(_MenuUnstyledContext.default.Provider, {
|
|
value: contextValue,
|
|
children
|
|
})
|
|
}))
|
|
}));
|
|
});
|
|
true ? MenuUnstyled.propTypes = {
|
|
actions: _utils.refType,
|
|
anchorEl: _propTypes.default.oneOfType([_utils.HTMLElementType, _propTypes.default.object, _propTypes.default.func]),
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Listbox: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
listbox: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
onClose: _propTypes.default.func,
|
|
open: _propTypes.default.bool
|
|
} : void 0;
|
|
var _default = MenuUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/MenuUnstyled.types.js
|
|
var require_MenuUnstyled_types = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/MenuUnstyled.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/useMenu.types.js
|
|
var require_useMenu_types = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/useMenu.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuUnstyled/index.js
|
|
var require_MenuUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/MenuUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
MenuUnstyledContext: true,
|
|
menuUnstyledClasses: true,
|
|
useMenu: true
|
|
};
|
|
Object.defineProperty(exports, "MenuUnstyledContext", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyledContext.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "menuUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _menuUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useMenu", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useMenu.default;
|
|
}
|
|
});
|
|
var _MenuUnstyled = _interopRequireDefault(require_MenuUnstyled());
|
|
var _MenuUnstyledContext = _interopRequireWildcard(require_MenuUnstyledContext());
|
|
Object.keys(_MenuUnstyledContext).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MenuUnstyledContext[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyledContext[key];
|
|
}
|
|
});
|
|
});
|
|
var _menuUnstyledClasses = _interopRequireWildcard(require_menuUnstyledClasses());
|
|
Object.keys(_menuUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _menuUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _menuUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _MenuUnstyled2 = require_MenuUnstyled_types();
|
|
Object.keys(_MenuUnstyled2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MenuUnstyled2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyled2[key];
|
|
}
|
|
});
|
|
});
|
|
var _useMenu = _interopRequireDefault(require_useMenu());
|
|
var _useMenu2 = require_useMenu_types();
|
|
Object.keys(_useMenu2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useMenu2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useMenu2[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/menuItemUnstyledClasses.js
|
|
var require_menuItemUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/menuItemUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getMenuItemUnstyledUtilityClass = getMenuItemUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getMenuItemUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiMenuItemUnstyled", slot);
|
|
}
|
|
var menuItemUnstyledClasses = (0, _generateUtilityClasses.default)("MuiMenuItemUnstyled", ["root", "disabled", "focusVisible"]);
|
|
var _default = menuItemUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/useMenuItem.js
|
|
var require_useMenuItem = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/useMenuItem.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useMenuItem;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _MenuUnstyled = require_MenuUnstyled2();
|
|
var _ButtonUnstyled = require_ButtonUnstyled2();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useMenuItem(props) {
|
|
const {
|
|
component,
|
|
disabled = false,
|
|
ref
|
|
} = props;
|
|
const id = (0, _utils.unstable_useId)();
|
|
const menuContext = React31.useContext(_MenuUnstyled.MenuUnstyledContext);
|
|
const itemRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(itemRef, ref);
|
|
if (menuContext === null) {
|
|
throw new Error("MenuItemUnstyled must be used within a MenuUnstyled");
|
|
}
|
|
const {
|
|
registerItem,
|
|
unregisterItem,
|
|
open
|
|
} = menuContext;
|
|
React31.useEffect(() => {
|
|
if (id === void 0) {
|
|
return void 0;
|
|
}
|
|
registerItem(id, {
|
|
disabled,
|
|
id,
|
|
ref: itemRef
|
|
});
|
|
return () => unregisterItem(id);
|
|
}, [id, registerItem, unregisterItem, disabled, ref]);
|
|
const {
|
|
getRootProps: getButtonProps,
|
|
focusVisible
|
|
} = (0, _ButtonUnstyled.useButton)({
|
|
component,
|
|
ref: handleRef,
|
|
disabled
|
|
});
|
|
const [focusRequested, requestFocus] = React31.useState(false);
|
|
const focusIfRequested = React31.useCallback(() => {
|
|
if (focusRequested && itemRef.current != null) {
|
|
itemRef.current.focus();
|
|
requestFocus(false);
|
|
}
|
|
}, [focusRequested]);
|
|
React31.useEffect(() => {
|
|
focusIfRequested();
|
|
});
|
|
React31.useDebugValue({
|
|
id,
|
|
disabled
|
|
});
|
|
const itemState = menuContext.getItemState(id != null ? id : "");
|
|
const {
|
|
highlighted
|
|
} = itemState != null ? itemState : {
|
|
highlighted: false
|
|
};
|
|
React31.useEffect(() => {
|
|
requestFocus(highlighted && open);
|
|
}, [highlighted, open]);
|
|
if (id === void 0) {
|
|
return {
|
|
getRootProps: (other) => (0, _extends2.default)({}, other, getButtonProps(other), {
|
|
role: "menuitem"
|
|
}),
|
|
itemState: null,
|
|
focusVisible
|
|
};
|
|
}
|
|
return {
|
|
getRootProps: (other) => {
|
|
const optionProps = menuContext.getItemProps(id, other);
|
|
return (0, _extends2.default)({}, other, getButtonProps(other), {
|
|
tabIndex: optionProps.tabIndex,
|
|
id: optionProps.id,
|
|
role: "menuitem"
|
|
});
|
|
},
|
|
itemState,
|
|
focusVisible
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/MenuItemUnstyled.js
|
|
var require_MenuItemUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/MenuItemUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils2();
|
|
var _menuItemUnstyledClasses = require_menuItemUnstyledClasses();
|
|
var _useMenuItem = _interopRequireDefault(require_useMenuItem());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["children", "className", "disabled", "component", "components", "componentsProps"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function getUtilityClasses(ownerState) {
|
|
const {
|
|
disabled,
|
|
focusVisible
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", focusVisible && "focusVisible"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _menuItemUnstyledClasses.getMenuItemUnstyledUtilityClass, {});
|
|
}
|
|
var MenuItemUnstyled = /* @__PURE__ */ React31.forwardRef(function MenuItemUnstyled2(props, ref) {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
children,
|
|
className,
|
|
disabled = false,
|
|
component,
|
|
components = {},
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const Root = (_ref = component != null ? component : components.Root) != null ? _ref : "li";
|
|
const {
|
|
getRootProps,
|
|
itemState,
|
|
focusVisible
|
|
} = (0, _useMenuItem.default)({
|
|
component: Root,
|
|
disabled,
|
|
ref
|
|
});
|
|
if (itemState == null) {
|
|
return null;
|
|
}
|
|
const ownerState = (0, _extends2.default)({}, props, itemState, {
|
|
focusVisible
|
|
});
|
|
const classes = getUtilityClasses(ownerState);
|
|
const rootProps = (0, _utils.appendOwnerState)(Root, (0, _extends2.default)({}, other, componentsProps.root, getRootProps(other), {
|
|
className: (0, _clsx.default)(classes.root, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
}), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({}, rootProps, {
|
|
children
|
|
}));
|
|
});
|
|
true ? MenuItemUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
disabled: _propTypes.default.bool
|
|
} : void 0;
|
|
var _default = MenuItemUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/MenuItemUnstyled.types.js
|
|
var require_MenuItemUnstyled_types = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/MenuItemUnstyled.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/useMenuItem.types.js
|
|
var require_useMenuItem_types = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/useMenuItem.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MenuItemUnstyled/index.js
|
|
var require_MenuItemUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/MenuItemUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
menuItemUnstyledClasses: true,
|
|
useMenuItem: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuItemUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "menuItemUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _menuItemUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useMenuItem", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useMenuItem.default;
|
|
}
|
|
});
|
|
var _MenuItemUnstyled = _interopRequireDefault(require_MenuItemUnstyled());
|
|
var _MenuItemUnstyled2 = require_MenuItemUnstyled_types();
|
|
Object.keys(_MenuItemUnstyled2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MenuItemUnstyled2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuItemUnstyled2[key];
|
|
}
|
|
});
|
|
});
|
|
var _menuItemUnstyledClasses = _interopRequireWildcard(require_menuItemUnstyledClasses());
|
|
Object.keys(_menuItemUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _menuItemUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _menuItemUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useMenuItem = _interopRequireDefault(require_useMenuItem());
|
|
var _useMenuItem2 = require_useMenuItem_types();
|
|
Object.keys(_useMenuItem2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useMenuItem2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useMenuItem2[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ModalUnstyled/ModalManager.js
|
|
var require_ModalManager = __commonJS({
|
|
"node_modules/@mui/base/node/ModalUnstyled/ModalManager.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ariaHidden = ariaHidden;
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
function isOverflowing(container) {
|
|
const doc = (0, _utils.unstable_ownerDocument)(container);
|
|
if (doc.body === container) {
|
|
return (0, _utils.unstable_ownerWindow)(container).innerWidth > doc.documentElement.clientWidth;
|
|
}
|
|
return container.scrollHeight > container.clientHeight;
|
|
}
|
|
function ariaHidden(element, show) {
|
|
if (show) {
|
|
element.setAttribute("aria-hidden", "true");
|
|
} else {
|
|
element.removeAttribute("aria-hidden");
|
|
}
|
|
}
|
|
function getPaddingRight(element) {
|
|
return parseInt((0, _utils.unstable_ownerWindow)(element).getComputedStyle(element).paddingRight, 10) || 0;
|
|
}
|
|
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude = [], show) {
|
|
const blacklist = [mountElement, currentElement, ...elementsToExclude];
|
|
const blacklistTagNames = ["TEMPLATE", "SCRIPT", "STYLE"];
|
|
[].forEach.call(container.children, (element) => {
|
|
if (blacklist.indexOf(element) === -1 && blacklistTagNames.indexOf(element.tagName) === -1) {
|
|
ariaHidden(element, show);
|
|
}
|
|
});
|
|
}
|
|
function findIndexOf(items, callback) {
|
|
let idx = -1;
|
|
items.some((item, index) => {
|
|
if (callback(item)) {
|
|
idx = index;
|
|
return true;
|
|
}
|
|
return false;
|
|
});
|
|
return idx;
|
|
}
|
|
function handleContainer(containerInfo, props) {
|
|
const restoreStyle = [];
|
|
const container = containerInfo.container;
|
|
if (!props.disableScrollLock) {
|
|
if (isOverflowing(container)) {
|
|
const scrollbarSize = (0, _utils.unstable_getScrollbarSize)((0, _utils.unstable_ownerDocument)(container));
|
|
restoreStyle.push({
|
|
value: container.style.paddingRight,
|
|
property: "padding-right",
|
|
el: container
|
|
});
|
|
container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;
|
|
const fixedElements = (0, _utils.unstable_ownerDocument)(container).querySelectorAll(".mui-fixed");
|
|
[].forEach.call(fixedElements, (element) => {
|
|
restoreStyle.push({
|
|
value: element.style.paddingRight,
|
|
property: "padding-right",
|
|
el: element
|
|
});
|
|
element.style.paddingRight = `${getPaddingRight(element) + scrollbarSize}px`;
|
|
});
|
|
}
|
|
const parent = container.parentElement;
|
|
const containerWindow = (0, _utils.unstable_ownerWindow)(container);
|
|
const scrollContainer = (parent == null ? void 0 : parent.nodeName) === "HTML" && containerWindow.getComputedStyle(parent).overflowY === "scroll" ? parent : container;
|
|
restoreStyle.push({
|
|
value: scrollContainer.style.overflow,
|
|
property: "overflow",
|
|
el: scrollContainer
|
|
}, {
|
|
value: scrollContainer.style.overflowX,
|
|
property: "overflow-x",
|
|
el: scrollContainer
|
|
}, {
|
|
value: scrollContainer.style.overflowY,
|
|
property: "overflow-y",
|
|
el: scrollContainer
|
|
});
|
|
scrollContainer.style.overflow = "hidden";
|
|
}
|
|
const restore = () => {
|
|
restoreStyle.forEach(({
|
|
value,
|
|
el,
|
|
property
|
|
}) => {
|
|
if (value) {
|
|
el.style.setProperty(property, value);
|
|
} else {
|
|
el.style.removeProperty(property);
|
|
}
|
|
});
|
|
};
|
|
return restore;
|
|
}
|
|
function getHiddenSiblings(container) {
|
|
const hiddenSiblings = [];
|
|
[].forEach.call(container.children, (element) => {
|
|
if (element.getAttribute("aria-hidden") === "true") {
|
|
hiddenSiblings.push(element);
|
|
}
|
|
});
|
|
return hiddenSiblings;
|
|
}
|
|
var ModalManager = class {
|
|
constructor() {
|
|
this.containers = void 0;
|
|
this.modals = void 0;
|
|
this.modals = [];
|
|
this.containers = [];
|
|
}
|
|
add(modal, container) {
|
|
let modalIndex = this.modals.indexOf(modal);
|
|
if (modalIndex !== -1) {
|
|
return modalIndex;
|
|
}
|
|
modalIndex = this.modals.length;
|
|
this.modals.push(modal);
|
|
if (modal.modalRef) {
|
|
ariaHidden(modal.modalRef, false);
|
|
}
|
|
const hiddenSiblings = getHiddenSiblings(container);
|
|
ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);
|
|
const containerIndex = findIndexOf(this.containers, (item) => item.container === container);
|
|
if (containerIndex !== -1) {
|
|
this.containers[containerIndex].modals.push(modal);
|
|
return modalIndex;
|
|
}
|
|
this.containers.push({
|
|
modals: [modal],
|
|
container,
|
|
restore: null,
|
|
hiddenSiblings
|
|
});
|
|
return modalIndex;
|
|
}
|
|
mount(modal, props) {
|
|
const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
|
|
const containerInfo = this.containers[containerIndex];
|
|
if (!containerInfo.restore) {
|
|
containerInfo.restore = handleContainer(containerInfo, props);
|
|
}
|
|
}
|
|
remove(modal) {
|
|
const modalIndex = this.modals.indexOf(modal);
|
|
if (modalIndex === -1) {
|
|
return modalIndex;
|
|
}
|
|
const containerIndex = findIndexOf(this.containers, (item) => item.modals.indexOf(modal) !== -1);
|
|
const containerInfo = this.containers[containerIndex];
|
|
containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
|
|
this.modals.splice(modalIndex, 1);
|
|
if (containerInfo.modals.length === 0) {
|
|
if (containerInfo.restore) {
|
|
containerInfo.restore();
|
|
}
|
|
if (modal.modalRef) {
|
|
ariaHidden(modal.modalRef, true);
|
|
}
|
|
ariaHiddenSiblings(containerInfo.container, modal.mount, modal.modalRef, containerInfo.hiddenSiblings, false);
|
|
this.containers.splice(containerIndex, 1);
|
|
} else {
|
|
const nextTop = containerInfo.modals[containerInfo.modals.length - 1];
|
|
if (nextTop.modalRef) {
|
|
ariaHidden(nextTop.modalRef, false);
|
|
}
|
|
}
|
|
return modalIndex;
|
|
}
|
|
isTopModal(modal) {
|
|
return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;
|
|
}
|
|
};
|
|
exports.default = ModalManager;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/Unstable_TrapFocus/Unstable_TrapFocus.js
|
|
var require_Unstable_TrapFocus = __commonJS({
|
|
"node_modules/@mui/base/node/Unstable_TrapFocus/Unstable_TrapFocus.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var candidatesSelector = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
|
|
function getTabIndex(node) {
|
|
const tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
|
|
if (!Number.isNaN(tabindexAttr)) {
|
|
return tabindexAttr;
|
|
}
|
|
if (node.contentEditable === "true" || (node.nodeName === "AUDIO" || node.nodeName === "VIDEO" || node.nodeName === "DETAILS") && node.getAttribute("tabindex") === null) {
|
|
return 0;
|
|
}
|
|
return node.tabIndex;
|
|
}
|
|
function isNonTabbableRadio(node) {
|
|
if (node.tagName !== "INPUT" || node.type !== "radio") {
|
|
return false;
|
|
}
|
|
if (!node.name) {
|
|
return false;
|
|
}
|
|
const getRadio = (selector) => node.ownerDocument.querySelector(`input[type="radio"]${selector}`);
|
|
let roving = getRadio(`[name="${node.name}"]:checked`);
|
|
if (!roving) {
|
|
roving = getRadio(`[name="${node.name}"]`);
|
|
}
|
|
return roving !== node;
|
|
}
|
|
function isNodeMatchingSelectorFocusable(node) {
|
|
if (node.disabled || node.tagName === "INPUT" && node.type === "hidden" || isNonTabbableRadio(node)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function defaultGetTabbable(root) {
|
|
const regularTabNodes = [];
|
|
const orderedTabNodes = [];
|
|
Array.from(root.querySelectorAll(candidatesSelector)).forEach((node, i) => {
|
|
const nodeTabIndex = getTabIndex(node);
|
|
if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {
|
|
return;
|
|
}
|
|
if (nodeTabIndex === 0) {
|
|
regularTabNodes.push(node);
|
|
} else {
|
|
orderedTabNodes.push({
|
|
documentOrder: i,
|
|
tabIndex: nodeTabIndex,
|
|
node
|
|
});
|
|
}
|
|
});
|
|
return orderedTabNodes.sort((a, b) => a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex).map((a) => a.node).concat(regularTabNodes);
|
|
}
|
|
function defaultIsEnabled() {
|
|
return true;
|
|
}
|
|
function Unstable_TrapFocus(props) {
|
|
const {
|
|
children,
|
|
disableAutoFocus = false,
|
|
disableEnforceFocus = false,
|
|
disableRestoreFocus = false,
|
|
getTabbable = defaultGetTabbable,
|
|
isEnabled = defaultIsEnabled,
|
|
open
|
|
} = props;
|
|
const ignoreNextEnforceFocus = React31.useRef();
|
|
const sentinelStart = React31.useRef(null);
|
|
const sentinelEnd = React31.useRef(null);
|
|
const nodeToRestore = React31.useRef(null);
|
|
const reactFocusEventTarget = React31.useRef(null);
|
|
const activated = React31.useRef(false);
|
|
const rootRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(children.ref, rootRef);
|
|
const lastKeydown = React31.useRef(null);
|
|
React31.useEffect(() => {
|
|
if (!open || !rootRef.current) {
|
|
return;
|
|
}
|
|
activated.current = !disableAutoFocus;
|
|
}, [disableAutoFocus, open]);
|
|
React31.useEffect(() => {
|
|
if (!open || !rootRef.current) {
|
|
return;
|
|
}
|
|
const doc = (0, _utils.unstable_ownerDocument)(rootRef.current);
|
|
if (!rootRef.current.contains(doc.activeElement)) {
|
|
if (!rootRef.current.hasAttribute("tabIndex")) {
|
|
if (true) {
|
|
console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join("\n"));
|
|
}
|
|
rootRef.current.setAttribute("tabIndex", -1);
|
|
}
|
|
if (activated.current) {
|
|
rootRef.current.focus();
|
|
}
|
|
}
|
|
return () => {
|
|
if (!disableRestoreFocus) {
|
|
if (nodeToRestore.current && nodeToRestore.current.focus) {
|
|
ignoreNextEnforceFocus.current = true;
|
|
nodeToRestore.current.focus();
|
|
}
|
|
nodeToRestore.current = null;
|
|
}
|
|
};
|
|
}, [open]);
|
|
React31.useEffect(() => {
|
|
if (!open || !rootRef.current) {
|
|
return;
|
|
}
|
|
const doc = (0, _utils.unstable_ownerDocument)(rootRef.current);
|
|
const contain = (nativeEvent) => {
|
|
const {
|
|
current: rootElement
|
|
} = rootRef;
|
|
if (rootElement === null) {
|
|
return;
|
|
}
|
|
if (!doc.hasFocus() || disableEnforceFocus || !isEnabled() || ignoreNextEnforceFocus.current) {
|
|
ignoreNextEnforceFocus.current = false;
|
|
return;
|
|
}
|
|
if (!rootElement.contains(doc.activeElement)) {
|
|
if (nativeEvent && reactFocusEventTarget.current !== nativeEvent.target || doc.activeElement !== reactFocusEventTarget.current) {
|
|
reactFocusEventTarget.current = null;
|
|
} else if (reactFocusEventTarget.current !== null) {
|
|
return;
|
|
}
|
|
if (!activated.current) {
|
|
return;
|
|
}
|
|
let tabbable = [];
|
|
if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
|
|
tabbable = getTabbable(rootRef.current);
|
|
}
|
|
if (tabbable.length > 0) {
|
|
var _lastKeydown$current, _lastKeydown$current2;
|
|
const isShiftTab = Boolean(((_lastKeydown$current = lastKeydown.current) == null ? void 0 : _lastKeydown$current.shiftKey) && ((_lastKeydown$current2 = lastKeydown.current) == null ? void 0 : _lastKeydown$current2.key) === "Tab");
|
|
const focusNext = tabbable[0];
|
|
const focusPrevious = tabbable[tabbable.length - 1];
|
|
if (isShiftTab) {
|
|
focusPrevious.focus();
|
|
} else {
|
|
focusNext.focus();
|
|
}
|
|
} else {
|
|
rootElement.focus();
|
|
}
|
|
}
|
|
};
|
|
const loopFocus = (nativeEvent) => {
|
|
lastKeydown.current = nativeEvent;
|
|
if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== "Tab") {
|
|
return;
|
|
}
|
|
if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
|
|
ignoreNextEnforceFocus.current = true;
|
|
sentinelEnd.current.focus();
|
|
}
|
|
};
|
|
doc.addEventListener("focusin", contain);
|
|
doc.addEventListener("keydown", loopFocus, true);
|
|
const interval = setInterval(() => {
|
|
if (doc.activeElement.tagName === "BODY") {
|
|
contain();
|
|
}
|
|
}, 50);
|
|
return () => {
|
|
clearInterval(interval);
|
|
doc.removeEventListener("focusin", contain);
|
|
doc.removeEventListener("keydown", loopFocus, true);
|
|
};
|
|
}, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);
|
|
const onFocus = (event) => {
|
|
if (nodeToRestore.current === null) {
|
|
nodeToRestore.current = event.relatedTarget;
|
|
}
|
|
activated.current = true;
|
|
reactFocusEventTarget.current = event.target;
|
|
const childrenPropsHandler = children.props.onFocus;
|
|
if (childrenPropsHandler) {
|
|
childrenPropsHandler(event);
|
|
}
|
|
};
|
|
const handleFocusSentinel = (event) => {
|
|
if (nodeToRestore.current === null) {
|
|
nodeToRestore.current = event.relatedTarget;
|
|
}
|
|
activated.current = true;
|
|
};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)("div", {
|
|
tabIndex: 0,
|
|
onFocus: handleFocusSentinel,
|
|
ref: sentinelStart,
|
|
"data-test": "sentinelStart"
|
|
}), /* @__PURE__ */ React31.cloneElement(children, {
|
|
ref: handleRef,
|
|
onFocus
|
|
}), /* @__PURE__ */ (0, _jsxRuntime.jsx)("div", {
|
|
tabIndex: 0,
|
|
onFocus: handleFocusSentinel,
|
|
ref: sentinelEnd,
|
|
"data-test": "sentinelEnd"
|
|
})]
|
|
});
|
|
}
|
|
true ? Unstable_TrapFocus.propTypes = {
|
|
children: _utils.elementAcceptingRef,
|
|
disableAutoFocus: _propTypes.default.bool,
|
|
disableEnforceFocus: _propTypes.default.bool,
|
|
disableRestoreFocus: _propTypes.default.bool,
|
|
getTabbable: _propTypes.default.func,
|
|
isEnabled: _propTypes.default.func,
|
|
open: _propTypes.default.bool.isRequired
|
|
} : void 0;
|
|
if (true) {
|
|
Unstable_TrapFocus["propTypes"] = (0, _utils.exactProp)(Unstable_TrapFocus.propTypes);
|
|
}
|
|
var _default = Unstable_TrapFocus;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/Unstable_TrapFocus/index.js
|
|
var require_Unstable_TrapFocus2 = __commonJS({
|
|
"node_modules/@mui/base/node/Unstable_TrapFocus/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Unstable_TrapFocus.default;
|
|
}
|
|
});
|
|
var _Unstable_TrapFocus = _interopRequireDefault(require_Unstable_TrapFocus());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ModalUnstyled/modalUnstyledClasses.js
|
|
var require_modalUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/ModalUnstyled/modalUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getModalUtilityClass = getModalUtilityClass;
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
function getModalUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiModal", slot);
|
|
}
|
|
var modalUnstyledClasses = (0, _generateUtilityClasses.default)("MuiModal", ["root", "hidden"]);
|
|
var _default = modalUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ModalUnstyled/ModalUnstyled.js
|
|
var require_ModalUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/ModalUnstyled/ModalUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
var _Portal = _interopRequireDefault(require_Portal2());
|
|
var _ModalManager = _interopRequireWildcard(require_ModalManager());
|
|
var _Unstable_TrapFocus = _interopRequireDefault(require_Unstable_TrapFocus2());
|
|
var _modalUnstyledClasses = require_modalUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
open,
|
|
exited,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", !open && exited && "hidden"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _modalUnstyledClasses.getModalUtilityClass, classes);
|
|
};
|
|
function getContainer(container) {
|
|
return typeof container === "function" ? container() : container;
|
|
}
|
|
function getHasTransition(props) {
|
|
return props.children ? props.children.props.hasOwnProperty("in") : false;
|
|
}
|
|
var defaultManager = new _ModalManager.default();
|
|
var ModalUnstyled = /* @__PURE__ */ React31.forwardRef(function ModalUnstyled2(props, ref) {
|
|
const {
|
|
BackdropComponent,
|
|
BackdropProps,
|
|
children,
|
|
classes: classesProp,
|
|
className,
|
|
closeAfterTransition = false,
|
|
component = "div",
|
|
components = {},
|
|
componentsProps = {},
|
|
container,
|
|
disableAutoFocus = false,
|
|
disableEnforceFocus = false,
|
|
disableEscapeKeyDown = false,
|
|
disablePortal = false,
|
|
disableRestoreFocus = false,
|
|
disableScrollLock = false,
|
|
hideBackdrop = false,
|
|
keepMounted = false,
|
|
manager = defaultManager,
|
|
onBackdropClick,
|
|
onClose,
|
|
onKeyDown,
|
|
open,
|
|
theme,
|
|
onTransitionEnter,
|
|
onTransitionExited
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const [exited, setExited] = React31.useState(true);
|
|
const modal = React31.useRef({});
|
|
const mountNodeRef = React31.useRef(null);
|
|
const modalRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(modalRef, ref);
|
|
const hasTransition = getHasTransition(props);
|
|
const getDoc = () => (0, _utils.unstable_ownerDocument)(mountNodeRef.current);
|
|
const getModal = () => {
|
|
modal.current.modalRef = modalRef.current;
|
|
modal.current.mountNode = mountNodeRef.current;
|
|
return modal.current;
|
|
};
|
|
const handleMounted = () => {
|
|
manager.mount(getModal(), {
|
|
disableScrollLock
|
|
});
|
|
modalRef.current.scrollTop = 0;
|
|
};
|
|
const handleOpen = (0, _utils.unstable_useEventCallback)(() => {
|
|
const resolvedContainer = getContainer(container) || getDoc().body;
|
|
manager.add(getModal(), resolvedContainer);
|
|
if (modalRef.current) {
|
|
handleMounted();
|
|
}
|
|
});
|
|
const isTopModal = React31.useCallback(() => manager.isTopModal(getModal()), [manager]);
|
|
const handlePortalRef = (0, _utils.unstable_useEventCallback)((node) => {
|
|
mountNodeRef.current = node;
|
|
if (!node) {
|
|
return;
|
|
}
|
|
if (open && isTopModal()) {
|
|
handleMounted();
|
|
} else {
|
|
(0, _ModalManager.ariaHidden)(modalRef.current, true);
|
|
}
|
|
});
|
|
const handleClose = React31.useCallback(() => {
|
|
manager.remove(getModal());
|
|
}, [manager]);
|
|
React31.useEffect(() => {
|
|
return () => {
|
|
handleClose();
|
|
};
|
|
}, [handleClose]);
|
|
React31.useEffect(() => {
|
|
if (open) {
|
|
handleOpen();
|
|
} else if (!hasTransition || !closeAfterTransition) {
|
|
handleClose();
|
|
}
|
|
}, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
classes: classesProp,
|
|
closeAfterTransition,
|
|
disableAutoFocus,
|
|
disableEnforceFocus,
|
|
disableEscapeKeyDown,
|
|
disablePortal,
|
|
disableRestoreFocus,
|
|
disableScrollLock,
|
|
exited,
|
|
hideBackdrop,
|
|
keepMounted
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
if (!keepMounted && !open && (!hasTransition || exited)) {
|
|
return null;
|
|
}
|
|
const handleEnter = () => {
|
|
setExited(false);
|
|
if (onTransitionEnter) {
|
|
onTransitionEnter();
|
|
}
|
|
};
|
|
const handleExited = () => {
|
|
setExited(true);
|
|
if (onTransitionExited) {
|
|
onTransitionExited();
|
|
}
|
|
if (closeAfterTransition) {
|
|
handleClose();
|
|
}
|
|
};
|
|
const handleBackdropClick = (event) => {
|
|
if (event.target !== event.currentTarget) {
|
|
return;
|
|
}
|
|
if (onBackdropClick) {
|
|
onBackdropClick(event);
|
|
}
|
|
if (onClose) {
|
|
onClose(event, "backdropClick");
|
|
}
|
|
};
|
|
const handleKeyDown = (event) => {
|
|
if (onKeyDown) {
|
|
onKeyDown(event);
|
|
}
|
|
if (event.key !== "Escape" || !isTopModal()) {
|
|
return;
|
|
}
|
|
if (!disableEscapeKeyDown) {
|
|
event.stopPropagation();
|
|
if (onClose) {
|
|
onClose(event, "escapeKeyDown");
|
|
}
|
|
}
|
|
};
|
|
const childProps = {};
|
|
if (children.props.tabIndex === void 0) {
|
|
childProps.tabIndex = "-1";
|
|
}
|
|
if (hasTransition) {
|
|
childProps.onEnter = (0, _utils.unstable_createChainedFunction)(handleEnter, children.props.onEnter);
|
|
childProps.onExited = (0, _utils.unstable_createChainedFunction)(handleExited, children.props.onExited);
|
|
}
|
|
const Root = components.Root || component;
|
|
const rootProps = componentsProps.root || {};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_Portal.default, {
|
|
ref: handlePortalRef,
|
|
container,
|
|
disablePortal,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({
|
|
role: "presentation"
|
|
}, rootProps, !(0, _isHostComponent.default)(Root) && {
|
|
as: component,
|
|
ownerState: (0, _extends2.default)({}, ownerState, rootProps.ownerState),
|
|
theme
|
|
}, other, {
|
|
ref: handleRef,
|
|
onKeyDown: handleKeyDown,
|
|
className: (0, _clsx.default)(classes.root, rootProps.className, className),
|
|
children: [!hideBackdrop && BackdropComponent ? /* @__PURE__ */ (0, _jsxRuntime.jsx)(BackdropComponent, (0, _extends2.default)({
|
|
open,
|
|
onClick: handleBackdropClick
|
|
}, BackdropProps)) : null, /* @__PURE__ */ (0, _jsxRuntime.jsx)(_Unstable_TrapFocus.default, {
|
|
disableEnforceFocus,
|
|
disableAutoFocus,
|
|
disableRestoreFocus,
|
|
isEnabled: isTopModal,
|
|
open,
|
|
children: /* @__PURE__ */ React31.cloneElement(children, childProps)
|
|
})]
|
|
}))
|
|
});
|
|
});
|
|
true ? ModalUnstyled.propTypes = {
|
|
BackdropComponent: _propTypes.default.elementType,
|
|
BackdropProps: _propTypes.default.object,
|
|
children: _utils.elementAcceptingRef.isRequired,
|
|
classes: _propTypes.default.object,
|
|
className: _propTypes.default.string,
|
|
closeAfterTransition: _propTypes.default.bool,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
container: _propTypes.default.oneOfType([_utils.HTMLElementType, _propTypes.default.func]),
|
|
disableAutoFocus: _propTypes.default.bool,
|
|
disableEnforceFocus: _propTypes.default.bool,
|
|
disableEscapeKeyDown: _propTypes.default.bool,
|
|
disablePortal: _propTypes.default.bool,
|
|
disableRestoreFocus: _propTypes.default.bool,
|
|
disableScrollLock: _propTypes.default.bool,
|
|
hideBackdrop: _propTypes.default.bool,
|
|
keepMounted: _propTypes.default.bool,
|
|
onBackdropClick: _propTypes.default.func,
|
|
onClose: _propTypes.default.func,
|
|
onKeyDown: _propTypes.default.func,
|
|
open: _propTypes.default.bool.isRequired
|
|
} : void 0;
|
|
var _default = ModalUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/ModalUnstyled/index.js
|
|
var require_ModalUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/ModalUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "ModalManager", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ModalManager.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ModalUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getModalUtilityClass", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _modalUnstyledClasses.getModalUtilityClass;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "modalUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _modalUnstyledClasses.default;
|
|
}
|
|
});
|
|
var _ModalUnstyled = _interopRequireDefault(require_ModalUnstyled());
|
|
var _ModalManager = _interopRequireDefault(require_ModalManager());
|
|
var _modalUnstyledClasses = _interopRequireWildcard(require_modalUnstyledClasses());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/useSelect.types.js
|
|
var require_useSelect_types = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/useSelect.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isOptionGroup = isOptionGroup;
|
|
function isOptionGroup(child) {
|
|
return !!child.options;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/utils.js
|
|
var require_utils3 = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/utils.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.areOptionsEqual = areOptionsEqual;
|
|
exports.flattenOptionGroups = flattenOptionGroups;
|
|
exports.getOptionsFromChildren = getOptionsFromChildren;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _react = _interopRequireDefault(require_react());
|
|
var _useSelect = require_useSelect_types();
|
|
function areOptionsEqual(option1, option2) {
|
|
return option1.label === option2.label && option1.value === option2.value && option1.disabled === option2.disabled;
|
|
}
|
|
function getOptionsFromChildren(children) {
|
|
if (children == null) {
|
|
return [];
|
|
}
|
|
const selectChildren = [];
|
|
_react.default.Children.forEach(children, (node) => {
|
|
var _props, _props2, _element$props$disabl2;
|
|
const nodeChildren = node == null ? void 0 : (_props = node.props) == null ? void 0 : _props.children;
|
|
if ((node == null ? void 0 : (_props2 = node.props) == null ? void 0 : _props2.value) === void 0) {
|
|
if (nodeChildren != null) {
|
|
var _element$props$disabl;
|
|
const element2 = node;
|
|
const group = {
|
|
options: getOptionsFromChildren(nodeChildren),
|
|
label: element2.props.label,
|
|
disabled: (_element$props$disabl = element2.props.disabled) != null ? _element$props$disabl : false
|
|
};
|
|
selectChildren.push(group);
|
|
}
|
|
return;
|
|
}
|
|
const element = node;
|
|
const option = {
|
|
value: element.props.value,
|
|
label: element.props.children,
|
|
disabled: (_element$props$disabl2 = element.props.disabled) != null ? _element$props$disabl2 : false
|
|
};
|
|
selectChildren.push(option);
|
|
});
|
|
return selectChildren != null ? selectChildren : [];
|
|
}
|
|
function flattenOptionGroups(groupedOptions, isGroupDisabled = false) {
|
|
let flatOptions = [];
|
|
groupedOptions.forEach((optionOrGroup) => {
|
|
if ((0, _useSelect.isOptionGroup)(optionOrGroup)) {
|
|
flatOptions = flatOptions.concat(flattenOptionGroups(optionOrGroup.options, optionOrGroup.disabled));
|
|
} else {
|
|
flatOptions.push((0, _extends2.default)({}, optionOrGroup, {
|
|
disabled: isGroupDisabled || optionOrGroup.disabled
|
|
}));
|
|
}
|
|
});
|
|
return flatOptions;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/useSelect.js
|
|
var require_useSelect = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/useSelect.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _ButtonUnstyled = require_ButtonUnstyled2();
|
|
var _ListboxUnstyled = require_ListboxUnstyled();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useSelect(props) {
|
|
const {
|
|
buttonComponent,
|
|
buttonRef: buttonRefProp,
|
|
defaultValue,
|
|
disabled = false,
|
|
listboxId,
|
|
listboxRef: listboxRefProp,
|
|
multiple = false,
|
|
onChange,
|
|
onOpenChange,
|
|
open = false,
|
|
options,
|
|
value: valueProp
|
|
} = props;
|
|
const buttonRef = React31.useRef(null);
|
|
const handleButtonRef = (0, _utils.unstable_useForkRef)(buttonRefProp, buttonRef);
|
|
const listboxRef = React31.useRef(null);
|
|
const intermediaryListboxRef = (0, _utils.unstable_useForkRef)(listboxRefProp, listboxRef);
|
|
const [value, setValue] = (0, _utils.unstable_useControlled)({
|
|
controlled: valueProp,
|
|
default: defaultValue,
|
|
name: "SelectUnstyled",
|
|
state: "value"
|
|
});
|
|
const ignoreEnterKeyUp = React31.useRef(false);
|
|
const ignoreClick = React31.useRef(false);
|
|
const [listboxFocusRequested, requestListboxFocus] = React31.useState(false);
|
|
const focusListboxIfRequested = React31.useCallback(() => {
|
|
if (listboxFocusRequested && listboxRef.current != null) {
|
|
listboxRef.current.focus();
|
|
requestListboxFocus(false);
|
|
}
|
|
}, [listboxFocusRequested]);
|
|
const updateListboxRef = (listboxElement) => {
|
|
listboxRef.current = listboxElement;
|
|
focusListboxIfRequested();
|
|
};
|
|
const handleListboxRef = (0, _utils.unstable_useForkRef)(intermediaryListboxRef, updateListboxRef);
|
|
React31.useEffect(() => {
|
|
focusListboxIfRequested();
|
|
}, [focusListboxIfRequested]);
|
|
React31.useEffect(() => {
|
|
requestListboxFocus(open);
|
|
}, [open]);
|
|
const createHandleMouseDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onMous = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);
|
|
if (!event.defaultPrevented && open) {
|
|
ignoreClick.current = true;
|
|
}
|
|
};
|
|
const createHandleButtonClick = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onClic;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);
|
|
if (!event.defaultPrevented && !ignoreClick.current) {
|
|
onOpenChange == null ? void 0 : onOpenChange(!open);
|
|
}
|
|
ignoreClick.current = false;
|
|
};
|
|
const createHandleButtonKeyDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onKeyD;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
if (event.key === "Enter") {
|
|
ignoreEnterKeyUp.current = true;
|
|
}
|
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
event.preventDefault();
|
|
onOpenChange == null ? void 0 : onOpenChange(true);
|
|
}
|
|
};
|
|
const createHandleListboxKeyUp = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onKeyU;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onKeyU = otherHandlers.onKeyUp) == null ? void 0 : _otherHandlers$onKeyU.call(otherHandlers, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
const closingKeys = multiple ? ["Escape"] : ["Escape", "Enter", " "];
|
|
if (open && !ignoreEnterKeyUp.current && closingKeys.includes(event.key)) {
|
|
var _buttonRef$current;
|
|
buttonRef == null ? void 0 : (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();
|
|
}
|
|
ignoreEnterKeyUp.current = false;
|
|
};
|
|
const createHandleListboxItemClick = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onClic2;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onClic2 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic2.call(otherHandlers, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
if (!multiple) {
|
|
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
}
|
|
};
|
|
const createHandleListboxBlur = (otherHandlers) => (event) => {
|
|
var _otherHandlers$blur;
|
|
otherHandlers == null ? void 0 : (_otherHandlers$blur = otherHandlers.blur) == null ? void 0 : _otherHandlers$blur.call(otherHandlers, event);
|
|
if (!event.defaultPrevented) {
|
|
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
}
|
|
};
|
|
const listboxReducer = (state, action) => {
|
|
const newState = (0, _ListboxUnstyled.defaultListboxReducer)(state, action);
|
|
if (action.type === _ListboxUnstyled.ActionTypes.keyDown && !open && (action.event.key === "ArrowUp" || action.event.key === "ArrowDown")) {
|
|
return (0, _extends2.default)({}, newState, {
|
|
selectedValue: newState.highlightedValue
|
|
});
|
|
}
|
|
if (action.type === _ListboxUnstyled.ActionTypes.blur || action.type === _ListboxUnstyled.ActionTypes.setValue || action.type === _ListboxUnstyled.ActionTypes.optionsChange) {
|
|
return (0, _extends2.default)({}, newState, {
|
|
highlightedValue: newState.selectedValue
|
|
});
|
|
}
|
|
return newState;
|
|
};
|
|
const {
|
|
getRootProps: getButtonRootProps,
|
|
active: buttonActive,
|
|
focusVisible: buttonFocusVisible
|
|
} = (0, _ButtonUnstyled.useButton)({
|
|
component: buttonComponent,
|
|
disabled,
|
|
ref: handleButtonRef
|
|
});
|
|
const selectedOption = React31.useMemo(() => {
|
|
var _props$options$find;
|
|
return props.multiple ? props.options.filter((o) => value.includes(o.value)) : (_props$options$find = props.options.find((o) => o.value === value)) != null ? _props$options$find : null;
|
|
}, [props.multiple, props.options, value]);
|
|
let useListboxParameters;
|
|
if (props.multiple) {
|
|
useListboxParameters = {
|
|
id: listboxId,
|
|
isOptionDisabled: (o) => {
|
|
var _o$disabled;
|
|
return (_o$disabled = o == null ? void 0 : o.disabled) != null ? _o$disabled : false;
|
|
},
|
|
optionComparer: (o, v) => (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value),
|
|
listboxRef: handleListboxRef,
|
|
multiple: true,
|
|
onChange: (newOptions) => {
|
|
setValue(newOptions.map((o) => o.value));
|
|
onChange == null ? void 0 : onChange(newOptions.map((o) => o.value));
|
|
},
|
|
options,
|
|
value: selectedOption
|
|
};
|
|
} else {
|
|
useListboxParameters = {
|
|
id: listboxId,
|
|
isOptionDisabled: (o) => {
|
|
var _o$disabled2;
|
|
return (_o$disabled2 = o == null ? void 0 : o.disabled) != null ? _o$disabled2 : false;
|
|
},
|
|
optionComparer: (o, v) => (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value),
|
|
listboxRef: handleListboxRef,
|
|
multiple: false,
|
|
onChange: (option) => {
|
|
var _option$value, _option$value2;
|
|
setValue((_option$value = option == null ? void 0 : option.value) != null ? _option$value : null);
|
|
onChange == null ? void 0 : onChange((_option$value2 = option == null ? void 0 : option.value) != null ? _option$value2 : null);
|
|
},
|
|
options,
|
|
stateReducer: listboxReducer,
|
|
value: selectedOption
|
|
};
|
|
}
|
|
const {
|
|
getRootProps: getListboxRootProps,
|
|
getOptionProps: getListboxOptionProps,
|
|
getOptionState,
|
|
highlightedOption,
|
|
selectedOption: listboxSelectedOption
|
|
} = (0, _ListboxUnstyled.useListbox)(useListboxParameters);
|
|
const getButtonProps = (otherHandlers = {}) => {
|
|
return (0, _extends2.default)({}, getButtonRootProps((0, _extends2.default)({}, otherHandlers, {
|
|
onClick: createHandleButtonClick(otherHandlers),
|
|
onMouseDown: createHandleMouseDown(otherHandlers),
|
|
onKeyDown: createHandleButtonKeyDown(otherHandlers)
|
|
})), {
|
|
"aria-expanded": open,
|
|
"aria-haspopup": "listbox"
|
|
});
|
|
};
|
|
const getListboxProps = (otherHandlers = {}) => getListboxRootProps((0, _extends2.default)({}, otherHandlers, {
|
|
onBlur: createHandleListboxBlur(otherHandlers),
|
|
onKeyUp: createHandleListboxKeyUp(otherHandlers)
|
|
}));
|
|
const getOptionProps = (option, otherHandlers = {}) => {
|
|
return getListboxOptionProps(option, (0, _extends2.default)({}, otherHandlers, {
|
|
onClick: createHandleListboxItemClick(otherHandlers)
|
|
}));
|
|
};
|
|
React31.useDebugValue({
|
|
selectedOption: listboxSelectedOption,
|
|
open,
|
|
highlightedOption
|
|
});
|
|
return {
|
|
buttonActive,
|
|
buttonFocusVisible,
|
|
disabled,
|
|
getButtonProps,
|
|
getListboxProps,
|
|
getOptionProps,
|
|
getOptionState,
|
|
open,
|
|
value
|
|
};
|
|
}
|
|
var _default = useSelect;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/SelectUnstyledContext.js
|
|
var require_SelectUnstyledContext = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/SelectUnstyledContext.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.SelectUnstyledContext = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var SelectUnstyledContext = /* @__PURE__ */ React31.createContext(void 0);
|
|
exports.SelectUnstyledContext = SelectUnstyledContext;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/selectUnstyledClasses.js
|
|
var require_selectUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/selectUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getSelectUnstyledUtilityClass = getSelectUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getSelectUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiSelectUnstyled", slot);
|
|
}
|
|
var selectUnstyledClasses = (0, _generateUtilityClasses.default)("MuiSelectUnstyled", ["root", "button", "listbox", "popper", "active", "expanded", "disabled", "focusVisible"]);
|
|
var _default = selectUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MultiSelectUnstyled/MultiSelectUnstyled.js
|
|
var require_MultiSelectUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/MultiSelectUnstyled/MultiSelectUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _utils2 = require_utils3();
|
|
var _useSelect = _interopRequireDefault(require_useSelect());
|
|
var _utils3 = require_utils2();
|
|
var _PopperUnstyled = _interopRequireDefault(require_PopperUnstyled2());
|
|
var _SelectUnstyledContext = require_SelectUnstyledContext();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _selectUnstyledClasses = require_selectUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["autoFocus", "children", "className", "component", "components", "componentsProps", "defaultListboxOpen", "defaultValue", "disabled", "listboxOpen", "onChange", "onListboxOpenChange", "value"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function defaultRenderMultipleValues(selectedOptions) {
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(React31.Fragment, {
|
|
children: selectedOptions.map((o) => o.label).join(", ")
|
|
});
|
|
}
|
|
function useUtilityClasses(ownerState) {
|
|
const {
|
|
active,
|
|
disabled,
|
|
open,
|
|
focusVisible
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", focusVisible && "focusVisible", active && "active", open && "expanded"],
|
|
listbox: ["listbox", disabled && "disabled"],
|
|
popper: ["popper"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _selectUnstyledClasses.getSelectUnstyledUtilityClass, {});
|
|
}
|
|
var MultiSelectUnstyled = /* @__PURE__ */ React31.forwardRef(function MultiSelectUnstyled2(props, ref) {
|
|
var _props$renderValue, _ref, _components$Listbox, _components$Popper, _componentsProps$list, _componentsProps$list2, _componentsProps$root, _componentsProps$list3, _componentsProps$popp;
|
|
const {
|
|
autoFocus,
|
|
children,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
defaultListboxOpen = false,
|
|
defaultValue = [],
|
|
disabled: disabledProp,
|
|
listboxOpen: listboxOpenProp,
|
|
onChange,
|
|
onListboxOpenChange,
|
|
value: valueProp
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const renderValue = (_props$renderValue = props.renderValue) != null ? _props$renderValue : defaultRenderMultipleValues;
|
|
const [groupedOptions, setGroupedOptions] = React31.useState([]);
|
|
const options = React31.useMemo(() => (0, _utils2.flattenOptionGroups)(groupedOptions), [groupedOptions]);
|
|
const [listboxOpen, setListboxOpen] = (0, _utils.unstable_useControlled)({
|
|
controlled: listboxOpenProp,
|
|
default: defaultListboxOpen,
|
|
name: "MultiSelectUnstyled",
|
|
state: "listboxOpen"
|
|
});
|
|
React31.useEffect(() => {
|
|
setGroupedOptions((0, _utils2.getOptionsFromChildren)(children));
|
|
}, [children]);
|
|
const [buttonDefined, setButtonDefined] = React31.useState(false);
|
|
const buttonRef = React31.useRef(null);
|
|
const listboxRef = React31.useRef(null);
|
|
const Button2 = (_ref = component != null ? component : components.Root) != null ? _ref : "button";
|
|
const ListboxRoot = (_components$Listbox = components.Listbox) != null ? _components$Listbox : "ul";
|
|
const Popper = (_components$Popper = components.Popper) != null ? _components$Popper : _PopperUnstyled.default;
|
|
const handleButtonRefChange = (element) => {
|
|
buttonRef.current = element;
|
|
if (element != null) {
|
|
setButtonDefined(true);
|
|
}
|
|
};
|
|
const handleButtonRef = (0, _utils.unstable_useForkRef)(ref, handleButtonRefChange);
|
|
const handleListboxRef = (0, _utils.unstable_useForkRef)(listboxRef, (_componentsProps$list = componentsProps.listbox) == null ? void 0 : _componentsProps$list.ref);
|
|
React31.useEffect(() => {
|
|
if (autoFocus) {
|
|
buttonRef.current.focus();
|
|
}
|
|
}, [autoFocus]);
|
|
const handleOpenChange = (isOpen) => {
|
|
setListboxOpen(isOpen);
|
|
onListboxOpenChange == null ? void 0 : onListboxOpenChange(isOpen);
|
|
};
|
|
const {
|
|
buttonActive,
|
|
buttonFocusVisible,
|
|
disabled,
|
|
getButtonProps,
|
|
getListboxProps,
|
|
getOptionProps,
|
|
getOptionState,
|
|
value
|
|
} = (0, _useSelect.default)({
|
|
buttonComponent: Button2,
|
|
buttonRef: handleButtonRef,
|
|
defaultValue,
|
|
disabled: disabledProp,
|
|
listboxId: (_componentsProps$list2 = componentsProps.listbox) == null ? void 0 : _componentsProps$list2.id,
|
|
listboxRef: handleListboxRef,
|
|
multiple: true,
|
|
onChange,
|
|
onOpenChange: handleOpenChange,
|
|
open: listboxOpen,
|
|
options,
|
|
value: valueProp
|
|
});
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
active: buttonActive,
|
|
defaultListboxOpen,
|
|
disabled,
|
|
focusVisible: buttonFocusVisible,
|
|
open: listboxOpen,
|
|
renderValue,
|
|
value
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const selectedOptions = React31.useMemo(() => {
|
|
if (value == null) {
|
|
return [];
|
|
}
|
|
return options.filter((o) => value.includes(o.value));
|
|
}, [options, value]);
|
|
const buttonProps = (0, _utils3.appendOwnerState)(Button2, (0, _extends2.default)({}, getButtonProps(), other, componentsProps.root, {
|
|
className: (0, _clsx.default)(className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, classes.root)
|
|
}), ownerState);
|
|
const listboxProps = (0, _utils3.appendOwnerState)(ListboxRoot, (0, _extends2.default)({}, getListboxProps(), componentsProps.listbox, {
|
|
className: (0, _clsx.default)((_componentsProps$list3 = componentsProps.listbox) == null ? void 0 : _componentsProps$list3.className, classes.listbox)
|
|
}), ownerState);
|
|
const popperProps = (0, _utils3.appendOwnerState)(Popper, (0, _extends2.default)({
|
|
open: listboxOpen,
|
|
anchorEl: buttonRef.current,
|
|
placement: "bottom-start",
|
|
disablePortal: true,
|
|
role: void 0
|
|
}, componentsProps.popper, {
|
|
className: (0, _clsx.default)((_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className, classes.popper)
|
|
}), ownerState);
|
|
const context = {
|
|
getOptionProps,
|
|
getOptionState,
|
|
listboxRef
|
|
};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Button2, (0, _extends2.default)({}, buttonProps, {
|
|
children: renderValue(selectedOptions)
|
|
})), buttonDefined && /* @__PURE__ */ (0, _jsxRuntime.jsx)(Popper, (0, _extends2.default)({}, popperProps, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(ListboxRoot, (0, _extends2.default)({}, listboxProps, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(_SelectUnstyledContext.SelectUnstyledContext.Provider, {
|
|
value: context,
|
|
children
|
|
})
|
|
}))
|
|
}))]
|
|
});
|
|
});
|
|
true ? MultiSelectUnstyled.propTypes = {
|
|
autoFocus: _propTypes.default.bool,
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Listbox: _propTypes.default.elementType,
|
|
Popper: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
listbox: _propTypes.default.object,
|
|
popper: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
defaultListboxOpen: _propTypes.default.bool,
|
|
defaultValue: _propTypes.default.array,
|
|
disabled: _propTypes.default.bool,
|
|
listboxOpen: _propTypes.default.bool,
|
|
onChange: _propTypes.default.func,
|
|
onListboxOpenChange: _propTypes.default.func,
|
|
renderValue: _propTypes.default.func,
|
|
value: _propTypes.default.array
|
|
} : void 0;
|
|
var _default = MultiSelectUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MultiSelectUnstyled/MultiSelectUnstyled.types.js
|
|
var require_MultiSelectUnstyled_types = __commonJS({
|
|
"node_modules/@mui/base/node/MultiSelectUnstyled/MultiSelectUnstyled.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/MultiSelectUnstyled/index.js
|
|
var require_MultiSelectUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/MultiSelectUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MultiSelectUnstyled.default;
|
|
}
|
|
});
|
|
var _MultiSelectUnstyled = _interopRequireDefault(require_MultiSelectUnstyled());
|
|
var _MultiSelectUnstyled2 = require_MultiSelectUnstyled_types();
|
|
Object.keys(_MultiSelectUnstyled2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MultiSelectUnstyled2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MultiSelectUnstyled2[key];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/NoSsr/NoSsr.js
|
|
var require_NoSsr = __commonJS({
|
|
"node_modules/@mui/base/node/NoSsr/NoSsr.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function NoSsr(props) {
|
|
const {
|
|
children,
|
|
defer = false,
|
|
fallback = null
|
|
} = props;
|
|
const [mountedState, setMountedState] = React31.useState(false);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (!defer) {
|
|
setMountedState(true);
|
|
}
|
|
}, [defer]);
|
|
React31.useEffect(() => {
|
|
if (defer) {
|
|
setMountedState(true);
|
|
}
|
|
}, [defer]);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(React31.Fragment, {
|
|
children: mountedState ? children : fallback
|
|
});
|
|
}
|
|
true ? NoSsr.propTypes = {
|
|
children: _propTypes.default.node,
|
|
defer: _propTypes.default.bool,
|
|
fallback: _propTypes.default.node
|
|
} : void 0;
|
|
if (true) {
|
|
NoSsr["propTypes"] = (0, _utils.exactProp)(NoSsr.propTypes);
|
|
}
|
|
var _default = NoSsr;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/NoSsr/index.js
|
|
var require_NoSsr2 = __commonJS({
|
|
"node_modules/@mui/base/node/NoSsr/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _NoSsr.default;
|
|
}
|
|
});
|
|
var _NoSsr = _interopRequireDefault(require_NoSsr());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionGroupUnstyled/optionGroupUnstyledClasses.js
|
|
var require_optionGroupUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/OptionGroupUnstyled/optionGroupUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getOptionGroupUnstyledUtilityClass = getOptionGroupUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getOptionGroupUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiOptionGroupUnstyled", slot);
|
|
}
|
|
var optionGroupUnstyledClasses = (0, _generateUtilityClasses.default)("MuiOptionGroupUnstyled", ["root", "label", "list"]);
|
|
var _default = optionGroupUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionGroupUnstyled/OptionGroupUnstyled.js
|
|
var require_OptionGroupUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/OptionGroupUnstyled/OptionGroupUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _react = _interopRequireDefault(require_react());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _optionGroupUnstyledClasses = require_optionGroupUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["className", "component", "components", "disabled", "componentsProps"];
|
|
function useUtilityClasses(disabled) {
|
|
const slots = {
|
|
root: ["root", disabled && "disabled"],
|
|
label: ["label"],
|
|
list: ["list"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _optionGroupUnstyledClasses.getOptionGroupUnstyledUtilityClass, {});
|
|
}
|
|
var OptionGroupUnstyled = /* @__PURE__ */ _react.default.forwardRef(function OptionGroupUnstyled2(props, ref) {
|
|
var _componentsProps$root, _componentsProps$labe, _componentsProps$list;
|
|
const {
|
|
className,
|
|
component,
|
|
components = {},
|
|
disabled = false,
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const Root = component || (components == null ? void 0 : components.Root) || "li";
|
|
const Label = (components == null ? void 0 : components.Label) || "span";
|
|
const List = (components == null ? void 0 : components.List) || "ul";
|
|
const classes = useUtilityClasses(disabled);
|
|
const rootProps = (0, _extends2.default)({}, other, {
|
|
ref
|
|
}, componentsProps.root, {
|
|
className: (0, _clsx.default)(classes.root, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
});
|
|
const labelProps = (0, _extends2.default)({}, componentsProps.label, {
|
|
className: (0, _clsx.default)(classes.label, (_componentsProps$labe = componentsProps.label) == null ? void 0 : _componentsProps$labe.className)
|
|
});
|
|
const listProps = (0, _extends2.default)({}, componentsProps.list, {
|
|
className: (0, _clsx.default)(classes.list, (_componentsProps$list = componentsProps.list) == null ? void 0 : _componentsProps$list.className)
|
|
});
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelProps, {
|
|
children: props.label
|
|
})), /* @__PURE__ */ (0, _jsxRuntime.jsx)(List, (0, _extends2.default)({}, listProps, {
|
|
children: props.children
|
|
}))]
|
|
}));
|
|
});
|
|
true ? OptionGroupUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Label: _propTypes.default.elementType,
|
|
List: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
label: _propTypes.default.object,
|
|
list: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
disabled: _propTypes.default.bool,
|
|
label: _propTypes.default.node
|
|
} : void 0;
|
|
var _default = OptionGroupUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionGroupUnstyled/OptionGroupUnstyledProps.js
|
|
var require_OptionGroupUnstyledProps = __commonJS({
|
|
"node_modules/@mui/base/node/OptionGroupUnstyled/OptionGroupUnstyledProps.js"() {
|
|
"use strict";
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionGroupUnstyled/index.js
|
|
var require_OptionGroupUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/OptionGroupUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
optionGroupUnstyledClasses: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionGroupUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "optionGroupUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _optionGroupUnstyledClasses.default;
|
|
}
|
|
});
|
|
var _OptionGroupUnstyled = _interopRequireDefault(require_OptionGroupUnstyled());
|
|
var _OptionGroupUnstyledProps = require_OptionGroupUnstyledProps();
|
|
Object.keys(_OptionGroupUnstyledProps).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _OptionGroupUnstyledProps[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionGroupUnstyledProps[key];
|
|
}
|
|
});
|
|
});
|
|
var _optionGroupUnstyledClasses = _interopRequireWildcard(require_optionGroupUnstyledClasses());
|
|
Object.keys(_optionGroupUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _optionGroupUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _optionGroupUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionUnstyled/optionUnstyledClasses.js
|
|
var require_optionUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/OptionUnstyled/optionUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getOptionUnstyledUtilityClass = getOptionUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getOptionUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiOptionUnstyled", slot);
|
|
}
|
|
var optionUnstyledClasses = (0, _generateUtilityClasses.default)("MuiOptionUnstyled", ["root", "disabled", "selected", "highlighted"]);
|
|
var _default = optionUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionUnstyled/OptionUnstyled.js
|
|
var require_OptionUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/OptionUnstyled/OptionUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _react = _interopRequireDefault(require_react());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _SelectUnstyledContext = require_SelectUnstyledContext();
|
|
var _optionUnstyledClasses = require_optionUnstyledClasses();
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["children", "className", "component", "components", "componentsProps", "disabled", "value"];
|
|
function useUtilityClasses(ownerState) {
|
|
const {
|
|
disabled,
|
|
highlighted,
|
|
selected
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", highlighted && "highlighted", selected && "selected"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _optionUnstyledClasses.getOptionUnstyledUtilityClass, {});
|
|
}
|
|
var OptionUnstyled = /* @__PURE__ */ _react.default.forwardRef(function OptionUnstyled2(props, ref) {
|
|
var _componentsProps$root;
|
|
const {
|
|
children,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
disabled,
|
|
value
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const selectContext = _react.default.useContext(_SelectUnstyledContext.SelectUnstyledContext);
|
|
if (!selectContext) {
|
|
throw new Error("OptionUnstyled must be used within a SelectUnstyled");
|
|
}
|
|
const Root = component || components.Root || "li";
|
|
const selectOption = {
|
|
value,
|
|
label: children,
|
|
disabled
|
|
};
|
|
const optionState = selectContext.getOptionState(selectOption);
|
|
const optionProps = selectContext.getOptionProps(selectOption);
|
|
const listboxRef = selectContext.listboxRef;
|
|
const ownerState = (0, _extends2.default)({}, props, optionState);
|
|
const optionRef = _react.default.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, optionRef);
|
|
_react.default.useEffect(() => {
|
|
if (optionState.highlighted) {
|
|
if (!listboxRef.current || !optionRef.current) {
|
|
return;
|
|
}
|
|
const listboxClientRect = listboxRef.current.getBoundingClientRect();
|
|
const optionClientRect = optionRef.current.getBoundingClientRect();
|
|
if (optionClientRect.top < listboxClientRect.top) {
|
|
listboxRef.current.scrollTop -= listboxClientRect.top - optionClientRect.top;
|
|
} else if (optionClientRect.bottom > listboxClientRect.bottom) {
|
|
listboxRef.current.scrollTop += optionClientRect.bottom - listboxClientRect.bottom;
|
|
}
|
|
}
|
|
}, [optionState.highlighted, listboxRef]);
|
|
const classes = useUtilityClasses(ownerState);
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, other, optionProps, componentsProps.root, {
|
|
ref: handleRef,
|
|
className: (0, _clsx.default)(classes.root, className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className)
|
|
}), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({}, rootProps, {
|
|
children
|
|
}));
|
|
});
|
|
true ? OptionUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
disabled: _propTypes.default.bool,
|
|
value: _propTypes.default.any.isRequired
|
|
} : void 0;
|
|
var _default = /* @__PURE__ */ _react.default.memo(OptionUnstyled);
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionUnstyled/OptionUnstyledProps.js
|
|
var require_OptionUnstyledProps = __commonJS({
|
|
"node_modules/@mui/base/node/OptionUnstyled/OptionUnstyledProps.js"() {
|
|
"use strict";
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/OptionUnstyled/index.js
|
|
var require_OptionUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/OptionUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
optionUnstyledClasses: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "optionUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _optionUnstyledClasses.default;
|
|
}
|
|
});
|
|
var _OptionUnstyled = _interopRequireDefault(require_OptionUnstyled());
|
|
var _OptionUnstyledProps = require_OptionUnstyledProps();
|
|
Object.keys(_OptionUnstyledProps).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _OptionUnstyledProps[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionUnstyledProps[key];
|
|
}
|
|
});
|
|
});
|
|
var _optionUnstyledClasses = _interopRequireWildcard(require_optionUnstyledClasses());
|
|
Object.keys(_optionUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _optionUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _optionUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/SelectUnstyled.js
|
|
var require_SelectUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/SelectUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _utils2 = require_utils3();
|
|
var _useSelect = _interopRequireDefault(require_useSelect());
|
|
var _utils3 = require_utils2();
|
|
var _PopperUnstyled = _interopRequireDefault(require_PopperUnstyled2());
|
|
var _SelectUnstyledContext = require_SelectUnstyledContext();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _selectUnstyledClasses = require_selectUnstyledClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["autoFocus", "children", "className", "component", "components", "componentsProps", "defaultValue", "defaultListboxOpen", "disabled", "listboxOpen", "onChange", "onListboxOpenChange", "renderValue", "value"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function defaultRenderSingleValue(selectedOption) {
|
|
var _selectedOption$label;
|
|
return (_selectedOption$label = selectedOption == null ? void 0 : selectedOption.label) != null ? _selectedOption$label : "";
|
|
}
|
|
function useUtilityClasses(ownerState) {
|
|
const {
|
|
active,
|
|
disabled,
|
|
open,
|
|
focusVisible
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", focusVisible && "focusVisible", active && "active", open && "expanded"],
|
|
listbox: ["listbox", disabled && "disabled"],
|
|
popper: ["popper"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _selectUnstyledClasses.getSelectUnstyledUtilityClass, {});
|
|
}
|
|
var SelectUnstyled = /* @__PURE__ */ React31.forwardRef(function SelectUnstyled2(props, ref) {
|
|
var _ref, _components$Listbox, _components$Popper, _componentsProps$list, _componentsProps$list2, _componentsProps$root, _componentsProps$list3, _componentsProps$popp;
|
|
const {
|
|
autoFocus,
|
|
children,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
defaultValue,
|
|
defaultListboxOpen = false,
|
|
disabled: disabledProp,
|
|
listboxOpen: listboxOpenProp,
|
|
onChange,
|
|
onListboxOpenChange,
|
|
renderValue: renderValueProp,
|
|
value: valueProp
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const renderValue = renderValueProp != null ? renderValueProp : defaultRenderSingleValue;
|
|
const [groupedOptions, setGroupedOptions] = React31.useState([]);
|
|
const options = React31.useMemo(() => (0, _utils2.flattenOptionGroups)(groupedOptions), [groupedOptions]);
|
|
const [listboxOpen, setListboxOpen] = (0, _utils.unstable_useControlled)({
|
|
controlled: listboxOpenProp,
|
|
default: defaultListboxOpen,
|
|
name: "SelectUnstyled",
|
|
state: "listboxOpen"
|
|
});
|
|
React31.useEffect(() => {
|
|
setGroupedOptions((0, _utils2.getOptionsFromChildren)(children));
|
|
}, [children]);
|
|
const [buttonDefined, setButtonDefined] = React31.useState(false);
|
|
const buttonRef = React31.useRef(null);
|
|
const listboxRef = React31.useRef(null);
|
|
const Button2 = (_ref = component != null ? component : components.Root) != null ? _ref : "button";
|
|
const ListboxRoot = (_components$Listbox = components.Listbox) != null ? _components$Listbox : "ul";
|
|
const Popper = (_components$Popper = components.Popper) != null ? _components$Popper : _PopperUnstyled.default;
|
|
const handleButtonRefChange = (element) => {
|
|
buttonRef.current = element;
|
|
if (element != null) {
|
|
setButtonDefined(true);
|
|
}
|
|
};
|
|
const handleButtonRef = (0, _utils.unstable_useForkRef)(ref, handleButtonRefChange);
|
|
const handleListboxRef = (0, _utils.unstable_useForkRef)(listboxRef, (_componentsProps$list = componentsProps.listbox) == null ? void 0 : _componentsProps$list.ref);
|
|
React31.useEffect(() => {
|
|
if (autoFocus) {
|
|
buttonRef.current.focus();
|
|
}
|
|
}, [autoFocus]);
|
|
const handleOpenChange = (isOpen) => {
|
|
setListboxOpen(isOpen);
|
|
onListboxOpenChange == null ? void 0 : onListboxOpenChange(isOpen);
|
|
};
|
|
const {
|
|
buttonActive,
|
|
buttonFocusVisible,
|
|
disabled,
|
|
getButtonProps,
|
|
getListboxProps,
|
|
getOptionProps,
|
|
getOptionState,
|
|
value
|
|
} = (0, _useSelect.default)({
|
|
buttonComponent: Button2,
|
|
buttonRef: handleButtonRef,
|
|
defaultValue,
|
|
disabled: disabledProp,
|
|
listboxId: (_componentsProps$list2 = componentsProps.listbox) == null ? void 0 : _componentsProps$list2.id,
|
|
listboxRef: handleListboxRef,
|
|
multiple: false,
|
|
onChange,
|
|
onOpenChange: handleOpenChange,
|
|
open: listboxOpen,
|
|
options,
|
|
value: valueProp
|
|
});
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
active: buttonActive,
|
|
defaultListboxOpen,
|
|
disabled,
|
|
focusVisible: buttonFocusVisible,
|
|
open: listboxOpen,
|
|
renderValue,
|
|
value
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const selectedOptions = React31.useMemo(() => {
|
|
return options.find((o) => value === o.value);
|
|
}, [options, value]);
|
|
const buttonProps = (0, _utils3.appendOwnerState)(Button2, (0, _extends2.default)({}, getButtonProps(), other, componentsProps.root, {
|
|
className: (0, _clsx.default)(className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, classes.root)
|
|
}), ownerState);
|
|
const listboxProps = (0, _utils3.appendOwnerState)(ListboxRoot, (0, _extends2.default)({}, getListboxProps(), componentsProps.listbox, {
|
|
className: (0, _clsx.default)((_componentsProps$list3 = componentsProps.listbox) == null ? void 0 : _componentsProps$list3.className, classes.listbox)
|
|
}), ownerState);
|
|
const popperProps = (0, _utils3.appendOwnerState)(Popper, (0, _extends2.default)({
|
|
open: listboxOpen,
|
|
anchorEl: buttonRef.current,
|
|
placement: "bottom-start",
|
|
disablePortal: true,
|
|
role: void 0
|
|
}, componentsProps.popper, {
|
|
className: (0, _clsx.default)((_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className, classes.popper)
|
|
}), ownerState);
|
|
const context = {
|
|
getOptionProps,
|
|
getOptionState,
|
|
listboxRef
|
|
};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Button2, (0, _extends2.default)({}, buttonProps, {
|
|
children: renderValue(selectedOptions)
|
|
})), buttonDefined && /* @__PURE__ */ (0, _jsxRuntime.jsx)(Popper, (0, _extends2.default)({}, popperProps, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(ListboxRoot, (0, _extends2.default)({}, listboxProps, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(_SelectUnstyledContext.SelectUnstyledContext.Provider, {
|
|
value: context,
|
|
children
|
|
})
|
|
}))
|
|
}))]
|
|
});
|
|
});
|
|
true ? SelectUnstyled.propTypes = {
|
|
autoFocus: _propTypes.default.bool,
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Listbox: _propTypes.default.elementType,
|
|
Popper: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
listbox: _propTypes.default.object,
|
|
popper: _propTypes.default.object,
|
|
root: _propTypes.default.object
|
|
}),
|
|
defaultListboxOpen: _propTypes.default.bool,
|
|
defaultValue: _propTypes.default.any,
|
|
disabled: _propTypes.default.bool,
|
|
listboxOpen: _propTypes.default.bool,
|
|
onChange: _propTypes.default.func,
|
|
onListboxOpenChange: _propTypes.default.func,
|
|
renderValue: _propTypes.default.func,
|
|
value: _propTypes.default.any
|
|
} : void 0;
|
|
var _default = SelectUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/SelectUnstyled.types.js
|
|
var require_SelectUnstyled_types = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/SelectUnstyled.types.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SelectUnstyled/index.js
|
|
var require_SelectUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/SelectUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
selectUnstyledClasses: true,
|
|
useSelect: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SelectUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "selectUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _selectUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useSelect", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useSelect.default;
|
|
}
|
|
});
|
|
var _SelectUnstyled = _interopRequireDefault(require_SelectUnstyled());
|
|
var _SelectUnstyledContext = require_SelectUnstyledContext();
|
|
Object.keys(_SelectUnstyledContext).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SelectUnstyledContext[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SelectUnstyledContext[key];
|
|
}
|
|
});
|
|
});
|
|
var _selectUnstyledClasses = _interopRequireWildcard(require_selectUnstyledClasses());
|
|
Object.keys(_selectUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _selectUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _selectUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _SelectUnstyled2 = require_SelectUnstyled_types();
|
|
Object.keys(_SelectUnstyled2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SelectUnstyled2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SelectUnstyled2[key];
|
|
}
|
|
});
|
|
});
|
|
var _useSelect = _interopRequireDefault(require_useSelect());
|
|
var _useSelect2 = require_useSelect_types();
|
|
Object.keys(_useSelect2).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useSelect2[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useSelect2[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SliderUnstyled/sliderUnstyledClasses.js
|
|
var require_sliderUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/SliderUnstyled/sliderUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getSliderUtilityClass = getSliderUtilityClass;
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
function getSliderUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiSlider", slot);
|
|
}
|
|
var sliderUnstyledClasses = (0, _generateUtilityClasses.default)("MuiSlider", ["root", "active", "focusVisible", "disabled", "dragging", "marked", "vertical", "trackInverted", "trackFalse", "rail", "track", "mark", "markActive", "markLabel", "markLabelActive", "thumb", "valueLabel", "valueLabelOpen", "valueLabelCircle", "valueLabelLabel"]);
|
|
var _default = sliderUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SliderUnstyled/SliderValueLabelUnstyled.js
|
|
var require_SliderValueLabelUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/SliderUnstyled/SliderValueLabelUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _sliderUnstyledClasses = _interopRequireDefault(require_sliderUnstyledClasses());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useValueLabelClasses = (props) => {
|
|
const {
|
|
open
|
|
} = props;
|
|
const utilityClasses = {
|
|
offset: (0, _clsx.default)(open && _sliderUnstyledClasses.default.valueLabelOpen),
|
|
circle: _sliderUnstyledClasses.default.valueLabelCircle,
|
|
label: _sliderUnstyledClasses.default.valueLabelLabel
|
|
};
|
|
return utilityClasses;
|
|
};
|
|
function SliderValueLabelUnstyled(props) {
|
|
const {
|
|
children,
|
|
className,
|
|
value,
|
|
theme
|
|
} = props;
|
|
const classes = useValueLabelClasses(props);
|
|
return /* @__PURE__ */ React31.cloneElement(children, {
|
|
className: (0, _clsx.default)(children.props.className)
|
|
}, /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [children.props.children, /* @__PURE__ */ (0, _jsxRuntime.jsx)("span", {
|
|
className: (0, _clsx.default)(classes.offset, className),
|
|
theme,
|
|
"aria-hidden": true,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)("span", {
|
|
className: classes.circle,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)("span", {
|
|
className: classes.label,
|
|
children: value
|
|
})
|
|
})
|
|
})]
|
|
}));
|
|
}
|
|
true ? SliderValueLabelUnstyled.propTypes = {
|
|
children: _propTypes.default.element.isRequired,
|
|
className: _propTypes.default.string,
|
|
theme: _propTypes.default.any,
|
|
value: _propTypes.default.node
|
|
} : void 0;
|
|
var _default = SliderValueLabelUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SliderUnstyled/useSlider.js
|
|
var require_useSlider = __commonJS({
|
|
"node_modules/@mui/base/node/SliderUnstyled/useSlider.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Identity = void 0;
|
|
exports.default = useSlider;
|
|
exports.valueToPercent = valueToPercent;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
function asc(a, b) {
|
|
return a - b;
|
|
}
|
|
function clamp(value, min, max) {
|
|
if (value == null) {
|
|
return min;
|
|
}
|
|
return Math.min(Math.max(min, value), max);
|
|
}
|
|
function findClosest(values, currentValue) {
|
|
var _values$reduce;
|
|
const {
|
|
index: closestIndex
|
|
} = (_values$reduce = values.reduce((acc, value, index) => {
|
|
const distance = Math.abs(currentValue - value);
|
|
if (acc === null || distance < acc.distance || distance === acc.distance) {
|
|
return {
|
|
distance,
|
|
index
|
|
};
|
|
}
|
|
return acc;
|
|
}, null)) != null ? _values$reduce : {};
|
|
return closestIndex;
|
|
}
|
|
function trackFinger(event, touchId) {
|
|
if (touchId.current !== void 0 && event.changedTouches) {
|
|
const touchEvent = event;
|
|
for (let i = 0; i < touchEvent.changedTouches.length; i += 1) {
|
|
const touch = touchEvent.changedTouches[i];
|
|
if (touch.identifier === touchId.current) {
|
|
return {
|
|
x: touch.clientX,
|
|
y: touch.clientY
|
|
};
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return {
|
|
x: event.clientX,
|
|
y: event.clientY
|
|
};
|
|
}
|
|
function valueToPercent(value, min, max) {
|
|
return (value - min) * 100 / (max - min);
|
|
}
|
|
function percentToValue(percent, min, max) {
|
|
return (max - min) * percent + min;
|
|
}
|
|
function getDecimalPrecision(num) {
|
|
if (Math.abs(num) < 1) {
|
|
const parts = num.toExponential().split("e-");
|
|
const matissaDecimalPart = parts[0].split(".")[1];
|
|
return (matissaDecimalPart ? matissaDecimalPart.length : 0) + parseInt(parts[1], 10);
|
|
}
|
|
const decimalPart = num.toString().split(".")[1];
|
|
return decimalPart ? decimalPart.length : 0;
|
|
}
|
|
function roundValueToStep(value, step, min) {
|
|
const nearest = Math.round((value - min) / step) * step + min;
|
|
return Number(nearest.toFixed(getDecimalPrecision(step)));
|
|
}
|
|
function setValueIndex({
|
|
values,
|
|
newValue,
|
|
index
|
|
}) {
|
|
const output = values.slice();
|
|
output[index] = newValue;
|
|
return output.sort(asc);
|
|
}
|
|
function focusThumb({
|
|
sliderRef,
|
|
activeIndex,
|
|
setActive
|
|
}) {
|
|
var _sliderRef$current, _doc$activeElement;
|
|
const doc = (0, _utils.unstable_ownerDocument)(sliderRef.current);
|
|
if (!((_sliderRef$current = sliderRef.current) != null && _sliderRef$current.contains(doc.activeElement)) || Number(doc == null ? void 0 : (_doc$activeElement = doc.activeElement) == null ? void 0 : _doc$activeElement.getAttribute("data-index")) !== activeIndex) {
|
|
var _sliderRef$current2;
|
|
(_sliderRef$current2 = sliderRef.current) == null ? void 0 : _sliderRef$current2.querySelector(`[type="range"][data-index="${activeIndex}"]`).focus();
|
|
}
|
|
if (setActive) {
|
|
setActive(activeIndex);
|
|
}
|
|
}
|
|
var axisProps = {
|
|
horizontal: {
|
|
offset: (percent) => ({
|
|
left: `${percent}%`
|
|
}),
|
|
leap: (percent) => ({
|
|
width: `${percent}%`
|
|
})
|
|
},
|
|
"horizontal-reverse": {
|
|
offset: (percent) => ({
|
|
right: `${percent}%`
|
|
}),
|
|
leap: (percent) => ({
|
|
width: `${percent}%`
|
|
})
|
|
},
|
|
vertical: {
|
|
offset: (percent) => ({
|
|
bottom: `${percent}%`
|
|
}),
|
|
leap: (percent) => ({
|
|
height: `${percent}%`
|
|
})
|
|
}
|
|
};
|
|
var Identity = (x) => x;
|
|
exports.Identity = Identity;
|
|
var cachedSupportsTouchActionNone;
|
|
function doesSupportTouchActionNone() {
|
|
if (cachedSupportsTouchActionNone === void 0) {
|
|
if (typeof CSS !== "undefined" && typeof CSS.supports === "function") {
|
|
cachedSupportsTouchActionNone = CSS.supports("touch-action", "none");
|
|
} else {
|
|
cachedSupportsTouchActionNone = true;
|
|
}
|
|
}
|
|
return cachedSupportsTouchActionNone;
|
|
}
|
|
function useSlider(props) {
|
|
const {
|
|
ref,
|
|
"aria-labelledby": ariaLabelledby,
|
|
defaultValue,
|
|
disableSwap = false,
|
|
disabled = false,
|
|
marks: marksProp = false,
|
|
max = 100,
|
|
min = 0,
|
|
name,
|
|
onChange,
|
|
onChangeCommitted,
|
|
orientation = "horizontal",
|
|
scale = Identity,
|
|
step = 1,
|
|
tabIndex,
|
|
value: valueProp,
|
|
isRtl = false
|
|
} = props;
|
|
const touchId = React31.useRef();
|
|
const [active, setActive] = React31.useState(-1);
|
|
const [open, setOpen] = React31.useState(-1);
|
|
const [dragging, setDragging] = React31.useState(false);
|
|
const moveCount = React31.useRef(0);
|
|
const [valueDerived, setValueState] = (0, _utils.unstable_useControlled)({
|
|
controlled: valueProp,
|
|
default: defaultValue != null ? defaultValue : min,
|
|
name: "Slider"
|
|
});
|
|
const handleChange = onChange && ((event, value, thumbIndex) => {
|
|
const nativeEvent = event.nativeEvent || event;
|
|
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
Object.defineProperty(clonedEvent, "target", {
|
|
writable: true,
|
|
value: {
|
|
value,
|
|
name
|
|
}
|
|
});
|
|
onChange(clonedEvent, value, thumbIndex);
|
|
});
|
|
const range = Array.isArray(valueDerived);
|
|
let values = range ? valueDerived.slice().sort(asc) : [valueDerived];
|
|
values = values.map((value) => clamp(value, min, max));
|
|
const marks = marksProp === true && step !== null ? [...Array(Math.floor((max - min) / step) + 1)].map((_, index) => ({
|
|
value: min + step * index
|
|
})) : marksProp || [];
|
|
const marksValues = marks.map((mark) => mark.value);
|
|
const {
|
|
isFocusVisibleRef,
|
|
onBlur: handleBlurVisible,
|
|
onFocus: handleFocusVisible,
|
|
ref: focusVisibleRef
|
|
} = (0, _utils.unstable_useIsFocusVisible)();
|
|
const [focusVisible, setFocusVisible] = React31.useState(-1);
|
|
const sliderRef = React31.useRef();
|
|
const handleFocusRef = (0, _utils.unstable_useForkRef)(focusVisibleRef, sliderRef);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, handleFocusRef);
|
|
const createHandleHiddenInputFocus = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onFocu;
|
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
handleFocusVisible(event);
|
|
if (isFocusVisibleRef.current === true) {
|
|
setFocusVisible(index);
|
|
}
|
|
setOpen(index);
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onFocu = otherHandlers.onFocus) == null ? void 0 : _otherHandlers$onFocu.call(otherHandlers, event);
|
|
};
|
|
const createHandleHiddenInputBlur = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onBlur;
|
|
handleBlurVisible(event);
|
|
if (isFocusVisibleRef.current === false) {
|
|
setFocusVisible(-1);
|
|
}
|
|
setOpen(-1);
|
|
otherHandlers == null ? void 0 : (_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);
|
|
};
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (disabled && sliderRef.current.contains(document.activeElement)) {
|
|
var _document$activeEleme;
|
|
(_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.blur();
|
|
}
|
|
}, [disabled]);
|
|
if (disabled && active !== -1) {
|
|
setActive(-1);
|
|
}
|
|
if (disabled && focusVisible !== -1) {
|
|
setFocusVisible(-1);
|
|
}
|
|
const createHandleHiddenInputChange = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onChan;
|
|
(_otherHandlers$onChan = otherHandlers.onChange) == null ? void 0 : _otherHandlers$onChan.call(otherHandlers, event);
|
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
const value = values[index];
|
|
const marksIndex = marksValues.indexOf(value);
|
|
let newValue = event.target.valueAsNumber;
|
|
if (marks && step == null) {
|
|
newValue = newValue < value ? marksValues[marksIndex - 1] : marksValues[marksIndex + 1];
|
|
}
|
|
newValue = clamp(newValue, min, max);
|
|
if (marks && step == null) {
|
|
const currentMarkIndex = marksValues.indexOf(values[index]);
|
|
newValue = newValue < values[index] ? marksValues[currentMarkIndex - 1] : marksValues[currentMarkIndex + 1];
|
|
}
|
|
if (range) {
|
|
if (disableSwap) {
|
|
newValue = clamp(newValue, values[index - 1] || -Infinity, values[index + 1] || Infinity);
|
|
}
|
|
const previousValue = newValue;
|
|
newValue = setValueIndex({
|
|
values,
|
|
newValue,
|
|
index
|
|
});
|
|
let activeIndex = index;
|
|
if (!disableSwap) {
|
|
activeIndex = newValue.indexOf(previousValue);
|
|
}
|
|
focusThumb({
|
|
sliderRef,
|
|
activeIndex
|
|
});
|
|
}
|
|
setValueState(newValue);
|
|
setFocusVisible(index);
|
|
if (handleChange) {
|
|
handleChange(event, newValue, index);
|
|
}
|
|
if (onChangeCommitted) {
|
|
onChangeCommitted(event, newValue);
|
|
}
|
|
};
|
|
const previousIndex = React31.useRef();
|
|
let axis = orientation;
|
|
if (isRtl && orientation === "horizontal") {
|
|
axis += "-reverse";
|
|
}
|
|
const getFingerNewValue = ({
|
|
finger,
|
|
move = false,
|
|
values: values2
|
|
}) => {
|
|
const {
|
|
current: slider
|
|
} = sliderRef;
|
|
const {
|
|
width,
|
|
height,
|
|
bottom,
|
|
left
|
|
} = slider.getBoundingClientRect();
|
|
let percent;
|
|
if (axis.indexOf("vertical") === 0) {
|
|
percent = (bottom - finger.y) / height;
|
|
} else {
|
|
percent = (finger.x - left) / width;
|
|
}
|
|
if (axis.indexOf("-reverse") !== -1) {
|
|
percent = 1 - percent;
|
|
}
|
|
let newValue;
|
|
newValue = percentToValue(percent, min, max);
|
|
if (step) {
|
|
newValue = roundValueToStep(newValue, step, min);
|
|
} else {
|
|
const closestIndex = findClosest(marksValues, newValue);
|
|
newValue = marksValues[closestIndex];
|
|
}
|
|
newValue = clamp(newValue, min, max);
|
|
let activeIndex = 0;
|
|
if (range) {
|
|
if (!move) {
|
|
activeIndex = findClosest(values2, newValue);
|
|
} else {
|
|
activeIndex = previousIndex.current;
|
|
}
|
|
if (disableSwap) {
|
|
newValue = clamp(newValue, values2[activeIndex - 1] || -Infinity, values2[activeIndex + 1] || Infinity);
|
|
}
|
|
const previousValue = newValue;
|
|
newValue = setValueIndex({
|
|
values: values2,
|
|
newValue,
|
|
index: activeIndex
|
|
});
|
|
if (!(disableSwap && move)) {
|
|
activeIndex = newValue.indexOf(previousValue);
|
|
previousIndex.current = activeIndex;
|
|
}
|
|
}
|
|
return {
|
|
newValue,
|
|
activeIndex
|
|
};
|
|
};
|
|
const handleTouchMove = (0, _utils.unstable_useEventCallback)((nativeEvent) => {
|
|
const finger = trackFinger(nativeEvent, touchId);
|
|
if (!finger) {
|
|
return;
|
|
}
|
|
moveCount.current += 1;
|
|
if (nativeEvent.type === "mousemove" && nativeEvent.buttons === 0) {
|
|
handleTouchEnd(nativeEvent);
|
|
return;
|
|
}
|
|
const {
|
|
newValue,
|
|
activeIndex
|
|
} = getFingerNewValue({
|
|
finger,
|
|
move: true,
|
|
values
|
|
});
|
|
focusThumb({
|
|
sliderRef,
|
|
activeIndex,
|
|
setActive
|
|
});
|
|
setValueState(newValue);
|
|
if (!dragging && moveCount.current > INTENTIONAL_DRAG_COUNT_THRESHOLD) {
|
|
setDragging(true);
|
|
}
|
|
if (handleChange) {
|
|
handleChange(nativeEvent, newValue, activeIndex);
|
|
}
|
|
});
|
|
const handleTouchEnd = (0, _utils.unstable_useEventCallback)((nativeEvent) => {
|
|
const finger = trackFinger(nativeEvent, touchId);
|
|
setDragging(false);
|
|
if (!finger) {
|
|
return;
|
|
}
|
|
const {
|
|
newValue
|
|
} = getFingerNewValue({
|
|
finger,
|
|
values
|
|
});
|
|
setActive(-1);
|
|
if (nativeEvent.type === "touchend") {
|
|
setOpen(-1);
|
|
}
|
|
if (onChangeCommitted) {
|
|
onChangeCommitted(nativeEvent, newValue);
|
|
}
|
|
touchId.current = void 0;
|
|
stopListening();
|
|
});
|
|
const handleTouchStart = (0, _utils.unstable_useEventCallback)((nativeEvent) => {
|
|
if (!doesSupportTouchActionNone()) {
|
|
nativeEvent.preventDefault();
|
|
}
|
|
const touch = nativeEvent.changedTouches[0];
|
|
if (touch != null) {
|
|
touchId.current = touch.identifier;
|
|
}
|
|
const finger = trackFinger(nativeEvent, touchId);
|
|
if (finger !== false) {
|
|
const {
|
|
newValue,
|
|
activeIndex
|
|
} = getFingerNewValue({
|
|
finger,
|
|
values
|
|
});
|
|
focusThumb({
|
|
sliderRef,
|
|
activeIndex,
|
|
setActive
|
|
});
|
|
setValueState(newValue);
|
|
if (handleChange) {
|
|
handleChange(nativeEvent, newValue, activeIndex);
|
|
}
|
|
}
|
|
moveCount.current = 0;
|
|
const doc = (0, _utils.unstable_ownerDocument)(sliderRef.current);
|
|
doc.addEventListener("touchmove", handleTouchMove);
|
|
doc.addEventListener("touchend", handleTouchEnd);
|
|
});
|
|
const stopListening = React31.useCallback(() => {
|
|
const doc = (0, _utils.unstable_ownerDocument)(sliderRef.current);
|
|
doc.removeEventListener("mousemove", handleTouchMove);
|
|
doc.removeEventListener("mouseup", handleTouchEnd);
|
|
doc.removeEventListener("touchmove", handleTouchMove);
|
|
doc.removeEventListener("touchend", handleTouchEnd);
|
|
}, [handleTouchEnd, handleTouchMove]);
|
|
React31.useEffect(() => {
|
|
const {
|
|
current: slider
|
|
} = sliderRef;
|
|
slider.addEventListener("touchstart", handleTouchStart, {
|
|
passive: doesSupportTouchActionNone()
|
|
});
|
|
return () => {
|
|
slider.removeEventListener("touchstart", handleTouchStart, {
|
|
passive: doesSupportTouchActionNone()
|
|
});
|
|
stopListening();
|
|
};
|
|
}, [stopListening, handleTouchStart]);
|
|
React31.useEffect(() => {
|
|
if (disabled) {
|
|
stopListening();
|
|
}
|
|
}, [disabled, stopListening]);
|
|
const createHandleMouseDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous;
|
|
(_otherHandlers$onMous = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);
|
|
if (event.defaultPrevented) {
|
|
return;
|
|
}
|
|
if (event.button !== 0) {
|
|
return;
|
|
}
|
|
event.preventDefault();
|
|
const finger = trackFinger(event, touchId);
|
|
if (finger !== false) {
|
|
const {
|
|
newValue,
|
|
activeIndex
|
|
} = getFingerNewValue({
|
|
finger,
|
|
values
|
|
});
|
|
focusThumb({
|
|
sliderRef,
|
|
activeIndex,
|
|
setActive
|
|
});
|
|
setValueState(newValue);
|
|
if (handleChange) {
|
|
handleChange(event, newValue, activeIndex);
|
|
}
|
|
}
|
|
moveCount.current = 0;
|
|
const doc = (0, _utils.unstable_ownerDocument)(sliderRef.current);
|
|
doc.addEventListener("mousemove", handleTouchMove);
|
|
doc.addEventListener("mouseup", handleTouchEnd);
|
|
};
|
|
const trackOffset = valueToPercent(range ? values[0] : min, min, max);
|
|
const trackLeap = valueToPercent(values[values.length - 1], min, max) - trackOffset;
|
|
const getRootProps = (otherHandlers) => {
|
|
const ownEventHandlers = {
|
|
onMouseDown: createHandleMouseDown(otherHandlers || {})
|
|
};
|
|
const mergedEventHandlers = (0, _extends2.default)({}, otherHandlers, ownEventHandlers);
|
|
return (0, _extends2.default)({
|
|
ref: handleRef
|
|
}, mergedEventHandlers);
|
|
};
|
|
const createHandleMouseOver = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous2;
|
|
(_otherHandlers$onMous2 = otherHandlers.onMouseOver) == null ? void 0 : _otherHandlers$onMous2.call(otherHandlers, event);
|
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
setOpen(index);
|
|
};
|
|
const createHandleMouseLeave = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onMous3;
|
|
(_otherHandlers$onMous3 = otherHandlers.onMouseLeave) == null ? void 0 : _otherHandlers$onMous3.call(otherHandlers, event);
|
|
setOpen(-1);
|
|
};
|
|
const getThumbProps = (otherHandlers) => {
|
|
const ownEventHandlers = {
|
|
onMouseOver: createHandleMouseOver(otherHandlers || {}),
|
|
onMouseLeave: createHandleMouseLeave(otherHandlers || {})
|
|
};
|
|
const mergedEventHandlers = (0, _extends2.default)({}, otherHandlers, ownEventHandlers);
|
|
return (0, _extends2.default)({}, mergedEventHandlers);
|
|
};
|
|
const getHiddenInputProps = (otherHandlers) => {
|
|
const ownEventHandlers = {
|
|
onChange: createHandleHiddenInputChange(otherHandlers || {}),
|
|
onFocus: createHandleHiddenInputFocus(otherHandlers || {}),
|
|
onBlur: createHandleHiddenInputBlur(otherHandlers || {})
|
|
};
|
|
const mergedEventHandlers = (0, _extends2.default)({}, otherHandlers, ownEventHandlers);
|
|
return (0, _extends2.default)({
|
|
tabIndex,
|
|
"aria-labelledby": ariaLabelledby,
|
|
"aria-orientation": orientation,
|
|
"aria-valuemax": scale(max),
|
|
"aria-valuemin": scale(min),
|
|
name,
|
|
type: "range",
|
|
min: props.min,
|
|
max: props.max,
|
|
step: props.step,
|
|
disabled
|
|
}, mergedEventHandlers, {
|
|
style: (0, _extends2.default)({}, _utils.visuallyHidden, {
|
|
direction: isRtl ? "rtl" : "ltr",
|
|
width: "100%",
|
|
height: "100%"
|
|
})
|
|
});
|
|
};
|
|
return {
|
|
axis,
|
|
axisProps,
|
|
getRootProps,
|
|
getHiddenInputProps,
|
|
getThumbProps,
|
|
dragging,
|
|
marks,
|
|
values,
|
|
active,
|
|
focusVisible,
|
|
open,
|
|
range,
|
|
trackOffset,
|
|
trackLeap
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SliderUnstyled/SliderUnstyled.js
|
|
var require_SliderUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/SliderUnstyled/SliderUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _isHostComponent = _interopRequireDefault(require_isHostComponent());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _sliderUnstyledClasses = require_sliderUnstyledClasses();
|
|
var _SliderValueLabelUnstyled = _interopRequireDefault(require_SliderValueLabelUnstyled());
|
|
var _useSlider = _interopRequireWildcard(require_useSlider());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["aria-label", "aria-valuetext", "className", "component", "classes", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var Identity = (x) => x;
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
disabled,
|
|
dragging,
|
|
marked,
|
|
orientation,
|
|
track,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", disabled && "disabled", dragging && "dragging", marked && "marked", orientation === "vertical" && "vertical", track === "inverted" && "trackInverted", track === false && "trackFalse"],
|
|
rail: ["rail"],
|
|
track: ["track"],
|
|
mark: ["mark"],
|
|
markActive: ["markActive"],
|
|
markLabel: ["markLabel"],
|
|
markLabelActive: ["markLabelActive"],
|
|
valueLabel: ["valueLabel"],
|
|
thumb: ["thumb", disabled && "disabled"],
|
|
active: ["active"],
|
|
disabled: ["disabled"],
|
|
focusVisible: ["focusVisible"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _sliderUnstyledClasses.getSliderUtilityClass, classes);
|
|
};
|
|
var Forward = ({
|
|
children
|
|
}) => children;
|
|
var SliderUnstyled = /* @__PURE__ */ React31.forwardRef(function SliderUnstyled2(props, ref) {
|
|
var _ref, _components$Rail, _components$Track, _components$Thumb, _components$ValueLabe, _components$Mark, _components$MarkLabel;
|
|
const {
|
|
"aria-label": ariaLabel,
|
|
"aria-valuetext": ariaValuetext,
|
|
className,
|
|
component,
|
|
classes: classesProp,
|
|
disableSwap = false,
|
|
disabled = false,
|
|
getAriaLabel,
|
|
getAriaValueText,
|
|
marks: marksProp = false,
|
|
max = 100,
|
|
min = 0,
|
|
onMouseDown,
|
|
orientation = "horizontal",
|
|
scale = Identity,
|
|
step = 1,
|
|
track = "normal",
|
|
valueLabelDisplay = "off",
|
|
valueLabelFormat = Identity,
|
|
isRtl = false,
|
|
components = {},
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
mark: marksProp,
|
|
classes: classesProp,
|
|
disabled,
|
|
isRtl,
|
|
max,
|
|
min,
|
|
orientation,
|
|
scale,
|
|
step,
|
|
track,
|
|
valueLabelDisplay,
|
|
valueLabelFormat
|
|
});
|
|
const {
|
|
axisProps,
|
|
getRootProps,
|
|
getHiddenInputProps,
|
|
getThumbProps,
|
|
open,
|
|
active,
|
|
axis,
|
|
range,
|
|
focusVisible,
|
|
dragging,
|
|
marks,
|
|
values,
|
|
trackOffset,
|
|
trackLeap
|
|
} = (0, _useSlider.default)((0, _extends2.default)({}, ownerState, {
|
|
ref
|
|
}));
|
|
ownerState.marked = marks.length > 0 && marks.some((mark) => mark.label);
|
|
ownerState.dragging = dragging;
|
|
const Root = (_ref = component != null ? component : components.Root) != null ? _ref : "span";
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
const Rail = (_components$Rail = components.Rail) != null ? _components$Rail : "span";
|
|
const railProps = (0, _appendOwnerState.default)(Rail, componentsProps.rail, ownerState);
|
|
const Track = (_components$Track = components.Track) != null ? _components$Track : "span";
|
|
const trackProps = (0, _appendOwnerState.default)(Track, componentsProps.track, ownerState);
|
|
const trackStyle = (0, _extends2.default)({}, axisProps[axis].offset(trackOffset), axisProps[axis].leap(trackLeap));
|
|
const Thumb = (_components$Thumb = components.Thumb) != null ? _components$Thumb : "span";
|
|
const thumbProps = (0, _appendOwnerState.default)(Thumb, componentsProps.thumb, ownerState);
|
|
const ValueLabel = (_components$ValueLabe = components.ValueLabel) != null ? _components$ValueLabe : _SliderValueLabelUnstyled.default;
|
|
const valueLabelProps = (0, _appendOwnerState.default)(ValueLabel, componentsProps.valueLabel, ownerState);
|
|
const Mark = (_components$Mark = components.Mark) != null ? _components$Mark : "span";
|
|
const markProps = (0, _appendOwnerState.default)(Mark, componentsProps.mark, ownerState);
|
|
const MarkLabel = (_components$MarkLabel = components.MarkLabel) != null ? _components$MarkLabel : "span";
|
|
const markLabelProps = (0, _appendOwnerState.default)(MarkLabel, componentsProps.markLabel, ownerState);
|
|
const Input = components.Input || "input";
|
|
const inputProps = (0, _appendOwnerState.default)(Input, componentsProps.input, ownerState);
|
|
const hiddenInputProps = getHiddenInputProps();
|
|
const classes = useUtilityClasses(ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, getRootProps({
|
|
onMouseDown
|
|
}), {
|
|
className: (0, _clsx.default)(classes.root, rootProps.className, className),
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Rail, (0, _extends2.default)({}, railProps, {
|
|
className: (0, _clsx.default)(classes.rail, railProps.className)
|
|
})), /* @__PURE__ */ (0, _jsxRuntime.jsx)(Track, (0, _extends2.default)({}, trackProps, {
|
|
className: (0, _clsx.default)(classes.track, trackProps.className),
|
|
style: (0, _extends2.default)({}, trackStyle, trackProps.style)
|
|
})), marks.map((mark, index) => {
|
|
const percent = (0, _useSlider.valueToPercent)(mark.value, min, max);
|
|
const style = axisProps[axis].offset(percent);
|
|
let markActive;
|
|
if (track === false) {
|
|
markActive = values.indexOf(mark.value) !== -1;
|
|
} else {
|
|
markActive = track === "normal" && (range ? mark.value >= values[0] && mark.value <= values[values.length - 1] : mark.value <= values[0]) || track === "inverted" && (range ? mark.value <= values[0] || mark.value >= values[values.length - 1] : mark.value >= values[0]);
|
|
}
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Mark, (0, _extends2.default)({
|
|
"data-index": index
|
|
}, markProps, !(0, _isHostComponent.default)(Mark) && {
|
|
markActive
|
|
}, {
|
|
style: (0, _extends2.default)({}, style, markProps.style),
|
|
className: (0, _clsx.default)(classes.mark, markProps.className, markActive && classes.markActive)
|
|
})), mark.label != null ? /* @__PURE__ */ (0, _jsxRuntime.jsx)(MarkLabel, (0, _extends2.default)({
|
|
"aria-hidden": true,
|
|
"data-index": index
|
|
}, markLabelProps, !(0, _isHostComponent.default)(MarkLabel) && {
|
|
markLabelActive: markActive
|
|
}, {
|
|
style: (0, _extends2.default)({}, style, markLabelProps.style),
|
|
className: (0, _clsx.default)(classes.markLabel, markLabelProps.className, markActive && classes.markLabelActive),
|
|
children: mark.label
|
|
})) : null]
|
|
}, mark.value);
|
|
}), values.map((value, index) => {
|
|
const percent = (0, _useSlider.valueToPercent)(value, min, max);
|
|
const style = axisProps[axis].offset(percent);
|
|
const ValueLabelComponent = valueLabelDisplay === "off" ? Forward : ValueLabel;
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(React31.Fragment, {
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(ValueLabelComponent, (0, _extends2.default)({}, !(0, _isHostComponent.default)(ValueLabelComponent) && {
|
|
valueLabelFormat,
|
|
valueLabelDisplay,
|
|
value: typeof valueLabelFormat === "function" ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
index,
|
|
open: open === index || active === index || valueLabelDisplay === "on",
|
|
disabled
|
|
}, valueLabelProps, {
|
|
className: (0, _clsx.default)(classes.valueLabel, valueLabelProps.className),
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(Thumb, (0, _extends2.default)({
|
|
"data-index": index
|
|
}, thumbProps, getThumbProps(), {
|
|
className: (0, _clsx.default)(classes.thumb, thumbProps.className, active === index && classes.active, focusVisible === index && classes.focusVisible)
|
|
}, !(0, _isHostComponent.default)(Thumb) && {
|
|
ownerState: (0, _extends2.default)({}, ownerState, thumbProps.ownerState)
|
|
}, {
|
|
style: (0, _extends2.default)({}, style, {
|
|
pointerEvents: disableSwap && active !== index ? "none" : void 0
|
|
}, thumbProps.style),
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(Input, (0, _extends2.default)({}, hiddenInputProps, {
|
|
"data-index": index,
|
|
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
"aria-valuenow": scale(value),
|
|
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
value: values[index]
|
|
}, !(0, _isHostComponent.default)(Input) && {
|
|
ownerState: (0, _extends2.default)({}, ownerState, inputProps.ownerState)
|
|
}, inputProps, {
|
|
style: (0, _extends2.default)({}, hiddenInputProps.style, inputProps.style)
|
|
}))
|
|
}))
|
|
}))
|
|
}, index);
|
|
})]
|
|
}));
|
|
});
|
|
true ? SliderUnstyled.propTypes = {
|
|
"aria-label": (0, _utils.chainPropTypes)(_propTypes.default.string, (props) => {
|
|
const range = Array.isArray(props.value || props.defaultValue);
|
|
if (range && props["aria-label"] != null) {
|
|
return new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider.");
|
|
}
|
|
return null;
|
|
}),
|
|
"aria-labelledby": _propTypes.default.string,
|
|
"aria-valuetext": (0, _utils.chainPropTypes)(_propTypes.default.string, (props) => {
|
|
const range = Array.isArray(props.value || props.defaultValue);
|
|
if (range && props["aria-valuetext"] != null) {
|
|
return new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider.");
|
|
}
|
|
return null;
|
|
}),
|
|
children: _propTypes.default.node,
|
|
classes: _propTypes.default.object,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Input: _propTypes.default.elementType,
|
|
Mark: _propTypes.default.elementType,
|
|
MarkLabel: _propTypes.default.elementType,
|
|
Rail: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType,
|
|
Thumb: _propTypes.default.elementType,
|
|
Track: _propTypes.default.elementType,
|
|
ValueLabel: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
input: _propTypes.default.object,
|
|
mark: _propTypes.default.object,
|
|
markLabel: _propTypes.default.object,
|
|
rail: _propTypes.default.object,
|
|
root: _propTypes.default.object,
|
|
thumb: _propTypes.default.object,
|
|
track: _propTypes.default.object,
|
|
valueLabel: _propTypes.default.shape({
|
|
className: _propTypes.default.string,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
style: _propTypes.default.object,
|
|
value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number]),
|
|
valueLabelDisplay: _propTypes.default.oneOf(["auto", "off", "on"])
|
|
})
|
|
}),
|
|
defaultValue: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number]),
|
|
disabled: _propTypes.default.bool,
|
|
disableSwap: _propTypes.default.bool,
|
|
getAriaLabel: _propTypes.default.func,
|
|
getAriaValueText: _propTypes.default.func,
|
|
isRtl: _propTypes.default.bool,
|
|
marks: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
label: _propTypes.default.node,
|
|
value: _propTypes.default.number.isRequired
|
|
})), _propTypes.default.bool]),
|
|
max: _propTypes.default.number,
|
|
min: _propTypes.default.number,
|
|
name: _propTypes.default.string,
|
|
onChange: _propTypes.default.func,
|
|
onChangeCommitted: _propTypes.default.func,
|
|
onMouseDown: _propTypes.default.func,
|
|
orientation: _propTypes.default.oneOf(["horizontal", "vertical"]),
|
|
scale: _propTypes.default.func,
|
|
step: _propTypes.default.number,
|
|
tabIndex: _propTypes.default.number,
|
|
track: _propTypes.default.oneOf(["inverted", "normal", false]),
|
|
value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number]),
|
|
valueLabelDisplay: _propTypes.default.oneOf(["auto", "off", "on"]),
|
|
valueLabelFormat: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string])
|
|
} : void 0;
|
|
var _default = SliderUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SliderUnstyled/index.js
|
|
var require_SliderUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/SliderUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
SliderValueLabelUnstyled: true,
|
|
sliderUnstyledClasses: true,
|
|
useSlider: true
|
|
};
|
|
Object.defineProperty(exports, "SliderValueLabelUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SliderValueLabelUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SliderUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "sliderUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sliderUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useSlider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useSlider.default;
|
|
}
|
|
});
|
|
var _SliderUnstyled = _interopRequireDefault(require_SliderUnstyled());
|
|
var _SliderValueLabelUnstyled = _interopRequireDefault(require_SliderValueLabelUnstyled());
|
|
var _sliderUnstyledClasses = _interopRequireWildcard(require_sliderUnstyledClasses());
|
|
Object.keys(_sliderUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _sliderUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sliderUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useSlider = _interopRequireDefault(require_useSlider());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SwitchUnstyled/useSwitch.js
|
|
var require_useSwitch = __commonJS({
|
|
"node_modules/@mui/base/node/SwitchUnstyled/useSwitch.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useSwitch;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useSwitch(props) {
|
|
const {
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
disabled,
|
|
onBlur,
|
|
onChange,
|
|
onFocus,
|
|
onFocusVisible,
|
|
readOnly,
|
|
required
|
|
} = props;
|
|
const [checked, setCheckedState] = (0, _utils.unstable_useControlled)({
|
|
controlled: checkedProp,
|
|
default: Boolean(defaultChecked),
|
|
name: "Switch",
|
|
state: "checked"
|
|
});
|
|
const handleInputChange = (event, otherHandler) => {
|
|
if (event.nativeEvent.defaultPrevented) {
|
|
return;
|
|
}
|
|
setCheckedState(event.target.checked);
|
|
onChange == null ? void 0 : onChange(event);
|
|
otherHandler == null ? void 0 : otherHandler(event);
|
|
};
|
|
const {
|
|
isFocusVisibleRef,
|
|
onBlur: handleBlurVisible,
|
|
onFocus: handleFocusVisible,
|
|
ref: focusVisibleRef
|
|
} = (0, _utils.unstable_useIsFocusVisible)();
|
|
const [focusVisible, setFocusVisible] = React31.useState(false);
|
|
if (disabled && focusVisible) {
|
|
setFocusVisible(false);
|
|
}
|
|
React31.useEffect(() => {
|
|
isFocusVisibleRef.current = focusVisible;
|
|
}, [focusVisible, isFocusVisibleRef]);
|
|
const inputRef = React31.useRef(null);
|
|
const handleFocus = (event, otherHandler) => {
|
|
if (!inputRef.current) {
|
|
inputRef.current = event.currentTarget;
|
|
}
|
|
handleFocusVisible(event);
|
|
if (isFocusVisibleRef.current === true) {
|
|
setFocusVisible(true);
|
|
onFocusVisible == null ? void 0 : onFocusVisible(event);
|
|
}
|
|
onFocus == null ? void 0 : onFocus(event);
|
|
otherHandler == null ? void 0 : otherHandler(event);
|
|
};
|
|
const handleBlur = (event, otherHandler) => {
|
|
handleBlurVisible(event);
|
|
if (isFocusVisibleRef.current === false) {
|
|
setFocusVisible(false);
|
|
}
|
|
onBlur == null ? void 0 : onBlur(event);
|
|
otherHandler == null ? void 0 : otherHandler(event);
|
|
};
|
|
const handleRefChange = (0, _utils.unstable_useForkRef)(focusVisibleRef, inputRef);
|
|
const getInputProps = (otherProps = {}) => (0, _extends2.default)({
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
disabled,
|
|
readOnly,
|
|
required,
|
|
type: "checkbox"
|
|
}, otherProps, {
|
|
onChange: (event) => handleInputChange(event, otherProps.onChange),
|
|
onFocus: (event) => handleFocus(event, otherProps.onFocus),
|
|
onBlur: (event) => handleBlur(event, otherProps.onBlur),
|
|
ref: handleRefChange
|
|
});
|
|
return {
|
|
checked,
|
|
disabled: Boolean(disabled),
|
|
focusVisible,
|
|
getInputProps,
|
|
readOnly: Boolean(readOnly)
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SwitchUnstyled/switchUnstyledClasses.js
|
|
var require_switchUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/SwitchUnstyled/switchUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getSwitchUnstyledUtilityClass = getSwitchUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getSwitchUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("MuiSwitch", slot);
|
|
}
|
|
var switchUnstyledClasses = (0, _generateUtilityClasses.default)("MuiSwitch", ["root", "input", "track", "thumb", "checked", "disabled", "focusVisible", "readOnly"]);
|
|
var _default = switchUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SwitchUnstyled/SwitchUnstyled.js
|
|
var require_SwitchUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/SwitchUnstyled/SwitchUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _useSwitch = _interopRequireDefault(require_useSwitch());
|
|
var _switchUnstyledClasses = _interopRequireDefault(require_switchUnstyledClasses());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["checked", "className", "component", "components", "componentsProps", "defaultChecked", "disabled", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var SwitchUnstyled = /* @__PURE__ */ React31.forwardRef(function SwitchUnstyled2(props, ref) {
|
|
var _ref, _components$Thumb, _componentsProps$thum, _components$Input, _componentsProps$inpu, _components$Track, _componentsProps$trac;
|
|
const {
|
|
checked: checkedProp,
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {},
|
|
defaultChecked,
|
|
disabled: disabledProp,
|
|
onBlur,
|
|
onChange,
|
|
onFocus,
|
|
onFocusVisible,
|
|
readOnly: readOnlyProp
|
|
} = props, otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const useSwitchProps = {
|
|
checked: checkedProp,
|
|
defaultChecked,
|
|
disabled: disabledProp,
|
|
onBlur,
|
|
onChange,
|
|
onFocus,
|
|
onFocusVisible,
|
|
readOnly: readOnlyProp
|
|
};
|
|
const {
|
|
getInputProps,
|
|
checked,
|
|
disabled,
|
|
focusVisible,
|
|
readOnly
|
|
} = (0, _useSwitch.default)(useSwitchProps);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
checked,
|
|
disabled,
|
|
focusVisible,
|
|
readOnly
|
|
});
|
|
const Root = (_ref = component != null ? component : components.Root) != null ? _ref : "span";
|
|
const rootProps = (0, _appendOwnerState.default)(Root, (0, _extends2.default)({}, otherProps, componentsProps.root), ownerState);
|
|
const Thumb = (_components$Thumb = components.Thumb) != null ? _components$Thumb : "span";
|
|
const thumbProps = (0, _appendOwnerState.default)(Thumb, (_componentsProps$thum = componentsProps.thumb) != null ? _componentsProps$thum : {}, ownerState);
|
|
const Input = (_components$Input = components.Input) != null ? _components$Input : "input";
|
|
const inputProps = (0, _appendOwnerState.default)(Input, (_componentsProps$inpu = componentsProps.input) != null ? _componentsProps$inpu : {}, ownerState);
|
|
const Track = components.Track === null ? () => null : (_components$Track = components.Track) != null ? _components$Track : "span";
|
|
const trackProps = (0, _appendOwnerState.default)(Track, (_componentsProps$trac = componentsProps.track) != null ? _componentsProps$trac : {}, ownerState);
|
|
const stateClasses = (0, _clsx.default)(checked && _switchUnstyledClasses.default.checked, disabled && _switchUnstyledClasses.default.disabled, focusVisible && _switchUnstyledClasses.default.focusVisible, readOnly && _switchUnstyledClasses.default.readOnly);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({
|
|
ref
|
|
}, rootProps, {
|
|
className: (0, _clsx.default)(_switchUnstyledClasses.default.root, stateClasses, className, rootProps == null ? void 0 : rootProps.className),
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(Track, (0, _extends2.default)({}, trackProps, {
|
|
className: (0, _clsx.default)(_switchUnstyledClasses.default.track, trackProps == null ? void 0 : trackProps.className)
|
|
})), /* @__PURE__ */ (0, _jsxRuntime.jsx)(Thumb, (0, _extends2.default)({}, thumbProps, {
|
|
className: (0, _clsx.default)(_switchUnstyledClasses.default.thumb, thumbProps == null ? void 0 : thumbProps.className)
|
|
})), /* @__PURE__ */ (0, _jsxRuntime.jsx)(Input, (0, _extends2.default)({}, getInputProps(inputProps), {
|
|
className: (0, _clsx.default)(_switchUnstyledClasses.default.input, inputProps == null ? void 0 : inputProps.className)
|
|
}))]
|
|
}));
|
|
});
|
|
true ? SwitchUnstyled.propTypes = {
|
|
checked: _propTypes.default.bool,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Input: _propTypes.default.elementType,
|
|
Root: _propTypes.default.elementType,
|
|
Thumb: _propTypes.default.elementType,
|
|
Track: _propTypes.default.oneOfType([_propTypes.default.elementType, _propTypes.default.oneOf([null])])
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
input: _propTypes.default.object,
|
|
root: _propTypes.default.object,
|
|
thumb: _propTypes.default.object,
|
|
track: _propTypes.default.object
|
|
}),
|
|
defaultChecked: _propTypes.default.bool,
|
|
disabled: _propTypes.default.bool,
|
|
onBlur: _propTypes.default.func,
|
|
onChange: _propTypes.default.func,
|
|
onFocus: _propTypes.default.func,
|
|
onFocusVisible: _propTypes.default.func,
|
|
readOnly: _propTypes.default.bool,
|
|
required: _propTypes.default.bool
|
|
} : void 0;
|
|
var _default = SwitchUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/SwitchUnstyled/index.js
|
|
var require_SwitchUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/SwitchUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
useSwitch: true,
|
|
switchUnstyledClasses: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SwitchUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "switchUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _switchUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useSwitch", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useSwitch.default;
|
|
}
|
|
});
|
|
var _SwitchUnstyled = _interopRequireWildcard(require_SwitchUnstyled());
|
|
Object.keys(_SwitchUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SwitchUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SwitchUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _useSwitch = _interopRequireWildcard(require_useSwitch());
|
|
Object.keys(_useSwitch).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useSwitch[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useSwitch[key];
|
|
}
|
|
});
|
|
});
|
|
var _switchUnstyledClasses = _interopRequireWildcard(require_switchUnstyledClasses());
|
|
Object.keys(_switchUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _switchUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _switchUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabPanelUnstyled/tabPanelUnstyledClasses.js
|
|
var require_tabPanelUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/TabPanelUnstyled/tabPanelUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getTabPanelUnstyledUtilityClass = getTabPanelUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getTabPanelUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("TabPanelUnstyled", slot);
|
|
}
|
|
var tabPanelUnstyledClasses = (0, _generateUtilityClasses.default)("TabPanelUnstyled", ["root", "hidden"]);
|
|
var _default = tabPanelUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsUnstyled/tabsUnstyledClasses.js
|
|
var require_tabsUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/TabsUnstyled/tabsUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getTabsUnstyledUtilityClass = getTabsUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getTabsUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("TabsUnstyled", slot);
|
|
}
|
|
var tabsUnstyledClasses = (0, _generateUtilityClasses.default)("TabsUnstyled", ["root", "horizontal", "vertical"]);
|
|
var _default = tabsUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsUnstyled/useTabs.js
|
|
var require_useTabs = __commonJS({
|
|
"node_modules/@mui/base/node/TabsUnstyled/useTabs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useTabs = (props) => {
|
|
const {
|
|
value: valueProp,
|
|
defaultValue,
|
|
onChange,
|
|
orientation,
|
|
direction,
|
|
selectionFollowsFocus
|
|
} = props;
|
|
const [value, setValue] = (0, _utils.unstable_useControlled)({
|
|
controlled: valueProp,
|
|
default: defaultValue,
|
|
name: "Tabs",
|
|
state: "value"
|
|
});
|
|
const idPrefix = (0, _utils.unstable_useId)();
|
|
const onSelected = React31.useCallback((e, newValue) => {
|
|
setValue(newValue);
|
|
if (onChange) {
|
|
onChange(e, newValue);
|
|
}
|
|
}, [onChange, setValue]);
|
|
const getRootProps = () => {
|
|
return {};
|
|
};
|
|
const tabsContextValue = React31.useMemo(() => {
|
|
return {
|
|
idPrefix,
|
|
value,
|
|
onSelected,
|
|
orientation,
|
|
direction,
|
|
selectionFollowsFocus
|
|
};
|
|
}, [idPrefix, value, onSelected, orientation, direction, selectionFollowsFocus]);
|
|
return {
|
|
getRootProps,
|
|
tabsContextValue
|
|
};
|
|
};
|
|
var _default = useTabs;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsUnstyled/TabsContext.js
|
|
var require_TabsContext = __commonJS({
|
|
"node_modules/@mui/base/node/TabsUnstyled/TabsContext.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getPanelId = getPanelId;
|
|
exports.getTabId = getTabId;
|
|
exports.useTabContext = useTabContext;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var Context = /* @__PURE__ */ React31.createContext(null);
|
|
if (true) {
|
|
Context.displayName = "TabsContext";
|
|
}
|
|
function useTabContext() {
|
|
return React31.useContext(Context);
|
|
}
|
|
function getPanelId(context, value) {
|
|
const {
|
|
idPrefix
|
|
} = context;
|
|
if (idPrefix === null) {
|
|
return null;
|
|
}
|
|
return `${context.idPrefix}-P-${value}`;
|
|
}
|
|
function getTabId(context, value) {
|
|
const {
|
|
idPrefix
|
|
} = context;
|
|
if (idPrefix === null) {
|
|
return null;
|
|
}
|
|
return `${context.idPrefix}-T-${value}`;
|
|
}
|
|
var _default = Context;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsUnstyled/TabsUnstyled.js
|
|
var require_TabsUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/TabsUnstyled/TabsUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils2();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _tabsUnstyledClasses = require_tabsUnstyledClasses();
|
|
var _useTabs = _interopRequireDefault(require_useTabs());
|
|
var _TabsContext = _interopRequireDefault(require_TabsContext());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["children", "className", "value", "defaultValue", "orientation", "direction", "component", "components", "componentsProps", "onChange", "selectionFollowsFocus"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
orientation
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", orientation]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _tabsUnstyledClasses.getTabsUnstyledUtilityClass, {});
|
|
};
|
|
var TabsUnstyled = /* @__PURE__ */ React31.forwardRef((props, ref) => {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
children,
|
|
className,
|
|
orientation = "horizontal",
|
|
direction = "ltr",
|
|
component,
|
|
components = {},
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
tabsContextValue,
|
|
getRootProps
|
|
} = (0, _useTabs.default)(props);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
orientation,
|
|
direction
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const TabsRoot = (_ref = component != null ? component : components.Root) != null ? _ref : "div";
|
|
const tabsRootProps = (0, _utils.appendOwnerState)(TabsRoot, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(TabsRoot, (0, _extends2.default)({}, getRootProps(), tabsRootProps, {
|
|
ref,
|
|
className: (0, _clsx.default)(classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, className),
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(_TabsContext.default.Provider, {
|
|
value: tabsContextValue,
|
|
children
|
|
})
|
|
}));
|
|
});
|
|
true ? TabsUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
defaultValue: _propTypes.default.oneOfType([_propTypes.default.oneOf([false]), _propTypes.default.number, _propTypes.default.string]),
|
|
direction: _propTypes.default.oneOf(["ltr", "rtl"]),
|
|
onChange: _propTypes.default.func,
|
|
orientation: _propTypes.default.oneOf(["horizontal", "vertical"]),
|
|
selectionFollowsFocus: _propTypes.default.bool,
|
|
value: _propTypes.default.oneOfType([_propTypes.default.oneOf([false]), _propTypes.default.number, _propTypes.default.string])
|
|
} : void 0;
|
|
var _default = TabsUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsUnstyled/index.js
|
|
var require_TabsUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/TabsUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
TabsContext: true,
|
|
tabsUnstyledClasses: true,
|
|
useTabs: true
|
|
};
|
|
Object.defineProperty(exports, "TabsContext", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsContext.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "tabsUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabsUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTabs", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabs.default;
|
|
}
|
|
});
|
|
var _TabsUnstyled = _interopRequireDefault(require_TabsUnstyled());
|
|
var _TabsContext = _interopRequireWildcard(require_TabsContext());
|
|
Object.keys(_TabsContext).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _TabsContext[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsContext[key];
|
|
}
|
|
});
|
|
});
|
|
var _tabsUnstyledClasses = _interopRequireWildcard(require_tabsUnstyledClasses());
|
|
Object.keys(_tabsUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _tabsUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabsUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useTabs = _interopRequireWildcard(require_useTabs());
|
|
Object.keys(_useTabs).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useTabs[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabs[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabPanelUnstyled/useTabPanel.js
|
|
var require_useTabPanel = __commonJS({
|
|
"node_modules/@mui/base/node/TabPanelUnstyled/useTabPanel.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _TabsUnstyled = require_TabsUnstyled2();
|
|
var useTabPanel = (props) => {
|
|
const {
|
|
value
|
|
} = props;
|
|
const context = (0, _TabsUnstyled.useTabContext)();
|
|
if (context === null) {
|
|
throw new Error("No TabContext provided");
|
|
}
|
|
const hidden = value !== context.value;
|
|
const id = (0, _TabsUnstyled.getPanelId)(context, value);
|
|
const tabId = (0, _TabsUnstyled.getTabId)(context, value);
|
|
const getRootProps = () => {
|
|
return {
|
|
"aria-labelledby": tabId,
|
|
hidden,
|
|
id
|
|
};
|
|
};
|
|
return {
|
|
hidden,
|
|
getRootProps
|
|
};
|
|
};
|
|
var _default = useTabPanel;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabPanelUnstyled/TabPanelUnstyled.js
|
|
var require_TabPanelUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/TabPanelUnstyled/TabPanelUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils2();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _tabPanelUnstyledClasses = require_tabPanelUnstyledClasses();
|
|
var _useTabPanel = _interopRequireDefault(require_useTabPanel());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["children", "className", "value", "components", "componentsProps", "component"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
hidden
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", hidden && "hidden"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _tabPanelUnstyledClasses.getTabPanelUnstyledUtilityClass, {});
|
|
};
|
|
var TabPanelUnstyled = /* @__PURE__ */ React31.forwardRef(function TabPanelUnstyled2(props, ref) {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
children,
|
|
className,
|
|
components = {},
|
|
componentsProps = {},
|
|
component
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
hidden,
|
|
getRootProps
|
|
} = (0, _useTabPanel.default)(props);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
hidden
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const TabPanelRoot = (_ref = component != null ? component : components.Root) != null ? _ref : "div";
|
|
const tabPanelRootProps = (0, _utils.appendOwnerState)(TabPanelRoot, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(TabPanelRoot, (0, _extends2.default)({}, getRootProps(), {
|
|
ref,
|
|
role: "tabpanel"
|
|
}, tabPanelRootProps, {
|
|
className: (0, _clsx.default)(classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, className),
|
|
children: !hidden && children
|
|
}));
|
|
});
|
|
true ? TabPanelUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
value: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
} : void 0;
|
|
var _default = TabPanelUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabPanelUnstyled/index.js
|
|
var require_TabPanelUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/TabPanelUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
tabPanelUnstyledClasses: true,
|
|
useTabPanel: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabPanelUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "tabPanelUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabPanelUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTabPanel", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabPanel.default;
|
|
}
|
|
});
|
|
var _TabPanelUnstyled = _interopRequireDefault(require_TabPanelUnstyled());
|
|
var _tabPanelUnstyledClasses = _interopRequireWildcard(require_tabPanelUnstyledClasses());
|
|
Object.keys(_tabPanelUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _tabPanelUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabPanelUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useTabPanel = _interopRequireWildcard(require_useTabPanel());
|
|
Object.keys(_useTabPanel).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useTabPanel[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabPanel[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsListUnstyled/tabsListUnstyledClasses.js
|
|
var require_tabsListUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/TabsListUnstyled/tabsListUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getTabsListUnstyledUtilityClass = getTabsListUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getTabsListUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("TabsListUnstyled", slot);
|
|
}
|
|
var tabsListUnstyledClasses = (0, _generateUtilityClasses.default)("TabsListUnstyled", ["root", "horizontal", "vertical"]);
|
|
var _default = tabsListUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsListUnstyled/useTabsList.js
|
|
var require_useTabsList = __commonJS({
|
|
"node_modules/@mui/base/node/TabsListUnstyled/useTabsList.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _utils = require_utils();
|
|
var _reactIs = require_react_is2();
|
|
var _TabsUnstyled = require_TabsUnstyled2();
|
|
var _extractEventHandlers = _interopRequireDefault(require_extractEventHandlers());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var nextItem = (list, item) => {
|
|
if (!list) {
|
|
return null;
|
|
}
|
|
if (list === item) {
|
|
return list.firstChild;
|
|
}
|
|
if (item && item.nextElementSibling) {
|
|
return item.nextElementSibling;
|
|
}
|
|
return list.firstChild;
|
|
};
|
|
var previousItem = (list, item) => {
|
|
if (!list) {
|
|
return null;
|
|
}
|
|
if (list === item) {
|
|
return list.lastChild;
|
|
}
|
|
if (item && item.previousElementSibling) {
|
|
return item.previousElementSibling;
|
|
}
|
|
return list.lastChild;
|
|
};
|
|
var moveFocus = (list, currentFocus, traversalFunction) => {
|
|
let wrappedOnce = false;
|
|
let nextFocus = traversalFunction(list, currentFocus);
|
|
while (list && nextFocus) {
|
|
if (nextFocus === list.firstChild) {
|
|
if (wrappedOnce) {
|
|
return;
|
|
}
|
|
wrappedOnce = true;
|
|
}
|
|
const nextFocusDisabled = nextFocus.disabled || nextFocus.getAttribute("aria-disabled") === "true";
|
|
if (!nextFocus.hasAttribute("tabindex") || nextFocusDisabled) {
|
|
nextFocus = traversalFunction(list, nextFocus);
|
|
} else {
|
|
nextFocus.focus();
|
|
return;
|
|
}
|
|
}
|
|
};
|
|
var useTabsList = (props) => {
|
|
const {
|
|
"aria-label": ariaLabel,
|
|
"aria-labelledby": ariaLabelledBy,
|
|
children,
|
|
ref
|
|
} = props;
|
|
const tabsListRef = /* @__PURE__ */ React31.createRef();
|
|
const handleRef = (0, _utils.unstable_useForkRef)(tabsListRef, ref);
|
|
const context = (0, _TabsUnstyled.useTabContext)();
|
|
if (context === null) {
|
|
throw new Error("No TabContext provided");
|
|
}
|
|
const {
|
|
value,
|
|
orientation = "horizontal",
|
|
direction = "ltr"
|
|
} = context;
|
|
const isRtl = direction === "rtl";
|
|
const handleKeyDown = (event) => {
|
|
const list = tabsListRef.current;
|
|
const currentFocus = (0, _utils.unstable_ownerDocument)(list).activeElement;
|
|
const role = currentFocus == null ? void 0 : currentFocus.getAttribute("role");
|
|
if (role !== "tab") {
|
|
return;
|
|
}
|
|
let previousItemKey = orientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
let nextItemKey = orientation === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
if (orientation === "horizontal" && isRtl) {
|
|
previousItemKey = "ArrowRight";
|
|
nextItemKey = "ArrowLeft";
|
|
}
|
|
switch (event.key) {
|
|
case previousItemKey:
|
|
event.preventDefault();
|
|
moveFocus(list, currentFocus, previousItem);
|
|
break;
|
|
case nextItemKey:
|
|
event.preventDefault();
|
|
moveFocus(list, currentFocus, nextItem);
|
|
break;
|
|
case "Home":
|
|
event.preventDefault();
|
|
moveFocus(list, null, nextItem);
|
|
break;
|
|
case "End":
|
|
event.preventDefault();
|
|
moveFocus(list, null, previousItem);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
};
|
|
const createHandleKeyDown = (otherHandlers) => (event) => {
|
|
var _otherHandlers$onKeyD;
|
|
handleKeyDown(event);
|
|
(_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);
|
|
};
|
|
const getRootProps = (otherHandlers) => {
|
|
const propsEventHandlers = (0, _extractEventHandlers.default)(props);
|
|
const externalEventHandlers = (0, _extends2.default)({}, propsEventHandlers, otherHandlers);
|
|
const ownEventHandlers = {
|
|
onKeyDown: createHandleKeyDown(externalEventHandlers)
|
|
};
|
|
const mergedEventHandlers = (0, _extends2.default)({}, externalEventHandlers, ownEventHandlers);
|
|
return (0, _extends2.default)({
|
|
"aria-label": ariaLabel,
|
|
"aria-labelledby": ariaLabelledBy,
|
|
"aria-orientation": orientation === "vertical" ? "vertical" : null,
|
|
role: "tablist",
|
|
ref: handleRef
|
|
}, mergedEventHandlers);
|
|
};
|
|
const processChildren = React31.useCallback(() => {
|
|
const valueToIndex = new Map();
|
|
let childIndex = 0;
|
|
const processedChildren = React31.Children.map(children, (child) => {
|
|
if (!/* @__PURE__ */ React31.isValidElement(child)) {
|
|
return null;
|
|
}
|
|
if (true) {
|
|
if ((0, _reactIs.isFragment)(child)) {
|
|
console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join("\n"));
|
|
}
|
|
}
|
|
const childValue = child.props.value === void 0 ? childIndex : child.props.value;
|
|
valueToIndex.set(childValue, childIndex);
|
|
childIndex += 1;
|
|
return /* @__PURE__ */ React31.cloneElement(child, (0, _extends2.default)({
|
|
value: childValue
|
|
}, childIndex === 1 && value === false && !child.props.tabIndex || value === childValue ? {
|
|
tabIndex: 0
|
|
} : {
|
|
tabIndex: -1
|
|
}));
|
|
});
|
|
return processedChildren;
|
|
}, [children, value]);
|
|
return {
|
|
isRtl,
|
|
orientation,
|
|
value,
|
|
processChildren,
|
|
getRootProps
|
|
};
|
|
};
|
|
var _default = useTabsList;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsListUnstyled/TabsListUnstyled.js
|
|
var require_TabsListUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/TabsListUnstyled/TabsListUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _utils = require_utils2();
|
|
var _tabsListUnstyledClasses = require_tabsListUnstyledClasses();
|
|
var _useTabsList = _interopRequireDefault(require_useTabsList());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["className", "children", "component", "components", "componentsProps"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
orientation
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", orientation]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _tabsListUnstyledClasses.getTabsListUnstyledUtilityClass, {});
|
|
};
|
|
var TabsListUnstyled = /* @__PURE__ */ React31.forwardRef((props, ref) => {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
className,
|
|
component,
|
|
components = {},
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
isRtl,
|
|
orientation,
|
|
getRootProps,
|
|
processChildren
|
|
} = (0, _useTabsList.default)((0, _extends2.default)({}, props, {
|
|
ref
|
|
}));
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
isRtl,
|
|
orientation
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const TabsListRoot = (_ref = component != null ? component : components.Root) != null ? _ref : "div";
|
|
const tabsListRootProps = (0, _utils.appendOwnerState)(TabsListRoot, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
const processedChildren = processChildren();
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(TabsListRoot, (0, _extends2.default)({}, getRootProps(), tabsListRootProps, {
|
|
className: (0, _clsx.default)(className, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, classes.root),
|
|
children: processedChildren
|
|
}));
|
|
});
|
|
true ? TabsListUnstyled.propTypes = {
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
})
|
|
} : void 0;
|
|
var _default = TabsListUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabsListUnstyled/index.js
|
|
var require_TabsListUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/TabsListUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
tabsListUnstyledClasses: true,
|
|
useTabsList: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsListUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "tabsListUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabsListUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTabsList", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabsList.default;
|
|
}
|
|
});
|
|
var _TabsListUnstyled = _interopRequireDefault(require_TabsListUnstyled());
|
|
var _tabsListUnstyledClasses = _interopRequireWildcard(require_tabsListUnstyledClasses());
|
|
Object.keys(_tabsListUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _tabsListUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabsListUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useTabsList = _interopRequireWildcard(require_useTabsList());
|
|
Object.keys(_useTabsList).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useTabsList[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTabsList[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabUnstyled/tabUnstyledClasses.js
|
|
var require_tabUnstyledClasses = __commonJS({
|
|
"node_modules/@mui/base/node/TabUnstyled/tabUnstyledClasses.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getTabUnstyledUtilityClass = getTabUnstyledUtilityClass;
|
|
var _generateUtilityClass = _interopRequireDefault(require_generateUtilityClass2());
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
function getTabUnstyledUtilityClass(slot) {
|
|
return (0, _generateUtilityClass.default)("TabUnstyled", slot);
|
|
}
|
|
var tabUnstyledClasses = (0, _generateUtilityClasses.default)("TabUnstyled", ["root", "selected", "disabled"]);
|
|
var _default = tabUnstyledClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabUnstyled/useTab.js
|
|
var require_useTab = __commonJS({
|
|
"node_modules/@mui/base/node/TabUnstyled/useTab.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _TabsUnstyled = require_TabsUnstyled2();
|
|
var _ButtonUnstyled = require_ButtonUnstyled2();
|
|
var _excluded = ["getRootProps"];
|
|
var useTab = (props) => {
|
|
const {
|
|
value: valueProp,
|
|
onChange,
|
|
onClick,
|
|
onFocus
|
|
} = props;
|
|
const _useButton = (0, _ButtonUnstyled.useButton)(props), {
|
|
getRootProps: getRootPropsButton
|
|
} = _useButton, otherButtonProps = (0, _objectWithoutPropertiesLoose2.default)(_useButton, _excluded);
|
|
const context = (0, _TabsUnstyled.useTabContext)();
|
|
if (context === null) {
|
|
throw new Error("No TabContext provided");
|
|
}
|
|
const value = valueProp != null ? valueProp : 0;
|
|
const selected = context.value === value;
|
|
const selectionFollowsFocus = context.selectionFollowsFocus;
|
|
const a11yAttributes = {
|
|
role: "tab",
|
|
"aria-controls": (0, _TabsUnstyled.getPanelId)(context, value),
|
|
id: (0, _TabsUnstyled.getTabId)(context, value),
|
|
"aria-selected": selected,
|
|
disabled: otherButtonProps.disabled
|
|
};
|
|
const handleFocus = (event) => {
|
|
if (selectionFollowsFocus && !selected) {
|
|
if (onChange) {
|
|
onChange(event, value);
|
|
}
|
|
context.onSelected(event, value);
|
|
}
|
|
if (onFocus) {
|
|
onFocus(event);
|
|
}
|
|
};
|
|
const handleClick = (event) => {
|
|
if (!selected) {
|
|
if (onChange) {
|
|
onChange(event, value);
|
|
}
|
|
context.onSelected(event, value);
|
|
}
|
|
if (onClick) {
|
|
onClick(event);
|
|
}
|
|
};
|
|
const getRootProps = (otherHandlers) => {
|
|
const buttonResolvedProps = getRootPropsButton((0, _extends2.default)({
|
|
onClick: handleClick,
|
|
onFocus: handleFocus
|
|
}, otherHandlers));
|
|
return (0, _extends2.default)({}, buttonResolvedProps, a11yAttributes);
|
|
};
|
|
return (0, _extends2.default)({
|
|
getRootProps
|
|
}, otherButtonProps, {
|
|
selected
|
|
});
|
|
};
|
|
var _default = useTab;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabUnstyled/TabUnstyled.js
|
|
var require_TabUnstyled = __commonJS({
|
|
"node_modules/@mui/base/node/TabUnstyled/TabUnstyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _utils = require_utils();
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _appendOwnerState = _interopRequireDefault(require_appendOwnerState());
|
|
var _tabUnstyledClasses = require_tabUnstyledClasses();
|
|
var _useTab = _interopRequireDefault(require_useTab());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["action", "children", "value", "className", "disabled", "onChange", "onClick", "onFocus", "component", "components", "componentsProps"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
selected,
|
|
disabled
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", selected && "selected", disabled && "disabled"]
|
|
};
|
|
return (0, _composeClasses.default)(slots, _tabUnstyledClasses.getTabUnstyledUtilityClass, {});
|
|
};
|
|
var TabUnstyled = /* @__PURE__ */ React31.forwardRef(function TabUnstyled2(props, ref) {
|
|
var _ref, _componentsProps$root;
|
|
const {
|
|
action,
|
|
children,
|
|
className,
|
|
disabled = false,
|
|
component,
|
|
components = {},
|
|
componentsProps = {}
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const tabRef = React31.useRef();
|
|
const handleRef = (0, _utils.unstable_useForkRef)(tabRef, ref);
|
|
const {
|
|
active,
|
|
focusVisible,
|
|
setFocusVisible,
|
|
selected,
|
|
getRootProps
|
|
} = (0, _useTab.default)((0, _extends2.default)({}, props, {
|
|
ref: handleRef
|
|
}));
|
|
React31.useImperativeHandle(action, () => ({
|
|
focusVisible: () => {
|
|
setFocusVisible(true);
|
|
tabRef.current.focus();
|
|
}
|
|
}), [setFocusVisible]);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
active,
|
|
focusVisible,
|
|
disabled,
|
|
selected
|
|
});
|
|
const classes = useUtilityClasses(ownerState);
|
|
const TabRoot = (_ref = component != null ? component : components.Root) != null ? _ref : "button";
|
|
const tabRootProps = (0, _appendOwnerState.default)(TabRoot, (0, _extends2.default)({}, other, componentsProps.root), ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(TabRoot, (0, _extends2.default)({}, getRootProps(), tabRootProps, {
|
|
className: (0, _clsx.default)(classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className, className),
|
|
ref,
|
|
children
|
|
}));
|
|
});
|
|
true ? TabUnstyled.propTypes = {
|
|
action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
current: _propTypes.default.shape({
|
|
focusVisible: _propTypes.default.func.isRequired
|
|
})
|
|
})]),
|
|
children: _propTypes.default.node,
|
|
className: _propTypes.default.string,
|
|
component: _propTypes.default.elementType,
|
|
components: _propTypes.default.shape({
|
|
Root: _propTypes.default.elementType
|
|
}),
|
|
componentsProps: _propTypes.default.shape({
|
|
root: _propTypes.default.object
|
|
}),
|
|
disabled: _propTypes.default.bool,
|
|
onChange: _propTypes.default.func,
|
|
onClick: _propTypes.default.func,
|
|
onFocus: _propTypes.default.func,
|
|
value: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
} : void 0;
|
|
var _default = TabUnstyled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TabUnstyled/index.js
|
|
var require_TabUnstyled2 = __commonJS({
|
|
"node_modules/@mui/base/node/TabUnstyled/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
tabUnstyledClasses: true,
|
|
useTab: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "tabUnstyledClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabUnstyledClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTab", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTab.default;
|
|
}
|
|
});
|
|
var _TabUnstyled = _interopRequireDefault(require_TabUnstyled());
|
|
var _tabUnstyledClasses = _interopRequireWildcard(require_tabUnstyledClasses());
|
|
Object.keys(_tabUnstyledClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _tabUnstyledClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _tabUnstyledClasses[key];
|
|
}
|
|
});
|
|
});
|
|
var _useTab = _interopRequireWildcard(require_useTab());
|
|
Object.keys(_useTab).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _useTab[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTab[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TextareaAutosize/TextareaAutosize.js
|
|
var require_TextareaAutosize = __commonJS({
|
|
"node_modules/@mui/base/node/TextareaAutosize/TextareaAutosize.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["onChange", "maxRows", "minRows", "style", "value"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function getStyleValue(computedStyle, property) {
|
|
return parseInt(computedStyle[property], 10) || 0;
|
|
}
|
|
var styles = {
|
|
shadow: {
|
|
visibility: "hidden",
|
|
position: "absolute",
|
|
overflow: "hidden",
|
|
height: 0,
|
|
top: 0,
|
|
left: 0,
|
|
transform: "translateZ(0)"
|
|
}
|
|
};
|
|
var TextareaAutosize = /* @__PURE__ */ React31.forwardRef(function TextareaAutosize2(props, ref) {
|
|
const {
|
|
onChange,
|
|
maxRows,
|
|
minRows = 1,
|
|
style,
|
|
value
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
current: isControlled
|
|
} = React31.useRef(value != null);
|
|
const inputRef = React31.useRef(null);
|
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, inputRef);
|
|
const shadowRef = React31.useRef(null);
|
|
const renders = React31.useRef(0);
|
|
const [state, setState] = React31.useState({});
|
|
const syncHeight = React31.useCallback(() => {
|
|
const input = inputRef.current;
|
|
const containerWindow = (0, _utils.unstable_ownerWindow)(input);
|
|
const computedStyle = containerWindow.getComputedStyle(input);
|
|
if (computedStyle.width === "0px") {
|
|
return;
|
|
}
|
|
const inputShallow = shadowRef.current;
|
|
inputShallow.style.width = computedStyle.width;
|
|
inputShallow.value = input.value || props.placeholder || "x";
|
|
if (inputShallow.value.slice(-1) === "\n") {
|
|
inputShallow.value += " ";
|
|
}
|
|
const boxSizing = computedStyle["box-sizing"];
|
|
const padding = getStyleValue(computedStyle, "padding-bottom") + getStyleValue(computedStyle, "padding-top");
|
|
const border = getStyleValue(computedStyle, "border-bottom-width") + getStyleValue(computedStyle, "border-top-width");
|
|
const innerHeight = inputShallow.scrollHeight;
|
|
inputShallow.value = "x";
|
|
const singleRowHeight = inputShallow.scrollHeight;
|
|
let outerHeight = innerHeight;
|
|
if (minRows) {
|
|
outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
|
|
}
|
|
if (maxRows) {
|
|
outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
|
|
}
|
|
outerHeight = Math.max(outerHeight, singleRowHeight);
|
|
const outerHeightStyle = outerHeight + (boxSizing === "border-box" ? padding + border : 0);
|
|
const overflow = Math.abs(outerHeight - innerHeight) <= 1;
|
|
setState((prevState) => {
|
|
if (renders.current < 20 && (outerHeightStyle > 0 && Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1 || prevState.overflow !== overflow)) {
|
|
renders.current += 1;
|
|
return {
|
|
overflow,
|
|
outerHeightStyle
|
|
};
|
|
}
|
|
if (true) {
|
|
if (renders.current === 20) {
|
|
console.error(["MUI: Too many re-renders. The layout is unstable.", "TextareaAutosize limits the number of renders to prevent an infinite loop."].join("\n"));
|
|
}
|
|
}
|
|
return prevState;
|
|
});
|
|
}, [maxRows, minRows, props.placeholder]);
|
|
React31.useEffect(() => {
|
|
const handleResize = (0, _utils.unstable_debounce)(() => {
|
|
renders.current = 0;
|
|
syncHeight();
|
|
});
|
|
const containerWindow = (0, _utils.unstable_ownerWindow)(inputRef.current);
|
|
containerWindow.addEventListener("resize", handleResize);
|
|
let resizeObserver;
|
|
if (typeof ResizeObserver !== "undefined") {
|
|
resizeObserver = new ResizeObserver(handleResize);
|
|
resizeObserver.observe(inputRef.current);
|
|
}
|
|
return () => {
|
|
handleResize.clear();
|
|
containerWindow.removeEventListener("resize", handleResize);
|
|
if (resizeObserver) {
|
|
resizeObserver.disconnect();
|
|
}
|
|
};
|
|
}, [syncHeight]);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
syncHeight();
|
|
});
|
|
React31.useEffect(() => {
|
|
renders.current = 0;
|
|
}, [value]);
|
|
const handleChange = (event) => {
|
|
renders.current = 0;
|
|
if (!isControlled) {
|
|
syncHeight();
|
|
}
|
|
if (onChange) {
|
|
onChange(event);
|
|
}
|
|
};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(React31.Fragment, {
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)("textarea", (0, _extends2.default)({
|
|
value,
|
|
onChange: handleChange,
|
|
ref: handleRef,
|
|
rows: minRows,
|
|
style: (0, _extends2.default)({
|
|
height: state.outerHeightStyle,
|
|
overflow: state.overflow ? "hidden" : null
|
|
}, style)
|
|
}, other)), /* @__PURE__ */ (0, _jsxRuntime.jsx)("textarea", {
|
|
"aria-hidden": true,
|
|
className: props.className,
|
|
readOnly: true,
|
|
ref: shadowRef,
|
|
tabIndex: -1,
|
|
style: (0, _extends2.default)({}, styles.shadow, style, {
|
|
padding: 0
|
|
})
|
|
})]
|
|
});
|
|
});
|
|
true ? TextareaAutosize.propTypes = {
|
|
className: _propTypes.default.string,
|
|
maxRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
minRows: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
onChange: _propTypes.default.func,
|
|
placeholder: _propTypes.default.string,
|
|
style: _propTypes.default.object,
|
|
value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.number, _propTypes.default.string])
|
|
} : void 0;
|
|
var _default = TextareaAutosize;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/TextareaAutosize/index.js
|
|
var require_TextareaAutosize2 = __commonJS({
|
|
"node_modules/@mui/base/node/TextareaAutosize/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TextareaAutosize.default;
|
|
}
|
|
});
|
|
var _TextareaAutosize = _interopRequireDefault(require_TextareaAutosize());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/base/node/index.js
|
|
var require_node2 = __commonJS({
|
|
"node_modules/@mui/base/node/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
BackdropUnstyled: true,
|
|
BadgeUnstyled: true,
|
|
ButtonUnstyled: true,
|
|
ClickAwayListener: true,
|
|
unstable_composeClasses: true,
|
|
generateUtilityClass: true,
|
|
generateUtilityClasses: true,
|
|
FormControlUnstyled: true,
|
|
InputUnstyled: true,
|
|
MenuUnstyled: true,
|
|
MenuItemUnstyled: true,
|
|
ModalUnstyled: true,
|
|
MultiSelectUnstyled: true,
|
|
NoSsr: true,
|
|
OptionGroupUnstyled: true,
|
|
OptionUnstyled: true,
|
|
PopperUnstyled: true,
|
|
Portal: true,
|
|
SelectUnstyled: true,
|
|
SliderUnstyled: true,
|
|
SwitchUnstyled: true,
|
|
TabPanelUnstyled: true,
|
|
TabsListUnstyled: true,
|
|
TabsUnstyled: true,
|
|
TabUnstyled: true,
|
|
TextareaAutosize: true,
|
|
Unstable_TrapFocus: true
|
|
};
|
|
Object.defineProperty(exports, "BackdropUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BackdropUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "BadgeUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BadgeUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ButtonUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ButtonUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ClickAwayListener", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ClickAwayListener.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "FormControlUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _FormControlUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "InputUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _InputUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "MenuItemUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuItemUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "MenuUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ModalUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ModalUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "MultiSelectUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MultiSelectUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "NoSsr", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _NoSsr.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "OptionGroupUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionGroupUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "OptionUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "PopperUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _PopperUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Portal", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Portal.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "SelectUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SelectUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "SliderUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SliderUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "SwitchUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SwitchUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "TabPanelUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabPanelUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "TabUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "TabsListUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsListUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "TabsUnstyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsUnstyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "TextareaAutosize", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TextareaAutosize.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Unstable_TrapFocus", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Unstable_TrapFocus.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "generateUtilityClass", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClass.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "generateUtilityClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClasses.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_composeClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _composeClasses.default;
|
|
}
|
|
});
|
|
var _utils = require_utils2();
|
|
Object.keys(_utils).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _utils[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _utils[key];
|
|
}
|
|
});
|
|
});
|
|
var _AutocompleteUnstyled = require_AutocompleteUnstyled();
|
|
Object.keys(_AutocompleteUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _AutocompleteUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _AutocompleteUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _BackdropUnstyled = _interopRequireWildcard(require_BackdropUnstyled2());
|
|
Object.keys(_BackdropUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _BackdropUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BackdropUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _BadgeUnstyled = _interopRequireWildcard(require_BadgeUnstyled2());
|
|
Object.keys(_BadgeUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _BadgeUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _BadgeUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _ButtonUnstyled = _interopRequireWildcard(require_ButtonUnstyled2());
|
|
Object.keys(_ButtonUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ButtonUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ButtonUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _ClickAwayListener = _interopRequireDefault(require_ClickAwayListener2());
|
|
var _composeClasses = _interopRequireDefault(require_composeClasses2());
|
|
var _generateUtilityClass = _interopRequireWildcard(require_generateUtilityClass2());
|
|
Object.keys(_generateUtilityClass).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _generateUtilityClass[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _generateUtilityClass[key];
|
|
}
|
|
});
|
|
});
|
|
var _generateUtilityClasses = _interopRequireDefault(require_generateUtilityClasses2());
|
|
var _FormControlUnstyled = _interopRequireWildcard(require_FormControlUnstyled2());
|
|
Object.keys(_FormControlUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _FormControlUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _FormControlUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _InputUnstyled = _interopRequireWildcard(require_InputUnstyled2());
|
|
Object.keys(_InputUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _InputUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _InputUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _ListboxUnstyled = require_ListboxUnstyled();
|
|
Object.keys(_ListboxUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ListboxUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ListboxUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _MenuUnstyled = _interopRequireWildcard(require_MenuUnstyled2());
|
|
Object.keys(_MenuUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MenuUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _MenuItemUnstyled = _interopRequireWildcard(require_MenuItemUnstyled2());
|
|
Object.keys(_MenuItemUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MenuItemUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MenuItemUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _ModalUnstyled = _interopRequireWildcard(require_ModalUnstyled2());
|
|
Object.keys(_ModalUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ModalUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ModalUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _MultiSelectUnstyled = _interopRequireWildcard(require_MultiSelectUnstyled2());
|
|
Object.keys(_MultiSelectUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _MultiSelectUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _MultiSelectUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _NoSsr = _interopRequireDefault(require_NoSsr2());
|
|
var _OptionGroupUnstyled = _interopRequireWildcard(require_OptionGroupUnstyled2());
|
|
Object.keys(_OptionGroupUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _OptionGroupUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionGroupUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _OptionUnstyled = _interopRequireWildcard(require_OptionUnstyled2());
|
|
Object.keys(_OptionUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _OptionUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _OptionUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _PopperUnstyled = _interopRequireDefault(require_PopperUnstyled2());
|
|
var _Portal = _interopRequireDefault(require_Portal2());
|
|
var _SelectUnstyled = _interopRequireWildcard(require_SelectUnstyled2());
|
|
Object.keys(_SelectUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SelectUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SelectUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _SliderUnstyled = _interopRequireWildcard(require_SliderUnstyled2());
|
|
Object.keys(_SliderUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SliderUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SliderUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _SwitchUnstyled = _interopRequireWildcard(require_SwitchUnstyled2());
|
|
Object.keys(_SwitchUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _SwitchUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SwitchUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _TabPanelUnstyled = _interopRequireWildcard(require_TabPanelUnstyled2());
|
|
Object.keys(_TabPanelUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _TabPanelUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabPanelUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _TabsListUnstyled = _interopRequireWildcard(require_TabsListUnstyled2());
|
|
Object.keys(_TabsListUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _TabsListUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsListUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _TabsUnstyled = _interopRequireWildcard(require_TabsUnstyled2());
|
|
Object.keys(_TabsUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _TabsUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabsUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _TabUnstyled = _interopRequireWildcard(require_TabUnstyled2());
|
|
Object.keys(_TabUnstyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _TabUnstyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _TabUnstyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _TextareaAutosize = _interopRequireDefault(require_TextareaAutosize2());
|
|
var _Unstable_TrapFocus = _interopRequireDefault(require_Unstable_TrapFocus2());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/memoize/dist/emotion-memoize.browser.cjs.js
|
|
var require_emotion_memoize_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/memoize/dist/emotion-memoize.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function memoize(fn) {
|
|
var cache = Object.create(null);
|
|
return function(arg) {
|
|
if (cache[arg] === void 0)
|
|
cache[arg] = fn(arg);
|
|
return cache[arg];
|
|
};
|
|
}
|
|
exports.default = memoize;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.browser.cjs.js
|
|
var require_emotion_is_prop_valid_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var memoize = require_emotion_memoize_browser_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var memoize__default = /* @__PURE__ */ _interopDefault(memoize);
|
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
var isPropValid = /* @__PURE__ */ memoize__default["default"](function(prop) {
|
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
});
|
|
exports.default = isPropValid;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/sheet/dist/emotion-sheet.browser.cjs.js
|
|
var require_emotion_sheet_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/sheet/dist/emotion-sheet.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function sheetForTag(tag) {
|
|
if (tag.sheet) {
|
|
return tag.sheet;
|
|
}
|
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
if (document.styleSheets[i].ownerNode === tag) {
|
|
return document.styleSheets[i];
|
|
}
|
|
}
|
|
}
|
|
function createStyleElement(options) {
|
|
var tag = document.createElement("style");
|
|
tag.setAttribute("data-emotion", options.key);
|
|
if (options.nonce !== void 0) {
|
|
tag.setAttribute("nonce", options.nonce);
|
|
}
|
|
tag.appendChild(document.createTextNode(""));
|
|
tag.setAttribute("data-s", "");
|
|
return tag;
|
|
}
|
|
var StyleSheet = /* @__PURE__ */ function() {
|
|
function StyleSheet2(options) {
|
|
var _this = this;
|
|
this._insertTag = function(tag) {
|
|
var before;
|
|
if (_this.tags.length === 0) {
|
|
if (_this.insertionPoint) {
|
|
before = _this.insertionPoint.nextSibling;
|
|
} else if (_this.prepend) {
|
|
before = _this.container.firstChild;
|
|
} else {
|
|
before = _this.before;
|
|
}
|
|
} else {
|
|
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
}
|
|
_this.container.insertBefore(tag, before);
|
|
_this.tags.push(tag);
|
|
};
|
|
this.isSpeedy = options.speedy === void 0 ? false : options.speedy;
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
this.nonce = options.nonce;
|
|
this.key = options.key;
|
|
this.container = options.container;
|
|
this.prepend = options.prepend;
|
|
this.insertionPoint = options.insertionPoint;
|
|
this.before = null;
|
|
}
|
|
var _proto = StyleSheet2.prototype;
|
|
_proto.hydrate = function hydrate(nodes) {
|
|
nodes.forEach(this._insertTag);
|
|
};
|
|
_proto.insert = function insert(rule) {
|
|
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
|
|
this._insertTag(createStyleElement(this));
|
|
}
|
|
var tag = this.tags[this.tags.length - 1];
|
|
if (true) {
|
|
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
|
|
}
|
|
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
}
|
|
if (this.isSpeedy) {
|
|
var sheet = sheetForTag(tag);
|
|
try {
|
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
} catch (e) {
|
|
if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
|
|
console.error('There was a problem inserting the following rule: "' + rule + '"', e);
|
|
}
|
|
}
|
|
} else {
|
|
tag.appendChild(document.createTextNode(rule));
|
|
}
|
|
this.ctr++;
|
|
};
|
|
_proto.flush = function flush() {
|
|
this.tags.forEach(function(tag) {
|
|
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
});
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
if (true) {
|
|
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
}
|
|
};
|
|
return StyleSheet2;
|
|
}();
|
|
exports.StyleSheet = StyleSheet;
|
|
}
|
|
});
|
|
|
|
// node_modules/stylis/dist/umd/stylis.js
|
|
var require_stylis = __commonJS({
|
|
"node_modules/stylis/dist/umd/stylis.js"(exports, module2) {
|
|
(function(e, r) {
|
|
typeof exports === "object" && typeof module2 !== "undefined" ? r(exports) : typeof define === "function" && define.amd ? define(["exports"], r) : (e = e || self, r(e.stylis = {}));
|
|
})(exports, function(e) {
|
|
"use strict";
|
|
var r = "-ms-";
|
|
var a = "-moz-";
|
|
var c = "-webkit-";
|
|
var t = "comm";
|
|
var n = "rule";
|
|
var s = "decl";
|
|
var i = "@page";
|
|
var u = "@media";
|
|
var o = "@import";
|
|
var f = "@charset";
|
|
var l = "@viewport";
|
|
var h = "@supports";
|
|
var p = "@document";
|
|
var v = "@namespace";
|
|
var b = "@keyframes";
|
|
var d = "@font-face";
|
|
var m = "@counter-style";
|
|
var w = "@font-feature-values";
|
|
var k = Math.abs;
|
|
var $ = String.fromCharCode;
|
|
var g = Object.assign;
|
|
function x(e2, r2) {
|
|
return (((r2 << 2 ^ O(e2, 0)) << 2 ^ O(e2, 1)) << 2 ^ O(e2, 2)) << 2 ^ O(e2, 3);
|
|
}
|
|
function E(e2) {
|
|
return e2.trim();
|
|
}
|
|
function y(e2, r2) {
|
|
return (e2 = r2.exec(e2)) ? e2[0] : e2;
|
|
}
|
|
function T(e2, r2, a2) {
|
|
return e2.replace(r2, a2);
|
|
}
|
|
function A(e2, r2) {
|
|
return e2.indexOf(r2);
|
|
}
|
|
function O(e2, r2) {
|
|
return e2.charCodeAt(r2) | 0;
|
|
}
|
|
function C(e2, r2, a2) {
|
|
return e2.slice(r2, a2);
|
|
}
|
|
function M(e2) {
|
|
return e2.length;
|
|
}
|
|
function S(e2) {
|
|
return e2.length;
|
|
}
|
|
function R(e2, r2) {
|
|
return r2.push(e2), e2;
|
|
}
|
|
function z(e2, r2) {
|
|
return e2.map(r2).join("");
|
|
}
|
|
e.line = 1;
|
|
e.column = 1;
|
|
e.length = 0;
|
|
e.position = 0;
|
|
e.character = 0;
|
|
e.characters = "";
|
|
function N(r2, a2, c2, t2, n2, s2, i2) {
|
|
return { value: r2, root: a2, parent: c2, type: t2, props: n2, children: s2, line: e.line, column: e.column, length: i2, return: "" };
|
|
}
|
|
function P(e2, r2) {
|
|
return g(N("", null, null, "", null, null, 0), e2, { length: -e2.length }, r2);
|
|
}
|
|
function j() {
|
|
return e.character;
|
|
}
|
|
function U() {
|
|
e.character = e.position > 0 ? O(e.characters, --e.position) : 0;
|
|
if (e.column--, e.character === 10)
|
|
e.column = 1, e.line--;
|
|
return e.character;
|
|
}
|
|
function _() {
|
|
e.character = e.position < e.length ? O(e.characters, e.position++) : 0;
|
|
if (e.column++, e.character === 10)
|
|
e.column = 1, e.line++;
|
|
return e.character;
|
|
}
|
|
function F() {
|
|
return O(e.characters, e.position);
|
|
}
|
|
function I() {
|
|
return e.position;
|
|
}
|
|
function L(r2, a2) {
|
|
return C(e.characters, r2, a2);
|
|
}
|
|
function D(e2) {
|
|
switch (e2) {
|
|
case 0:
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
return 5;
|
|
case 33:
|
|
case 43:
|
|
case 44:
|
|
case 47:
|
|
case 62:
|
|
case 64:
|
|
case 126:
|
|
case 59:
|
|
case 123:
|
|
case 125:
|
|
return 4;
|
|
case 58:
|
|
return 3;
|
|
case 34:
|
|
case 39:
|
|
case 40:
|
|
case 91:
|
|
return 2;
|
|
case 41:
|
|
case 93:
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
function K(r2) {
|
|
return e.line = e.column = 1, e.length = M(e.characters = r2), e.position = 0, [];
|
|
}
|
|
function V(r2) {
|
|
return e.characters = "", r2;
|
|
}
|
|
function W(r2) {
|
|
return E(L(e.position - 1, Z(r2 === 91 ? r2 + 2 : r2 === 40 ? r2 + 1 : r2)));
|
|
}
|
|
function Y(e2) {
|
|
return V(G(K(e2)));
|
|
}
|
|
function B(r2) {
|
|
while (e.character = F())
|
|
if (e.character < 33)
|
|
_();
|
|
else
|
|
break;
|
|
return D(r2) > 2 || D(e.character) > 3 ? "" : " ";
|
|
}
|
|
function G(r2) {
|
|
while (_())
|
|
switch (D(e.character)) {
|
|
case 0:
|
|
R(J(e.position - 1), r2);
|
|
break;
|
|
case 2:
|
|
R(W(e.character), r2);
|
|
break;
|
|
default:
|
|
R($(e.character), r2);
|
|
}
|
|
return r2;
|
|
}
|
|
function H(r2, a2) {
|
|
while (--a2 && _())
|
|
if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97)
|
|
break;
|
|
return L(r2, I() + (a2 < 6 && F() == 32 && _() == 32));
|
|
}
|
|
function Z(r2) {
|
|
while (_())
|
|
switch (e.character) {
|
|
case r2:
|
|
return e.position;
|
|
case 34:
|
|
case 39:
|
|
if (r2 !== 34 && r2 !== 39)
|
|
Z(e.character);
|
|
break;
|
|
case 40:
|
|
if (r2 === 41)
|
|
Z(r2);
|
|
break;
|
|
case 92:
|
|
_();
|
|
break;
|
|
}
|
|
return e.position;
|
|
}
|
|
function q(r2, a2) {
|
|
while (_())
|
|
if (r2 + e.character === 47 + 10)
|
|
break;
|
|
else if (r2 + e.character === 42 + 42 && F() === 47)
|
|
break;
|
|
return "/*" + L(a2, e.position - 1) + "*" + $(r2 === 47 ? r2 : _());
|
|
}
|
|
function J(r2) {
|
|
while (!D(F()))
|
|
_();
|
|
return L(r2, e.position);
|
|
}
|
|
function Q(e2) {
|
|
return V(X("", null, null, null, [""], e2 = K(e2), 0, [0], e2));
|
|
}
|
|
function X(e2, r2, a2, c2, t2, n2, s2, i2, u2) {
|
|
var o2 = 0;
|
|
var f2 = 0;
|
|
var l2 = s2;
|
|
var h2 = 0;
|
|
var p2 = 0;
|
|
var v2 = 0;
|
|
var b2 = 1;
|
|
var d2 = 1;
|
|
var m2 = 1;
|
|
var w2 = 0;
|
|
var k2 = "";
|
|
var g2 = t2;
|
|
var x2 = n2;
|
|
var E2 = c2;
|
|
var y2 = k2;
|
|
while (d2)
|
|
switch (v2 = w2, w2 = _()) {
|
|
case 40:
|
|
if (v2 != 108 && y2.charCodeAt(l2 - 1) == 58) {
|
|
if (A(y2 += T(W(w2), "&", "&\f"), "&\f") != -1)
|
|
m2 = -1;
|
|
break;
|
|
}
|
|
case 34:
|
|
case 39:
|
|
case 91:
|
|
y2 += W(w2);
|
|
break;
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
y2 += B(v2);
|
|
break;
|
|
case 92:
|
|
y2 += H(I() - 1, 7);
|
|
continue;
|
|
case 47:
|
|
switch (F()) {
|
|
case 42:
|
|
case 47:
|
|
R(re(q(_(), I()), r2, a2), u2);
|
|
break;
|
|
default:
|
|
y2 += "/";
|
|
}
|
|
break;
|
|
case 123 * b2:
|
|
i2[o2++] = M(y2) * m2;
|
|
case 125 * b2:
|
|
case 59:
|
|
case 0:
|
|
switch (w2) {
|
|
case 0:
|
|
case 125:
|
|
d2 = 0;
|
|
case 59 + f2:
|
|
if (p2 > 0 && M(y2) - l2)
|
|
R(p2 > 32 ? ae(y2 + ";", c2, a2, l2 - 1) : ae(T(y2, " ", "") + ";", c2, a2, l2 - 2), u2);
|
|
break;
|
|
case 59:
|
|
y2 += ";";
|
|
default:
|
|
R(E2 = ee(y2, r2, a2, o2, f2, t2, i2, k2, g2 = [], x2 = [], l2), n2);
|
|
if (w2 === 123)
|
|
if (f2 === 0)
|
|
X(y2, r2, E2, E2, g2, n2, l2, i2, x2);
|
|
else
|
|
switch (h2) {
|
|
case 100:
|
|
case 109:
|
|
case 115:
|
|
X(e2, E2, E2, c2 && R(ee(e2, E2, E2, 0, 0, t2, i2, k2, t2, g2 = [], l2), x2), t2, x2, l2, i2, c2 ? g2 : x2);
|
|
break;
|
|
default:
|
|
X(y2, E2, E2, E2, [""], x2, 0, i2, x2);
|
|
}
|
|
}
|
|
o2 = f2 = p2 = 0, b2 = m2 = 1, k2 = y2 = "", l2 = s2;
|
|
break;
|
|
case 58:
|
|
l2 = 1 + M(y2), p2 = v2;
|
|
default:
|
|
if (b2 < 1) {
|
|
if (w2 == 123)
|
|
--b2;
|
|
else if (w2 == 125 && b2++ == 0 && U() == 125)
|
|
continue;
|
|
}
|
|
switch (y2 += $(w2), w2 * b2) {
|
|
case 38:
|
|
m2 = f2 > 0 ? 1 : (y2 += "\f", -1);
|
|
break;
|
|
case 44:
|
|
i2[o2++] = (M(y2) - 1) * m2, m2 = 1;
|
|
break;
|
|
case 64:
|
|
if (F() === 45)
|
|
y2 += W(_());
|
|
h2 = F(), f2 = l2 = M(k2 = y2 += J(I())), w2++;
|
|
break;
|
|
case 45:
|
|
if (v2 === 45 && M(y2) == 2)
|
|
b2 = 0;
|
|
}
|
|
}
|
|
return n2;
|
|
}
|
|
function ee(e2, r2, a2, c2, t2, s2, i2, u2, o2, f2, l2) {
|
|
var h2 = t2 - 1;
|
|
var p2 = t2 === 0 ? s2 : [""];
|
|
var v2 = S(p2);
|
|
for (var b2 = 0, d2 = 0, m2 = 0; b2 < c2; ++b2)
|
|
for (var w2 = 0, $2 = C(e2, h2 + 1, h2 = k(d2 = i2[b2])), g2 = e2; w2 < v2; ++w2)
|
|
if (g2 = E(d2 > 0 ? p2[w2] + " " + $2 : T($2, /&\f/g, p2[w2])))
|
|
o2[m2++] = g2;
|
|
return N(e2, r2, a2, t2 === 0 ? n : u2, o2, f2, l2);
|
|
}
|
|
function re(e2, r2, a2) {
|
|
return N(e2, r2, a2, t, $(j()), C(e2, 2, -2), 0);
|
|
}
|
|
function ae(e2, r2, a2, c2) {
|
|
return N(e2, r2, a2, s, C(e2, 0, c2), C(e2, c2 + 1, -1), c2);
|
|
}
|
|
function ce(e2, t2) {
|
|
switch (x(e2, t2)) {
|
|
case 5103:
|
|
return c + "print-" + e2 + e2;
|
|
case 5737:
|
|
case 4201:
|
|
case 3177:
|
|
case 3433:
|
|
case 1641:
|
|
case 4457:
|
|
case 2921:
|
|
case 5572:
|
|
case 6356:
|
|
case 5844:
|
|
case 3191:
|
|
case 6645:
|
|
case 3005:
|
|
case 6391:
|
|
case 5879:
|
|
case 5623:
|
|
case 6135:
|
|
case 4599:
|
|
case 4855:
|
|
case 4215:
|
|
case 6389:
|
|
case 5109:
|
|
case 5365:
|
|
case 5621:
|
|
case 3829:
|
|
return c + e2 + e2;
|
|
case 5349:
|
|
case 4246:
|
|
case 4810:
|
|
case 6968:
|
|
case 2756:
|
|
return c + e2 + a + e2 + r + e2 + e2;
|
|
case 6828:
|
|
case 4268:
|
|
return c + e2 + r + e2 + e2;
|
|
case 6165:
|
|
return c + e2 + r + "flex-" + e2 + e2;
|
|
case 5187:
|
|
return c + e2 + T(e2, /(\w+).+(:[^]+)/, c + "box-$1$2" + r + "flex-$1$2") + e2;
|
|
case 5443:
|
|
return c + e2 + r + "flex-item-" + T(e2, /flex-|-self/, "") + e2;
|
|
case 4675:
|
|
return c + e2 + r + "flex-line-pack" + T(e2, /align-content|flex-|-self/, "") + e2;
|
|
case 5548:
|
|
return c + e2 + r + T(e2, "shrink", "negative") + e2;
|
|
case 5292:
|
|
return c + e2 + r + T(e2, "basis", "preferred-size") + e2;
|
|
case 6060:
|
|
return c + "box-" + T(e2, "-grow", "") + c + e2 + r + T(e2, "grow", "positive") + e2;
|
|
case 4554:
|
|
return c + T(e2, /([^-])(transform)/g, "$1" + c + "$2") + e2;
|
|
case 6187:
|
|
return T(T(T(e2, /(zoom-|grab)/, c + "$1"), /(image-set)/, c + "$1"), e2, "") + e2;
|
|
case 5495:
|
|
case 3959:
|
|
return T(e2, /(image-set\([^]*)/, c + "$1$`$1");
|
|
case 4968:
|
|
return T(T(e2, /(.+:)(flex-)?(.*)/, c + "box-pack:$3" + r + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c + e2 + e2;
|
|
case 4095:
|
|
case 3583:
|
|
case 4068:
|
|
case 2532:
|
|
return T(e2, /(.+)-inline(.+)/, c + "$1$2") + e2;
|
|
case 8116:
|
|
case 7059:
|
|
case 5753:
|
|
case 5535:
|
|
case 5445:
|
|
case 5701:
|
|
case 4933:
|
|
case 4677:
|
|
case 5533:
|
|
case 5789:
|
|
case 5021:
|
|
case 4765:
|
|
if (M(e2) - 1 - t2 > 6)
|
|
switch (O(e2, t2 + 1)) {
|
|
case 109:
|
|
if (O(e2, t2 + 4) !== 45)
|
|
break;
|
|
case 102:
|
|
return T(e2, /(.+:)(.+)-([^]+)/, "$1" + c + "$2-$3$1" + a + (O(e2, t2 + 3) == 108 ? "$3" : "$2-$3")) + e2;
|
|
case 115:
|
|
return ~A(e2, "stretch") ? ce(T(e2, "stretch", "fill-available"), t2) + e2 : e2;
|
|
}
|
|
break;
|
|
case 4949:
|
|
if (O(e2, t2 + 1) !== 115)
|
|
break;
|
|
case 6444:
|
|
switch (O(e2, M(e2) - 3 - (~A(e2, "!important") && 10))) {
|
|
case 107:
|
|
return T(e2, ":", ":" + c) + e2;
|
|
case 101:
|
|
return T(e2, /(.+:)([^;!]+)(;|!.+)?/, "$1" + c + (O(e2, 14) === 45 ? "inline-" : "") + "box$3$1" + c + "$2$3$1" + r + "$2box$3") + e2;
|
|
}
|
|
break;
|
|
case 5936:
|
|
switch (O(e2, t2 + 11)) {
|
|
case 114:
|
|
return c + e2 + r + T(e2, /[svh]\w+-[tblr]{2}/, "tb") + e2;
|
|
case 108:
|
|
return c + e2 + r + T(e2, /[svh]\w+-[tblr]{2}/, "tb-rl") + e2;
|
|
case 45:
|
|
return c + e2 + r + T(e2, /[svh]\w+-[tblr]{2}/, "lr") + e2;
|
|
}
|
|
return c + e2 + r + e2 + e2;
|
|
}
|
|
return e2;
|
|
}
|
|
function te(e2, r2) {
|
|
var a2 = "";
|
|
var c2 = S(e2);
|
|
for (var t2 = 0; t2 < c2; t2++)
|
|
a2 += r2(e2[t2], t2, e2, r2) || "";
|
|
return a2;
|
|
}
|
|
function ne(e2, r2, a2, c2) {
|
|
switch (e2.type) {
|
|
case o:
|
|
case s:
|
|
return e2.return = e2.return || e2.value;
|
|
case t:
|
|
return "";
|
|
case b:
|
|
return e2.return = e2.value + "{" + te(e2.children, c2) + "}";
|
|
case n:
|
|
e2.value = e2.props.join(",");
|
|
}
|
|
return M(a2 = te(e2.children, c2)) ? e2.return = e2.value + "{" + a2 + "}" : "";
|
|
}
|
|
function se(e2) {
|
|
var r2 = S(e2);
|
|
return function(a2, c2, t2, n2) {
|
|
var s2 = "";
|
|
for (var i2 = 0; i2 < r2; i2++)
|
|
s2 += e2[i2](a2, c2, t2, n2) || "";
|
|
return s2;
|
|
};
|
|
}
|
|
function ie(e2) {
|
|
return function(r2) {
|
|
if (!r2.root) {
|
|
if (r2 = r2.return)
|
|
e2(r2);
|
|
}
|
|
};
|
|
}
|
|
function ue(e2, t2, i2, u2) {
|
|
if (e2.length > -1) {
|
|
if (!e2.return)
|
|
switch (e2.type) {
|
|
case s:
|
|
e2.return = ce(e2.value, e2.length);
|
|
break;
|
|
case b:
|
|
return te([P(e2, { value: T(e2.value, "@", "@" + c) })], u2);
|
|
case n:
|
|
if (e2.length)
|
|
return z(e2.props, function(t3) {
|
|
switch (y(t3, /(::plac\w+|:read-\w+)/)) {
|
|
case ":read-only":
|
|
case ":read-write":
|
|
return te([P(e2, { props: [T(t3, /:(read-\w+)/, ":" + a + "$1")] })], u2);
|
|
case "::placeholder":
|
|
return te([P(e2, { props: [T(t3, /:(plac\w+)/, ":" + c + "input-$1")] }), P(e2, { props: [T(t3, /:(plac\w+)/, ":" + a + "$1")] }), P(e2, { props: [T(t3, /:(plac\w+)/, r + "input-$1")] })], u2);
|
|
}
|
|
return "";
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function oe(e2) {
|
|
switch (e2.type) {
|
|
case n:
|
|
e2.props = e2.props.map(function(r2) {
|
|
return z(Y(r2), function(r3, a2, c2) {
|
|
switch (O(r3, 0)) {
|
|
case 12:
|
|
return C(r3, 1, M(r3));
|
|
case 0:
|
|
case 40:
|
|
case 43:
|
|
case 62:
|
|
case 126:
|
|
return r3;
|
|
case 58:
|
|
if (c2[++a2] === "global")
|
|
c2[a2] = "", c2[++a2] = "\f" + C(c2[a2], a2 = 1, -1);
|
|
case 32:
|
|
return a2 === 1 ? "" : r3;
|
|
default:
|
|
switch (a2) {
|
|
case 0:
|
|
e2 = r3;
|
|
return S(c2) > 1 ? "" : r3;
|
|
case (a2 = S(c2) - 1):
|
|
case 2:
|
|
return a2 === 2 ? r3 + e2 + e2 : r3 + e2;
|
|
default:
|
|
return r3;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
e.CHARSET = f;
|
|
e.COMMENT = t;
|
|
e.COUNTER_STYLE = m;
|
|
e.DECLARATION = s;
|
|
e.DOCUMENT = p;
|
|
e.FONT_FACE = d;
|
|
e.FONT_FEATURE_VALUES = w;
|
|
e.IMPORT = o;
|
|
e.KEYFRAMES = b;
|
|
e.MEDIA = u;
|
|
e.MOZ = a;
|
|
e.MS = r;
|
|
e.NAMESPACE = v;
|
|
e.PAGE = i;
|
|
e.RULESET = n;
|
|
e.SUPPORTS = h;
|
|
e.VIEWPORT = l;
|
|
e.WEBKIT = c;
|
|
e.abs = k;
|
|
e.alloc = K;
|
|
e.append = R;
|
|
e.assign = g;
|
|
e.caret = I;
|
|
e.char = j;
|
|
e.charat = O;
|
|
e.combine = z;
|
|
e.comment = re;
|
|
e.commenter = q;
|
|
e.compile = Q;
|
|
e.copy = P;
|
|
e.dealloc = V;
|
|
e.declaration = ae;
|
|
e.delimit = W;
|
|
e.delimiter = Z;
|
|
e.escaping = H;
|
|
e.from = $;
|
|
e.hash = x;
|
|
e.identifier = J;
|
|
e.indexof = A;
|
|
e.match = y;
|
|
e.middleware = se;
|
|
e.namespace = oe;
|
|
e.next = _;
|
|
e.node = N;
|
|
e.parse = X;
|
|
e.peek = F;
|
|
e.prefix = ce;
|
|
e.prefixer = ue;
|
|
e.prev = U;
|
|
e.replace = T;
|
|
e.ruleset = ee;
|
|
e.rulesheet = ie;
|
|
e.serialize = te;
|
|
e.sizeof = S;
|
|
e.slice = L;
|
|
e.stringify = ne;
|
|
e.strlen = M;
|
|
e.substr = C;
|
|
e.token = D;
|
|
e.tokenize = Y;
|
|
e.tokenizer = G;
|
|
e.trim = E;
|
|
e.whitespace = B;
|
|
Object.defineProperty(e, "__esModule", { value: true });
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.cjs.js
|
|
var require_weak_memoize_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var weakMemoize = function weakMemoize2(func) {
|
|
var cache = new WeakMap();
|
|
return function(arg) {
|
|
if (cache.has(arg)) {
|
|
return cache.get(arg);
|
|
}
|
|
var ret = func(arg);
|
|
cache.set(arg, ret);
|
|
return ret;
|
|
};
|
|
};
|
|
exports.default = weakMemoize;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/cache/dist/emotion-cache.browser.cjs.js
|
|
var require_emotion_cache_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/cache/dist/emotion-cache.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var sheet = require_emotion_sheet_browser_cjs();
|
|
var stylis = require_stylis();
|
|
require_weak_memoize_browser_cjs();
|
|
require_emotion_memoize_browser_cjs();
|
|
var last = function last2(arr) {
|
|
return arr.length ? arr[arr.length - 1] : null;
|
|
};
|
|
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
|
|
var previous = 0;
|
|
var character = 0;
|
|
while (true) {
|
|
previous = character;
|
|
character = stylis.peek();
|
|
if (previous === 38 && character === 12) {
|
|
points[index] = 1;
|
|
}
|
|
if (stylis.token(character)) {
|
|
break;
|
|
}
|
|
stylis.next();
|
|
}
|
|
return stylis.slice(begin, stylis.position);
|
|
};
|
|
var toRules = function toRules2(parsed, points) {
|
|
var index = -1;
|
|
var character = 44;
|
|
do {
|
|
switch (stylis.token(character)) {
|
|
case 0:
|
|
if (character === 38 && stylis.peek() === 12) {
|
|
points[index] = 1;
|
|
}
|
|
parsed[index] += identifierWithPointTracking(stylis.position - 1, points, index);
|
|
break;
|
|
case 2:
|
|
parsed[index] += stylis.delimit(character);
|
|
break;
|
|
case 4:
|
|
if (character === 44) {
|
|
parsed[++index] = stylis.peek() === 58 ? "&\f" : "";
|
|
points[index] = parsed[index].length;
|
|
break;
|
|
}
|
|
default:
|
|
parsed[index] += stylis.from(character);
|
|
}
|
|
} while (character = stylis.next());
|
|
return parsed;
|
|
};
|
|
var getRules = function getRules2(value, points) {
|
|
return stylis.dealloc(toRules(stylis.alloc(value), points));
|
|
};
|
|
var fixedElements = /* @__PURE__ */ new WeakMap();
|
|
var compat = function compat2(element) {
|
|
if (element.type !== "rule" || !element.parent || element.length < 1) {
|
|
return;
|
|
}
|
|
var value = element.value, parent = element.parent;
|
|
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
while (parent.type !== "rule") {
|
|
parent = parent.parent;
|
|
if (!parent)
|
|
return;
|
|
}
|
|
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
|
|
return;
|
|
}
|
|
if (isImplicitRule) {
|
|
return;
|
|
}
|
|
fixedElements.set(element, true);
|
|
var points = [];
|
|
var rules = getRules(value, points);
|
|
var parentRules = parent.props;
|
|
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
}
|
|
}
|
|
};
|
|
var removeLabel = function removeLabel2(element) {
|
|
if (element.type === "decl") {
|
|
var value = element.value;
|
|
if (value.charCodeAt(0) === 108 && value.charCodeAt(2) === 98) {
|
|
element["return"] = "";
|
|
element.value = "";
|
|
}
|
|
}
|
|
};
|
|
var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
|
|
var isIgnoringComment = function isIgnoringComment2(element) {
|
|
return !!element && element.type === "comm" && element.children.indexOf(ignoreFlag) > -1;
|
|
};
|
|
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache) {
|
|
return function(element, index, children) {
|
|
if (element.type !== "rule")
|
|
return;
|
|
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
if (unsafePseudoClasses && cache.compat !== true) {
|
|
var prevElement = index > 0 ? children[index - 1] : null;
|
|
if (prevElement && isIgnoringComment(last(prevElement.children))) {
|
|
return;
|
|
}
|
|
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
|
|
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
|
|
});
|
|
}
|
|
};
|
|
};
|
|
var isImportRule = function isImportRule2(element) {
|
|
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
};
|
|
var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index, children) {
|
|
for (var i = index - 1; i >= 0; i--) {
|
|
if (!isImportRule(children[i])) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
var nullifyElement = function nullifyElement2(element) {
|
|
element.type = "";
|
|
element.value = "";
|
|
element["return"] = "";
|
|
element.children = "";
|
|
element.props = "";
|
|
};
|
|
var incorrectImportAlarm = function incorrectImportAlarm2(element, index, children) {
|
|
if (!isImportRule(element)) {
|
|
return;
|
|
}
|
|
if (element.parent) {
|
|
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
nullifyElement(element);
|
|
} else if (isPrependedWithRegularRules(index, children)) {
|
|
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
nullifyElement(element);
|
|
}
|
|
};
|
|
var defaultStylisPlugins = [stylis.prefixer];
|
|
var createCache = function createCache2(options) {
|
|
var key = options.key;
|
|
if (!key) {
|
|
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
}
|
|
if (key === "css") {
|
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
Array.prototype.forEach.call(ssrStyles, function(node) {
|
|
var dataEmotionAttribute = node.getAttribute("data-emotion");
|
|
if (dataEmotionAttribute.indexOf(" ") === -1) {
|
|
return;
|
|
}
|
|
document.head.appendChild(node);
|
|
node.setAttribute("data-s", "");
|
|
});
|
|
}
|
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
if (true) {
|
|
if (/[^a-z-]/.test(key)) {
|
|
throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
|
|
}
|
|
}
|
|
var inserted = {};
|
|
var container;
|
|
var nodesToHydrate = [];
|
|
{
|
|
container = options.container || document.head;
|
|
Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="' + key + ' "]'), function(node) {
|
|
var attrib = node.getAttribute("data-emotion").split(" ");
|
|
for (var i = 1; i < attrib.length; i++) {
|
|
inserted[attrib[i]] = true;
|
|
}
|
|
nodesToHydrate.push(node);
|
|
});
|
|
}
|
|
var _insert;
|
|
var omnipresentPlugins = [compat, removeLabel];
|
|
if (true) {
|
|
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
get compat() {
|
|
return cache.compat;
|
|
}
|
|
}), incorrectImportAlarm);
|
|
}
|
|
{
|
|
var currentSheet;
|
|
var finalizingPlugins = [stylis.stringify, true ? function(element) {
|
|
if (!element.root) {
|
|
if (element["return"]) {
|
|
currentSheet.insert(element["return"]);
|
|
} else if (element.value && element.type !== stylis.COMMENT) {
|
|
currentSheet.insert(element.value + "{}");
|
|
}
|
|
}
|
|
} : stylis.rulesheet(function(rule) {
|
|
currentSheet.insert(rule);
|
|
})];
|
|
var serializer = stylis.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
var stylis$1 = function stylis$12(styles) {
|
|
return stylis.serialize(stylis.compile(styles), serializer);
|
|
};
|
|
_insert = function insert(selector, serialized, sheet2, shouldCache) {
|
|
currentSheet = sheet2;
|
|
if (serialized.map !== void 0) {
|
|
currentSheet = {
|
|
insert: function insert2(rule) {
|
|
sheet2.insert(rule + serialized.map);
|
|
}
|
|
};
|
|
}
|
|
stylis$1(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
if (shouldCache) {
|
|
cache.inserted[serialized.name] = true;
|
|
}
|
|
};
|
|
}
|
|
var cache = {
|
|
key,
|
|
sheet: new sheet.StyleSheet({
|
|
key,
|
|
container,
|
|
nonce: options.nonce,
|
|
speedy: options.speedy,
|
|
prepend: options.prepend,
|
|
insertionPoint: options.insertionPoint
|
|
}),
|
|
nonce: options.nonce,
|
|
inserted,
|
|
registered: {},
|
|
insert: _insert
|
|
};
|
|
cache.sheet.hydrate(nodesToHydrate);
|
|
return cache;
|
|
};
|
|
exports.default = createCache;
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
function isValidElementType(type) {
|
|
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_ASYNC_MODE_TYPE:
|
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
var Fragment = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
}
|
|
}
|
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
}
|
|
function isContextConsumer(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
exports.AsyncMode = AsyncMode;
|
|
exports.ConcurrentMode = ConcurrentMode;
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef;
|
|
exports.Fragment = Fragment;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isValidElementType = isValidElementType;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/index.js
|
|
var require_react_is3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development3();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
var require_hoist_non_react_statics_cjs = __commonJS({
|
|
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
var reactIs = require_react_is3();
|
|
var REACT_STATICS = {
|
|
childContextTypes: true,
|
|
contextType: true,
|
|
contextTypes: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
getDefaultProps: true,
|
|
getDerivedStateFromError: true,
|
|
getDerivedStateFromProps: true,
|
|
mixins: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var KNOWN_STATICS = {
|
|
name: true,
|
|
length: true,
|
|
prototype: true,
|
|
caller: true,
|
|
callee: true,
|
|
arguments: true,
|
|
arity: true
|
|
};
|
|
var FORWARD_REF_STATICS = {
|
|
"$$typeof": true,
|
|
render: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true
|
|
};
|
|
var MEMO_STATICS = {
|
|
"$$typeof": true,
|
|
compare: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var TYPE_STATICS = {};
|
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
function getStatics(component) {
|
|
if (reactIs.isMemo(component)) {
|
|
return MEMO_STATICS;
|
|
}
|
|
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
|
|
}
|
|
var defineProperty = Object.defineProperty;
|
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
var objectPrototype = Object.prototype;
|
|
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
if (typeof sourceComponent !== "string") {
|
|
if (objectPrototype) {
|
|
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
}
|
|
}
|
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
if (getOwnPropertySymbols) {
|
|
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
}
|
|
var targetStatics = getStatics(targetComponent);
|
|
var sourceStatics = getStatics(sourceComponent);
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
var key = keys[i];
|
|
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
try {
|
|
defineProperty(targetComponent, key, descriptor);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return targetComponent;
|
|
}
|
|
module2.exports = hoistNonReactStatics;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js
|
|
var require_emotion_react_isolated_hnrs_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var hoistNonReactStatics$1 = require_hoist_non_react_statics_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var hoistNonReactStatics__default = /* @__PURE__ */ _interopDefault(hoistNonReactStatics$1);
|
|
var hoistNonReactStatics = function(targetComponent, sourceComponent) {
|
|
return hoistNonReactStatics__default["default"](targetComponent, sourceComponent);
|
|
};
|
|
exports.default = hoistNonReactStatics;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.js
|
|
var require_emotion_utils_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var isBrowser = true;
|
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
var rawClassName = "";
|
|
classNames.split(" ").forEach(function(className) {
|
|
if (registered[className] !== void 0) {
|
|
registeredStyles.push(registered[className] + ";");
|
|
} else {
|
|
rawClassName += className + " ";
|
|
}
|
|
});
|
|
return rawClassName;
|
|
}
|
|
var registerStyles = function registerStyles2(cache, serialized, isStringTag) {
|
|
var className = cache.key + "-" + serialized.name;
|
|
if ((isStringTag === false || isBrowser === false) && cache.registered[className] === void 0) {
|
|
cache.registered[className] = serialized.styles;
|
|
}
|
|
};
|
|
var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
|
|
registerStyles(cache, serialized, isStringTag);
|
|
var className = cache.key + "-" + serialized.name;
|
|
if (cache.inserted[serialized.name] === void 0) {
|
|
var current = serialized;
|
|
do {
|
|
var maybeStyles = cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
|
|
current = current.next;
|
|
} while (current !== void 0);
|
|
}
|
|
};
|
|
exports.getRegisteredStyles = getRegisteredStyles;
|
|
exports.insertStyles = insertStyles;
|
|
exports.registerStyles = registerStyles;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/hash/dist/hash.browser.cjs.js
|
|
var require_hash_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/hash/dist/hash.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function murmur2(str) {
|
|
var h = 0;
|
|
var k, i = 0, len = str.length;
|
|
for (; len >= 4; ++i, len -= 4) {
|
|
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
|
|
k ^= k >>> 24;
|
|
h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
}
|
|
switch (len) {
|
|
case 3:
|
|
h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
case 2:
|
|
h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
case 1:
|
|
h ^= str.charCodeAt(i) & 255;
|
|
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
}
|
|
h ^= h >>> 13;
|
|
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
}
|
|
exports.default = murmur2;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/unitless/dist/unitless.browser.cjs.js
|
|
var require_unitless_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/unitless/dist/unitless.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var unitlessKeys = {
|
|
animationIterationCount: 1,
|
|
borderImageOutset: 1,
|
|
borderImageSlice: 1,
|
|
borderImageWidth: 1,
|
|
boxFlex: 1,
|
|
boxFlexGroup: 1,
|
|
boxOrdinalGroup: 1,
|
|
columnCount: 1,
|
|
columns: 1,
|
|
flex: 1,
|
|
flexGrow: 1,
|
|
flexPositive: 1,
|
|
flexShrink: 1,
|
|
flexNegative: 1,
|
|
flexOrder: 1,
|
|
gridRow: 1,
|
|
gridRowEnd: 1,
|
|
gridRowSpan: 1,
|
|
gridRowStart: 1,
|
|
gridColumn: 1,
|
|
gridColumnEnd: 1,
|
|
gridColumnSpan: 1,
|
|
gridColumnStart: 1,
|
|
msGridRow: 1,
|
|
msGridRowSpan: 1,
|
|
msGridColumn: 1,
|
|
msGridColumnSpan: 1,
|
|
fontWeight: 1,
|
|
lineHeight: 1,
|
|
opacity: 1,
|
|
order: 1,
|
|
orphans: 1,
|
|
tabSize: 1,
|
|
widows: 1,
|
|
zIndex: 1,
|
|
zoom: 1,
|
|
WebkitLineClamp: 1,
|
|
fillOpacity: 1,
|
|
floodOpacity: 1,
|
|
stopOpacity: 1,
|
|
strokeDasharray: 1,
|
|
strokeDashoffset: 1,
|
|
strokeMiterlimit: 1,
|
|
strokeOpacity: 1,
|
|
strokeWidth: 1
|
|
};
|
|
exports.default = unitlessKeys;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/serialize/dist/emotion-serialize.browser.cjs.js
|
|
var require_emotion_serialize_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/serialize/dist/emotion-serialize.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var hashString = require_hash_browser_cjs();
|
|
var unitless = require_unitless_browser_cjs();
|
|
var memoize = require_emotion_memoize_browser_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var hashString__default = /* @__PURE__ */ _interopDefault(hashString);
|
|
var unitless__default = /* @__PURE__ */ _interopDefault(unitless);
|
|
var memoize__default = /* @__PURE__ */ _interopDefault(memoize);
|
|
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
|
|
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
You can read more about this here:
|
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
var isCustomProperty = function isCustomProperty2(property) {
|
|
return property.charCodeAt(1) === 45;
|
|
};
|
|
var isProcessableValue = function isProcessableValue2(value) {
|
|
return value != null && typeof value !== "boolean";
|
|
};
|
|
var processStyleName = /* @__PURE__ */ memoize__default["default"](function(styleName) {
|
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
});
|
|
var processStyleValue = function processStyleValue2(key, value) {
|
|
switch (key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
if (typeof value === "string") {
|
|
return value.replace(animationRegex, function(match, p1, p2) {
|
|
cursor = {
|
|
name: p1,
|
|
styles: p2,
|
|
next: cursor
|
|
};
|
|
return p1;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
if (unitless__default["default"][key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
|
|
return value + "px";
|
|
}
|
|
return value;
|
|
};
|
|
if (true) {
|
|
contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
contentValues = ["normal", "none", "initial", "inherit", "unset"];
|
|
oldProcessStyleValue = processStyleValue;
|
|
msPattern = /^-ms-/;
|
|
hyphenPattern = /-(.)/g;
|
|
hyphenatedCache = {};
|
|
processStyleValue = function processStyleValue2(key, value) {
|
|
if (key === "content") {
|
|
if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
}
|
|
}
|
|
var processed = oldProcessStyleValue(key, value);
|
|
if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
|
|
hyphenatedCache[key] = true;
|
|
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
|
|
return _char.toUpperCase();
|
|
}) + "?");
|
|
}
|
|
return processed;
|
|
};
|
|
}
|
|
var contentValuePattern;
|
|
var contentValues;
|
|
var oldProcessStyleValue;
|
|
var msPattern;
|
|
var hyphenPattern;
|
|
var hyphenatedCache;
|
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
if (interpolation == null) {
|
|
return "";
|
|
}
|
|
if (interpolation.__emotion_styles !== void 0) {
|
|
if (interpolation.toString() === "NO_COMPONENT_SELECTOR") {
|
|
throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
|
|
}
|
|
return interpolation;
|
|
}
|
|
switch (typeof interpolation) {
|
|
case "boolean": {
|
|
return "";
|
|
}
|
|
case "object": {
|
|
if (interpolation.anim === 1) {
|
|
cursor = {
|
|
name: interpolation.name,
|
|
styles: interpolation.styles,
|
|
next: cursor
|
|
};
|
|
return interpolation.name;
|
|
}
|
|
if (interpolation.styles !== void 0) {
|
|
var next = interpolation.next;
|
|
if (next !== void 0) {
|
|
while (next !== void 0) {
|
|
cursor = {
|
|
name: next.name,
|
|
styles: next.styles,
|
|
next: cursor
|
|
};
|
|
next = next.next;
|
|
}
|
|
}
|
|
var styles = interpolation.styles + ";";
|
|
if (interpolation.map !== void 0) {
|
|
styles += interpolation.map;
|
|
}
|
|
return styles;
|
|
}
|
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
}
|
|
case "function": {
|
|
if (mergedProps !== void 0) {
|
|
var previousCursor = cursor;
|
|
var result = interpolation(mergedProps);
|
|
cursor = previousCursor;
|
|
return handleInterpolation(mergedProps, registered, result);
|
|
} else if (true) {
|
|
console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
|
|
}
|
|
break;
|
|
}
|
|
case "string":
|
|
if (true) {
|
|
var matched = [];
|
|
var replaced = interpolation.replace(animationRegex, function(match, p1, p2) {
|
|
var fakeVarName = "animation" + matched.length;
|
|
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
|
|
return "${" + fakeVarName + "}";
|
|
});
|
|
if (matched.length) {
|
|
console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\n" + ("css`" + replaced + "`"));
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
if (registered == null) {
|
|
return interpolation;
|
|
}
|
|
var cached = registered[interpolation];
|
|
return cached !== void 0 ? cached : interpolation;
|
|
}
|
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
var string = "";
|
|
if (Array.isArray(obj)) {
|
|
for (var i = 0; i < obj.length; i++) {
|
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
}
|
|
} else {
|
|
for (var _key in obj) {
|
|
var value = obj[_key];
|
|
if (typeof value !== "object") {
|
|
if (registered != null && registered[value] !== void 0) {
|
|
string += _key + "{" + registered[value] + "}";
|
|
} else if (isProcessableValue(value)) {
|
|
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
}
|
|
} else {
|
|
if (_key === "NO_COMPONENT_SELECTOR" && true) {
|
|
throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
|
|
}
|
|
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
for (var _i = 0; _i < value.length; _i++) {
|
|
if (isProcessableValue(value[_i])) {
|
|
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
}
|
|
}
|
|
} else {
|
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
switch (_key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
break;
|
|
}
|
|
default: {
|
|
if (_key === "undefined") {
|
|
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
}
|
|
string += _key + "{" + interpolated + "}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return string;
|
|
}
|
|
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
var sourceMapPattern;
|
|
if (true) {
|
|
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
}
|
|
var cursor;
|
|
var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
|
|
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
return args[0];
|
|
}
|
|
var stringMode = true;
|
|
var styles = "";
|
|
cursor = void 0;
|
|
var strings = args[0];
|
|
if (strings == null || strings.raw === void 0) {
|
|
stringMode = false;
|
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
} else {
|
|
if (strings[0] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles += strings[0];
|
|
}
|
|
for (var i = 1; i < args.length; i++) {
|
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
if (stringMode) {
|
|
if (strings[i] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles += strings[i];
|
|
}
|
|
}
|
|
var sourceMap;
|
|
if (true) {
|
|
styles = styles.replace(sourceMapPattern, function(match2) {
|
|
sourceMap = match2;
|
|
return "";
|
|
});
|
|
}
|
|
labelPattern.lastIndex = 0;
|
|
var identifierName = "";
|
|
var match;
|
|
while ((match = labelPattern.exec(styles)) !== null) {
|
|
identifierName += "-" + match[1];
|
|
}
|
|
var name = hashString__default["default"](styles) + identifierName;
|
|
if (true) {
|
|
return {
|
|
name,
|
|
styles,
|
|
map: sourceMap,
|
|
next: cursor,
|
|
toString: function toString() {
|
|
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
}
|
|
};
|
|
}
|
|
return {
|
|
name,
|
|
styles,
|
|
next: cursor
|
|
};
|
|
};
|
|
exports.serializeStyles = serializeStyles;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/dist/emotion-element-35a1554b.browser.cjs.js
|
|
var require_emotion_element_35a1554b_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/react/dist/emotion-element-35a1554b.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
var React31 = require_react();
|
|
var createCache = require_emotion_cache_browser_cjs();
|
|
var _extends = require_extends();
|
|
var weakMemoize = require_weak_memoize_browser_cjs();
|
|
var _isolatedHnrs_dist_emotionReact_isolatedHnrs = require_emotion_react_isolated_hnrs_browser_cjs();
|
|
var utils = require_emotion_utils_browser_cjs();
|
|
var serialize = require_emotion_serialize_browser_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
function _interopNamespace(e) {
|
|
if (e && e.__esModule)
|
|
return e;
|
|
var n = Object.create(null);
|
|
if (e) {
|
|
Object.keys(e).forEach(function(k) {
|
|
if (k !== "default") {
|
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
Object.defineProperty(n, k, d.get ? d : {
|
|
enumerable: true,
|
|
get: function() {
|
|
return e[k];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
n["default"] = e;
|
|
return Object.freeze(n);
|
|
}
|
|
var React__namespace = /* @__PURE__ */ _interopNamespace(React31);
|
|
var createCache__default = /* @__PURE__ */ _interopDefault(createCache);
|
|
var _extends__default = /* @__PURE__ */ _interopDefault(_extends);
|
|
var weakMemoize__default = /* @__PURE__ */ _interopDefault(weakMemoize);
|
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
var EmotionCacheContext = /* @__PURE__ */ React31.createContext(typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache__default["default"]({
|
|
key: "css"
|
|
}) : null);
|
|
if (true) {
|
|
EmotionCacheContext.displayName = "EmotionCacheContext";
|
|
}
|
|
var CacheProvider = EmotionCacheContext.Provider;
|
|
var __unsafe_useEmotionCache = function useEmotionCache() {
|
|
return React31.useContext(EmotionCacheContext);
|
|
};
|
|
var withEmotionCache = function withEmotionCache2(func) {
|
|
return /* @__PURE__ */ React31.forwardRef(function(props, ref) {
|
|
var cache = React31.useContext(EmotionCacheContext);
|
|
return func(props, cache, ref);
|
|
});
|
|
};
|
|
var ThemeContext = /* @__PURE__ */ React31.createContext({});
|
|
if (true) {
|
|
ThemeContext.displayName = "EmotionThemeContext";
|
|
}
|
|
var useTheme = function useTheme2() {
|
|
return React31.useContext(ThemeContext);
|
|
};
|
|
var getTheme = function getTheme2(outerTheme, theme) {
|
|
if (typeof theme === "function") {
|
|
var mergedTheme = theme(outerTheme);
|
|
if (mergedTheme == null || typeof mergedTheme !== "object" || Array.isArray(mergedTheme)) {
|
|
throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");
|
|
}
|
|
return mergedTheme;
|
|
}
|
|
if (theme == null || typeof theme !== "object" || Array.isArray(theme)) {
|
|
throw new Error("[ThemeProvider] Please make your theme prop a plain object");
|
|
}
|
|
return _extends__default["default"]({}, outerTheme, theme);
|
|
};
|
|
var createCacheWithTheme = /* @__PURE__ */ weakMemoize__default["default"](function(outerTheme) {
|
|
return weakMemoize__default["default"](function(theme) {
|
|
return getTheme(outerTheme, theme);
|
|
});
|
|
});
|
|
var ThemeProvider = function ThemeProvider2(props) {
|
|
var theme = React31.useContext(ThemeContext);
|
|
if (props.theme !== theme) {
|
|
theme = createCacheWithTheme(theme)(props.theme);
|
|
}
|
|
return /* @__PURE__ */ React31.createElement(ThemeContext.Provider, {
|
|
value: theme
|
|
}, props.children);
|
|
};
|
|
function withTheme(Component) {
|
|
var componentName = Component.displayName || Component.name || "Component";
|
|
var render = function render2(props, ref) {
|
|
var theme = React31.useContext(ThemeContext);
|
|
return /* @__PURE__ */ React31.createElement(Component, _extends__default["default"]({
|
|
theme,
|
|
ref
|
|
}, props));
|
|
};
|
|
var WithTheme = /* @__PURE__ */ React31.forwardRef(render);
|
|
WithTheme.displayName = "WithTheme(" + componentName + ")";
|
|
return _isolatedHnrs_dist_emotionReact_isolatedHnrs["default"](WithTheme, Component);
|
|
}
|
|
var getLastPart = function getLastPart2(functionName) {
|
|
var parts = functionName.split(".");
|
|
return parts[parts.length - 1];
|
|
};
|
|
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine2(line) {
|
|
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
if (match)
|
|
return getLastPart(match[1]);
|
|
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
if (match)
|
|
return getLastPart(match[1]);
|
|
return void 0;
|
|
};
|
|
var internalReactFunctionNames = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]);
|
|
var sanitizeIdentifier = function sanitizeIdentifier2(identifier) {
|
|
return identifier.replace(/\$/g, "-");
|
|
};
|
|
var getLabelFromStackTrace = function getLabelFromStackTrace2(stackTrace) {
|
|
if (!stackTrace)
|
|
return void 0;
|
|
var lines = stackTrace.split("\n");
|
|
for (var i = 0; i < lines.length; i++) {
|
|
var functionName = getFunctionNameFromStackTraceLine(lines[i]);
|
|
if (!functionName)
|
|
continue;
|
|
if (internalReactFunctionNames.has(functionName))
|
|
break;
|
|
if (/^[A-Z]/.test(functionName))
|
|
return sanitizeIdentifier(functionName);
|
|
}
|
|
return void 0;
|
|
};
|
|
var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : function useInsertionEffect2(create) {
|
|
create();
|
|
};
|
|
function useInsertionEffectMaybe(create) {
|
|
useInsertionEffect(create);
|
|
}
|
|
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
|
|
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
|
|
var createEmotionProps = function createEmotionProps2(type, props) {
|
|
if (typeof props.css === "string" && props.css.indexOf(":") !== -1) {
|
|
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
|
|
}
|
|
var newProps = {};
|
|
for (var key in props) {
|
|
if (hasOwnProperty.call(props, key)) {
|
|
newProps[key] = props[key];
|
|
}
|
|
}
|
|
newProps[typePropName] = type;
|
|
if (!!props.css && (typeof props.css !== "object" || typeof props.css.name !== "string" || props.css.name.indexOf("-") === -1)) {
|
|
var label = getLabelFromStackTrace(new Error().stack);
|
|
if (label)
|
|
newProps[labelPropName] = label;
|
|
}
|
|
return newProps;
|
|
};
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag;
|
|
utils.registerStyles(cache, serialized, isStringTag);
|
|
var rules = useInsertionEffectMaybe(function() {
|
|
return utils.insertStyles(cache, serialized, isStringTag);
|
|
});
|
|
return null;
|
|
};
|
|
var Emotion = /* @__PURE__ */ withEmotionCache(function(props, cache, ref) {
|
|
var cssProp = props.css;
|
|
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
|
|
cssProp = cache.registered[cssProp];
|
|
}
|
|
var WrappedComponent = props[typePropName];
|
|
var registeredStyles = [cssProp];
|
|
var className = "";
|
|
if (typeof props.className === "string") {
|
|
className = utils.getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serialize.serializeStyles(registeredStyles, void 0, React31.useContext(ThemeContext));
|
|
if (serialized.name.indexOf("-") === -1) {
|
|
var labelFromStack = props[labelPropName];
|
|
if (labelFromStack) {
|
|
serialized = serialize.serializeStyles([serialized, "label:" + labelFromStack + ";"]);
|
|
}
|
|
}
|
|
className += cache.key + "-" + serialized.name;
|
|
var newProps = {};
|
|
for (var key in props) {
|
|
if (hasOwnProperty.call(props, key) && key !== "css" && key !== typePropName && key !== labelPropName) {
|
|
newProps[key] = props[key];
|
|
}
|
|
}
|
|
newProps.ref = ref;
|
|
newProps.className = className;
|
|
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(Insertion, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof WrappedComponent === "string"
|
|
}), /* @__PURE__ */ React31.createElement(WrappedComponent, newProps));
|
|
});
|
|
if (true) {
|
|
Emotion.displayName = "EmotionCssPropInternal";
|
|
}
|
|
exports.CacheProvider = CacheProvider;
|
|
exports.Emotion = Emotion;
|
|
exports.ThemeContext = ThemeContext;
|
|
exports.ThemeProvider = ThemeProvider;
|
|
exports.__unsafe_useEmotionCache = __unsafe_useEmotionCache;
|
|
exports.createEmotionProps = createEmotionProps;
|
|
exports.hasOwnProperty = hasOwnProperty;
|
|
exports.useInsertionEffectMaybe = useInsertionEffectMaybe;
|
|
exports.useTheme = useTheme;
|
|
exports.withEmotionCache = withEmotionCache;
|
|
exports.withTheme = withTheme;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/dist/emotion-react.browser.cjs.js
|
|
var require_emotion_react_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/react/dist/emotion-react.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var React31 = require_react();
|
|
require_emotion_cache_browser_cjs();
|
|
var emotionElement = require_emotion_element_35a1554b_browser_cjs();
|
|
require_extends();
|
|
require_weak_memoize_browser_cjs();
|
|
require_hoist_non_react_statics_cjs();
|
|
require_emotion_react_isolated_hnrs_browser_cjs();
|
|
var utils = require_emotion_utils_browser_cjs();
|
|
var serialize = require_emotion_serialize_browser_cjs();
|
|
function _interopNamespace(e) {
|
|
if (e && e.__esModule)
|
|
return e;
|
|
var n = Object.create(null);
|
|
if (e) {
|
|
Object.keys(e).forEach(function(k) {
|
|
if (k !== "default") {
|
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
Object.defineProperty(n, k, d.get ? d : {
|
|
enumerable: true,
|
|
get: function() {
|
|
return e[k];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
n["default"] = e;
|
|
return Object.freeze(n);
|
|
}
|
|
var React__namespace = /* @__PURE__ */ _interopNamespace(React31);
|
|
var pkg = {
|
|
name: "@emotion/react",
|
|
version: "11.9.0",
|
|
main: "dist/emotion-react.cjs.js",
|
|
module: "dist/emotion-react.esm.js",
|
|
browser: {
|
|
"./dist/emotion-react.cjs.js": "./dist/emotion-react.browser.cjs.js",
|
|
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
|
|
},
|
|
types: "types/index.d.ts",
|
|
files: [
|
|
"src",
|
|
"dist",
|
|
"jsx-runtime",
|
|
"jsx-dev-runtime",
|
|
"_isolated-hnrs",
|
|
"types/*.d.ts",
|
|
"macro.js",
|
|
"macro.d.ts",
|
|
"macro.js.flow"
|
|
],
|
|
sideEffects: false,
|
|
author: "Emotion Contributors",
|
|
license: "MIT",
|
|
scripts: {
|
|
"test:typescript": "dtslint types"
|
|
},
|
|
dependencies: {
|
|
"@babel/runtime": "^7.13.10",
|
|
"@emotion/babel-plugin": "^11.7.1",
|
|
"@emotion/cache": "^11.7.1",
|
|
"@emotion/serialize": "^1.0.3",
|
|
"@emotion/utils": "^1.1.0",
|
|
"@emotion/weak-memoize": "^0.2.5",
|
|
"hoist-non-react-statics": "^3.3.1"
|
|
},
|
|
peerDependencies: {
|
|
"@babel/core": "^7.0.0",
|
|
react: ">=16.8.0"
|
|
},
|
|
peerDependenciesMeta: {
|
|
"@babel/core": {
|
|
optional: true
|
|
},
|
|
"@types/react": {
|
|
optional: true
|
|
}
|
|
},
|
|
devDependencies: {
|
|
"@babel/core": "^7.13.10",
|
|
"@emotion/css": "11.9.0",
|
|
"@emotion/css-prettifier": "1.0.1",
|
|
"@emotion/server": "11.4.0",
|
|
"@emotion/styled": "11.8.1",
|
|
"@types/react": "^16.9.11",
|
|
dtslint: "^4.2.1",
|
|
"html-tag-names": "^1.1.2",
|
|
react: "16.14.0",
|
|
"svg-tag-names": "^1.1.1",
|
|
typescript: "^4.5.5"
|
|
},
|
|
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
publishConfig: {
|
|
access: "public"
|
|
},
|
|
"umd:main": "dist/emotion-react.umd.min.js",
|
|
preconstruct: {
|
|
entrypoints: [
|
|
"./index.js",
|
|
"./jsx-runtime.js",
|
|
"./jsx-dev-runtime.js",
|
|
"./_isolated-hnrs.js"
|
|
],
|
|
umdName: "emotionReact"
|
|
}
|
|
};
|
|
var jsx = function jsx2(type, props) {
|
|
var args = arguments;
|
|
if (props == null || !emotionElement.hasOwnProperty.call(props, "css")) {
|
|
return React31.createElement.apply(void 0, args);
|
|
}
|
|
var argsLength = args.length;
|
|
var createElementArgArray = new Array(argsLength);
|
|
createElementArgArray[0] = emotionElement.Emotion;
|
|
createElementArgArray[1] = emotionElement.createEmotionProps(type, props);
|
|
for (var i = 2; i < argsLength; i++) {
|
|
createElementArgArray[i] = args[i];
|
|
}
|
|
return React31.createElement.apply(null, createElementArgArray);
|
|
};
|
|
var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : React31.useLayoutEffect;
|
|
var warnedAboutCssPropForGlobal = false;
|
|
var Global = /* @__PURE__ */ emotionElement.withEmotionCache(function(props, cache) {
|
|
if (!warnedAboutCssPropForGlobal && (props.className || props.css)) {
|
|
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
warnedAboutCssPropForGlobal = true;
|
|
}
|
|
var styles = props.styles;
|
|
var serialized = serialize.serializeStyles([styles], void 0, React31.useContext(emotionElement.ThemeContext));
|
|
var sheetRef = React31.useRef();
|
|
useInsertionEffect(function() {
|
|
var key = cache.key + "-global";
|
|
var sheet = new cache.sheet.constructor({
|
|
key,
|
|
nonce: cache.sheet.nonce,
|
|
container: cache.sheet.container,
|
|
speedy: cache.sheet.isSpeedy
|
|
});
|
|
var rehydrating = false;
|
|
var node = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
|
|
if (cache.sheet.tags.length) {
|
|
sheet.before = cache.sheet.tags[0];
|
|
}
|
|
if (node !== null) {
|
|
rehydrating = true;
|
|
node.setAttribute("data-emotion", key);
|
|
sheet.hydrate([node]);
|
|
}
|
|
sheetRef.current = [sheet, rehydrating];
|
|
return function() {
|
|
sheet.flush();
|
|
};
|
|
}, [cache]);
|
|
useInsertionEffect(function() {
|
|
var sheetRefCurrent = sheetRef.current;
|
|
var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
|
|
if (rehydrating) {
|
|
sheetRefCurrent[1] = false;
|
|
return;
|
|
}
|
|
if (serialized.next !== void 0) {
|
|
utils.insertStyles(cache, serialized.next, true);
|
|
}
|
|
if (sheet.tags.length) {
|
|
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
sheet.before = element;
|
|
sheet.flush();
|
|
}
|
|
cache.insert("", serialized, sheet, false);
|
|
}, [cache, serialized.name]);
|
|
return null;
|
|
});
|
|
if (true) {
|
|
Global.displayName = "EmotionGlobal";
|
|
}
|
|
function css() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return serialize.serializeStyles(args);
|
|
}
|
|
var keyframes = function keyframes2() {
|
|
var insertable = css.apply(void 0, arguments);
|
|
var name = "animation-" + insertable.name;
|
|
return {
|
|
name,
|
|
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
anim: 1,
|
|
toString: function toString() {
|
|
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
}
|
|
};
|
|
};
|
|
var classnames = function classnames2(args) {
|
|
var len = args.length;
|
|
var i = 0;
|
|
var cls = "";
|
|
for (; i < len; i++) {
|
|
var arg = args[i];
|
|
if (arg == null)
|
|
continue;
|
|
var toAdd = void 0;
|
|
switch (typeof arg) {
|
|
case "boolean":
|
|
break;
|
|
case "object": {
|
|
if (Array.isArray(arg)) {
|
|
toAdd = classnames2(arg);
|
|
} else {
|
|
if (arg.styles !== void 0 && arg.name !== void 0) {
|
|
console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.");
|
|
}
|
|
toAdd = "";
|
|
for (var k in arg) {
|
|
if (arg[k] && k) {
|
|
toAdd && (toAdd += " ");
|
|
toAdd += k;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default: {
|
|
toAdd = arg;
|
|
}
|
|
}
|
|
if (toAdd) {
|
|
cls && (cls += " ");
|
|
cls += toAdd;
|
|
}
|
|
}
|
|
return cls;
|
|
};
|
|
function merge(registered, css2, className) {
|
|
var registeredStyles = [];
|
|
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
|
|
if (registeredStyles.length < 2) {
|
|
return className;
|
|
}
|
|
return rawClassName + css2(registeredStyles);
|
|
}
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serializedArr = _ref.serializedArr;
|
|
var rules = emotionElement.useInsertionEffectMaybe(function() {
|
|
for (var i = 0; i < serializedArr.length; i++) {
|
|
var res = utils.insertStyles(cache, serializedArr[i], false);
|
|
}
|
|
});
|
|
return null;
|
|
};
|
|
var ClassNames = /* @__PURE__ */ emotionElement.withEmotionCache(function(props, cache) {
|
|
var hasRendered = false;
|
|
var serializedArr = [];
|
|
var css2 = function css3() {
|
|
if (hasRendered && true) {
|
|
throw new Error("css can only be used during render");
|
|
}
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
var serialized = serialize.serializeStyles(args, cache.registered);
|
|
serializedArr.push(serialized);
|
|
utils.registerStyles(cache, serialized, false);
|
|
return cache.key + "-" + serialized.name;
|
|
};
|
|
var cx = function cx2() {
|
|
if (hasRendered && true) {
|
|
throw new Error("cx can only be used during render");
|
|
}
|
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
args[_key2] = arguments[_key2];
|
|
}
|
|
return merge(cache.registered, css2, classnames(args));
|
|
};
|
|
var content = {
|
|
css: css2,
|
|
cx,
|
|
theme: React31.useContext(emotionElement.ThemeContext)
|
|
};
|
|
var ele = props.children(content);
|
|
hasRendered = true;
|
|
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(Insertion, {
|
|
cache,
|
|
serializedArr
|
|
}), ele);
|
|
});
|
|
if (true) {
|
|
ClassNames.displayName = "EmotionClassNames";
|
|
}
|
|
if (true) {
|
|
isBrowser = true;
|
|
isJest = typeof jest !== "undefined";
|
|
if (isBrowser && !isJest) {
|
|
globalContext = typeof globalThis !== "undefined" ? globalThis : isBrowser ? window : global;
|
|
globalKey = "__EMOTION_REACT_" + pkg.version.split(".")[0] + "__";
|
|
if (globalContext[globalKey]) {
|
|
console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.");
|
|
}
|
|
globalContext[globalKey] = true;
|
|
}
|
|
}
|
|
var isBrowser;
|
|
var isJest;
|
|
var globalContext;
|
|
var globalKey;
|
|
exports.CacheProvider = emotionElement.CacheProvider;
|
|
exports.ThemeContext = emotionElement.ThemeContext;
|
|
exports.ThemeProvider = emotionElement.ThemeProvider;
|
|
exports.__unsafe_useEmotionCache = emotionElement.__unsafe_useEmotionCache;
|
|
exports.useTheme = emotionElement.useTheme;
|
|
exports.withEmotionCache = emotionElement.withEmotionCache;
|
|
exports.withTheme = emotionElement.withTheme;
|
|
exports.ClassNames = ClassNames;
|
|
exports.Global = Global;
|
|
exports.createElement = jsx;
|
|
exports.css = css;
|
|
exports.jsx = jsx;
|
|
exports.keyframes = keyframes;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.cjs.js
|
|
var require_emotion_styled_base_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var _extends = require_extends();
|
|
var React31 = require_react();
|
|
var isPropValid = require_emotion_is_prop_valid_browser_cjs();
|
|
var react = require_emotion_react_browser_cjs();
|
|
var utils = require_emotion_utils_browser_cjs();
|
|
var serialize = require_emotion_serialize_browser_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
function _interopNamespace(e) {
|
|
if (e && e.__esModule)
|
|
return e;
|
|
var n = Object.create(null);
|
|
if (e) {
|
|
Object.keys(e).forEach(function(k) {
|
|
if (k !== "default") {
|
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
Object.defineProperty(n, k, d.get ? d : {
|
|
enumerable: true,
|
|
get: function() {
|
|
return e[k];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
n["default"] = e;
|
|
return Object.freeze(n);
|
|
}
|
|
var _extends__default = /* @__PURE__ */ _interopDefault(_extends);
|
|
var React__namespace = /* @__PURE__ */ _interopNamespace(React31);
|
|
var isPropValid__default = /* @__PURE__ */ _interopDefault(isPropValid);
|
|
var testOmitPropsOnStringTag = isPropValid__default["default"];
|
|
var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
|
|
return key !== "theme";
|
|
};
|
|
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
|
|
return typeof tag === "string" && tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
};
|
|
var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
|
|
var shouldForwardProp;
|
|
if (options) {
|
|
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
|
|
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
} : optionsShouldForwardProp;
|
|
}
|
|
if (typeof shouldForwardProp !== "function" && isReal) {
|
|
shouldForwardProp = tag.__emotion_forwardProp;
|
|
}
|
|
return shouldForwardProp;
|
|
};
|
|
var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : function useInsertionEffect2(create) {
|
|
create();
|
|
};
|
|
function useInsertionEffectMaybe(create) {
|
|
useInsertionEffect(create);
|
|
}
|
|
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
|
|
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
You can read more about this here:
|
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag;
|
|
utils.registerStyles(cache, serialized, isStringTag);
|
|
var rules = useInsertionEffectMaybe(function() {
|
|
return utils.insertStyles(cache, serialized, isStringTag);
|
|
});
|
|
return null;
|
|
};
|
|
var createStyled = function createStyled2(tag, options) {
|
|
if (true) {
|
|
if (tag === void 0) {
|
|
throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");
|
|
}
|
|
}
|
|
var isReal = tag.__emotion_real === tag;
|
|
var baseTag = isReal && tag.__emotion_base || tag;
|
|
var identifierName;
|
|
var targetClassName;
|
|
if (options !== void 0) {
|
|
identifierName = options.label;
|
|
targetClassName = options.target;
|
|
}
|
|
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
var shouldUseAs = !defaultShouldForwardProp("as");
|
|
return function() {
|
|
var args = arguments;
|
|
var styles = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
|
|
if (identifierName !== void 0) {
|
|
styles.push("label:" + identifierName + ";");
|
|
}
|
|
if (args[0] == null || args[0].raw === void 0) {
|
|
styles.push.apply(styles, args);
|
|
} else {
|
|
if (args[0][0] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles.push(args[0][0]);
|
|
var len = args.length;
|
|
var i = 1;
|
|
for (; i < len; i++) {
|
|
if (args[0][i] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles.push(args[i], args[0][i]);
|
|
}
|
|
}
|
|
var Styled = react.withEmotionCache(function(props, cache, ref) {
|
|
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
var className = "";
|
|
var classInterpolations = [];
|
|
var mergedProps = props;
|
|
if (props.theme == null) {
|
|
mergedProps = {};
|
|
for (var key in props) {
|
|
mergedProps[key] = props[key];
|
|
}
|
|
mergedProps.theme = React31.useContext(react.ThemeContext);
|
|
}
|
|
if (typeof props.className === "string") {
|
|
className = utils.getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serialize.serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
className += cache.key + "-" + serialized.name;
|
|
if (targetClassName !== void 0) {
|
|
className += " " + targetClassName;
|
|
}
|
|
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
var newProps = {};
|
|
for (var _key in props) {
|
|
if (shouldUseAs && _key === "as")
|
|
continue;
|
|
if (finalShouldForwardProp(_key)) {
|
|
newProps[_key] = props[_key];
|
|
}
|
|
}
|
|
newProps.className = className;
|
|
newProps.ref = ref;
|
|
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(Insertion, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof FinalTag === "string"
|
|
}), /* @__PURE__ */ React31.createElement(FinalTag, newProps));
|
|
});
|
|
Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
|
|
Styled.defaultProps = tag.defaultProps;
|
|
Styled.__emotion_real = Styled;
|
|
Styled.__emotion_base = baseTag;
|
|
Styled.__emotion_styles = styles;
|
|
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
Object.defineProperty(Styled, "toString", {
|
|
value: function value() {
|
|
if (targetClassName === void 0 && true) {
|
|
return "NO_COMPONENT_SELECTOR";
|
|
}
|
|
return "." + targetClassName;
|
|
}
|
|
});
|
|
Styled.withComponent = function(nextTag, nextOptions) {
|
|
return createStyled2(nextTag, _extends__default["default"]({}, options, nextOptions, {
|
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
})).apply(void 0, styles);
|
|
};
|
|
return Styled;
|
|
};
|
|
};
|
|
exports.default = createStyled;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/styled/dist/emotion-styled.browser.cjs.js
|
|
var require_emotion_styled_browser_cjs = __commonJS({
|
|
"node_modules/@emotion/styled/dist/emotion-styled.browser.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require_extends();
|
|
require_react();
|
|
require_emotion_is_prop_valid_browser_cjs();
|
|
var base_dist_emotionStyledBase = require_emotion_styled_base_browser_cjs();
|
|
require_emotion_react_browser_cjs();
|
|
require_emotion_utils_browser_cjs();
|
|
require_emotion_serialize_browser_cjs();
|
|
var tags = [
|
|
"a",
|
|
"abbr",
|
|
"address",
|
|
"area",
|
|
"article",
|
|
"aside",
|
|
"audio",
|
|
"b",
|
|
"base",
|
|
"bdi",
|
|
"bdo",
|
|
"big",
|
|
"blockquote",
|
|
"body",
|
|
"br",
|
|
"button",
|
|
"canvas",
|
|
"caption",
|
|
"cite",
|
|
"code",
|
|
"col",
|
|
"colgroup",
|
|
"data",
|
|
"datalist",
|
|
"dd",
|
|
"del",
|
|
"details",
|
|
"dfn",
|
|
"dialog",
|
|
"div",
|
|
"dl",
|
|
"dt",
|
|
"em",
|
|
"embed",
|
|
"fieldset",
|
|
"figcaption",
|
|
"figure",
|
|
"footer",
|
|
"form",
|
|
"h1",
|
|
"h2",
|
|
"h3",
|
|
"h4",
|
|
"h5",
|
|
"h6",
|
|
"head",
|
|
"header",
|
|
"hgroup",
|
|
"hr",
|
|
"html",
|
|
"i",
|
|
"iframe",
|
|
"img",
|
|
"input",
|
|
"ins",
|
|
"kbd",
|
|
"keygen",
|
|
"label",
|
|
"legend",
|
|
"li",
|
|
"link",
|
|
"main",
|
|
"map",
|
|
"mark",
|
|
"marquee",
|
|
"menu",
|
|
"menuitem",
|
|
"meta",
|
|
"meter",
|
|
"nav",
|
|
"noscript",
|
|
"object",
|
|
"ol",
|
|
"optgroup",
|
|
"option",
|
|
"output",
|
|
"p",
|
|
"param",
|
|
"picture",
|
|
"pre",
|
|
"progress",
|
|
"q",
|
|
"rp",
|
|
"rt",
|
|
"ruby",
|
|
"s",
|
|
"samp",
|
|
"script",
|
|
"section",
|
|
"select",
|
|
"small",
|
|
"source",
|
|
"span",
|
|
"strong",
|
|
"style",
|
|
"sub",
|
|
"summary",
|
|
"sup",
|
|
"table",
|
|
"tbody",
|
|
"td",
|
|
"textarea",
|
|
"tfoot",
|
|
"th",
|
|
"thead",
|
|
"time",
|
|
"title",
|
|
"tr",
|
|
"track",
|
|
"u",
|
|
"ul",
|
|
"var",
|
|
"video",
|
|
"wbr",
|
|
"circle",
|
|
"clipPath",
|
|
"defs",
|
|
"ellipse",
|
|
"foreignObject",
|
|
"g",
|
|
"image",
|
|
"line",
|
|
"linearGradient",
|
|
"mask",
|
|
"path",
|
|
"pattern",
|
|
"polygon",
|
|
"polyline",
|
|
"radialGradient",
|
|
"rect",
|
|
"stop",
|
|
"svg",
|
|
"text",
|
|
"tspan"
|
|
];
|
|
var newStyled = base_dist_emotionStyledBase["default"].bind();
|
|
tags.forEach(function(tagName) {
|
|
newStyled[tagName] = newStyled(tagName);
|
|
});
|
|
exports.default = newStyled;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/node/StyledEngineProvider/StyledEngineProvider.js
|
|
var require_StyledEngineProvider = __commonJS({
|
|
"node_modules/@mui/styled-engine/node/StyledEngineProvider/StyledEngineProvider.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = StyledEngineProvider;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _react2 = require_emotion_react_browser_cjs();
|
|
var _cache = _interopRequireDefault(require_emotion_cache_browser_cjs());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache2 = _getRequireWildcardCache(nodeInterop);
|
|
if (cache2 && cache2.has(obj)) {
|
|
return cache2.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache2) {
|
|
cache2.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var cache = (0, _cache.default)({
|
|
key: "css",
|
|
prepend: true
|
|
});
|
|
function StyledEngineProvider(props) {
|
|
const {
|
|
injectFirst,
|
|
children
|
|
} = props;
|
|
return injectFirst ? /* @__PURE__ */ (0, _jsxRuntime.jsx)(_react2.CacheProvider, {
|
|
value: cache,
|
|
children
|
|
}) : children;
|
|
}
|
|
true ? StyledEngineProvider.propTypes = {
|
|
children: _propTypes.default.node,
|
|
injectFirst: _propTypes.default.bool
|
|
} : void 0;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/node/StyledEngineProvider/index.js
|
|
var require_StyledEngineProvider2 = __commonJS({
|
|
"node_modules/@mui/styled-engine/node/StyledEngineProvider/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _StyledEngineProvider.default;
|
|
}
|
|
});
|
|
var _StyledEngineProvider = _interopRequireDefault(require_StyledEngineProvider());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/node/GlobalStyles/GlobalStyles.js
|
|
var require_GlobalStyles = __commonJS({
|
|
"node_modules/@mui/styled-engine/node/GlobalStyles/GlobalStyles.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = GlobalStyles;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _react2 = require_emotion_react_browser_cjs();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function isEmpty(obj) {
|
|
return obj === void 0 || obj === null || Object.keys(obj).length === 0;
|
|
}
|
|
function GlobalStyles(props) {
|
|
const {
|
|
styles,
|
|
defaultTheme = {}
|
|
} = props;
|
|
const globalStyles = typeof styles === "function" ? (themeInput) => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_react2.Global, {
|
|
styles: globalStyles
|
|
});
|
|
}
|
|
true ? GlobalStyles.propTypes = {
|
|
defaultTheme: _propTypes.default.object,
|
|
styles: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.func])
|
|
} : void 0;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/node/GlobalStyles/index.js
|
|
var require_GlobalStyles2 = __commonJS({
|
|
"node_modules/@mui/styled-engine/node/GlobalStyles/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _GlobalStyles.default;
|
|
}
|
|
});
|
|
var _GlobalStyles = _interopRequireDefault(require_GlobalStyles());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/styled-engine/node/index.js
|
|
var require_node3 = __commonJS({
|
|
"node_modules/@mui/styled-engine/node/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "GlobalStyles", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _GlobalStyles.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "StyledEngineProvider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _StyledEngineProvider.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ThemeContext", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _react.ThemeContext;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "css", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _react.css;
|
|
}
|
|
});
|
|
exports.default = styled;
|
|
Object.defineProperty(exports, "keyframes", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _react.keyframes;
|
|
}
|
|
});
|
|
var _styled = _interopRequireDefault(require_emotion_styled_browser_cjs());
|
|
var _react = require_emotion_react_browser_cjs();
|
|
var _StyledEngineProvider = _interopRequireDefault(require_StyledEngineProvider2());
|
|
var _GlobalStyles = _interopRequireDefault(require_GlobalStyles2());
|
|
function styled(tag, options) {
|
|
const stylesFactory = (0, _styled.default)(tag, options);
|
|
if (true) {
|
|
return (...styles) => {
|
|
const component = typeof tag === "string" ? `"${tag}"` : "component";
|
|
if (styles.length === 0) {
|
|
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n"));
|
|
} else if (styles.some((style) => style === void 0)) {
|
|
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
}
|
|
return stylesFactory(...styles);
|
|
};
|
|
}
|
|
return stylesFactory;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/responsivePropType.js
|
|
var require_responsivePropType = __commonJS({
|
|
"node_modules/@mui/system/responsivePropType.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var responsivePropType = true ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.object, _propTypes.default.array]) : {};
|
|
var _default = responsivePropType;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/merge.js
|
|
var require_merge = __commonJS({
|
|
"node_modules/@mui/system/merge.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
function merge(acc, item) {
|
|
if (!item) {
|
|
return acc;
|
|
}
|
|
return (0, _utils.deepmerge)(acc, item, {
|
|
clone: false
|
|
});
|
|
}
|
|
var _default = merge;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/breakpoints.js
|
|
var require_breakpoints = __commonJS({
|
|
"node_modules/@mui/system/breakpoints.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.computeBreakpointsBase = computeBreakpointsBase;
|
|
exports.createEmptyBreakpointObject = createEmptyBreakpointObject;
|
|
exports.default = void 0;
|
|
exports.handleBreakpoints = handleBreakpoints;
|
|
exports.mergeBreakpointsInOrder = mergeBreakpointsInOrder;
|
|
exports.removeUnusedBreakpoints = removeUnusedBreakpoints;
|
|
exports.resolveBreakpointValues = resolveBreakpointValues;
|
|
exports.values = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _merge = _interopRequireDefault(require_merge());
|
|
var values = {
|
|
xs: 0,
|
|
sm: 600,
|
|
md: 900,
|
|
lg: 1200,
|
|
xl: 1536
|
|
};
|
|
exports.values = values;
|
|
var defaultBreakpoints = {
|
|
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
up: (key) => `@media (min-width:${values[key]}px)`
|
|
};
|
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
const theme = props.theme || {};
|
|
if (Array.isArray(propValue)) {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return propValue.reduce((acc, item, index) => {
|
|
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
if (typeof propValue === "object") {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
} else {
|
|
const cssKey = breakpoint;
|
|
acc[cssKey] = propValue[cssKey];
|
|
}
|
|
return acc;
|
|
}, {});
|
|
}
|
|
const output = styleFromPropValue(propValue);
|
|
return output;
|
|
}
|
|
function breakpoints(styleFunction) {
|
|
const newStyleFunction = (props) => {
|
|
const theme = props.theme || {};
|
|
const base = styleFunction(props);
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
const extended = themeBreakpoints.keys.reduce((acc, key) => {
|
|
if (props[key]) {
|
|
acc = acc || {};
|
|
acc[themeBreakpoints.up(key)] = styleFunction((0, _extends2.default)({
|
|
theme
|
|
}, props[key]));
|
|
}
|
|
return acc;
|
|
}, null);
|
|
return (0, _merge.default)(base, extended);
|
|
};
|
|
newStyleFunction.propTypes = true ? (0, _extends2.default)({}, styleFunction.propTypes, {
|
|
xs: _propTypes.default.object,
|
|
sm: _propTypes.default.object,
|
|
md: _propTypes.default.object,
|
|
lg: _propTypes.default.object,
|
|
xl: _propTypes.default.object
|
|
}) : {};
|
|
newStyleFunction.filterProps = ["xs", "sm", "md", "lg", "xl", ...styleFunction.filterProps];
|
|
return newStyleFunction;
|
|
}
|
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
var _breakpointsInput$key;
|
|
const breakpointsInOrder = breakpointsInput == null ? void 0 : (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
acc[breakpointStyleKey] = {};
|
|
return acc;
|
|
}, {});
|
|
return breakpointsInOrder || {};
|
|
}
|
|
function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
return breakpointKeys.reduce((acc, key) => {
|
|
const breakpointOutput = acc[key];
|
|
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
if (isBreakpointUnused) {
|
|
delete acc[key];
|
|
}
|
|
return acc;
|
|
}, style);
|
|
}
|
|
function mergeBreakpointsInOrder(breakpointsInput, ...styles) {
|
|
const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);
|
|
const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => (0, _utils.deepmerge)(prev, next), {});
|
|
return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);
|
|
}
|
|
function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
|
|
if (typeof breakpointValues !== "object") {
|
|
return {};
|
|
}
|
|
const base = {};
|
|
const breakpointsKeys = Object.keys(themeBreakpoints);
|
|
if (Array.isArray(breakpointValues)) {
|
|
breakpointsKeys.forEach((breakpoint, i) => {
|
|
if (i < breakpointValues.length) {
|
|
base[breakpoint] = true;
|
|
}
|
|
});
|
|
} else {
|
|
breakpointsKeys.forEach((breakpoint) => {
|
|
if (breakpointValues[breakpoint] != null) {
|
|
base[breakpoint] = true;
|
|
}
|
|
});
|
|
}
|
|
return base;
|
|
}
|
|
function resolveBreakpointValues({
|
|
values: breakpointValues,
|
|
breakpoints: themeBreakpoints,
|
|
base: customBase
|
|
}) {
|
|
const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);
|
|
const keys = Object.keys(base);
|
|
if (keys.length === 0) {
|
|
return breakpointValues;
|
|
}
|
|
let previous;
|
|
return keys.reduce((acc, breakpoint, i) => {
|
|
if (Array.isArray(breakpointValues)) {
|
|
acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
|
|
previous = i;
|
|
} else {
|
|
acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;
|
|
previous = breakpoint;
|
|
}
|
|
return acc;
|
|
}, {});
|
|
}
|
|
var _default = breakpoints;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/style.js
|
|
var require_style = __commonJS({
|
|
"node_modules/@mui/system/style.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getPath = getPath;
|
|
var _utils = require_utils();
|
|
var _responsivePropType = _interopRequireDefault(require_responsivePropType());
|
|
var _breakpoints = require_breakpoints();
|
|
function getPath(obj, path) {
|
|
if (!path || typeof path !== "string") {
|
|
return null;
|
|
}
|
|
return path.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
}
|
|
function getValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
let value;
|
|
if (typeof themeMapping === "function") {
|
|
value = themeMapping(propValueFinal);
|
|
} else if (Array.isArray(themeMapping)) {
|
|
value = themeMapping[propValueFinal] || userValue;
|
|
} else {
|
|
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
}
|
|
if (transform) {
|
|
value = transform(value);
|
|
}
|
|
return value;
|
|
}
|
|
function style(options) {
|
|
const {
|
|
prop,
|
|
cssProperty = options.prop,
|
|
themeKey,
|
|
transform
|
|
} = options;
|
|
const fn = (props) => {
|
|
if (props[prop] == null) {
|
|
return null;
|
|
}
|
|
const propValue = props[prop];
|
|
const theme = props.theme;
|
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
const styleFromPropValue = (propValueFinal) => {
|
|
let value = getValue(themeMapping, transform, propValueFinal);
|
|
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
value = getValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : (0, _utils.unstable_capitalize)(propValueFinal)}`, propValueFinal);
|
|
}
|
|
if (cssProperty === false) {
|
|
return value;
|
|
}
|
|
return {
|
|
[cssProperty]: value
|
|
};
|
|
};
|
|
return (0, _breakpoints.handleBreakpoints)(props, propValue, styleFromPropValue);
|
|
};
|
|
fn.propTypes = true ? {
|
|
[prop]: _responsivePropType.default
|
|
} : {};
|
|
fn.filterProps = [prop];
|
|
return fn;
|
|
}
|
|
var _default = style;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/compose.js
|
|
var require_compose = __commonJS({
|
|
"node_modules/@mui/system/compose.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _merge = _interopRequireDefault(require_merge());
|
|
function compose(...styles) {
|
|
const handlers = styles.reduce((acc, style) => {
|
|
style.filterProps.forEach((prop) => {
|
|
acc[prop] = style;
|
|
});
|
|
return acc;
|
|
}, {});
|
|
const fn = (props) => {
|
|
return Object.keys(props).reduce((acc, prop) => {
|
|
if (handlers[prop]) {
|
|
return (0, _merge.default)(acc, handlers[prop](props));
|
|
}
|
|
return acc;
|
|
}, {});
|
|
};
|
|
fn.propTypes = true ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};
|
|
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
|
return fn;
|
|
}
|
|
var _default = compose;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/memoize.js
|
|
var require_memoize = __commonJS({
|
|
"node_modules/@mui/system/memoize.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = memoize;
|
|
function memoize(fn) {
|
|
const cache = {};
|
|
return (arg) => {
|
|
if (cache[arg] === void 0) {
|
|
cache[arg] = fn(arg);
|
|
}
|
|
return cache[arg];
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/spacing.js
|
|
var require_spacing = __commonJS({
|
|
"node_modules/@mui/system/spacing.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.createUnarySpacing = createUnarySpacing;
|
|
exports.createUnaryUnit = createUnaryUnit;
|
|
exports.default = void 0;
|
|
exports.getStyleFromPropValue = getStyleFromPropValue;
|
|
exports.getValue = getValue;
|
|
exports.margin = margin;
|
|
exports.padding = padding;
|
|
var _responsivePropType = _interopRequireDefault(require_responsivePropType());
|
|
var _breakpoints = require_breakpoints();
|
|
var _style = require_style();
|
|
var _merge = _interopRequireDefault(require_merge());
|
|
var _memoize = _interopRequireDefault(require_memoize());
|
|
var properties = {
|
|
m: "margin",
|
|
p: "padding"
|
|
};
|
|
var directions = {
|
|
t: "Top",
|
|
r: "Right",
|
|
b: "Bottom",
|
|
l: "Left",
|
|
x: ["Left", "Right"],
|
|
y: ["Top", "Bottom"]
|
|
};
|
|
var aliases = {
|
|
marginX: "mx",
|
|
marginY: "my",
|
|
paddingX: "px",
|
|
paddingY: "py"
|
|
};
|
|
var getCssProperties = (0, _memoize.default)((prop) => {
|
|
if (prop.length > 2) {
|
|
if (aliases[prop]) {
|
|
prop = aliases[prop];
|
|
} else {
|
|
return [prop];
|
|
}
|
|
}
|
|
const [a, b] = prop.split("");
|
|
const property = properties[a];
|
|
const direction = directions[b] || "";
|
|
return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
});
|
|
var marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
|
|
var paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
var spacingKeys = [...marginKeys, ...paddingKeys];
|
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
const themeSpacing = (0, _style.getPath)(theme, themeKey) || defaultValue;
|
|
if (typeof themeSpacing === "number") {
|
|
return (abs) => {
|
|
if (typeof abs === "string") {
|
|
return abs;
|
|
}
|
|
if (true) {
|
|
if (typeof abs !== "number") {
|
|
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
}
|
|
}
|
|
return themeSpacing * abs;
|
|
};
|
|
}
|
|
if (Array.isArray(themeSpacing)) {
|
|
return (abs) => {
|
|
if (typeof abs === "string") {
|
|
return abs;
|
|
}
|
|
if (true) {
|
|
if (!Number.isInteger(abs)) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join("\n"));
|
|
} else if (abs > themeSpacing.length - 1) {
|
|
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join("\n"));
|
|
}
|
|
}
|
|
return themeSpacing[abs];
|
|
};
|
|
}
|
|
if (typeof themeSpacing === "function") {
|
|
return themeSpacing;
|
|
}
|
|
if (true) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, "It should be a number, an array or a function."].join("\n"));
|
|
}
|
|
return () => void 0;
|
|
}
|
|
function createUnarySpacing(theme) {
|
|
return createUnaryUnit(theme, "spacing", 8, "spacing");
|
|
}
|
|
function getValue(transformer, propValue) {
|
|
if (typeof propValue === "string" || propValue == null) {
|
|
return propValue;
|
|
}
|
|
const abs = Math.abs(propValue);
|
|
const transformed = transformer(abs);
|
|
if (propValue >= 0) {
|
|
return transformed;
|
|
}
|
|
if (typeof transformed === "number") {
|
|
return -transformed;
|
|
}
|
|
return `-${transformed}`;
|
|
}
|
|
function getStyleFromPropValue(cssProperties, transformer) {
|
|
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
acc[cssProperty] = getValue(transformer, propValue);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
function resolveCssProperty(props, keys, prop, transformer) {
|
|
if (keys.indexOf(prop) === -1) {
|
|
return null;
|
|
}
|
|
const cssProperties = getCssProperties(prop);
|
|
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
const propValue = props[prop];
|
|
return (0, _breakpoints.handleBreakpoints)(props, propValue, styleFromPropValue);
|
|
}
|
|
function style(props, keys) {
|
|
const transformer = createUnarySpacing(props.theme);
|
|
return Object.keys(props).map((prop) => resolveCssProperty(props, keys, prop, transformer)).reduce(_merge.default, {});
|
|
}
|
|
function margin(props) {
|
|
return style(props, marginKeys);
|
|
}
|
|
margin.propTypes = true ? marginKeys.reduce((obj, key) => {
|
|
obj[key] = _responsivePropType.default;
|
|
return obj;
|
|
}, {}) : {};
|
|
margin.filterProps = marginKeys;
|
|
function padding(props) {
|
|
return style(props, paddingKeys);
|
|
}
|
|
padding.propTypes = true ? paddingKeys.reduce((obj, key) => {
|
|
obj[key] = _responsivePropType.default;
|
|
return obj;
|
|
}, {}) : {};
|
|
padding.filterProps = paddingKeys;
|
|
function spacing(props) {
|
|
return style(props, spacingKeys);
|
|
}
|
|
spacing.propTypes = true ? spacingKeys.reduce((obj, key) => {
|
|
obj[key] = _responsivePropType.default;
|
|
return obj;
|
|
}, {}) : {};
|
|
spacing.filterProps = spacingKeys;
|
|
var _default = spacing;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/borders.js
|
|
var require_borders = __commonJS({
|
|
"node_modules/@mui/system/borders.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = exports.borderTopColor = exports.borderTop = exports.borderRightColor = exports.borderRight = exports.borderRadius = exports.borderLeftColor = exports.borderLeft = exports.borderColor = exports.borderBottomColor = exports.borderBottom = exports.border = void 0;
|
|
var _responsivePropType = _interopRequireDefault(require_responsivePropType());
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var _spacing = require_spacing();
|
|
var _breakpoints = require_breakpoints();
|
|
function getBorder(value) {
|
|
if (typeof value !== "number") {
|
|
return value;
|
|
}
|
|
return `${value}px solid`;
|
|
}
|
|
var border = (0, _style.default)({
|
|
prop: "border",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
exports.border = border;
|
|
var borderTop = (0, _style.default)({
|
|
prop: "borderTop",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
exports.borderTop = borderTop;
|
|
var borderRight = (0, _style.default)({
|
|
prop: "borderRight",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
exports.borderRight = borderRight;
|
|
var borderBottom = (0, _style.default)({
|
|
prop: "borderBottom",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
exports.borderBottom = borderBottom;
|
|
var borderLeft = (0, _style.default)({
|
|
prop: "borderLeft",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
exports.borderLeft = borderLeft;
|
|
var borderColor = (0, _style.default)({
|
|
prop: "borderColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.borderColor = borderColor;
|
|
var borderTopColor = (0, _style.default)({
|
|
prop: "borderTopColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.borderTopColor = borderTopColor;
|
|
var borderRightColor = (0, _style.default)({
|
|
prop: "borderRightColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.borderRightColor = borderRightColor;
|
|
var borderBottomColor = (0, _style.default)({
|
|
prop: "borderBottomColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.borderBottomColor = borderBottomColor;
|
|
var borderLeftColor = (0, _style.default)({
|
|
prop: "borderLeftColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.borderLeftColor = borderLeftColor;
|
|
var borderRadius = (props) => {
|
|
if (props.borderRadius !== void 0 && props.borderRadius !== null) {
|
|
const transformer = (0, _spacing.createUnaryUnit)(props.theme, "shape.borderRadius", 4, "borderRadius");
|
|
const styleFromPropValue = (propValue) => ({
|
|
borderRadius: (0, _spacing.getValue)(transformer, propValue)
|
|
});
|
|
return (0, _breakpoints.handleBreakpoints)(props, props.borderRadius, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
exports.borderRadius = borderRadius;
|
|
borderRadius.propTypes = true ? {
|
|
borderRadius: _responsivePropType.default
|
|
} : {};
|
|
borderRadius.filterProps = ["borderRadius"];
|
|
var borders = (0, _compose.default)(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
var _default = borders;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/display.js
|
|
var require_display = __commonJS({
|
|
"node_modules/@mui/system/display.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.whiteSpace = exports.visibility = exports.textOverflow = exports.overflow = exports.displayRaw = exports.displayPrint = exports.default = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var displayPrint = (0, _style.default)({
|
|
prop: "displayPrint",
|
|
cssProperty: false,
|
|
transform: (value) => ({
|
|
"@media print": {
|
|
display: value
|
|
}
|
|
})
|
|
});
|
|
exports.displayPrint = displayPrint;
|
|
var displayRaw = (0, _style.default)({
|
|
prop: "display"
|
|
});
|
|
exports.displayRaw = displayRaw;
|
|
var overflow = (0, _style.default)({
|
|
prop: "overflow"
|
|
});
|
|
exports.overflow = overflow;
|
|
var textOverflow = (0, _style.default)({
|
|
prop: "textOverflow"
|
|
});
|
|
exports.textOverflow = textOverflow;
|
|
var visibility = (0, _style.default)({
|
|
prop: "visibility"
|
|
});
|
|
exports.visibility = visibility;
|
|
var whiteSpace = (0, _style.default)({
|
|
prop: "whiteSpace"
|
|
});
|
|
exports.whiteSpace = whiteSpace;
|
|
var _default = (0, _compose.default)(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/flexbox.js
|
|
var require_flexbox = __commonJS({
|
|
"node_modules/@mui/system/flexbox.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.order = exports.justifySelf = exports.justifyItems = exports.justifyContent = exports.flexWrap = exports.flexShrink = exports.flexGrow = exports.flexDirection = exports.flexBasis = exports.flex = exports.default = exports.alignSelf = exports.alignItems = exports.alignContent = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var flexBasis = (0, _style.default)({
|
|
prop: "flexBasis"
|
|
});
|
|
exports.flexBasis = flexBasis;
|
|
var flexDirection = (0, _style.default)({
|
|
prop: "flexDirection"
|
|
});
|
|
exports.flexDirection = flexDirection;
|
|
var flexWrap = (0, _style.default)({
|
|
prop: "flexWrap"
|
|
});
|
|
exports.flexWrap = flexWrap;
|
|
var justifyContent = (0, _style.default)({
|
|
prop: "justifyContent"
|
|
});
|
|
exports.justifyContent = justifyContent;
|
|
var alignItems = (0, _style.default)({
|
|
prop: "alignItems"
|
|
});
|
|
exports.alignItems = alignItems;
|
|
var alignContent = (0, _style.default)({
|
|
prop: "alignContent"
|
|
});
|
|
exports.alignContent = alignContent;
|
|
var order = (0, _style.default)({
|
|
prop: "order"
|
|
});
|
|
exports.order = order;
|
|
var flex = (0, _style.default)({
|
|
prop: "flex"
|
|
});
|
|
exports.flex = flex;
|
|
var flexGrow = (0, _style.default)({
|
|
prop: "flexGrow"
|
|
});
|
|
exports.flexGrow = flexGrow;
|
|
var flexShrink = (0, _style.default)({
|
|
prop: "flexShrink"
|
|
});
|
|
exports.flexShrink = flexShrink;
|
|
var alignSelf = (0, _style.default)({
|
|
prop: "alignSelf"
|
|
});
|
|
exports.alignSelf = alignSelf;
|
|
var justifyItems = (0, _style.default)({
|
|
prop: "justifyItems"
|
|
});
|
|
exports.justifyItems = justifyItems;
|
|
var justifySelf = (0, _style.default)({
|
|
prop: "justifySelf"
|
|
});
|
|
exports.justifySelf = justifySelf;
|
|
var flexbox = (0, _compose.default)(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
|
|
var _default = flexbox;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/grid.js
|
|
var require_grid = __commonJS({
|
|
"node_modules/@mui/system/grid.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.rowGap = exports.gridTemplateRows = exports.gridTemplateColumns = exports.gridTemplateAreas = exports.gridRow = exports.gridColumn = exports.gridAutoRows = exports.gridAutoFlow = exports.gridAutoColumns = exports.gridArea = exports.gap = exports.default = exports.columnGap = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var _spacing = require_spacing();
|
|
var _breakpoints = require_breakpoints();
|
|
var _responsivePropType = _interopRequireDefault(require_responsivePropType());
|
|
var gap = (props) => {
|
|
if (props.gap !== void 0 && props.gap !== null) {
|
|
const transformer = (0, _spacing.createUnaryUnit)(props.theme, "spacing", 8, "gap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
gap: (0, _spacing.getValue)(transformer, propValue)
|
|
});
|
|
return (0, _breakpoints.handleBreakpoints)(props, props.gap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
exports.gap = gap;
|
|
gap.propTypes = true ? {
|
|
gap: _responsivePropType.default
|
|
} : {};
|
|
gap.filterProps = ["gap"];
|
|
var columnGap = (props) => {
|
|
if (props.columnGap !== void 0 && props.columnGap !== null) {
|
|
const transformer = (0, _spacing.createUnaryUnit)(props.theme, "spacing", 8, "columnGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
columnGap: (0, _spacing.getValue)(transformer, propValue)
|
|
});
|
|
return (0, _breakpoints.handleBreakpoints)(props, props.columnGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
exports.columnGap = columnGap;
|
|
columnGap.propTypes = true ? {
|
|
columnGap: _responsivePropType.default
|
|
} : {};
|
|
columnGap.filterProps = ["columnGap"];
|
|
var rowGap = (props) => {
|
|
if (props.rowGap !== void 0 && props.rowGap !== null) {
|
|
const transformer = (0, _spacing.createUnaryUnit)(props.theme, "spacing", 8, "rowGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
rowGap: (0, _spacing.getValue)(transformer, propValue)
|
|
});
|
|
return (0, _breakpoints.handleBreakpoints)(props, props.rowGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
exports.rowGap = rowGap;
|
|
rowGap.propTypes = true ? {
|
|
rowGap: _responsivePropType.default
|
|
} : {};
|
|
rowGap.filterProps = ["rowGap"];
|
|
var gridColumn = (0, _style.default)({
|
|
prop: "gridColumn"
|
|
});
|
|
exports.gridColumn = gridColumn;
|
|
var gridRow = (0, _style.default)({
|
|
prop: "gridRow"
|
|
});
|
|
exports.gridRow = gridRow;
|
|
var gridAutoFlow = (0, _style.default)({
|
|
prop: "gridAutoFlow"
|
|
});
|
|
exports.gridAutoFlow = gridAutoFlow;
|
|
var gridAutoColumns = (0, _style.default)({
|
|
prop: "gridAutoColumns"
|
|
});
|
|
exports.gridAutoColumns = gridAutoColumns;
|
|
var gridAutoRows = (0, _style.default)({
|
|
prop: "gridAutoRows"
|
|
});
|
|
exports.gridAutoRows = gridAutoRows;
|
|
var gridTemplateColumns = (0, _style.default)({
|
|
prop: "gridTemplateColumns"
|
|
});
|
|
exports.gridTemplateColumns = gridTemplateColumns;
|
|
var gridTemplateRows = (0, _style.default)({
|
|
prop: "gridTemplateRows"
|
|
});
|
|
exports.gridTemplateRows = gridTemplateRows;
|
|
var gridTemplateAreas = (0, _style.default)({
|
|
prop: "gridTemplateAreas"
|
|
});
|
|
exports.gridTemplateAreas = gridTemplateAreas;
|
|
var gridArea = (0, _style.default)({
|
|
prop: "gridArea"
|
|
});
|
|
exports.gridArea = gridArea;
|
|
var grid = (0, _compose.default)(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
var _default = grid;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/palette.js
|
|
var require_palette = __commonJS({
|
|
"node_modules/@mui/system/palette.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = exports.color = exports.bgcolor = exports.backgroundColor = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var color = (0, _style.default)({
|
|
prop: "color",
|
|
themeKey: "palette"
|
|
});
|
|
exports.color = color;
|
|
var bgcolor = (0, _style.default)({
|
|
prop: "bgcolor",
|
|
cssProperty: "backgroundColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.bgcolor = bgcolor;
|
|
var backgroundColor = (0, _style.default)({
|
|
prop: "backgroundColor",
|
|
themeKey: "palette"
|
|
});
|
|
exports.backgroundColor = backgroundColor;
|
|
var palette = (0, _compose.default)(color, bgcolor, backgroundColor);
|
|
var _default = palette;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/positions.js
|
|
var require_positions = __commonJS({
|
|
"node_modules/@mui/system/positions.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.zIndex = exports.top = exports.right = exports.position = exports.left = exports.default = exports.bottom = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var position = (0, _style.default)({
|
|
prop: "position"
|
|
});
|
|
exports.position = position;
|
|
var zIndex = (0, _style.default)({
|
|
prop: "zIndex",
|
|
themeKey: "zIndex"
|
|
});
|
|
exports.zIndex = zIndex;
|
|
var top = (0, _style.default)({
|
|
prop: "top"
|
|
});
|
|
exports.top = top;
|
|
var right = (0, _style.default)({
|
|
prop: "right"
|
|
});
|
|
exports.right = right;
|
|
var bottom = (0, _style.default)({
|
|
prop: "bottom"
|
|
});
|
|
exports.bottom = bottom;
|
|
var left = (0, _style.default)({
|
|
prop: "left"
|
|
});
|
|
exports.left = left;
|
|
var _default = (0, _compose.default)(position, zIndex, top, right, bottom, left);
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/shadows.js
|
|
var require_shadows = __commonJS({
|
|
"node_modules/@mui/system/shadows.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var boxShadow = (0, _style.default)({
|
|
prop: "boxShadow",
|
|
themeKey: "shadows"
|
|
});
|
|
var _default = boxShadow;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/sizing.js
|
|
var require_sizing = __commonJS({
|
|
"node_modules/@mui/system/sizing.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.width = exports.sizeWidth = exports.sizeHeight = exports.minWidth = exports.minHeight = exports.maxWidth = exports.maxHeight = exports.height = exports.default = exports.boxSizing = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var _breakpoints = require_breakpoints();
|
|
function transform(value) {
|
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
}
|
|
var width = (0, _style.default)({
|
|
prop: "width",
|
|
transform
|
|
});
|
|
exports.width = width;
|
|
var maxWidth = (props) => {
|
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
const styleFromPropValue = (propValue) => {
|
|
var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
|
|
const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || _breakpoints.values[propValue];
|
|
return {
|
|
maxWidth: breakpoint || transform(propValue)
|
|
};
|
|
};
|
|
return (0, _breakpoints.handleBreakpoints)(props, props.maxWidth, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
exports.maxWidth = maxWidth;
|
|
maxWidth.filterProps = ["maxWidth"];
|
|
var minWidth = (0, _style.default)({
|
|
prop: "minWidth",
|
|
transform
|
|
});
|
|
exports.minWidth = minWidth;
|
|
var height = (0, _style.default)({
|
|
prop: "height",
|
|
transform
|
|
});
|
|
exports.height = height;
|
|
var maxHeight = (0, _style.default)({
|
|
prop: "maxHeight",
|
|
transform
|
|
});
|
|
exports.maxHeight = maxHeight;
|
|
var minHeight = (0, _style.default)({
|
|
prop: "minHeight",
|
|
transform
|
|
});
|
|
exports.minHeight = minHeight;
|
|
var sizeWidth = (0, _style.default)({
|
|
prop: "size",
|
|
cssProperty: "width",
|
|
transform
|
|
});
|
|
exports.sizeWidth = sizeWidth;
|
|
var sizeHeight = (0, _style.default)({
|
|
prop: "size",
|
|
cssProperty: "height",
|
|
transform
|
|
});
|
|
exports.sizeHeight = sizeHeight;
|
|
var boxSizing = (0, _style.default)({
|
|
prop: "boxSizing"
|
|
});
|
|
exports.boxSizing = boxSizing;
|
|
var sizing = (0, _compose.default)(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
var _default = sizing;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/typography.js
|
|
var require_typography = __commonJS({
|
|
"node_modules/@mui/system/typography.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.typographyVariant = exports.textTransform = exports.textAlign = exports.lineHeight = exports.letterSpacing = exports.fontWeight = exports.fontStyle = exports.fontSize = exports.fontFamily = exports.default = void 0;
|
|
var _style = _interopRequireDefault(require_style());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var fontFamily = (0, _style.default)({
|
|
prop: "fontFamily",
|
|
themeKey: "typography"
|
|
});
|
|
exports.fontFamily = fontFamily;
|
|
var fontSize = (0, _style.default)({
|
|
prop: "fontSize",
|
|
themeKey: "typography"
|
|
});
|
|
exports.fontSize = fontSize;
|
|
var fontStyle = (0, _style.default)({
|
|
prop: "fontStyle",
|
|
themeKey: "typography"
|
|
});
|
|
exports.fontStyle = fontStyle;
|
|
var fontWeight = (0, _style.default)({
|
|
prop: "fontWeight",
|
|
themeKey: "typography"
|
|
});
|
|
exports.fontWeight = fontWeight;
|
|
var letterSpacing = (0, _style.default)({
|
|
prop: "letterSpacing"
|
|
});
|
|
exports.letterSpacing = letterSpacing;
|
|
var textTransform = (0, _style.default)({
|
|
prop: "textTransform"
|
|
});
|
|
exports.textTransform = textTransform;
|
|
var lineHeight = (0, _style.default)({
|
|
prop: "lineHeight"
|
|
});
|
|
exports.lineHeight = lineHeight;
|
|
var textAlign = (0, _style.default)({
|
|
prop: "textAlign"
|
|
});
|
|
exports.textAlign = textAlign;
|
|
var typographyVariant = (0, _style.default)({
|
|
prop: "typography",
|
|
cssProperty: false,
|
|
themeKey: "typography"
|
|
});
|
|
exports.typographyVariant = typographyVariant;
|
|
var typography = (0, _compose.default)(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);
|
|
var _default = typography;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/getThemeValue.js
|
|
var require_getThemeValue = __commonJS({
|
|
"node_modules/@mui/system/getThemeValue.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.styleFunctionMapping = exports.propToStyleFunction = exports.default = void 0;
|
|
var _borders = _interopRequireDefault(require_borders());
|
|
var _display = _interopRequireDefault(require_display());
|
|
var _flexbox = _interopRequireDefault(require_flexbox());
|
|
var _grid = _interopRequireDefault(require_grid());
|
|
var _positions = _interopRequireDefault(require_positions());
|
|
var _palette = _interopRequireDefault(require_palette());
|
|
var _shadows = _interopRequireDefault(require_shadows());
|
|
var _sizing = _interopRequireDefault(require_sizing());
|
|
var _spacing = _interopRequireDefault(require_spacing());
|
|
var _typography = _interopRequireDefault(require_typography());
|
|
var filterPropsMapping = {
|
|
borders: _borders.default.filterProps,
|
|
display: _display.default.filterProps,
|
|
flexbox: _flexbox.default.filterProps,
|
|
grid: _grid.default.filterProps,
|
|
positions: _positions.default.filterProps,
|
|
palette: _palette.default.filterProps,
|
|
shadows: _shadows.default.filterProps,
|
|
sizing: _sizing.default.filterProps,
|
|
spacing: _spacing.default.filterProps,
|
|
typography: _typography.default.filterProps
|
|
};
|
|
var styleFunctionMapping = {
|
|
borders: _borders.default,
|
|
display: _display.default,
|
|
flexbox: _flexbox.default,
|
|
grid: _grid.default,
|
|
positions: _positions.default,
|
|
palette: _palette.default,
|
|
shadows: _shadows.default,
|
|
sizing: _sizing.default,
|
|
spacing: _spacing.default,
|
|
typography: _typography.default
|
|
};
|
|
exports.styleFunctionMapping = styleFunctionMapping;
|
|
var propToStyleFunction = Object.keys(filterPropsMapping).reduce((acc, styleFnName) => {
|
|
filterPropsMapping[styleFnName].forEach((propName) => {
|
|
acc[propName] = styleFunctionMapping[styleFnName];
|
|
});
|
|
return acc;
|
|
}, {});
|
|
exports.propToStyleFunction = propToStyleFunction;
|
|
function getThemeValue(prop, value, theme) {
|
|
const inputProps = {
|
|
[prop]: value,
|
|
theme
|
|
};
|
|
const styleFunction = propToStyleFunction[prop];
|
|
return styleFunction ? styleFunction(inputProps) : {
|
|
[prop]: value
|
|
};
|
|
}
|
|
var _default = getThemeValue;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/styleFunctionSx/styleFunctionSx.js
|
|
var require_styleFunctionSx = __commonJS({
|
|
"node_modules/@mui/system/styleFunctionSx/styleFunctionSx.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.unstable_createStyleFunctionSx = unstable_createStyleFunctionSx;
|
|
var _merge = _interopRequireDefault(require_merge());
|
|
var _getThemeValue = require_getThemeValue();
|
|
var _breakpoints = require_breakpoints();
|
|
function objectsHaveSameKeys(...objects) {
|
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
const union = new Set(allKeys);
|
|
return objects.every((object) => union.size === Object.keys(object).length);
|
|
}
|
|
function callIfFn(maybeFn, arg) {
|
|
return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
|
|
}
|
|
function unstable_createStyleFunctionSx(styleFunctionMapping = _getThemeValue.styleFunctionMapping) {
|
|
const propToStyleFunction = Object.keys(styleFunctionMapping).reduce((acc, styleFnName) => {
|
|
styleFunctionMapping[styleFnName].filterProps.forEach((propName) => {
|
|
acc[propName] = styleFunctionMapping[styleFnName];
|
|
});
|
|
return acc;
|
|
}, {});
|
|
function getThemeValue(prop, value, theme) {
|
|
const inputProps = {
|
|
[prop]: value,
|
|
theme
|
|
};
|
|
const styleFunction = propToStyleFunction[prop];
|
|
return styleFunction ? styleFunction(inputProps) : {
|
|
[prop]: value
|
|
};
|
|
}
|
|
function styleFunctionSx2(props) {
|
|
const {
|
|
sx,
|
|
theme = {}
|
|
} = props || {};
|
|
if (!sx) {
|
|
return null;
|
|
}
|
|
function traverse(sxInput) {
|
|
let sxObject = sxInput;
|
|
if (typeof sxInput === "function") {
|
|
sxObject = sxInput(theme);
|
|
} else if (typeof sxInput !== "object") {
|
|
return sxInput;
|
|
}
|
|
if (!sxObject) {
|
|
return null;
|
|
}
|
|
const emptyBreakpoints = (0, _breakpoints.createEmptyBreakpointObject)(theme.breakpoints);
|
|
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
let css = emptyBreakpoints;
|
|
Object.keys(sxObject).forEach((styleKey) => {
|
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
if (value !== null && value !== void 0) {
|
|
if (typeof value === "object") {
|
|
if (propToStyleFunction[styleKey]) {
|
|
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme));
|
|
} else {
|
|
const breakpointsValues = (0, _breakpoints.handleBreakpoints)({
|
|
theme
|
|
}, value, (x) => ({
|
|
[styleKey]: x
|
|
}));
|
|
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
css[styleKey] = styleFunctionSx2({
|
|
sx: value,
|
|
theme
|
|
});
|
|
} else {
|
|
css = (0, _merge.default)(css, breakpointsValues);
|
|
}
|
|
}
|
|
} else {
|
|
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme));
|
|
}
|
|
}
|
|
});
|
|
return (0, _breakpoints.removeUnusedBreakpoints)(breakpointsKeys, css);
|
|
}
|
|
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
}
|
|
return styleFunctionSx2;
|
|
}
|
|
var styleFunctionSx = unstable_createStyleFunctionSx();
|
|
styleFunctionSx.filterProps = ["sx"];
|
|
var _default = styleFunctionSx;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/styleFunctionSx/extendSxProp.js
|
|
var require_extendSxProp = __commonJS({
|
|
"node_modules/@mui/system/styleFunctionSx/extendSxProp.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = extendSxProp;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _getThemeValue = require_getThemeValue();
|
|
var _excluded = ["sx"];
|
|
var splitProps = (props) => {
|
|
const result = {
|
|
systemProps: {},
|
|
otherProps: {}
|
|
};
|
|
Object.keys(props).forEach((prop) => {
|
|
if (_getThemeValue.propToStyleFunction[prop]) {
|
|
result.systemProps[prop] = props[prop];
|
|
} else {
|
|
result.otherProps[prop] = props[prop];
|
|
}
|
|
});
|
|
return result;
|
|
};
|
|
function extendSxProp(props) {
|
|
const {
|
|
sx: inSx
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const {
|
|
systemProps,
|
|
otherProps
|
|
} = splitProps(other);
|
|
let finalSx;
|
|
if (Array.isArray(inSx)) {
|
|
finalSx = [systemProps, ...inSx];
|
|
} else if (typeof inSx === "function") {
|
|
finalSx = (...args) => {
|
|
const result = inSx(...args);
|
|
if (!(0, _utils.isPlainObject)(result)) {
|
|
return systemProps;
|
|
}
|
|
return (0, _extends2.default)({}, systemProps, result);
|
|
};
|
|
} else {
|
|
finalSx = (0, _extends2.default)({}, systemProps, inSx);
|
|
}
|
|
return (0, _extends2.default)({}, otherProps, {
|
|
sx: finalSx
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/styleFunctionSx/index.js
|
|
var require_styleFunctionSx2 = __commonJS({
|
|
"node_modules/@mui/system/styleFunctionSx/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styleFunctionSx.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "extendSxProp", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _extendSxProp.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_createStyleFunctionSx", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styleFunctionSx.unstable_createStyleFunctionSx;
|
|
}
|
|
});
|
|
var _styleFunctionSx = _interopRequireWildcard(require_styleFunctionSx());
|
|
var _extendSxProp = _interopRequireDefault(require_extendSxProp());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/sx/sx.js
|
|
var require_sx = __commonJS({
|
|
"node_modules/@mui/system/sx/sx.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _styleFunctionSx = _interopRequireDefault(require_styleFunctionSx2());
|
|
function sx(styles) {
|
|
return ({
|
|
theme
|
|
}) => (0, _styleFunctionSx.default)({
|
|
sx: styles,
|
|
theme
|
|
});
|
|
}
|
|
var _default = sx;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/sx/index.js
|
|
var require_sx2 = __commonJS({
|
|
"node_modules/@mui/system/sx/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sx.default;
|
|
}
|
|
});
|
|
var _sx = _interopRequireDefault(require_sx());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createTheme/createBreakpoints.js
|
|
var require_createBreakpoints = __commonJS({
|
|
"node_modules/@mui/system/createTheme/createBreakpoints.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.breakpointKeys = void 0;
|
|
exports.default = createBreakpoints;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _excluded = ["values", "unit", "step"];
|
|
var breakpointKeys = ["xs", "sm", "md", "lg", "xl"];
|
|
exports.breakpointKeys = breakpointKeys;
|
|
var sortBreakpointsValues = (values) => {
|
|
const breakpointsAsArray = Object.keys(values).map((key) => ({
|
|
key,
|
|
val: values[key]
|
|
})) || [];
|
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
return (0, _extends2.default)({}, acc, {
|
|
[obj.key]: obj.val
|
|
});
|
|
}, {});
|
|
};
|
|
function createBreakpoints(breakpoints) {
|
|
const {
|
|
values = {
|
|
xs: 0,
|
|
sm: 600,
|
|
md: 900,
|
|
lg: 1200,
|
|
xl: 1536
|
|
},
|
|
unit = "px",
|
|
step = 5
|
|
} = breakpoints, other = (0, _objectWithoutPropertiesLoose2.default)(breakpoints, _excluded);
|
|
const sortedValues = sortBreakpointsValues(values);
|
|
const keys = Object.keys(sortedValues);
|
|
function up(key) {
|
|
const value = typeof values[key] === "number" ? values[key] : key;
|
|
return `@media (min-width:${value}${unit})`;
|
|
}
|
|
function down(key) {
|
|
const value = typeof values[key] === "number" ? values[key] : key;
|
|
return `@media (max-width:${value - step / 100}${unit})`;
|
|
}
|
|
function between(start, end) {
|
|
const endIndex = keys.indexOf(end);
|
|
return `@media (min-width:${typeof values[start] === "number" ? values[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === "number" ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
}
|
|
function only(key) {
|
|
if (keys.indexOf(key) + 1 < keys.length) {
|
|
return between(key, keys[keys.indexOf(key) + 1]);
|
|
}
|
|
return up(key);
|
|
}
|
|
function not(key) {
|
|
const keyIndex = keys.indexOf(key);
|
|
if (keyIndex === 0) {
|
|
return up(keys[1]);
|
|
}
|
|
if (keyIndex === keys.length - 1) {
|
|
return down(keys[keyIndex]);
|
|
}
|
|
return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
}
|
|
return (0, _extends2.default)({
|
|
keys,
|
|
values: sortedValues,
|
|
up,
|
|
down,
|
|
between,
|
|
only,
|
|
not,
|
|
unit
|
|
}, other);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createTheme/shape.js
|
|
var require_shape = __commonJS({
|
|
"node_modules/@mui/system/createTheme/shape.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var shape = {
|
|
borderRadius: 4
|
|
};
|
|
var _default = shape;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createTheme/createSpacing.js
|
|
var require_createSpacing = __commonJS({
|
|
"node_modules/@mui/system/createTheme/createSpacing.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createSpacing;
|
|
var _spacing = require_spacing();
|
|
function createSpacing(spacingInput = 8) {
|
|
if (spacingInput.mui) {
|
|
return spacingInput;
|
|
}
|
|
const transform = (0, _spacing.createUnarySpacing)({
|
|
spacing: spacingInput
|
|
});
|
|
const spacing = (...argsInput) => {
|
|
if (true) {
|
|
if (!(argsInput.length <= 4)) {
|
|
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
}
|
|
}
|
|
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
return args.map((argument) => {
|
|
const output = transform(argument);
|
|
return typeof output === "number" ? `${output}px` : output;
|
|
}).join(" ");
|
|
};
|
|
spacing.mui = true;
|
|
return spacing;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createTheme/createTheme.js
|
|
var require_createTheme = __commonJS({
|
|
"node_modules/@mui/system/createTheme/createTheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _createBreakpoints = _interopRequireDefault(require_createBreakpoints());
|
|
var _shape = _interopRequireDefault(require_shape());
|
|
var _createSpacing = _interopRequireDefault(require_createSpacing());
|
|
var _excluded = ["breakpoints", "palette", "spacing", "shape"];
|
|
function createTheme(options = {}, ...args) {
|
|
const {
|
|
breakpoints: breakpointsInput = {},
|
|
palette: paletteInput = {},
|
|
spacing: spacingInput,
|
|
shape: shapeInput = {}
|
|
} = options, other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);
|
|
const breakpoints = (0, _createBreakpoints.default)(breakpointsInput);
|
|
const spacing = (0, _createSpacing.default)(spacingInput);
|
|
let muiTheme = (0, _utils.deepmerge)({
|
|
breakpoints,
|
|
direction: "ltr",
|
|
components: {},
|
|
palette: (0, _extends2.default)({
|
|
mode: "light"
|
|
}, paletteInput),
|
|
spacing,
|
|
shape: (0, _extends2.default)({}, _shape.default, shapeInput)
|
|
}, other);
|
|
muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);
|
|
return muiTheme;
|
|
}
|
|
var _default = createTheme;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createTheme/index.js
|
|
var require_createTheme2 = __commonJS({
|
|
"node_modules/@mui/system/createTheme/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createTheme.default;
|
|
}
|
|
});
|
|
var _createTheme = _interopRequireDefault(require_createTheme());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/useTheme/ThemeContext.js
|
|
var require_ThemeContext = __commonJS({
|
|
"node_modules/@mui/private-theming/node/useTheme/ThemeContext.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var ThemeContext = /* @__PURE__ */ React31.createContext(null);
|
|
if (true) {
|
|
ThemeContext.displayName = "ThemeContext";
|
|
}
|
|
var _default = ThemeContext;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/useTheme/useTheme.js
|
|
var require_useTheme = __commonJS({
|
|
"node_modules/@mui/private-theming/node/useTheme/useTheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useTheme;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _ThemeContext = _interopRequireDefault(require_ThemeContext());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function useTheme() {
|
|
const theme = React31.useContext(_ThemeContext.default);
|
|
if (true) {
|
|
React31.useDebugValue(theme);
|
|
}
|
|
return theme;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/useTheme/index.js
|
|
var require_useTheme2 = __commonJS({
|
|
"node_modules/@mui/private-theming/node/useTheme/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTheme.default;
|
|
}
|
|
});
|
|
var _useTheme = _interopRequireDefault(require_useTheme());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/ThemeProvider/nested.js
|
|
var require_nested = __commonJS({
|
|
"node_modules/@mui/private-theming/node/ThemeProvider/nested.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var _default = hasSymbol ? Symbol.for("mui.nested") : "__THEME_NESTED__";
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/ThemeProvider/ThemeProvider.js
|
|
var require_ThemeProvider = __commonJS({
|
|
"node_modules/@mui/private-theming/node/ThemeProvider/ThemeProvider.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _utils = require_utils();
|
|
var _ThemeContext = _interopRequireDefault(require_ThemeContext());
|
|
var _useTheme = _interopRequireDefault(require_useTheme2());
|
|
var _nested = _interopRequireDefault(require_nested());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
if (typeof localTheme === "function") {
|
|
const mergedTheme = localTheme(outerTheme);
|
|
if (true) {
|
|
if (!mergedTheme) {
|
|
console.error(["MUI: You should return an object from your theme function, i.e.", "<ThemeProvider theme={() => ({})} />"].join("\n"));
|
|
}
|
|
}
|
|
return mergedTheme;
|
|
}
|
|
return (0, _extends2.default)({}, outerTheme, localTheme);
|
|
}
|
|
function ThemeProvider(props) {
|
|
const {
|
|
children,
|
|
theme: localTheme
|
|
} = props;
|
|
const outerTheme = (0, _useTheme.default)();
|
|
if (true) {
|
|
if (outerTheme === null && typeof localTheme === "function") {
|
|
console.error(["MUI: You are providing a theme function prop to the ThemeProvider component:", "<ThemeProvider theme={outerTheme => outerTheme} />", "", "However, no outer theme is present.", "Make sure a theme is already injected higher in the React tree or provide a theme object."].join("\n"));
|
|
}
|
|
}
|
|
const theme = React31.useMemo(() => {
|
|
const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
|
|
if (output != null) {
|
|
output[_nested.default] = outerTheme !== null;
|
|
}
|
|
return output;
|
|
}, [localTheme, outerTheme]);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_ThemeContext.default.Provider, {
|
|
value: theme,
|
|
children
|
|
});
|
|
}
|
|
true ? ThemeProvider.propTypes = {
|
|
children: _propTypes.default.node,
|
|
theme: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired
|
|
} : void 0;
|
|
if (true) {
|
|
true ? ThemeProvider.propTypes = (0, _utils.exactProp)(ThemeProvider.propTypes) : void 0;
|
|
}
|
|
var _default = ThemeProvider;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/ThemeProvider/index.js
|
|
var require_ThemeProvider2 = __commonJS({
|
|
"node_modules/@mui/private-theming/node/ThemeProvider/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ThemeProvider.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_nested", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _nested.default;
|
|
}
|
|
});
|
|
var _ThemeProvider = _interopRequireDefault(require_ThemeProvider());
|
|
var _nested = _interopRequireDefault(require_nested());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/private-theming/node/index.js
|
|
var require_node4 = __commonJS({
|
|
"node_modules/@mui/private-theming/node/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
ThemeProvider: true,
|
|
useTheme: true
|
|
};
|
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ThemeProvider.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTheme", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTheme.default;
|
|
}
|
|
});
|
|
var _ThemeProvider = _interopRequireWildcard(require_ThemeProvider2());
|
|
Object.keys(_ThemeProvider).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _ThemeProvider[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ThemeProvider[key];
|
|
}
|
|
});
|
|
});
|
|
var _useTheme = _interopRequireDefault(require_useTheme2());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/useThemeWithoutDefault.js
|
|
var require_useThemeWithoutDefault = __commonJS({
|
|
"node_modules/@mui/system/useThemeWithoutDefault.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _privateTheming = require_node4();
|
|
function isObjectEmpty(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
function useTheme(defaultTheme = null) {
|
|
const contextTheme = (0, _privateTheming.useTheme)();
|
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
}
|
|
var _default = useTheme;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/useTheme.js
|
|
var require_useTheme3 = __commonJS({
|
|
"node_modules/@mui/system/useTheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.systemDefaultTheme = exports.default = void 0;
|
|
var _createTheme = _interopRequireDefault(require_createTheme2());
|
|
var _useThemeWithoutDefault = _interopRequireDefault(require_useThemeWithoutDefault());
|
|
var systemDefaultTheme = (0, _createTheme.default)();
|
|
exports.systemDefaultTheme = systemDefaultTheme;
|
|
function useTheme(defaultTheme = systemDefaultTheme) {
|
|
return (0, _useThemeWithoutDefault.default)(defaultTheme);
|
|
}
|
|
var _default = useTheme;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createBox.js
|
|
var require_createBox = __commonJS({
|
|
"node_modules/@mui/system/createBox.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createBox;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _styledEngine = _interopRequireDefault(require_node3());
|
|
var _styleFunctionSx = _interopRequireWildcard(require_styleFunctionSx2());
|
|
var _useTheme = _interopRequireDefault(require_useTheme3());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["className", "component"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function createBox(options = {}) {
|
|
const {
|
|
defaultTheme,
|
|
defaultClassName = "MuiBox-root",
|
|
generateClassName,
|
|
styleFunctionSx = _styleFunctionSx.default
|
|
} = options;
|
|
const BoxRoot = (0, _styledEngine.default)("div")(styleFunctionSx);
|
|
const Box = /* @__PURE__ */ React31.forwardRef(function Box2(inProps, ref) {
|
|
const theme = (0, _useTheme.default)(defaultTheme);
|
|
const _extendSxProp = (0, _styleFunctionSx.extendSxProp)(inProps), {
|
|
className,
|
|
component = "div"
|
|
} = _extendSxProp, other = (0, _objectWithoutPropertiesLoose2.default)(_extendSxProp, _excluded);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(BoxRoot, (0, _extends2.default)({
|
|
as: component,
|
|
ref,
|
|
className: (0, _clsx.default)(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
theme
|
|
}, other));
|
|
});
|
|
true ? Box.propTypes = {
|
|
children: _propTypes.default.node,
|
|
component: _propTypes.default.elementType,
|
|
sx: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array, _propTypes.default.func])
|
|
} : void 0;
|
|
return Box;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/Box/Box.js
|
|
var require_Box = __commonJS({
|
|
"node_modules/@mui/system/Box/Box.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createBox = _interopRequireDefault(require_createBox());
|
|
var Box = (0, _createBox.default)();
|
|
var _default = Box;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/Box/index.js
|
|
var require_Box2 = __commonJS({
|
|
"node_modules/@mui/system/Box/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Box.default;
|
|
}
|
|
});
|
|
var _Box = _interopRequireDefault(require_Box());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/propsToClassKey.js
|
|
var require_propsToClassKey = __commonJS({
|
|
"node_modules/@mui/system/propsToClassKey.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = propsToClassKey;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _excluded = ["variant"];
|
|
function isEmpty(string) {
|
|
return string.length === 0;
|
|
}
|
|
function propsToClassKey(props) {
|
|
const {
|
|
variant
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
let classKey = variant || "";
|
|
Object.keys(other).sort().forEach((key) => {
|
|
if (key === "color") {
|
|
classKey += isEmpty(classKey) ? props[key] : (0, _utils.unstable_capitalize)(props[key]);
|
|
} else {
|
|
classKey += `${isEmpty(classKey) ? key : (0, _utils.unstable_capitalize)(key)}${(0, _utils.unstable_capitalize)(props[key].toString())}`;
|
|
}
|
|
});
|
|
return classKey;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/createStyled.js
|
|
var require_createStyled = __commonJS({
|
|
"node_modules/@mui/system/createStyled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createStyled;
|
|
exports.shouldForwardProp = shouldForwardProp;
|
|
exports.systemDefaultTheme = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _styledEngine = _interopRequireDefault(require_node3());
|
|
var _utils = require_utils();
|
|
var _createTheme = _interopRequireDefault(require_createTheme2());
|
|
var _propsToClassKey = _interopRequireDefault(require_propsToClassKey());
|
|
var _styleFunctionSx = _interopRequireDefault(require_styleFunctionSx2());
|
|
var _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
var _excluded2 = ["theme"];
|
|
var _excluded3 = ["theme"];
|
|
function isEmpty(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
var getStyleOverrides = (name, theme) => {
|
|
if (theme.components && theme.components[name] && theme.components[name].styleOverrides) {
|
|
return theme.components[name].styleOverrides;
|
|
}
|
|
return null;
|
|
};
|
|
var getVariantStyles = (name, theme) => {
|
|
let variants = [];
|
|
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
variants = theme.components[name].variants;
|
|
}
|
|
const variantsStyles = {};
|
|
variants.forEach((definition) => {
|
|
const key = (0, _propsToClassKey.default)(definition.props);
|
|
variantsStyles[key] = definition.style;
|
|
});
|
|
return variantsStyles;
|
|
};
|
|
var variantsResolver = (props, styles, theme, name) => {
|
|
var _theme$components, _theme$components$nam;
|
|
const {
|
|
ownerState = {}
|
|
} = props;
|
|
const variantsStyles = [];
|
|
const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;
|
|
if (themeVariants) {
|
|
themeVariants.forEach((themeVariant) => {
|
|
let isMatch = true;
|
|
Object.keys(themeVariant.props).forEach((key) => {
|
|
if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {
|
|
isMatch = false;
|
|
}
|
|
});
|
|
if (isMatch) {
|
|
variantsStyles.push(styles[(0, _propsToClassKey.default)(themeVariant.props)]);
|
|
}
|
|
});
|
|
}
|
|
return variantsStyles;
|
|
};
|
|
function shouldForwardProp(prop) {
|
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
}
|
|
var systemDefaultTheme = (0, _createTheme.default)();
|
|
exports.systemDefaultTheme = systemDefaultTheme;
|
|
var lowercaseFirstLetter = (string) => {
|
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
};
|
|
function createStyled(input = {}) {
|
|
const {
|
|
defaultTheme = systemDefaultTheme,
|
|
rootShouldForwardProp = shouldForwardProp,
|
|
slotShouldForwardProp = shouldForwardProp,
|
|
styleFunctionSx = _styleFunctionSx.default
|
|
} = input;
|
|
return (tag, inputOptions = {}) => {
|
|
const {
|
|
name: componentName,
|
|
slot: componentSlot,
|
|
skipVariantsResolver: inputSkipVariantsResolver,
|
|
skipSx: inputSkipSx,
|
|
overridesResolver
|
|
} = inputOptions, options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded);
|
|
const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : componentSlot && componentSlot !== "Root" || false;
|
|
const skipSx = inputSkipSx || false;
|
|
let label;
|
|
if (true) {
|
|
if (componentName) {
|
|
label = `${componentName}-${lowercaseFirstLetter(componentSlot || "Root")}`;
|
|
}
|
|
}
|
|
let shouldForwardPropOption = shouldForwardProp;
|
|
if (componentSlot === "Root") {
|
|
shouldForwardPropOption = rootShouldForwardProp;
|
|
} else if (componentSlot) {
|
|
shouldForwardPropOption = slotShouldForwardProp;
|
|
}
|
|
const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({
|
|
shouldForwardProp: shouldForwardPropOption,
|
|
label
|
|
}, options));
|
|
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
const expressionsWithDefaultTheme = expressions ? expressions.map((stylesArg) => {
|
|
return typeof stylesArg === "function" && stylesArg.__emotion_real !== stylesArg ? (_ref) => {
|
|
let {
|
|
theme: themeInput
|
|
} = _ref, other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded2);
|
|
return stylesArg((0, _extends2.default)({
|
|
theme: isEmpty(themeInput) ? defaultTheme : themeInput
|
|
}, other));
|
|
} : stylesArg;
|
|
}) : [];
|
|
let transformedStyleArg = styleArg;
|
|
if (componentName && overridesResolver) {
|
|
expressionsWithDefaultTheme.push((props) => {
|
|
const theme = isEmpty(props.theme) ? defaultTheme : props.theme;
|
|
const styleOverrides = getStyleOverrides(componentName, theme);
|
|
if (styleOverrides) {
|
|
const resolvedStyleOverrides = {};
|
|
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
resolvedStyleOverrides[slotKey] = typeof slotStyle === "function" ? slotStyle(props) : slotStyle;
|
|
});
|
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
}
|
|
return null;
|
|
});
|
|
}
|
|
if (componentName && !skipVariantsResolver) {
|
|
expressionsWithDefaultTheme.push((props) => {
|
|
const theme = isEmpty(props.theme) ? defaultTheme : props.theme;
|
|
return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
});
|
|
}
|
|
if (!skipSx) {
|
|
expressionsWithDefaultTheme.push((props) => {
|
|
const theme = isEmpty(props.theme) ? defaultTheme : props.theme;
|
|
return styleFunctionSx((0, _extends2.default)({}, props, {
|
|
theme
|
|
}));
|
|
});
|
|
}
|
|
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
const placeholders = new Array(numOfCustomFnsApplied).fill("");
|
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
} else if (typeof styleArg === "function" && styleArg.__emotion_real !== styleArg) {
|
|
transformedStyleArg = (_ref2) => {
|
|
let {
|
|
theme: themeInput
|
|
} = _ref2, other = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded3);
|
|
return styleArg((0, _extends2.default)({
|
|
theme: isEmpty(themeInput) ? defaultTheme : themeInput
|
|
}, other));
|
|
};
|
|
}
|
|
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
if (true) {
|
|
let displayName;
|
|
if (componentName) {
|
|
displayName = `${componentName}${componentSlot || ""}`;
|
|
}
|
|
if (displayName === void 0) {
|
|
displayName = `Styled(${(0, _utils.getDisplayName)(tag)})`;
|
|
}
|
|
Component.displayName = displayName;
|
|
}
|
|
return Component;
|
|
};
|
|
if (defaultStyledResolver.withConfig) {
|
|
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
}
|
|
return muiStyledResolver;
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/styled.js
|
|
var require_styled = __commonJS({
|
|
"node_modules/@mui/system/styled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createStyled = _interopRequireDefault(require_createStyled());
|
|
var styled = (0, _createStyled.default)();
|
|
var _default = styled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/useThemeProps/getThemeProps.js
|
|
var require_getThemeProps = __commonJS({
|
|
"node_modules/@mui/system/useThemeProps/getThemeProps.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getThemeProps;
|
|
var _utils = require_utils();
|
|
function getThemeProps(params) {
|
|
const {
|
|
theme,
|
|
name,
|
|
props
|
|
} = params;
|
|
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
return props;
|
|
}
|
|
return (0, _utils.internal_resolveProps)(theme.components[name].defaultProps, props);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/useThemeProps/useThemeProps.js
|
|
var require_useThemeProps = __commonJS({
|
|
"node_modules/@mui/system/useThemeProps/useThemeProps.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useThemeProps;
|
|
var _getThemeProps = _interopRequireDefault(require_getThemeProps());
|
|
var _useTheme = _interopRequireDefault(require_useTheme3());
|
|
function useThemeProps({
|
|
props,
|
|
name,
|
|
defaultTheme
|
|
}) {
|
|
const theme = (0, _useTheme.default)(defaultTheme);
|
|
const mergedProps = (0, _getThemeProps.default)({
|
|
theme,
|
|
name,
|
|
props
|
|
});
|
|
return mergedProps;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/useThemeProps/index.js
|
|
var require_useThemeProps2 = __commonJS({
|
|
"node_modules/@mui/system/useThemeProps/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useThemeProps.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getThemeProps", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _getThemeProps.default;
|
|
}
|
|
});
|
|
var _useThemeProps = _interopRequireDefault(require_useThemeProps());
|
|
var _getThemeProps = _interopRequireDefault(require_getThemeProps());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/colorManipulator.js
|
|
var require_colorManipulator = __commonJS({
|
|
"node_modules/@mui/system/colorManipulator.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.alpha = alpha;
|
|
exports.darken = darken;
|
|
exports.decomposeColor = decomposeColor;
|
|
exports.emphasize = emphasize;
|
|
exports.getContrastRatio = getContrastRatio;
|
|
exports.getLuminance = getLuminance;
|
|
exports.hexToRgb = hexToRgb;
|
|
exports.hslToRgb = hslToRgb;
|
|
exports.lighten = lighten;
|
|
exports.recomposeColor = recomposeColor;
|
|
exports.rgbToHex = rgbToHex;
|
|
var _utils = require_utils();
|
|
function clamp(value, min = 0, max = 1) {
|
|
if (true) {
|
|
if (value < min || value > max) {
|
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
}
|
|
}
|
|
return Math.min(Math.max(min, value), max);
|
|
}
|
|
function hexToRgb(color) {
|
|
color = color.substr(1);
|
|
const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, "g");
|
|
let colors = color.match(re);
|
|
if (colors && colors[0].length === 1) {
|
|
colors = colors.map((n) => n + n);
|
|
}
|
|
return colors ? `rgb${colors.length === 4 ? "a" : ""}(${colors.map((n, index) => {
|
|
return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1e3) / 1e3;
|
|
}).join(", ")})` : "";
|
|
}
|
|
function intToHex(int) {
|
|
const hex = int.toString(16);
|
|
return hex.length === 1 ? `0${hex}` : hex;
|
|
}
|
|
function decomposeColor(color) {
|
|
if (color.type) {
|
|
return color;
|
|
}
|
|
if (color.charAt(0) === "#") {
|
|
return decomposeColor(hexToRgb(color));
|
|
}
|
|
const marker = color.indexOf("(");
|
|
const type = color.substring(0, marker);
|
|
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
|
|
throw new Error(true ? `MUI: Unsupported \`${color}\` color.
|
|
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _utils.formatMuiErrorMessage)(9, color));
|
|
}
|
|
let values = color.substring(marker + 1, color.length - 1);
|
|
let colorSpace;
|
|
if (type === "color") {
|
|
values = values.split(" ");
|
|
colorSpace = values.shift();
|
|
if (values.length === 4 && values[3].charAt(0) === "/") {
|
|
values[3] = values[3].substr(1);
|
|
}
|
|
if (["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {
|
|
throw new Error(true ? `MUI: unsupported \`${colorSpace}\` color space.
|
|
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _utils.formatMuiErrorMessage)(10, colorSpace));
|
|
}
|
|
} else {
|
|
values = values.split(",");
|
|
}
|
|
values = values.map((value) => parseFloat(value));
|
|
return {
|
|
type,
|
|
values,
|
|
colorSpace
|
|
};
|
|
}
|
|
function recomposeColor(color) {
|
|
const {
|
|
type,
|
|
colorSpace
|
|
} = color;
|
|
let {
|
|
values
|
|
} = color;
|
|
if (type.indexOf("rgb") !== -1) {
|
|
values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);
|
|
} else if (type.indexOf("hsl") !== -1) {
|
|
values[1] = `${values[1]}%`;
|
|
values[2] = `${values[2]}%`;
|
|
}
|
|
if (type.indexOf("color") !== -1) {
|
|
values = `${colorSpace} ${values.join(" ")}`;
|
|
} else {
|
|
values = `${values.join(", ")}`;
|
|
}
|
|
return `${type}(${values})`;
|
|
}
|
|
function rgbToHex(color) {
|
|
if (color.indexOf("#") === 0) {
|
|
return color;
|
|
}
|
|
const {
|
|
values
|
|
} = decomposeColor(color);
|
|
return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join("")}`;
|
|
}
|
|
function hslToRgb(color) {
|
|
color = decomposeColor(color);
|
|
const {
|
|
values
|
|
} = color;
|
|
const h = values[0];
|
|
const s = values[1] / 100;
|
|
const l = values[2] / 100;
|
|
const a = s * Math.min(l, 1 - l);
|
|
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
let type = "rgb";
|
|
const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
if (color.type === "hsla") {
|
|
type += "a";
|
|
rgb.push(values[3]);
|
|
}
|
|
return recomposeColor({
|
|
type,
|
|
values: rgb
|
|
});
|
|
}
|
|
function getLuminance(color) {
|
|
color = decomposeColor(color);
|
|
let rgb = color.type === "hsl" ? decomposeColor(hslToRgb(color)).values : color.values;
|
|
rgb = rgb.map((val) => {
|
|
if (color.type !== "color") {
|
|
val /= 255;
|
|
}
|
|
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
});
|
|
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
|
}
|
|
function getContrastRatio(foreground, background) {
|
|
const lumA = getLuminance(foreground);
|
|
const lumB = getLuminance(background);
|
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
}
|
|
function alpha(color, value) {
|
|
color = decomposeColor(color);
|
|
value = clamp(value);
|
|
if (color.type === "rgb" || color.type === "hsl") {
|
|
color.type += "a";
|
|
}
|
|
if (color.type === "color") {
|
|
color.values[3] = `/${value}`;
|
|
} else {
|
|
color.values[3] = value;
|
|
}
|
|
return recomposeColor(color);
|
|
}
|
|
function darken(color, coefficient) {
|
|
color = decomposeColor(color);
|
|
coefficient = clamp(coefficient);
|
|
if (color.type.indexOf("hsl") !== -1) {
|
|
color.values[2] *= 1 - coefficient;
|
|
} else if (color.type.indexOf("rgb") !== -1 || color.type.indexOf("color") !== -1) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color.values[i] *= 1 - coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color);
|
|
}
|
|
function lighten(color, coefficient) {
|
|
color = decomposeColor(color);
|
|
coefficient = clamp(coefficient);
|
|
if (color.type.indexOf("hsl") !== -1) {
|
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
} else if (color.type.indexOf("rgb") !== -1) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
}
|
|
} else if (color.type.indexOf("color") !== -1) {
|
|
for (let i = 0; i < 3; i += 1) {
|
|
color.values[i] += (1 - color.values[i]) * coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color);
|
|
}
|
|
function emphasize(color, coefficient = 0.15) {
|
|
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/ThemeProvider/ThemeProvider.js
|
|
var require_ThemeProvider3 = __commonJS({
|
|
"node_modules/@mui/system/ThemeProvider/ThemeProvider.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _privateTheming = require_node4();
|
|
var _utils = require_utils();
|
|
var _styledEngine = require_node3();
|
|
var _useTheme = _interopRequireDefault(require_useTheme3());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function InnerThemeProvider(props) {
|
|
const theme = (0, _useTheme.default)();
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_styledEngine.ThemeContext.Provider, {
|
|
value: typeof theme === "object" ? theme : {},
|
|
children: props.children
|
|
});
|
|
}
|
|
true ? InnerThemeProvider.propTypes = {
|
|
children: _propTypes.default.node
|
|
} : void 0;
|
|
function ThemeProvider(props) {
|
|
const {
|
|
children,
|
|
theme: localTheme
|
|
} = props;
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)(_privateTheming.ThemeProvider, {
|
|
theme: localTheme,
|
|
children: /* @__PURE__ */ (0, _jsxRuntime.jsx)(InnerThemeProvider, {
|
|
children
|
|
})
|
|
});
|
|
}
|
|
true ? ThemeProvider.propTypes = {
|
|
children: _propTypes.default.node,
|
|
theme: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired
|
|
} : void 0;
|
|
if (true) {
|
|
true ? ThemeProvider.propTypes = (0, _utils.exactProp)(ThemeProvider.propTypes) : void 0;
|
|
}
|
|
var _default = ThemeProvider;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/ThemeProvider/index.js
|
|
var require_ThemeProvider4 = __commonJS({
|
|
"node_modules/@mui/system/ThemeProvider/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ThemeProvider.default;
|
|
}
|
|
});
|
|
var _ThemeProvider = _interopRequireDefault(require_ThemeProvider3());
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/cssVars/cssVarsParser.js
|
|
var require_cssVarsParser = __commonJS({
|
|
"node_modules/@mui/system/cssVars/cssVarsParser.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.assignNestedKeys = void 0;
|
|
exports.default = cssVarsParser;
|
|
exports.walkObjectDeep = void 0;
|
|
var assignNestedKeys = (obj, keys, value) => {
|
|
let temp = obj;
|
|
keys.forEach((k, index) => {
|
|
if (index === keys.length - 1) {
|
|
if (temp && typeof temp === "object") {
|
|
temp[k] = value;
|
|
}
|
|
} else if (temp && typeof temp === "object") {
|
|
if (!temp[k]) {
|
|
temp[k] = {};
|
|
}
|
|
temp = temp[k];
|
|
}
|
|
});
|
|
};
|
|
exports.assignNestedKeys = assignNestedKeys;
|
|
var walkObjectDeep = (obj, callback, shouldSkipPaths) => {
|
|
function recurse(object, parentKeys = []) {
|
|
Object.entries(object).forEach(([key, value]) => {
|
|
if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([...parentKeys, key])) {
|
|
if (value !== void 0 && value !== null) {
|
|
if (typeof value === "object" && Object.keys(value).length > 0) {
|
|
recurse(value, [...parentKeys, key]);
|
|
} else {
|
|
callback([...parentKeys, key], value, object);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
recurse(obj);
|
|
};
|
|
exports.walkObjectDeep = walkObjectDeep;
|
|
var getCssValue = (keys, value) => {
|
|
if (typeof value === "number") {
|
|
if (["lineHeight", "fontWeight", "opacity", "zIndex"].some((prop) => keys.includes(prop))) {
|
|
return value;
|
|
}
|
|
return `${value}px`;
|
|
}
|
|
return value;
|
|
};
|
|
function cssVarsParser(theme, options) {
|
|
const {
|
|
prefix,
|
|
basePrefix = "",
|
|
shouldSkipGeneratingVar
|
|
} = options || {};
|
|
const css = {};
|
|
const vars = {};
|
|
const parsedTheme = {};
|
|
walkObjectDeep(theme, (keys, value) => {
|
|
if (typeof value === "string" || typeof value === "number") {
|
|
if (typeof value === "string" && value.match(/var\(\s*--/)) {
|
|
if (!basePrefix && prefix) {
|
|
value = value.replace(/var\(\s*--/g, `var(--${prefix}-`);
|
|
} else {
|
|
value = prefix ? value.replace(new RegExp(`var\\(\\s*--${basePrefix}`, "g"), `var(--${prefix}`) : value.replace(new RegExp(`var\\(\\s*--${basePrefix}-`, "g"), "var(--");
|
|
}
|
|
}
|
|
if (!shouldSkipGeneratingVar || shouldSkipGeneratingVar && !shouldSkipGeneratingVar(keys, value)) {
|
|
const cssVar = `--${prefix ? `${prefix}-` : ""}${keys.join("-")}`;
|
|
Object.assign(css, {
|
|
[cssVar]: getCssValue(keys, value)
|
|
});
|
|
assignNestedKeys(vars, keys, `var(${cssVar})`);
|
|
}
|
|
}
|
|
assignNestedKeys(parsedTheme, keys, value);
|
|
}, (keys) => keys[0] === "vars");
|
|
return {
|
|
css,
|
|
vars,
|
|
parsedTheme
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/cssVars/getInitColorSchemeScript.js
|
|
var require_getInitColorSchemeScript = __commonJS({
|
|
"node_modules/@mui/system/cssVars/getInitColorSchemeScript.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_ATTRIBUTE = void 0;
|
|
exports.default = getInitColorSchemeScript;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var DEFAULT_MODE_STORAGE_KEY = "mui-mode";
|
|
exports.DEFAULT_MODE_STORAGE_KEY = DEFAULT_MODE_STORAGE_KEY;
|
|
var DEFAULT_COLOR_SCHEME_STORAGE_KEY = "mui-color-scheme";
|
|
exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = DEFAULT_COLOR_SCHEME_STORAGE_KEY;
|
|
var DEFAULT_ATTRIBUTE = "data-mui-color-scheme";
|
|
exports.DEFAULT_ATTRIBUTE = DEFAULT_ATTRIBUTE;
|
|
function getInitColorSchemeScript(options) {
|
|
const {
|
|
enableSystem,
|
|
defaultLightColorScheme = "light",
|
|
defaultDarkColorScheme = "dark",
|
|
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
|
|
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
|
|
attribute = DEFAULT_ATTRIBUTE
|
|
} = options || {};
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsx)("script", {
|
|
dangerouslySetInnerHTML: {
|
|
__html: `(function() { try {
|
|
var mode = localStorage.getItem('${modeStorageKey}');
|
|
var colorScheme = '';
|
|
if (mode === 'system' || (!mode && !!${enableSystem})) {
|
|
// handle system mode
|
|
var mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
if (mql.matches) {
|
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
|
|
} else {
|
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
|
|
}
|
|
}
|
|
if (mode === 'light') {
|
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
|
|
}
|
|
if (mode === 'dark') {
|
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
|
|
}
|
|
if (colorScheme) {
|
|
document.documentElement.setAttribute('${attribute}', colorScheme);
|
|
}
|
|
} catch (e) {} })();`
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/cssVars/useCurrentColorScheme.js
|
|
var require_useCurrentColorScheme = __commonJS({
|
|
"node_modules/@mui/system/cssVars/useCurrentColorScheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useCurrentColorScheme;
|
|
exports.getColorScheme = getColorScheme;
|
|
exports.getSystemMode = getSystemMode;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _getInitColorSchemeScript = require_getInitColorSchemeScript();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function getSystemMode(mode) {
|
|
if (typeof window !== "undefined" && mode === "system") {
|
|
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
if (mql.matches) {
|
|
return "dark";
|
|
}
|
|
return "light";
|
|
}
|
|
return void 0;
|
|
}
|
|
function processState(state, callback) {
|
|
if (state.mode === "light" || state.mode === "system" && state.systemMode === "light") {
|
|
return callback("light");
|
|
}
|
|
if (state.mode === "dark" || state.mode === "system" && state.systemMode === "dark") {
|
|
return callback("dark");
|
|
}
|
|
return void 0;
|
|
}
|
|
function getColorScheme(state) {
|
|
return processState(state, (mode) => {
|
|
if (mode === "light") {
|
|
return state.lightColorScheme;
|
|
}
|
|
if (mode === "dark") {
|
|
return state.darkColorScheme;
|
|
}
|
|
return void 0;
|
|
});
|
|
}
|
|
function resolveValue(key, defaultValue) {
|
|
if (typeof window === "undefined") {
|
|
return void 0;
|
|
}
|
|
let value;
|
|
try {
|
|
value = localStorage.getItem(key) || void 0;
|
|
} catch (e) {
|
|
}
|
|
return value || defaultValue;
|
|
}
|
|
function useCurrentColorScheme(options) {
|
|
const {
|
|
defaultMode = "light",
|
|
defaultLightColorScheme,
|
|
defaultDarkColorScheme,
|
|
supportedColorSchemes = [],
|
|
modeStorageKey = _getInitColorSchemeScript.DEFAULT_MODE_STORAGE_KEY,
|
|
colorSchemeStorageKey = _getInitColorSchemeScript.DEFAULT_COLOR_SCHEME_STORAGE_KEY
|
|
} = options;
|
|
const joinedColorSchemes = supportedColorSchemes.join(",");
|
|
const [state, setState] = React31.useState(() => {
|
|
const initialMode = resolveValue(modeStorageKey, defaultMode);
|
|
return {
|
|
mode: initialMode,
|
|
systemMode: getSystemMode(initialMode),
|
|
lightColorScheme: resolveValue(`${colorSchemeStorageKey}-light`) || defaultLightColorScheme,
|
|
darkColorScheme: resolveValue(`${colorSchemeStorageKey}-dark`) || defaultDarkColorScheme
|
|
};
|
|
});
|
|
const colorScheme = getColorScheme(state);
|
|
const setMode = React31.useCallback((mode) => {
|
|
setState((currentState) => {
|
|
const newMode = !mode ? defaultMode : mode;
|
|
if (typeof localStorage !== "undefined") {
|
|
localStorage.setItem(modeStorageKey, newMode);
|
|
}
|
|
return (0, _extends2.default)({}, currentState, {
|
|
mode: newMode,
|
|
systemMode: getSystemMode(newMode)
|
|
});
|
|
});
|
|
}, [modeStorageKey, defaultMode]);
|
|
const setColorScheme = React31.useCallback((value) => {
|
|
if (!value || typeof value === "string") {
|
|
if (value && !supportedColorSchemes.includes(value)) {
|
|
console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
|
|
} else {
|
|
setState((currentState) => {
|
|
const newState = (0, _extends2.default)({}, currentState);
|
|
if (!value) {
|
|
newState.lightColorScheme = defaultLightColorScheme;
|
|
newState.darkColorScheme = defaultDarkColorScheme;
|
|
return newState;
|
|
}
|
|
processState(currentState, (mode) => {
|
|
localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);
|
|
if (mode === "light") {
|
|
newState.lightColorScheme = value;
|
|
}
|
|
if (mode === "dark") {
|
|
newState.darkColorScheme = value;
|
|
}
|
|
});
|
|
return newState;
|
|
});
|
|
}
|
|
} else if (value.light && !supportedColorSchemes.includes(value.light) || value.dark && !supportedColorSchemes.includes(value.dark)) {
|
|
console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
|
|
} else {
|
|
setState((currentState) => {
|
|
const newState = (0, _extends2.default)({}, currentState);
|
|
if (value.light || value.light === null) {
|
|
newState.lightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
|
|
}
|
|
if (value.dark || value.dark === null) {
|
|
newState.darkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
|
|
}
|
|
return newState;
|
|
});
|
|
if (value.light) {
|
|
localStorage.setItem(`${colorSchemeStorageKey}-light`, value.light);
|
|
}
|
|
if (value.dark) {
|
|
localStorage.setItem(`${colorSchemeStorageKey}-dark`, value.dark);
|
|
}
|
|
}
|
|
}, [colorSchemeStorageKey, supportedColorSchemes, defaultLightColorScheme, defaultDarkColorScheme]);
|
|
const handleMediaQuery = React31.useCallback((e) => {
|
|
if (state.mode === "system") {
|
|
setState((currentState) => (0, _extends2.default)({}, currentState, {
|
|
systemMode: e.matches ? "dark" : "light"
|
|
}));
|
|
}
|
|
}, [state.mode]);
|
|
const mediaListener = React31.useRef(handleMediaQuery);
|
|
mediaListener.current = handleMediaQuery;
|
|
React31.useEffect(() => {
|
|
const handler = (...args) => mediaListener.current(...args);
|
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
media.addListener(handler);
|
|
handler(media);
|
|
return () => media.removeListener(handler);
|
|
}, []);
|
|
React31.useEffect(() => {
|
|
if (state.mode) {
|
|
localStorage.setItem(modeStorageKey, state.mode);
|
|
}
|
|
processState(state, (mode) => {
|
|
if (mode === "light") {
|
|
localStorage.setItem(`${colorSchemeStorageKey}-light`, state.lightColorScheme);
|
|
}
|
|
if (mode === "dark") {
|
|
localStorage.setItem(`${colorSchemeStorageKey}-dark`, state.darkColorScheme);
|
|
}
|
|
});
|
|
}, [state, colorSchemeStorageKey, modeStorageKey]);
|
|
React31.useEffect(() => {
|
|
const handleStorage = (event) => {
|
|
const value = event.newValue;
|
|
if (typeof event.key === "string" && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {
|
|
if (event.key.endsWith("light")) {
|
|
setColorScheme({
|
|
light: value
|
|
});
|
|
}
|
|
if (event.key.endsWith("dark")) {
|
|
setColorScheme({
|
|
dark: value
|
|
});
|
|
}
|
|
}
|
|
if (event.key === modeStorageKey && (!value || ["light", "dark", "system"].includes(value))) {
|
|
setMode(value || defaultMode);
|
|
}
|
|
};
|
|
window.addEventListener("storage", handleStorage);
|
|
return () => window.removeEventListener("storage", handleStorage);
|
|
}, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode]);
|
|
return (0, _extends2.default)({}, state, {
|
|
colorScheme,
|
|
setMode,
|
|
setColorScheme
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/cssVars/createGetCssVar.js
|
|
var require_createGetCssVar = __commonJS({
|
|
"node_modules/@mui/system/cssVars/createGetCssVar.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createGetCssVar;
|
|
function createGetCssVar(prefix = "") {
|
|
function appendVar(...vars) {
|
|
if (!vars.length) {
|
|
return "";
|
|
}
|
|
const value = vars[0];
|
|
if (typeof value === "string" && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))/)) {
|
|
return `, var(--${prefix ? `${prefix}-` : ""}${value}${appendVar(...vars.slice(1))})`;
|
|
}
|
|
return `, ${value}`;
|
|
}
|
|
const getCssVar = (field, ...vars) => {
|
|
return `var(--${prefix ? `${prefix}-` : ""}${field}${appendVar(...vars)})`;
|
|
};
|
|
return getCssVar;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/cssVars/createCssVarsProvider.js
|
|
var require_createCssVarsProvider = __commonJS({
|
|
"node_modules/@mui/system/cssVars/createCssVarsProvider.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DISABLE_CSS_TRANSITION = void 0;
|
|
exports.default = createCssVarsProvider;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _styledEngine = require_node3();
|
|
var _createSpacing = _interopRequireDefault(require_createSpacing());
|
|
var _createBreakpoints = _interopRequireDefault(require_createBreakpoints());
|
|
var _cssVarsParser = _interopRequireDefault(require_cssVarsParser());
|
|
var _ThemeProvider = _interopRequireDefault(require_ThemeProvider4());
|
|
var _getInitColorSchemeScript = _interopRequireWildcard(require_getInitColorSchemeScript());
|
|
var _useCurrentColorScheme = _interopRequireDefault(require_useCurrentColorScheme());
|
|
var _createGetCssVar = _interopRequireDefault(require_createGetCssVar());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["colorSchemes"];
|
|
var _excluded2 = ["colorSchemes"];
|
|
var _excluded3 = ["components"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var DISABLE_CSS_TRANSITION = "*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
|
|
exports.DISABLE_CSS_TRANSITION = DISABLE_CSS_TRANSITION;
|
|
function createCssVarsProvider(options) {
|
|
var _baseTheme$breakpoint;
|
|
const {
|
|
theme: baseTheme = {},
|
|
defaultMode: desisgnSystemMode = "light",
|
|
defaultColorScheme: designSystemColorScheme,
|
|
disableTransitionOnChange: designSystemTransitionOnChange = false,
|
|
enableColorScheme: designSystemEnableColorScheme = true,
|
|
prefix: designSystemPrefix = "",
|
|
shouldSkipGeneratingVar,
|
|
resolveTheme
|
|
} = options;
|
|
const systemSpacing = (0, _createSpacing.default)(baseTheme.spacing);
|
|
const systemBreakpoints = (0, _createBreakpoints.default)((_baseTheme$breakpoint = baseTheme.breakpoints) != null ? _baseTheme$breakpoint : {});
|
|
if (!baseTheme.colorSchemes || typeof designSystemColorScheme === "string" && !baseTheme.colorSchemes[designSystemColorScheme] || typeof designSystemColorScheme === "object" && !baseTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.light] || typeof designSystemColorScheme === "object" && !baseTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.dark]) {
|
|
console.error(`MUI: \`${designSystemColorScheme}\` does not exist in \`theme.colorSchemes\`.`);
|
|
}
|
|
const ColorSchemeContext = /* @__PURE__ */ React31.createContext(void 0);
|
|
const useColorScheme = () => {
|
|
const value = React31.useContext(ColorSchemeContext);
|
|
if (!value) {
|
|
throw new Error(true ? `MUI: \`useColorScheme\` must be called under <CssVarsProvider />` : (0, _utils.formatMuiErrorMessage)(19));
|
|
}
|
|
return value;
|
|
};
|
|
function CssVarsProvider({
|
|
children,
|
|
theme: themeProp = {},
|
|
prefix = designSystemPrefix,
|
|
modeStorageKey = _getInitColorSchemeScript.DEFAULT_MODE_STORAGE_KEY,
|
|
attribute = _getInitColorSchemeScript.DEFAULT_ATTRIBUTE,
|
|
defaultMode = desisgnSystemMode,
|
|
defaultColorScheme = designSystemColorScheme,
|
|
disableTransitionOnChange = designSystemTransitionOnChange,
|
|
enableColorScheme = designSystemEnableColorScheme
|
|
}) {
|
|
const {
|
|
colorSchemes: baseColorSchemes = {}
|
|
} = baseTheme, restBaseTheme = (0, _objectWithoutPropertiesLoose2.default)(baseTheme, _excluded);
|
|
const {
|
|
colorSchemes: colorSchemesProp = {}
|
|
} = themeProp, restThemeProp = (0, _objectWithoutPropertiesLoose2.default)(themeProp, _excluded2);
|
|
const hasMounted = React31.useRef(false);
|
|
let _deepmerge = (0, _utils.deepmerge)(restBaseTheme, restThemeProp), {
|
|
components = {}
|
|
} = _deepmerge, mergedTheme = (0, _objectWithoutPropertiesLoose2.default)(_deepmerge, _excluded3);
|
|
const colorSchemes = (0, _utils.deepmerge)(baseColorSchemes, colorSchemesProp);
|
|
const allColorSchemes = Object.keys(colorSchemes);
|
|
const defaultLightColorScheme = typeof defaultColorScheme === "string" ? defaultColorScheme : defaultColorScheme.light;
|
|
const defaultDarkColorScheme = typeof defaultColorScheme === "string" ? defaultColorScheme : defaultColorScheme.dark;
|
|
const {
|
|
mode,
|
|
setMode,
|
|
systemMode,
|
|
lightColorScheme,
|
|
darkColorScheme,
|
|
colorScheme,
|
|
setColorScheme
|
|
} = (0, _useCurrentColorScheme.default)({
|
|
supportedColorSchemes: allColorSchemes,
|
|
defaultLightColorScheme,
|
|
defaultDarkColorScheme,
|
|
modeStorageKey,
|
|
defaultMode
|
|
});
|
|
const resolvedColorScheme = (() => {
|
|
if (!colorScheme) {
|
|
if (defaultMode === "dark") {
|
|
return defaultDarkColorScheme;
|
|
}
|
|
return defaultLightColorScheme;
|
|
}
|
|
return colorScheme;
|
|
})();
|
|
const {
|
|
css: rootCss,
|
|
vars: rootVars,
|
|
parsedTheme
|
|
} = (0, _cssVarsParser.default)(mergedTheme, {
|
|
prefix,
|
|
basePrefix: designSystemPrefix,
|
|
shouldSkipGeneratingVar
|
|
});
|
|
mergedTheme = (0, _extends2.default)({}, parsedTheme, {
|
|
components,
|
|
colorSchemes,
|
|
prefix,
|
|
vars: rootVars,
|
|
spacing: themeProp.spacing ? (0, _createSpacing.default)(themeProp.spacing) : systemSpacing,
|
|
breakpoints: themeProp.breakpoints ? (0, _createBreakpoints.default)(themeProp.breakpoints) : systemBreakpoints,
|
|
getCssVar: (0, _createGetCssVar.default)(prefix)
|
|
});
|
|
const styleSheet = {};
|
|
Object.entries(colorSchemes).forEach(([key, scheme]) => {
|
|
const {
|
|
css,
|
|
vars,
|
|
parsedTheme: parsedScheme
|
|
} = (0, _cssVarsParser.default)(scheme, {
|
|
prefix,
|
|
basePrefix: designSystemPrefix,
|
|
shouldSkipGeneratingVar
|
|
});
|
|
mergedTheme.vars = (0, _utils.deepmerge)(mergedTheme.vars, vars);
|
|
if (key === resolvedColorScheme) {
|
|
mergedTheme = (0, _extends2.default)({}, mergedTheme, parsedScheme);
|
|
}
|
|
const resolvedDefaultColorScheme = (() => {
|
|
if (typeof defaultColorScheme === "string") {
|
|
return defaultColorScheme;
|
|
}
|
|
if (defaultMode === "dark") {
|
|
return defaultColorScheme.dark;
|
|
}
|
|
return defaultColorScheme.light;
|
|
})();
|
|
if (key === resolvedDefaultColorScheme) {
|
|
styleSheet[":root"] = css;
|
|
} else {
|
|
styleSheet[`[${attribute}="${key}"]`] = css;
|
|
}
|
|
});
|
|
React31.useEffect(() => {
|
|
if (colorScheme) {
|
|
document.documentElement.setAttribute(attribute, colorScheme);
|
|
}
|
|
}, [colorScheme, attribute]);
|
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
if (!mode || !enableColorScheme) {
|
|
return void 0;
|
|
}
|
|
const priorColorScheme = document.documentElement.style.getPropertyValue("color-scheme");
|
|
if (mode === "system") {
|
|
document.documentElement.style.setProperty("color-scheme", systemMode);
|
|
} else {
|
|
document.documentElement.style.setProperty("color-scheme", mode);
|
|
}
|
|
return () => {
|
|
document.documentElement.style.setProperty("color-scheme", priorColorScheme);
|
|
};
|
|
}, [mode, systemMode, enableColorScheme]);
|
|
React31.useEffect(() => {
|
|
let timer;
|
|
if (disableTransitionOnChange && hasMounted.current) {
|
|
const css = document.createElement("style");
|
|
css.appendChild(document.createTextNode(DISABLE_CSS_TRANSITION));
|
|
document.head.appendChild(css);
|
|
(() => window.getComputedStyle(document.body))();
|
|
timer = setTimeout(() => {
|
|
document.head.removeChild(css);
|
|
}, 1);
|
|
}
|
|
return () => {
|
|
clearTimeout(timer);
|
|
};
|
|
}, [colorScheme, disableTransitionOnChange]);
|
|
React31.useEffect(() => {
|
|
hasMounted.current = true;
|
|
return () => {
|
|
hasMounted.current = false;
|
|
};
|
|
}, []);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(ColorSchemeContext.Provider, {
|
|
value: {
|
|
mode,
|
|
setMode,
|
|
lightColorScheme,
|
|
darkColorScheme,
|
|
colorScheme,
|
|
setColorScheme,
|
|
allColorSchemes
|
|
},
|
|
children: [/* @__PURE__ */ (0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {
|
|
styles: {
|
|
":root": rootCss
|
|
}
|
|
}), /* @__PURE__ */ (0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {
|
|
styles: styleSheet
|
|
}), /* @__PURE__ */ (0, _jsxRuntime.jsx)(_ThemeProvider.default, {
|
|
theme: resolveTheme ? resolveTheme(mergedTheme) : mergedTheme,
|
|
children
|
|
})]
|
|
});
|
|
}
|
|
true ? CssVarsProvider.propTypes = {
|
|
attribute: _propTypes.default.string,
|
|
children: _propTypes.default.node,
|
|
defaultColorScheme: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
defaultMode: _propTypes.default.string,
|
|
disableTransitionOnChange: _propTypes.default.bool,
|
|
enableColorScheme: _propTypes.default.bool,
|
|
modeStorageKey: _propTypes.default.string,
|
|
prefix: _propTypes.default.string,
|
|
theme: _propTypes.default.object
|
|
} : void 0;
|
|
return {
|
|
CssVarsProvider,
|
|
useColorScheme,
|
|
getInitColorSchemeScript: _getInitColorSchemeScript.default
|
|
};
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/system/index.js
|
|
var require_system = __commonJS({
|
|
"node_modules/@mui/system/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
css: true,
|
|
keyframes: true,
|
|
GlobalStyles: true,
|
|
StyledEngineProvider: true,
|
|
borders: true,
|
|
breakpoints: true,
|
|
handleBreakpoints: true,
|
|
mergeBreakpointsInOrder: true,
|
|
unstable_resolveBreakpointValues: true,
|
|
compose: true,
|
|
display: true,
|
|
flexbox: true,
|
|
grid: true,
|
|
palette: true,
|
|
positions: true,
|
|
shadows: true,
|
|
sizing: true,
|
|
spacing: true,
|
|
style: true,
|
|
getPath: true,
|
|
typography: true,
|
|
unstable_styleFunctionSx: true,
|
|
unstable_createStyleFunctionSx: true,
|
|
unstable_extendSxProp: true,
|
|
experimental_sx: true,
|
|
unstable_getThemeValue: true,
|
|
Box: true,
|
|
createBox: true,
|
|
createStyled: true,
|
|
styled: true,
|
|
createTheme: true,
|
|
createBreakpoints: true,
|
|
createSpacing: true,
|
|
shape: true,
|
|
useThemeProps: true,
|
|
getThemeProps: true,
|
|
useTheme: true,
|
|
useThemeWithoutDefault: true,
|
|
ThemeProvider: true,
|
|
unstable_createCssVarsProvider: true,
|
|
unstable_createGetCssVar: true
|
|
};
|
|
Object.defineProperty(exports, "Box", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _Box.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "GlobalStyles", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styledEngine.GlobalStyles;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "StyledEngineProvider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styledEngine.StyledEngineProvider;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ThemeProvider.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "borders", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _borders.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "breakpoints", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _breakpoints.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "compose", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _compose.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createBox", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createBox.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createBreakpoints", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createBreakpoints.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createSpacing", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createSpacing.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createStyled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createStyled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createTheme", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createTheme.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "css", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styledEngine.css;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "display", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _display.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "experimental_sx", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sx.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "flexbox", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _flexbox.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getPath", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _style.getPath;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "getThemeProps", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useThemeProps.getThemeProps;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "grid", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _grid.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "handleBreakpoints", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _breakpoints.handleBreakpoints;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "keyframes", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styledEngine.keyframes;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "mergeBreakpointsInOrder", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _breakpoints.mergeBreakpointsInOrder;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "palette", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _palette.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "positions", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _positions.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "shadows", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _shadows.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "shape", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _shape.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "sizing", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sizing.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "spacing", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _spacing.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "style", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _style.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "styled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "typography", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _typography.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_createCssVarsProvider", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createCssVarsProvider.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_createGetCssVar", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createGetCssVar.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_createStyleFunctionSx", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styleFunctionSx.unstable_createStyleFunctionSx;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_extendSxProp", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styleFunctionSx.extendSxProp;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_getThemeValue", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _getThemeValue.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_resolveBreakpointValues", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _breakpoints.resolveBreakpointValues;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_styleFunctionSx", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _styleFunctionSx.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useTheme", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useTheme.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useThemeProps", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useThemeProps.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useThemeWithoutDefault", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useThemeWithoutDefault.default;
|
|
}
|
|
});
|
|
var _styledEngine = require_node3();
|
|
var _borders = _interopRequireWildcard(require_borders());
|
|
Object.keys(_borders).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _borders[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _borders[key];
|
|
}
|
|
});
|
|
});
|
|
var _breakpoints = _interopRequireWildcard(require_breakpoints());
|
|
var _compose = _interopRequireDefault(require_compose());
|
|
var _display = _interopRequireDefault(require_display());
|
|
var _flexbox = _interopRequireWildcard(require_flexbox());
|
|
Object.keys(_flexbox).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _flexbox[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _flexbox[key];
|
|
}
|
|
});
|
|
});
|
|
var _grid = _interopRequireWildcard(require_grid());
|
|
Object.keys(_grid).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _grid[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _grid[key];
|
|
}
|
|
});
|
|
});
|
|
var _palette = _interopRequireWildcard(require_palette());
|
|
Object.keys(_palette).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _palette[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _palette[key];
|
|
}
|
|
});
|
|
});
|
|
var _positions = _interopRequireWildcard(require_positions());
|
|
Object.keys(_positions).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _positions[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _positions[key];
|
|
}
|
|
});
|
|
});
|
|
var _shadows = _interopRequireDefault(require_shadows());
|
|
var _sizing = _interopRequireWildcard(require_sizing());
|
|
Object.keys(_sizing).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _sizing[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _sizing[key];
|
|
}
|
|
});
|
|
});
|
|
var _spacing = _interopRequireWildcard(require_spacing());
|
|
Object.keys(_spacing).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _spacing[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _spacing[key];
|
|
}
|
|
});
|
|
});
|
|
var _style = _interopRequireWildcard(require_style());
|
|
var _typography = _interopRequireWildcard(require_typography());
|
|
Object.keys(_typography).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _typography[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _typography[key];
|
|
}
|
|
});
|
|
});
|
|
var _styleFunctionSx = _interopRequireWildcard(require_styleFunctionSx2());
|
|
var _sx = _interopRequireDefault(require_sx2());
|
|
var _getThemeValue = _interopRequireDefault(require_getThemeValue());
|
|
var _Box = _interopRequireDefault(require_Box2());
|
|
var _createBox = _interopRequireDefault(require_createBox());
|
|
var _createStyled = _interopRequireWildcard(require_createStyled());
|
|
Object.keys(_createStyled).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _createStyled[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createStyled[key];
|
|
}
|
|
});
|
|
});
|
|
var _styled = _interopRequireDefault(require_styled());
|
|
var _createTheme = _interopRequireDefault(require_createTheme2());
|
|
var _createBreakpoints = _interopRequireDefault(require_createBreakpoints());
|
|
var _createSpacing = _interopRequireDefault(require_createSpacing());
|
|
var _shape = _interopRequireDefault(require_shape());
|
|
var _useThemeProps = _interopRequireWildcard(require_useThemeProps2());
|
|
var _useTheme = _interopRequireDefault(require_useTheme3());
|
|
var _useThemeWithoutDefault = _interopRequireDefault(require_useThemeWithoutDefault());
|
|
var _colorManipulator = require_colorManipulator();
|
|
Object.keys(_colorManipulator).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _colorManipulator[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _colorManipulator[key];
|
|
}
|
|
});
|
|
});
|
|
var _ThemeProvider = _interopRequireDefault(require_ThemeProvider4());
|
|
var _createCssVarsProvider = _interopRequireDefault(require_createCssVarsProvider());
|
|
var _createGetCssVar = _interopRequireDefault(require_createGetCssVar());
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/createMixins.js
|
|
var require_createMixins = __commonJS({
|
|
"node_modules/@mui/material/node/styles/createMixins.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createMixins;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
function createMixins(breakpoints, spacing, mixins) {
|
|
return (0, _extends2.default)({
|
|
toolbar: {
|
|
minHeight: 56,
|
|
[`${breakpoints.up("xs")} and (orientation: landscape)`]: {
|
|
minHeight: 48
|
|
},
|
|
[breakpoints.up("sm")]: {
|
|
minHeight: 64
|
|
}
|
|
}
|
|
}, mixins);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/common.js
|
|
var require_common = __commonJS({
|
|
"node_modules/@mui/material/node/colors/common.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var common = {
|
|
black: "#000",
|
|
white: "#fff"
|
|
};
|
|
var _default = common;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/grey.js
|
|
var require_grey = __commonJS({
|
|
"node_modules/@mui/material/node/colors/grey.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var grey = {
|
|
50: "#fafafa",
|
|
100: "#f5f5f5",
|
|
200: "#eeeeee",
|
|
300: "#e0e0e0",
|
|
400: "#bdbdbd",
|
|
500: "#9e9e9e",
|
|
600: "#757575",
|
|
700: "#616161",
|
|
800: "#424242",
|
|
900: "#212121",
|
|
A100: "#f5f5f5",
|
|
A200: "#eeeeee",
|
|
A400: "#bdbdbd",
|
|
A700: "#616161"
|
|
};
|
|
var _default = grey;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/purple.js
|
|
var require_purple = __commonJS({
|
|
"node_modules/@mui/material/node/colors/purple.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var purple = {
|
|
50: "#f3e5f5",
|
|
100: "#e1bee7",
|
|
200: "#ce93d8",
|
|
300: "#ba68c8",
|
|
400: "#ab47bc",
|
|
500: "#9c27b0",
|
|
600: "#8e24aa",
|
|
700: "#7b1fa2",
|
|
800: "#6a1b9a",
|
|
900: "#4a148c",
|
|
A100: "#ea80fc",
|
|
A200: "#e040fb",
|
|
A400: "#d500f9",
|
|
A700: "#aa00ff"
|
|
};
|
|
var _default = purple;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/red.js
|
|
var require_red = __commonJS({
|
|
"node_modules/@mui/material/node/colors/red.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var red = {
|
|
50: "#ffebee",
|
|
100: "#ffcdd2",
|
|
200: "#ef9a9a",
|
|
300: "#e57373",
|
|
400: "#ef5350",
|
|
500: "#f44336",
|
|
600: "#e53935",
|
|
700: "#d32f2f",
|
|
800: "#c62828",
|
|
900: "#b71c1c",
|
|
A100: "#ff8a80",
|
|
A200: "#ff5252",
|
|
A400: "#ff1744",
|
|
A700: "#d50000"
|
|
};
|
|
var _default = red;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/orange.js
|
|
var require_orange = __commonJS({
|
|
"node_modules/@mui/material/node/colors/orange.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var orange = {
|
|
50: "#fff3e0",
|
|
100: "#ffe0b2",
|
|
200: "#ffcc80",
|
|
300: "#ffb74d",
|
|
400: "#ffa726",
|
|
500: "#ff9800",
|
|
600: "#fb8c00",
|
|
700: "#f57c00",
|
|
800: "#ef6c00",
|
|
900: "#e65100",
|
|
A100: "#ffd180",
|
|
A200: "#ffab40",
|
|
A400: "#ff9100",
|
|
A700: "#ff6d00"
|
|
};
|
|
var _default = orange;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/blue.js
|
|
var require_blue = __commonJS({
|
|
"node_modules/@mui/material/node/colors/blue.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var blue = {
|
|
50: "#e3f2fd",
|
|
100: "#bbdefb",
|
|
200: "#90caf9",
|
|
300: "#64b5f6",
|
|
400: "#42a5f5",
|
|
500: "#2196f3",
|
|
600: "#1e88e5",
|
|
700: "#1976d2",
|
|
800: "#1565c0",
|
|
900: "#0d47a1",
|
|
A100: "#82b1ff",
|
|
A200: "#448aff",
|
|
A400: "#2979ff",
|
|
A700: "#2962ff"
|
|
};
|
|
var _default = blue;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/lightBlue.js
|
|
var require_lightBlue = __commonJS({
|
|
"node_modules/@mui/material/node/colors/lightBlue.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var lightBlue = {
|
|
50: "#e1f5fe",
|
|
100: "#b3e5fc",
|
|
200: "#81d4fa",
|
|
300: "#4fc3f7",
|
|
400: "#29b6f6",
|
|
500: "#03a9f4",
|
|
600: "#039be5",
|
|
700: "#0288d1",
|
|
800: "#0277bd",
|
|
900: "#01579b",
|
|
A100: "#80d8ff",
|
|
A200: "#40c4ff",
|
|
A400: "#00b0ff",
|
|
A700: "#0091ea"
|
|
};
|
|
var _default = lightBlue;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/colors/green.js
|
|
var require_green = __commonJS({
|
|
"node_modules/@mui/material/node/colors/green.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var green = {
|
|
50: "#e8f5e9",
|
|
100: "#c8e6c9",
|
|
200: "#a5d6a7",
|
|
300: "#81c784",
|
|
400: "#66bb6a",
|
|
500: "#4caf50",
|
|
600: "#43a047",
|
|
700: "#388e3c",
|
|
800: "#2e7d32",
|
|
900: "#1b5e20",
|
|
A100: "#b9f6ca",
|
|
A200: "#69f0ae",
|
|
A400: "#00e676",
|
|
A700: "#00c853"
|
|
};
|
|
var _default = green;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/createPalette.js
|
|
var require_createPalette = __commonJS({
|
|
"node_modules/@mui/material/node/styles/createPalette.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.dark = void 0;
|
|
exports.default = createPalette;
|
|
exports.light = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _system = require_system();
|
|
var _common = _interopRequireDefault(require_common());
|
|
var _grey = _interopRequireDefault(require_grey());
|
|
var _purple = _interopRequireDefault(require_purple());
|
|
var _red = _interopRequireDefault(require_red());
|
|
var _orange = _interopRequireDefault(require_orange());
|
|
var _blue = _interopRequireDefault(require_blue());
|
|
var _lightBlue = _interopRequireDefault(require_lightBlue());
|
|
var _green = _interopRequireDefault(require_green());
|
|
var _excluded = ["mode", "contrastThreshold", "tonalOffset"];
|
|
var light = {
|
|
text: {
|
|
primary: "rgba(0, 0, 0, 0.87)",
|
|
secondary: "rgba(0, 0, 0, 0.6)",
|
|
disabled: "rgba(0, 0, 0, 0.38)"
|
|
},
|
|
divider: "rgba(0, 0, 0, 0.12)",
|
|
background: {
|
|
paper: _common.default.white,
|
|
default: _common.default.white
|
|
},
|
|
action: {
|
|
active: "rgba(0, 0, 0, 0.54)",
|
|
hover: "rgba(0, 0, 0, 0.04)",
|
|
hoverOpacity: 0.04,
|
|
selected: "rgba(0, 0, 0, 0.08)",
|
|
selectedOpacity: 0.08,
|
|
disabled: "rgba(0, 0, 0, 0.26)",
|
|
disabledBackground: "rgba(0, 0, 0, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(0, 0, 0, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.12
|
|
}
|
|
};
|
|
exports.light = light;
|
|
var dark = {
|
|
text: {
|
|
primary: _common.default.white,
|
|
secondary: "rgba(255, 255, 255, 0.7)",
|
|
disabled: "rgba(255, 255, 255, 0.5)",
|
|
icon: "rgba(255, 255, 255, 0.5)"
|
|
},
|
|
divider: "rgba(255, 255, 255, 0.12)",
|
|
background: {
|
|
paper: "#121212",
|
|
default: "#121212"
|
|
},
|
|
action: {
|
|
active: _common.default.white,
|
|
hover: "rgba(255, 255, 255, 0.08)",
|
|
hoverOpacity: 0.08,
|
|
selected: "rgba(255, 255, 255, 0.16)",
|
|
selectedOpacity: 0.16,
|
|
disabled: "rgba(255, 255, 255, 0.3)",
|
|
disabledBackground: "rgba(255, 255, 255, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(255, 255, 255, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.24
|
|
}
|
|
};
|
|
exports.dark = dark;
|
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
if (!intent[direction]) {
|
|
if (intent.hasOwnProperty(shade)) {
|
|
intent[direction] = intent[shade];
|
|
} else if (direction === "light") {
|
|
intent.light = (0, _system.lighten)(intent.main, tonalOffsetLight);
|
|
} else if (direction === "dark") {
|
|
intent.dark = (0, _system.darken)(intent.main, tonalOffsetDark);
|
|
}
|
|
}
|
|
}
|
|
function getDefaultPrimary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _blue.default[200],
|
|
light: _blue.default[50],
|
|
dark: _blue.default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: _blue.default[700],
|
|
light: _blue.default[400],
|
|
dark: _blue.default[800]
|
|
};
|
|
}
|
|
function getDefaultSecondary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _purple.default[200],
|
|
light: _purple.default[50],
|
|
dark: _purple.default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: _purple.default[500],
|
|
light: _purple.default[300],
|
|
dark: _purple.default[700]
|
|
};
|
|
}
|
|
function getDefaultError(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _red.default[500],
|
|
light: _red.default[300],
|
|
dark: _red.default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: _red.default[700],
|
|
light: _red.default[400],
|
|
dark: _red.default[800]
|
|
};
|
|
}
|
|
function getDefaultInfo(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _lightBlue.default[400],
|
|
light: _lightBlue.default[300],
|
|
dark: _lightBlue.default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: _lightBlue.default[700],
|
|
light: _lightBlue.default[500],
|
|
dark: _lightBlue.default[900]
|
|
};
|
|
}
|
|
function getDefaultSuccess(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _green.default[400],
|
|
light: _green.default[300],
|
|
dark: _green.default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: _green.default[800],
|
|
light: _green.default[500],
|
|
dark: _green.default[900]
|
|
};
|
|
}
|
|
function getDefaultWarning(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: _orange.default[400],
|
|
light: _orange.default[300],
|
|
dark: _orange.default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: "#ed6c02",
|
|
light: _orange.default[500],
|
|
dark: _orange.default[900]
|
|
};
|
|
}
|
|
function createPalette(palette) {
|
|
const {
|
|
mode = "light",
|
|
contrastThreshold = 3,
|
|
tonalOffset = 0.2
|
|
} = palette, other = (0, _objectWithoutPropertiesLoose2.default)(palette, _excluded);
|
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
const error = palette.error || getDefaultError(mode);
|
|
const info = palette.info || getDefaultInfo(mode);
|
|
const success = palette.success || getDefaultSuccess(mode);
|
|
const warning = palette.warning || getDefaultWarning(mode);
|
|
function getContrastText(background) {
|
|
const contrastText = (0, _system.getContrastRatio)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
if (true) {
|
|
const contrast = (0, _system.getContrastRatio)(background, contrastText);
|
|
if (contrast < 3) {
|
|
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, "falls below the WCAG recommended absolute minimum contrast ratio of 3:1.", "https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join("\n"));
|
|
}
|
|
}
|
|
return contrastText;
|
|
}
|
|
const augmentColor = ({
|
|
color,
|
|
name,
|
|
mainShade = 500,
|
|
lightShade = 300,
|
|
darkShade = 700
|
|
}) => {
|
|
color = (0, _extends2.default)({}, color);
|
|
if (!color.main && color[mainShade]) {
|
|
color.main = color[mainShade];
|
|
}
|
|
if (!color.hasOwnProperty("main")) {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : (0, _utils.formatMuiErrorMessage)(11, name ? ` (${name})` : "", mainShade));
|
|
}
|
|
if (typeof color.main !== "string") {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
|
|
|
Did you intend to use one of the following approaches?
|
|
|
|
import { green } from "@mui/material/colors";
|
|
|
|
const theme1 = createTheme({ palette: {
|
|
primary: green,
|
|
} });
|
|
|
|
const theme2 = createTheme({ palette: {
|
|
primary: { main: green[500] },
|
|
} });` : (0, _utils.formatMuiErrorMessage)(12, name ? ` (${name})` : "", JSON.stringify(color.main)));
|
|
}
|
|
addLightOrDark(color, "light", lightShade, tonalOffset);
|
|
addLightOrDark(color, "dark", darkShade, tonalOffset);
|
|
if (!color.contrastText) {
|
|
color.contrastText = getContrastText(color.main);
|
|
}
|
|
return color;
|
|
};
|
|
const modes = {
|
|
dark,
|
|
light
|
|
};
|
|
if (true) {
|
|
if (!modes[mode]) {
|
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
}
|
|
}
|
|
const paletteOutput = (0, _utils.deepmerge)((0, _extends2.default)({
|
|
common: _common.default,
|
|
mode,
|
|
primary: augmentColor({
|
|
color: primary,
|
|
name: "primary"
|
|
}),
|
|
secondary: augmentColor({
|
|
color: secondary,
|
|
name: "secondary",
|
|
mainShade: "A400",
|
|
lightShade: "A200",
|
|
darkShade: "A700"
|
|
}),
|
|
error: augmentColor({
|
|
color: error,
|
|
name: "error"
|
|
}),
|
|
warning: augmentColor({
|
|
color: warning,
|
|
name: "warning"
|
|
}),
|
|
info: augmentColor({
|
|
color: info,
|
|
name: "info"
|
|
}),
|
|
success: augmentColor({
|
|
color: success,
|
|
name: "success"
|
|
}),
|
|
grey: _grey.default,
|
|
contrastThreshold,
|
|
getContrastText,
|
|
augmentColor,
|
|
tonalOffset
|
|
}, modes[mode]), other);
|
|
return paletteOutput;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/createTypography.js
|
|
var require_createTypography = __commonJS({
|
|
"node_modules/@mui/material/node/styles/createTypography.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createTypography;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _excluded = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
function round(value) {
|
|
return Math.round(value * 1e5) / 1e5;
|
|
}
|
|
var caseAllCaps = {
|
|
textTransform: "uppercase"
|
|
};
|
|
var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
function createTypography(palette, typography) {
|
|
const _ref = typeof typography === "function" ? typography(palette) : typography, {
|
|
fontFamily = defaultFontFamily,
|
|
fontSize = 14,
|
|
fontWeightLight = 300,
|
|
fontWeightRegular = 400,
|
|
fontWeightMedium = 500,
|
|
fontWeightBold = 700,
|
|
htmlFontSize = 16,
|
|
allVariants,
|
|
pxToRem: pxToRem2
|
|
} = _ref, other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
if (true) {
|
|
if (typeof fontSize !== "number") {
|
|
console.error("MUI: `fontSize` is required to be a number.");
|
|
}
|
|
if (typeof htmlFontSize !== "number") {
|
|
console.error("MUI: `htmlFontSize` is required to be a number.");
|
|
}
|
|
}
|
|
const coef = fontSize / 14;
|
|
const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
|
|
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => (0, _extends2.default)({
|
|
fontFamily,
|
|
fontWeight,
|
|
fontSize: pxToRem(size),
|
|
lineHeight
|
|
}, fontFamily === defaultFontFamily ? {
|
|
letterSpacing: `${round(letterSpacing / size)}em`
|
|
} : {}, casing, allVariants);
|
|
const variants = {
|
|
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
|
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
|
h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
|
|
h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
|
|
h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
|
|
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
|
|
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
|
|
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
|
|
body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
|
|
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
|
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
|
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
|
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)
|
|
};
|
|
return (0, _utils.deepmerge)((0, _extends2.default)({
|
|
htmlFontSize,
|
|
pxToRem,
|
|
fontFamily,
|
|
fontSize,
|
|
fontWeightLight,
|
|
fontWeightRegular,
|
|
fontWeightMedium,
|
|
fontWeightBold
|
|
}, variants), other, {
|
|
clone: false
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/shadows.js
|
|
var require_shadows2 = __commonJS({
|
|
"node_modules/@mui/material/node/styles/shadows.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var shadowKeyUmbraOpacity = 0.2;
|
|
var shadowKeyPenumbraOpacity = 0.14;
|
|
var shadowAmbientShadowOpacity = 0.12;
|
|
function createShadow(...px) {
|
|
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
|
|
}
|
|
var shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
var _default = shadows;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/createTransitions.js
|
|
var require_createTransitions = __commonJS({
|
|
"node_modules/@mui/material/node/styles/createTransitions.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createTransitions;
|
|
exports.easing = exports.duration = void 0;
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _excluded = ["duration", "easing", "delay"];
|
|
var easing = {
|
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
|
|
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
|
|
};
|
|
exports.easing = easing;
|
|
var duration = {
|
|
shortest: 150,
|
|
shorter: 200,
|
|
short: 250,
|
|
standard: 300,
|
|
complex: 375,
|
|
enteringScreen: 225,
|
|
leavingScreen: 195
|
|
};
|
|
exports.duration = duration;
|
|
function formatMs(milliseconds) {
|
|
return `${Math.round(milliseconds)}ms`;
|
|
}
|
|
function getAutoHeightDuration(height) {
|
|
if (!height) {
|
|
return 0;
|
|
}
|
|
const constant = height / 36;
|
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
}
|
|
function createTransitions(inputTransitions) {
|
|
const mergedEasing = (0, _extends2.default)({}, easing, inputTransitions.easing);
|
|
const mergedDuration = (0, _extends2.default)({}, duration, inputTransitions.duration);
|
|
const create = (props = ["all"], options = {}) => {
|
|
const {
|
|
duration: durationOption = mergedDuration.standard,
|
|
easing: easingOption = mergedEasing.easeInOut,
|
|
delay = 0
|
|
} = options, other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);
|
|
if (true) {
|
|
const isString = (value) => typeof value === "string";
|
|
const isNumber2 = (value) => !isNaN(parseFloat(value));
|
|
if (!isString(props) && !Array.isArray(props)) {
|
|
console.error('MUI: Argument "props" must be a string or Array.');
|
|
}
|
|
if (!isNumber2(durationOption) && !isString(durationOption)) {
|
|
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
|
}
|
|
if (!isString(easingOption)) {
|
|
console.error('MUI: Argument "easing" must be a string.');
|
|
}
|
|
if (!isNumber2(delay) && !isString(delay)) {
|
|
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
}
|
|
if (Object.keys(other).length !== 0) {
|
|
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(",")}].`);
|
|
}
|
|
}
|
|
return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
|
|
};
|
|
return (0, _extends2.default)({
|
|
getAutoHeightDuration,
|
|
create
|
|
}, inputTransitions, {
|
|
easing: mergedEasing,
|
|
duration: mergedDuration
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/zIndex.js
|
|
var require_zIndex = __commonJS({
|
|
"node_modules/@mui/material/node/styles/zIndex.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var zIndex = {
|
|
mobileStepper: 1e3,
|
|
speedDial: 1050,
|
|
appBar: 1100,
|
|
drawer: 1200,
|
|
modal: 1300,
|
|
snackbar: 1400,
|
|
tooltip: 1500
|
|
};
|
|
var _default = zIndex;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/createTheme.js
|
|
var require_createTheme3 = __commonJS({
|
|
"node_modules/@mui/material/node/styles/createTheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.createMuiTheme = createMuiTheme;
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var _utils = require_utils();
|
|
var _base = require_node2();
|
|
var _system = require_system();
|
|
var _createMixins = _interopRequireDefault(require_createMixins());
|
|
var _createPalette = _interopRequireDefault(require_createPalette());
|
|
var _createTypography = _interopRequireDefault(require_createTypography());
|
|
var _shadows = _interopRequireDefault(require_shadows2());
|
|
var _createTransitions = _interopRequireDefault(require_createTransitions());
|
|
var _zIndex = _interopRequireDefault(require_zIndex());
|
|
var _excluded = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
function createTheme(options = {}, ...args) {
|
|
const {
|
|
mixins: mixinsInput = {},
|
|
palette: paletteInput = {},
|
|
transitions: transitionsInput = {},
|
|
typography: typographyInput = {}
|
|
} = options, other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);
|
|
const palette = (0, _createPalette.default)(paletteInput);
|
|
const systemTheme = (0, _system.createTheme)(options);
|
|
let muiTheme = (0, _utils.deepmerge)(systemTheme, {
|
|
mixins: (0, _createMixins.default)(systemTheme.breakpoints, systemTheme.spacing, mixinsInput),
|
|
palette,
|
|
shadows: _shadows.default.slice(),
|
|
typography: (0, _createTypography.default)(palette, typographyInput),
|
|
transitions: (0, _createTransitions.default)(transitionsInput),
|
|
zIndex: (0, _extends2.default)({}, _zIndex.default)
|
|
});
|
|
muiTheme = (0, _utils.deepmerge)(muiTheme, other);
|
|
muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);
|
|
if (true) {
|
|
const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
|
|
const traverse = (node, component) => {
|
|
let key;
|
|
for (key in node) {
|
|
const child = node[key];
|
|
if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {
|
|
if (true) {
|
|
const stateClass = (0, _base.generateUtilityClass)("", key);
|
|
console.error([`MUI: The \`${component}\` component increases the CSS specificity of the \`${key}\` internal state.`, "You can not override it like this: ", JSON.stringify(node, null, 2), "", `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
|
root: {
|
|
[`&.${stateClass}`]: child
|
|
}
|
|
}, null, 2), "", "https://mui.com/r/state-classes-guide"].join("\n"));
|
|
}
|
|
node[key] = {};
|
|
}
|
|
}
|
|
};
|
|
Object.keys(muiTheme.components).forEach((component) => {
|
|
const styleOverrides = muiTheme.components[component].styleOverrides;
|
|
if (styleOverrides && component.indexOf("Mui") === 0) {
|
|
traverse(styleOverrides, component);
|
|
}
|
|
});
|
|
}
|
|
return muiTheme;
|
|
}
|
|
var warnedOnce = false;
|
|
function createMuiTheme(...args) {
|
|
if (true) {
|
|
if (!warnedOnce) {
|
|
warnedOnce = true;
|
|
console.error(["MUI: the createMuiTheme function was renamed to createTheme.", "", "You should use `import { createTheme } from '@mui/material/styles'`"].join("\n"));
|
|
}
|
|
}
|
|
return createTheme(...args);
|
|
}
|
|
var _default = createTheme;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/defaultTheme.js
|
|
var require_defaultTheme = __commonJS({
|
|
"node_modules/@mui/material/node/styles/defaultTheme.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createTheme = _interopRequireDefault(require_createTheme3());
|
|
var defaultTheme = (0, _createTheme.default)();
|
|
var _default = defaultTheme;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/useThemeProps.js
|
|
var require_useThemeProps3 = __commonJS({
|
|
"node_modules/@mui/material/node/styles/useThemeProps.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = useThemeProps;
|
|
var _system = require_system();
|
|
var _defaultTheme = _interopRequireDefault(require_defaultTheme());
|
|
function useThemeProps({
|
|
props,
|
|
name
|
|
}) {
|
|
return (0, _system.useThemeProps)({
|
|
props,
|
|
name,
|
|
defaultTheme: _defaultTheme.default
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/styles/styled.js
|
|
var require_styled2 = __commonJS({
|
|
"node_modules/@mui/material/node/styles/styled.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.slotShouldForwardProp = exports.rootShouldForwardProp = exports.default = void 0;
|
|
var _system = require_system();
|
|
var _defaultTheme = _interopRequireDefault(require_defaultTheme());
|
|
var rootShouldForwardProp = (prop) => (0, _system.shouldForwardProp)(prop) && prop !== "classes";
|
|
exports.rootShouldForwardProp = rootShouldForwardProp;
|
|
var slotShouldForwardProp = _system.shouldForwardProp;
|
|
exports.slotShouldForwardProp = slotShouldForwardProp;
|
|
var styled = (0, _system.createStyled)({
|
|
defaultTheme: _defaultTheme.default,
|
|
rootShouldForwardProp
|
|
});
|
|
var _default = styled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/SvgIcon/svgIconClasses.js
|
|
var require_svgIconClasses = __commonJS({
|
|
"node_modules/@mui/material/node/SvgIcon/svgIconClasses.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
exports.getSvgIconUtilityClass = getSvgIconUtilityClass;
|
|
var _base = require_node2();
|
|
function getSvgIconUtilityClass(slot) {
|
|
return (0, _base.generateUtilityClass)("MuiSvgIcon", slot);
|
|
}
|
|
var svgIconClasses = (0, _base.generateUtilityClasses)("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
|
|
var _default = svgIconClasses;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/SvgIcon/SvgIcon.js
|
|
var require_SvgIcon = __commonJS({
|
|
"node_modules/@mui/material/node/SvgIcon/SvgIcon.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _propTypes = _interopRequireDefault(require_prop_types());
|
|
var _clsx = _interopRequireDefault(require_clsx());
|
|
var _base = require_node2();
|
|
var _capitalize = _interopRequireDefault(require_capitalize2());
|
|
var _useThemeProps = _interopRequireDefault(require_useThemeProps3());
|
|
var _styled = _interopRequireDefault(require_styled2());
|
|
var _svgIconClasses = require_svgIconClasses();
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
color,
|
|
fontSize,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", color !== "inherit" && `color${(0, _capitalize.default)(color)}`, `fontSize${(0, _capitalize.default)(fontSize)}`]
|
|
};
|
|
return (0, _base.unstable_composeClasses)(slots, _svgIconClasses.getSvgIconUtilityClass, classes);
|
|
};
|
|
var SvgIconRoot = (0, _styled.default)("svg", {
|
|
name: "MuiSvgIcon",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.color !== "inherit" && styles[`color${(0, _capitalize.default)(ownerState.color)}`], styles[`fontSize${(0, _capitalize.default)(ownerState.fontSize)}`]];
|
|
}
|
|
})(({
|
|
theme,
|
|
ownerState
|
|
}) => {
|
|
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$palette$ownerS, _theme$palette, _theme$palette$ownerS2, _theme$palette2, _theme$palette2$actio, _theme$palette3, _theme$palette3$actio;
|
|
return {
|
|
userSelect: "none",
|
|
width: "1em",
|
|
height: "1em",
|
|
display: "inline-block",
|
|
fill: "currentColor",
|
|
flexShrink: 0,
|
|
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, "fill", {
|
|
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
}),
|
|
fontSize: {
|
|
inherit: "inherit",
|
|
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || "1.25rem",
|
|
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || "1.5rem",
|
|
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || "2.1875"
|
|
}[ownerState.fontSize],
|
|
color: (_theme$palette$ownerS = (_theme$palette = theme.palette) == null ? void 0 : (_theme$palette$ownerS2 = _theme$palette[ownerState.color]) == null ? void 0 : _theme$palette$ownerS2.main) != null ? _theme$palette$ownerS : {
|
|
action: (_theme$palette2 = theme.palette) == null ? void 0 : (_theme$palette2$actio = _theme$palette2.action) == null ? void 0 : _theme$palette2$actio.active,
|
|
disabled: (_theme$palette3 = theme.palette) == null ? void 0 : (_theme$palette3$actio = _theme$palette3.action) == null ? void 0 : _theme$palette3$actio.disabled,
|
|
inherit: void 0
|
|
}[ownerState.color]
|
|
};
|
|
});
|
|
var SvgIcon = /* @__PURE__ */ React31.forwardRef(function SvgIcon2(inProps, ref) {
|
|
const props = (0, _useThemeProps.default)({
|
|
props: inProps,
|
|
name: "MuiSvgIcon"
|
|
});
|
|
const {
|
|
children,
|
|
className,
|
|
color = "inherit",
|
|
component = "svg",
|
|
fontSize = "medium",
|
|
htmlColor,
|
|
inheritViewBox = false,
|
|
titleAccess,
|
|
viewBox = "0 0 24 24"
|
|
} = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
color,
|
|
component,
|
|
fontSize,
|
|
instanceFontSize: inProps.fontSize,
|
|
inheritViewBox,
|
|
viewBox
|
|
});
|
|
const more = {};
|
|
if (!inheritViewBox) {
|
|
more.viewBox = viewBox;
|
|
}
|
|
const classes = useUtilityClasses(ownerState);
|
|
return /* @__PURE__ */ (0, _jsxRuntime.jsxs)(SvgIconRoot, (0, _extends2.default)({
|
|
as: component,
|
|
className: (0, _clsx.default)(classes.root, className),
|
|
ownerState,
|
|
focusable: "false",
|
|
color: htmlColor,
|
|
"aria-hidden": titleAccess ? void 0 : true,
|
|
role: titleAccess ? "img" : void 0,
|
|
ref
|
|
}, more, other, {
|
|
children: [children, titleAccess ? /* @__PURE__ */ (0, _jsxRuntime.jsx)("title", {
|
|
children: titleAccess
|
|
}) : null]
|
|
}));
|
|
});
|
|
true ? SvgIcon.propTypes = {
|
|
children: _propTypes.default.node,
|
|
classes: _propTypes.default.object,
|
|
className: _propTypes.default.string,
|
|
color: _propTypes.default.oneOfType([_propTypes.default.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), _propTypes.default.string]),
|
|
component: _propTypes.default.elementType,
|
|
fontSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(["inherit", "large", "medium", "small"]), _propTypes.default.string]),
|
|
htmlColor: _propTypes.default.string,
|
|
inheritViewBox: _propTypes.default.bool,
|
|
shapeRendering: _propTypes.default.string,
|
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
titleAccess: _propTypes.default.string,
|
|
viewBox: _propTypes.default.string
|
|
} : void 0;
|
|
SvgIcon.muiName = "SvgIcon";
|
|
var _default = SvgIcon;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/SvgIcon/index.js
|
|
var require_SvgIcon2 = __commonJS({
|
|
"node_modules/@mui/material/node/SvgIcon/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var _exportNames = {
|
|
svgIconClasses: true
|
|
};
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _SvgIcon.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "svgIconClasses", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _svgIconClasses.default;
|
|
}
|
|
});
|
|
var _SvgIcon = _interopRequireDefault(require_SvgIcon());
|
|
var _svgIconClasses = _interopRequireWildcard(require_svgIconClasses());
|
|
Object.keys(_svgIconClasses).forEach(function(key) {
|
|
if (key === "default" || key === "__esModule")
|
|
return;
|
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key))
|
|
return;
|
|
if (key in exports && exports[key] === _svgIconClasses[key])
|
|
return;
|
|
Object.defineProperty(exports, key, {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _svgIconClasses[key];
|
|
}
|
|
});
|
|
});
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/createSvgIcon.js
|
|
var require_createSvgIcon = __commonJS({
|
|
"node_modules/@mui/material/node/utils/createSvgIcon.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = createSvgIcon2;
|
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _SvgIcon = _interopRequireDefault(require_SvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
function _getRequireWildcardCache(nodeInterop) {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cacheBabelInterop = new WeakMap();
|
|
var cacheNodeInterop = new WeakMap();
|
|
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
})(nodeInterop);
|
|
}
|
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { default: obj };
|
|
}
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function createSvgIcon2(path, displayName) {
|
|
const Component = (props, ref) => /* @__PURE__ */ (0, _jsxRuntime.jsx)(_SvgIcon.default, (0, _extends2.default)({
|
|
"data-testid": `${displayName}Icon`,
|
|
ref
|
|
}, props, {
|
|
children: path
|
|
}));
|
|
if (true) {
|
|
Component.displayName = `${displayName}Icon`;
|
|
}
|
|
Component.muiName = _SvgIcon.default.muiName;
|
|
return /* @__PURE__ */ React31.memo(/* @__PURE__ */ React31.forwardRef(Component));
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/debounce.js
|
|
var require_debounce2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/debounce.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_debounce;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/deprecatedPropType.js
|
|
var require_deprecatedPropType2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/deprecatedPropType.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_deprecatedPropType;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/isMuiElement.js
|
|
var require_isMuiElement2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/isMuiElement.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_isMuiElement;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/ownerDocument.js
|
|
var require_ownerDocument2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/ownerDocument.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_ownerDocument;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/ownerWindow.js
|
|
var require_ownerWindow2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/ownerWindow.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_ownerWindow;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/requirePropFactory.js
|
|
var require_requirePropFactory2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/requirePropFactory.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_requirePropFactory;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/setRef.js
|
|
var require_setRef2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/setRef.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_setRef;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useEnhancedEffect.js
|
|
var require_useEnhancedEffect2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useEnhancedEffect.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useEnhancedEffect;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useId.js
|
|
var require_useId2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useId.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useId;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/unsupportedProp.js
|
|
var require_unsupportedProp2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/unsupportedProp.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_unsupportedProp;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useControlled.js
|
|
var require_useControlled2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useControlled.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useControlled;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useEventCallback.js
|
|
var require_useEventCallback2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useEventCallback.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useEventCallback;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useForkRef.js
|
|
var require_useForkRef2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useForkRef.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useForkRef;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/useIsFocusVisible.js
|
|
var require_useIsFocusVisible2 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/useIsFocusVisible.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _utils = require_utils();
|
|
var _default = _utils.unstable_useIsFocusVisible;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/material/node/utils/index.js
|
|
var require_utils4 = __commonJS({
|
|
"node_modules/@mui/material/node/utils/index.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "capitalize", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _capitalize.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createChainedFunction", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createChainedFunction.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "createSvgIcon", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _createSvgIcon.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "debounce", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _debounce.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "deprecatedPropType", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _deprecatedPropType.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "isMuiElement", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _isMuiElement.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ownerDocument", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ownerDocument.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "ownerWindow", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _ownerWindow.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "requirePropFactory", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _requirePropFactory.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "setRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _setRef.default;
|
|
}
|
|
});
|
|
exports.unstable_ClassNameGenerator = void 0;
|
|
Object.defineProperty(exports, "unstable_useEnhancedEffect", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useEnhancedEffect.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unstable_useId", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useId.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "unsupportedProp", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _unsupportedProp.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useControlled", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useControlled.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useEventCallback", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useEventCallback.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useForkRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useForkRef.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "useIsFocusVisible", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _useIsFocusVisible.default;
|
|
}
|
|
});
|
|
var _className = require_className();
|
|
var _capitalize = _interopRequireDefault(require_capitalize2());
|
|
var _createChainedFunction = _interopRequireDefault(require_createChainedFunction2());
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon());
|
|
var _debounce = _interopRequireDefault(require_debounce2());
|
|
var _deprecatedPropType = _interopRequireDefault(require_deprecatedPropType2());
|
|
var _isMuiElement = _interopRequireDefault(require_isMuiElement2());
|
|
var _ownerDocument = _interopRequireDefault(require_ownerDocument2());
|
|
var _ownerWindow = _interopRequireDefault(require_ownerWindow2());
|
|
var _requirePropFactory = _interopRequireDefault(require_requirePropFactory2());
|
|
var _setRef = _interopRequireDefault(require_setRef2());
|
|
var _useEnhancedEffect = _interopRequireDefault(require_useEnhancedEffect2());
|
|
var _useId = _interopRequireDefault(require_useId2());
|
|
var _unsupportedProp = _interopRequireDefault(require_unsupportedProp2());
|
|
var _useControlled = _interopRequireDefault(require_useControlled2());
|
|
var _useEventCallback = _interopRequireDefault(require_useEventCallback2());
|
|
var _useForkRef = _interopRequireDefault(require_useForkRef2());
|
|
var _useIsFocusVisible = _interopRequireDefault(require_useIsFocusVisible2());
|
|
var unstable_ClassNameGenerator = {
|
|
configure: (generator) => {
|
|
console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.", "", "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", "", "The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401", "", "The updated documentation: https://mui.com/guides/classname-generator/"].join("\n"));
|
|
_className.unstable_ClassNameGenerator.configure(generator);
|
|
}
|
|
};
|
|
exports.unstable_ClassNameGenerator = unstable_ClassNameGenerator;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/utils/createSvgIcon.js
|
|
var require_createSvgIcon2 = __commonJS({
|
|
"node_modules/@mui/icons-material/utils/createSvgIcon.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _utils.createSvgIcon;
|
|
}
|
|
});
|
|
var _utils = require_utils4();
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/Close.js
|
|
var require_Close = __commonJS({
|
|
"node_modules/@mui/icons-material/Close.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
}), "Close");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/crc-32/crc32.js
|
|
var require_crc32 = __commonJS({
|
|
"node_modules/crc-32/crc32.js"(exports) {
|
|
var CRC322;
|
|
(function(factory) {
|
|
if (typeof DO_NOT_EXPORT_CRC === "undefined") {
|
|
if (typeof exports === "object") {
|
|
factory(exports);
|
|
} else if (typeof define === "function" && define.amd) {
|
|
define(function() {
|
|
var module3 = {};
|
|
factory(module3);
|
|
return module3;
|
|
});
|
|
} else {
|
|
factory(CRC322 = {});
|
|
}
|
|
} else {
|
|
factory(CRC322 = {});
|
|
}
|
|
})(function(CRC323) {
|
|
CRC323.version = "1.2.2";
|
|
function signed_crc_table() {
|
|
var c = 0, table = new Array(256);
|
|
for (var n = 0; n != 256; ++n) {
|
|
c = n;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
|
|
table[n] = c;
|
|
}
|
|
return typeof Int32Array !== "undefined" ? new Int32Array(table) : table;
|
|
}
|
|
var T0 = signed_crc_table();
|
|
function slice_by_16_tables(T) {
|
|
var c = 0, v = 0, n = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096);
|
|
for (n = 0; n != 256; ++n)
|
|
table[n] = T[n];
|
|
for (n = 0; n != 256; ++n) {
|
|
v = T[n];
|
|
for (c = 256 + n; c < 4096; c += 256)
|
|
v = table[c] = v >>> 8 ^ T[v & 255];
|
|
}
|
|
var out = [];
|
|
for (n = 1; n != 16; ++n)
|
|
out[n - 1] = typeof Int32Array !== "undefined" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);
|
|
return out;
|
|
}
|
|
var TT = slice_by_16_tables(T0);
|
|
var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
|
|
var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
|
|
var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];
|
|
function crc32_bstr(bstr, seed) {
|
|
var C = seed ^ -1;
|
|
for (var i = 0, L = bstr.length; i < L; )
|
|
C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i++)) & 255];
|
|
return ~C;
|
|
}
|
|
function crc32_buf(B, seed) {
|
|
var C = seed ^ -1, L = B.length - 15, i = 0;
|
|
for (; i < L; )
|
|
C = Tf[B[i++] ^ C & 255] ^ Te[B[i++] ^ C >> 8 & 255] ^ Td[B[i++] ^ C >> 16 & 255] ^ Tc[B[i++] ^ C >>> 24] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];
|
|
L += 15;
|
|
while (i < L)
|
|
C = C >>> 8 ^ T0[(C ^ B[i++]) & 255];
|
|
return ~C;
|
|
}
|
|
function crc32_str(str, seed) {
|
|
var C = seed ^ -1;
|
|
for (var i = 0, L = str.length, c = 0, d = 0; i < L; ) {
|
|
c = str.charCodeAt(i++);
|
|
if (c < 128) {
|
|
C = C >>> 8 ^ T0[(C ^ c) & 255];
|
|
} else if (c < 2048) {
|
|
C = C >>> 8 ^ T0[(C ^ (192 | c >> 6 & 31)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255];
|
|
} else if (c >= 55296 && c < 57344) {
|
|
c = (c & 1023) + 64;
|
|
d = str.charCodeAt(i++) & 1023;
|
|
C = C >>> 8 ^ T0[(C ^ (240 | c >> 8 & 7)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | c >> 2 & 63)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | d & 63)) & 255];
|
|
} else {
|
|
C = C >>> 8 ^ T0[(C ^ (224 | c >> 12 & 15)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | c >> 6 & 63)) & 255];
|
|
C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255];
|
|
}
|
|
}
|
|
return ~C;
|
|
}
|
|
CRC323.table = T0;
|
|
CRC323.bstr = crc32_bstr;
|
|
CRC323.buf = crc32_buf;
|
|
CRC323.str = crc32_str;
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/MoreVert.js
|
|
var require_MoreVert = __commonJS({
|
|
"node_modules/@mui/icons-material/MoreVert.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
}), "MoreVert");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/Delete.js
|
|
var require_Delete = __commonJS({
|
|
"node_modules/@mui/icons-material/Delete.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
|
|
}), "Delete");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/Sort.js
|
|
var require_Sort = __commonJS({
|
|
"node_modules/@mui/icons-material/Sort.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"
|
|
}), "Sort");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardArrowDown.js
|
|
var require_KeyboardArrowDown = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardArrowDown.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
}), "KeyboardArrowDown");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardArrowUp.js
|
|
var require_KeyboardArrowUp = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardArrowUp.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"
|
|
}), "KeyboardArrowUp");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardDoubleArrowUp.js
|
|
var require_KeyboardDoubleArrowUp = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardDoubleArrowUp.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)([/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"
|
|
}, "0"), /* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"
|
|
}, "1")], "KeyboardDoubleArrowUp");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardDoubleArrowDown.js
|
|
var require_KeyboardDoubleArrowDown = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardDoubleArrowDown.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)([/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"
|
|
}, "0"), /* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"
|
|
}, "1")], "KeyboardDoubleArrowDown");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardArrowLeft.js
|
|
var require_KeyboardArrowLeft = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardArrowLeft.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
|
|
}), "KeyboardArrowLeft");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardArrowRight.js
|
|
var require_KeyboardArrowRight = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardArrowRight.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
}), "KeyboardArrowRight");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardDoubleArrowLeft.js
|
|
var require_KeyboardDoubleArrowLeft = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardDoubleArrowLeft.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)([/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M17.59 18 19 16.59 14.42 12 19 7.41 17.59 6l-6 6z"
|
|
}, "0"), /* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "m11 18 1.41-1.41L7.83 12l4.58-4.59L11 6l-6 6z"
|
|
}, "1")], "KeyboardDoubleArrowLeft");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardDoubleArrowRight.js
|
|
var require_KeyboardDoubleArrowRight = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardDoubleArrowRight.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)([/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M6.41 6 5 7.41 9.58 12 5 16.59 6.41 18l6-6z"
|
|
}, "0"), /* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "m13 6-1.41 1.41L16.17 12l-4.58 4.59L13 18l6-6z"
|
|
}, "1")], "KeyboardDoubleArrowRight");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/KeyboardBackspace.js
|
|
var require_KeyboardBackspace = __commonJS({
|
|
"node_modules/@mui/icons-material/KeyboardBackspace.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M21 11H6.83l3.58-3.59L9 6l-6 6 6 6 1.41-1.41L6.83 13H21z"
|
|
}), "KeyboardBackspace");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/MoveUp.js
|
|
var require_MoveUp = __commonJS({
|
|
"node_modules/@mui/icons-material/MoveUp.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M3 13c0-2.45 1.76-4.47 4.08-4.91l-1.49 1.5L7 11l4-4.01L7 3 5.59 4.41l1.58 1.58v.06C3.7 6.46 1 9.42 1 13c0 3.87 3.13 7 7 7h3v-2H8c-2.76 0-5-2.24-5-5zm10 0v7h9v-7h-9zm7 5h-5v-3h5v3zM13 4h9v7h-9z"
|
|
}), "MoveUp");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/MoveDown.js
|
|
var require_MoveDown = __commonJS({
|
|
"node_modules/@mui/icons-material/MoveDown.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M3 11c0 2.45 1.76 4.47 4.08 4.91l-1.49-1.49L7 13l4 4.01L7 21l-1.41-1.41 1.58-1.58v-.06C3.7 17.54 1 14.58 1 11c0-3.87 3.13-7 7-7h3v2H8c-2.76 0-5 2.24-5 5zm19 0V4h-9v7h9zm-2-2h-5V6h5v3zm-7 4h9v7h-9z"
|
|
}), "MoveDown");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/TextSnippet.js
|
|
var require_TextSnippet = __commonJS({
|
|
"node_modules/@mui/icons-material/TextSnippet.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "m20.41 8.41-4.83-4.83c-.37-.37-.88-.58-1.41-.58H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.42zM7 7h7v2H7V7zm10 10H7v-2h10v2zm0-4H7v-2h10v2z"
|
|
}), "TextSnippet");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/@mui/icons-material/Edit.js
|
|
var require_Edit = __commonJS({
|
|
"node_modules/@mui/icons-material/Edit.js"(exports) {
|
|
"use strict";
|
|
var _interopRequireDefault = require_interopRequireDefault();
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _createSvgIcon = _interopRequireDefault(require_createSvgIcon2());
|
|
var _jsxRuntime = require_jsx_runtime();
|
|
var _default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
|
|
d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"
|
|
}), "Edit");
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
// node_modules/classnames/index.js
|
|
var require_classnames = __commonJS({
|
|
"node_modules/classnames/index.js"(exports, module2) {
|
|
(function() {
|
|
"use strict";
|
|
var hasOwn = {}.hasOwnProperty;
|
|
function classNames() {
|
|
var classes = [];
|
|
for (var i = 0; i < arguments.length; i++) {
|
|
var arg = arguments[i];
|
|
if (!arg)
|
|
continue;
|
|
var argType = typeof arg;
|
|
if (argType === "string" || argType === "number") {
|
|
classes.push(arg);
|
|
} else if (Array.isArray(arg)) {
|
|
if (arg.length) {
|
|
var inner = classNames.apply(null, arg);
|
|
if (inner) {
|
|
classes.push(inner);
|
|
}
|
|
}
|
|
} else if (argType === "object") {
|
|
if (arg.toString === Object.prototype.toString) {
|
|
for (var key in arg) {
|
|
if (hasOwn.call(arg, key) && arg[key]) {
|
|
classes.push(key);
|
|
}
|
|
}
|
|
} else {
|
|
classes.push(arg.toString());
|
|
}
|
|
}
|
|
}
|
|
return classes.join(" ");
|
|
}
|
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
classNames.default = classNames;
|
|
module2.exports = classNames;
|
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
define("classnames", [], function() {
|
|
return classNames;
|
|
});
|
|
} else {
|
|
window.classNames = classNames;
|
|
}
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/requiredArgs/index.js
|
|
var require_requiredArgs = __commonJS({
|
|
"node_modules/date-fns/_lib/requiredArgs/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = requiredArgs;
|
|
function requiredArgs(required, args) {
|
|
if (args.length < required) {
|
|
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isDate/index.js
|
|
var require_isDate = __commonJS({
|
|
"node_modules/date-fns/isDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isDate2;
|
|
var _index = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isDate2(value) {
|
|
(0, _index.default)(1, arguments);
|
|
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/toDate/index.js
|
|
var require_toDate = __commonJS({
|
|
"node_modules/date-fns/toDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = toDate;
|
|
var _index = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function toDate(argument) {
|
|
(0, _index.default)(1, arguments);
|
|
var argStr = Object.prototype.toString.call(argument);
|
|
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
|
|
return new Date(argument.getTime());
|
|
} else if (typeof argument === "number" || argStr === "[object Number]") {
|
|
return new Date(argument);
|
|
} else {
|
|
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
|
|
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule");
|
|
console.warn(new Error().stack);
|
|
}
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isValid/index.js
|
|
var require_isValid = __commonJS({
|
|
"node_modules/date-fns/isValid/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isValid;
|
|
var _index = _interopRequireDefault(require_isDate());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isValid(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
if (!(0, _index.default)(dirtyDate) && typeof dirtyDate !== "number") {
|
|
return false;
|
|
}
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
return !isNaN(Number(date));
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js
|
|
var require_formatDistance = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var formatDistanceLocale = {
|
|
lessThanXSeconds: {
|
|
one: "less than a second",
|
|
other: "less than {{count}} seconds"
|
|
},
|
|
xSeconds: {
|
|
one: "1 second",
|
|
other: "{{count}} seconds"
|
|
},
|
|
halfAMinute: "half a minute",
|
|
lessThanXMinutes: {
|
|
one: "less than a minute",
|
|
other: "less than {{count}} minutes"
|
|
},
|
|
xMinutes: {
|
|
one: "1 minute",
|
|
other: "{{count}} minutes"
|
|
},
|
|
aboutXHours: {
|
|
one: "about 1 hour",
|
|
other: "about {{count}} hours"
|
|
},
|
|
xHours: {
|
|
one: "1 hour",
|
|
other: "{{count}} hours"
|
|
},
|
|
xDays: {
|
|
one: "1 day",
|
|
other: "{{count}} days"
|
|
},
|
|
aboutXWeeks: {
|
|
one: "about 1 week",
|
|
other: "about {{count}} weeks"
|
|
},
|
|
xWeeks: {
|
|
one: "1 week",
|
|
other: "{{count}} weeks"
|
|
},
|
|
aboutXMonths: {
|
|
one: "about 1 month",
|
|
other: "about {{count}} months"
|
|
},
|
|
xMonths: {
|
|
one: "1 month",
|
|
other: "{{count}} months"
|
|
},
|
|
aboutXYears: {
|
|
one: "about 1 year",
|
|
other: "about {{count}} years"
|
|
},
|
|
xYears: {
|
|
one: "1 year",
|
|
other: "{{count}} years"
|
|
},
|
|
overXYears: {
|
|
one: "over 1 year",
|
|
other: "over {{count}} years"
|
|
},
|
|
almostXYears: {
|
|
one: "almost 1 year",
|
|
other: "almost {{count}} years"
|
|
}
|
|
};
|
|
var formatDistance = function(token, count, options) {
|
|
var result;
|
|
var tokenValue = formatDistanceLocale[token];
|
|
if (typeof tokenValue === "string") {
|
|
result = tokenValue;
|
|
} else if (count === 1) {
|
|
result = tokenValue.one;
|
|
} else {
|
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
}
|
|
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
if (options.comparison && options.comparison > 0) {
|
|
return "in " + result;
|
|
} else {
|
|
return result + " ago";
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
var _default = formatDistance;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js
|
|
var require_buildFormatLongFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildFormatLongFn;
|
|
function buildFormatLongFn(args) {
|
|
return function() {
|
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var width = options.width ? String(options.width) : args.defaultWidth;
|
|
var format = args.formats[width] || args.formats[args.defaultWidth];
|
|
return format;
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatLong/index.js
|
|
var require_formatLong = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatLong/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildFormatLongFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var dateFormats = {
|
|
full: "EEEE, MMMM do, y",
|
|
long: "MMMM do, y",
|
|
medium: "MMM d, y",
|
|
short: "MM/dd/yyyy"
|
|
};
|
|
var timeFormats = {
|
|
full: "h:mm:ss a zzzz",
|
|
long: "h:mm:ss a z",
|
|
medium: "h:mm:ss a",
|
|
short: "h:mm a"
|
|
};
|
|
var dateTimeFormats = {
|
|
full: "{{date}} 'at' {{time}}",
|
|
long: "{{date}} 'at' {{time}}",
|
|
medium: "{{date}}, {{time}}",
|
|
short: "{{date}}, {{time}}"
|
|
};
|
|
var formatLong = {
|
|
date: (0, _index.default)({
|
|
formats: dateFormats,
|
|
defaultWidth: "full"
|
|
}),
|
|
time: (0, _index.default)({
|
|
formats: timeFormats,
|
|
defaultWidth: "full"
|
|
}),
|
|
dateTime: (0, _index.default)({
|
|
formats: dateTimeFormats,
|
|
defaultWidth: "full"
|
|
})
|
|
};
|
|
var _default = formatLong;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js
|
|
var require_formatRelative = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var formatRelativeLocale = {
|
|
lastWeek: "'last' eeee 'at' p",
|
|
yesterday: "'yesterday at' p",
|
|
today: "'today at' p",
|
|
tomorrow: "'tomorrow at' p",
|
|
nextWeek: "eeee 'at' p",
|
|
other: "P"
|
|
};
|
|
var formatRelative = function(token, _date, _baseDate, _options) {
|
|
return formatRelativeLocale[token];
|
|
};
|
|
var _default = formatRelative;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js
|
|
var require_buildLocalizeFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildLocalizeFn;
|
|
function buildLocalizeFn(args) {
|
|
return function(dirtyIndex, dirtyOptions) {
|
|
var options = dirtyOptions || {};
|
|
var context = options.context ? String(options.context) : "standalone";
|
|
var valuesArray;
|
|
if (context === "formatting" && args.formattingValues) {
|
|
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
var width = options.width ? String(options.width) : defaultWidth;
|
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
} else {
|
|
var _defaultWidth = args.defaultWidth;
|
|
var _width = options.width ? String(options.width) : args.defaultWidth;
|
|
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
}
|
|
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
|
return valuesArray[index];
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/localize/index.js
|
|
var require_localize = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/localize/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildLocalizeFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var eraValues = {
|
|
narrow: ["B", "A"],
|
|
abbreviated: ["BC", "AD"],
|
|
wide: ["Before Christ", "Anno Domini"]
|
|
};
|
|
var quarterValues = {
|
|
narrow: ["1", "2", "3", "4"],
|
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
};
|
|
var monthValues = {
|
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
|
};
|
|
var dayValues = {
|
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
};
|
|
var dayPeriodValues = {
|
|
narrow: {
|
|
am: "a",
|
|
pm: "p",
|
|
midnight: "mi",
|
|
noon: "n",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
},
|
|
abbreviated: {
|
|
am: "AM",
|
|
pm: "PM",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
},
|
|
wide: {
|
|
am: "a.m.",
|
|
pm: "p.m.",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
}
|
|
};
|
|
var formattingDayPeriodValues = {
|
|
narrow: {
|
|
am: "a",
|
|
pm: "p",
|
|
midnight: "mi",
|
|
noon: "n",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
},
|
|
abbreviated: {
|
|
am: "AM",
|
|
pm: "PM",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
},
|
|
wide: {
|
|
am: "a.m.",
|
|
pm: "p.m.",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
}
|
|
};
|
|
var ordinalNumber = function(dirtyNumber, _options) {
|
|
var number = Number(dirtyNumber);
|
|
var rem100 = number % 100;
|
|
if (rem100 > 20 || rem100 < 10) {
|
|
switch (rem100 % 10) {
|
|
case 1:
|
|
return number + "st";
|
|
case 2:
|
|
return number + "nd";
|
|
case 3:
|
|
return number + "rd";
|
|
}
|
|
}
|
|
return number + "th";
|
|
};
|
|
var localize = {
|
|
ordinalNumber,
|
|
era: (0, _index.default)({
|
|
values: eraValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
quarter: (0, _index.default)({
|
|
values: quarterValues,
|
|
defaultWidth: "wide",
|
|
argumentCallback: function(quarter) {
|
|
return quarter - 1;
|
|
}
|
|
}),
|
|
month: (0, _index.default)({
|
|
values: monthValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
day: (0, _index.default)({
|
|
values: dayValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
dayPeriod: (0, _index.default)({
|
|
values: dayPeriodValues,
|
|
defaultWidth: "wide",
|
|
formattingValues: formattingDayPeriodValues,
|
|
defaultFormattingWidth: "wide"
|
|
})
|
|
};
|
|
var _default = localize;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildMatchFn/index.js
|
|
var require_buildMatchFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildMatchFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildMatchFn;
|
|
function buildMatchFn(args) {
|
|
return function(string) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var width = options.width;
|
|
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
var matchResult = string.match(matchPattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
var matchedString = matchResult[0];
|
|
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
|
|
return pattern.test(matchedString);
|
|
}) : findKey(parsePatterns, function(pattern) {
|
|
return pattern.test(matchedString);
|
|
});
|
|
var value;
|
|
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
var rest = string.slice(matchedString.length);
|
|
return {
|
|
value,
|
|
rest
|
|
};
|
|
};
|
|
}
|
|
function findKey(object, predicate) {
|
|
for (var key in object) {
|
|
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
return key;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
function findIndex(array, predicate) {
|
|
for (var key = 0; key < array.length; key++) {
|
|
if (predicate(array[key])) {
|
|
return key;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js
|
|
var require_buildMatchPatternFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildMatchPatternFn;
|
|
function buildMatchPatternFn(args) {
|
|
return function(string) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var matchResult = string.match(args.matchPattern);
|
|
if (!matchResult)
|
|
return null;
|
|
var matchedString = matchResult[0];
|
|
var parseResult = string.match(args.parsePattern);
|
|
if (!parseResult)
|
|
return null;
|
|
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
var rest = string.slice(matchedString.length);
|
|
return {
|
|
value,
|
|
rest
|
|
};
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/match/index.js
|
|
var require_match = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/match/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildMatchFn());
|
|
var _index2 = _interopRequireDefault(require_buildMatchPatternFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
var parseOrdinalNumberPattern = /\d+/i;
|
|
var matchEraPatterns = {
|
|
narrow: /^(b|a)/i,
|
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
};
|
|
var parseEraPatterns = {
|
|
any: [/^b/i, /^(a|c)/i]
|
|
};
|
|
var matchQuarterPatterns = {
|
|
narrow: /^[1234]/i,
|
|
abbreviated: /^q[1234]/i,
|
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
};
|
|
var parseQuarterPatterns = {
|
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
};
|
|
var matchMonthPatterns = {
|
|
narrow: /^[jfmasond]/i,
|
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
};
|
|
var parseMonthPatterns = {
|
|
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
|
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
|
};
|
|
var matchDayPatterns = {
|
|
narrow: /^[smtwf]/i,
|
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
};
|
|
var parseDayPatterns = {
|
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
};
|
|
var matchDayPeriodPatterns = {
|
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
};
|
|
var parseDayPeriodPatterns = {
|
|
any: {
|
|
am: /^a/i,
|
|
pm: /^p/i,
|
|
midnight: /^mi/i,
|
|
noon: /^no/i,
|
|
morning: /morning/i,
|
|
afternoon: /afternoon/i,
|
|
evening: /evening/i,
|
|
night: /night/i
|
|
}
|
|
};
|
|
var match = {
|
|
ordinalNumber: (0, _index2.default)({
|
|
matchPattern: matchOrdinalNumberPattern,
|
|
parsePattern: parseOrdinalNumberPattern,
|
|
valueCallback: function(value) {
|
|
return parseInt(value, 10);
|
|
}
|
|
}),
|
|
era: (0, _index.default)({
|
|
matchPatterns: matchEraPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseEraPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
quarter: (0, _index.default)({
|
|
matchPatterns: matchQuarterPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseQuarterPatterns,
|
|
defaultParseWidth: "any",
|
|
valueCallback: function(index) {
|
|
return index + 1;
|
|
}
|
|
}),
|
|
month: (0, _index.default)({
|
|
matchPatterns: matchMonthPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseMonthPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
day: (0, _index.default)({
|
|
matchPatterns: matchDayPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseDayPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
dayPeriod: (0, _index.default)({
|
|
matchPatterns: matchDayPeriodPatterns,
|
|
defaultMatchWidth: "any",
|
|
parsePatterns: parseDayPeriodPatterns,
|
|
defaultParseWidth: "any"
|
|
})
|
|
};
|
|
var _default = match;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/index.js
|
|
var require_en_US = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_formatDistance());
|
|
var _index2 = _interopRequireDefault(require_formatLong());
|
|
var _index3 = _interopRequireDefault(require_formatRelative());
|
|
var _index4 = _interopRequireDefault(require_localize());
|
|
var _index5 = _interopRequireDefault(require_match());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var locale = {
|
|
code: "en-US",
|
|
formatDistance: _index.default,
|
|
formatLong: _index2.default,
|
|
formatRelative: _index3.default,
|
|
localize: _index4.default,
|
|
match: _index5.default,
|
|
options: {
|
|
weekStartsOn: 0,
|
|
firstWeekContainsDate: 1
|
|
}
|
|
};
|
|
var _default = locale;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/toInteger/index.js
|
|
var require_toInteger = __commonJS({
|
|
"node_modules/date-fns/_lib/toInteger/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = toInteger;
|
|
function toInteger(dirtyNumber) {
|
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
return NaN;
|
|
}
|
|
var number = Number(dirtyNumber);
|
|
if (isNaN(number)) {
|
|
return number;
|
|
}
|
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMilliseconds/index.js
|
|
var require_addMilliseconds = __commonJS({
|
|
"node_modules/date-fns/addMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMilliseconds;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var timestamp = (0, _index2.default)(dirtyDate).getTime();
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return new Date(timestamp + amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMilliseconds/index.js
|
|
var require_subMilliseconds = __commonJS({
|
|
"node_modules/date-fns/subMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMilliseconds;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCDayOfYear/index.js
|
|
var require_getUTCDayOfYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCDayOfYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCDayOfYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_DAY = 864e5;
|
|
function getUTCDayOfYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var timestamp = date.getTime();
|
|
date.setUTCMonth(0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
var startOfYearTimestamp = date.getTime();
|
|
var difference = timestamp - startOfYearTimestamp;
|
|
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCISOWeek/index.js
|
|
var require_startOfUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCISOWeek(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var weekStartsOn = 1;
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getUTCDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCISOWeekYear/index.js
|
|
var require_getUTCISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCISOWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getUTCISOWeekYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getUTCFullYear();
|
|
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
|
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index3.default)(fourthOfJanuaryOfNextYear);
|
|
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index3.default)(fourthOfJanuaryOfThisYear);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js
|
|
var require_startOfUTCISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCISOWeekYear;
|
|
var _index = _interopRequireDefault(require_getUTCISOWeekYear());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var year = (0, _index.default)(dirtyDate);
|
|
var fourthOfJanuary = new Date(0);
|
|
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
|
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
|
var date = (0, _index2.default)(fourthOfJanuary);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCISOWeek/index.js
|
|
var require_getUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getUTCISOWeek(dirtyDate) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCWeek/index.js
|
|
var require_startOfUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCWeek(dirtyDate, dirtyOptions) {
|
|
(0, _index2.default)(1, arguments);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index3.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index3.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getUTCDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCWeekYear/index.js
|
|
var require_getUTCWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getUTCFullYear();
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index4.default)(localeFirstWeekContainsDate);
|
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index4.default)(options.firstWeekContainsDate);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var firstWeekOfNextYear = new Date(0);
|
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, dirtyOptions);
|
|
var firstWeekOfThisYear = new Date(0);
|
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, dirtyOptions);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCWeekYear/index.js
|
|
var require_startOfUTCWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCWeekYear;
|
|
var _index = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
|
|
(0, _index2.default)(1, arguments);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
|
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index4.default)(localeFirstWeekContainsDate);
|
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index4.default)(options.firstWeekContainsDate);
|
|
var year = (0, _index.default)(dirtyDate, dirtyOptions);
|
|
var firstWeek = new Date(0);
|
|
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
var date = (0, _index3.default)(firstWeek, dirtyOptions);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCWeek/index.js
|
|
var require_getUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getUTCWeek(dirtyDate, options) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/addLeadingZeros/index.js
|
|
var require_addLeadingZeros = __commonJS({
|
|
"node_modules/date-fns/_lib/addLeadingZeros/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addLeadingZeros;
|
|
function addLeadingZeros(number, targetLength) {
|
|
var sign = number < 0 ? "-" : "";
|
|
var output = Math.abs(number).toString();
|
|
while (output.length < targetLength) {
|
|
output = "0" + output;
|
|
}
|
|
return sign + output;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/lightFormatters/index.js
|
|
var require_lightFormatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/lightFormatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_addLeadingZeros());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var formatters = {
|
|
y: function(date, token) {
|
|
var signedYear = date.getUTCFullYear();
|
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
return (0, _index.default)(token === "yy" ? year % 100 : year, token.length);
|
|
},
|
|
M: function(date, token) {
|
|
var month = date.getUTCMonth();
|
|
return token === "M" ? String(month + 1) : (0, _index.default)(month + 1, 2);
|
|
},
|
|
d: function(date, token) {
|
|
return (0, _index.default)(date.getUTCDate(), token.length);
|
|
},
|
|
a: function(date, token) {
|
|
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
return dayPeriodEnumValue.toUpperCase();
|
|
case "aaa":
|
|
return dayPeriodEnumValue;
|
|
case "aaaaa":
|
|
return dayPeriodEnumValue[0];
|
|
case "aaaa":
|
|
default:
|
|
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
}
|
|
},
|
|
h: function(date, token) {
|
|
return (0, _index.default)(date.getUTCHours() % 12 || 12, token.length);
|
|
},
|
|
H: function(date, token) {
|
|
return (0, _index.default)(date.getUTCHours(), token.length);
|
|
},
|
|
m: function(date, token) {
|
|
return (0, _index.default)(date.getUTCMinutes(), token.length);
|
|
},
|
|
s: function(date, token) {
|
|
return (0, _index.default)(date.getUTCSeconds(), token.length);
|
|
},
|
|
S: function(date, token) {
|
|
var numberOfDigits = token.length;
|
|
var milliseconds = date.getUTCMilliseconds();
|
|
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
return (0, _index.default)(fractionalSeconds, token.length);
|
|
}
|
|
};
|
|
var _default = formatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/formatters/index.js
|
|
var require_formatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/formatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_getUTCDayOfYear());
|
|
var _index2 = _interopRequireDefault(require_getUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_getUTCISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_getUTCWeek());
|
|
var _index5 = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index6 = _interopRequireDefault(require_addLeadingZeros());
|
|
var _index7 = _interopRequireDefault(require_lightFormatters());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var dayPeriodEnum = {
|
|
am: "am",
|
|
pm: "pm",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
};
|
|
var formatters = {
|
|
G: function(date, token, localize) {
|
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
switch (token) {
|
|
case "G":
|
|
case "GG":
|
|
case "GGG":
|
|
return localize.era(era, {
|
|
width: "abbreviated"
|
|
});
|
|
case "GGGGG":
|
|
return localize.era(era, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGG":
|
|
default:
|
|
return localize.era(era, {
|
|
width: "wide"
|
|
});
|
|
}
|
|
},
|
|
y: function(date, token, localize) {
|
|
if (token === "yo") {
|
|
var signedYear = date.getUTCFullYear();
|
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
return localize.ordinalNumber(year, {
|
|
unit: "year"
|
|
});
|
|
}
|
|
return _index7.default.y(date, token);
|
|
},
|
|
Y: function(date, token, localize, options) {
|
|
var signedWeekYear = (0, _index5.default)(date, options);
|
|
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
if (token === "YY") {
|
|
var twoDigitYear = weekYear % 100;
|
|
return (0, _index6.default)(twoDigitYear, 2);
|
|
}
|
|
if (token === "Yo") {
|
|
return localize.ordinalNumber(weekYear, {
|
|
unit: "year"
|
|
});
|
|
}
|
|
return (0, _index6.default)(weekYear, token.length);
|
|
},
|
|
R: function(date, token) {
|
|
var isoWeekYear = (0, _index3.default)(date);
|
|
return (0, _index6.default)(isoWeekYear, token.length);
|
|
},
|
|
u: function(date, token) {
|
|
var year = date.getUTCFullYear();
|
|
return (0, _index6.default)(year, token.length);
|
|
},
|
|
Q: function(date, token, localize) {
|
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
switch (token) {
|
|
case "Q":
|
|
return String(quarter);
|
|
case "QQ":
|
|
return (0, _index6.default)(quarter, 2);
|
|
case "Qo":
|
|
return localize.ordinalNumber(quarter, {
|
|
unit: "quarter"
|
|
});
|
|
case "QQQ":
|
|
return localize.quarter(quarter, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQQ":
|
|
return localize.quarter(quarter, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQ":
|
|
default:
|
|
return localize.quarter(quarter, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
q: function(date, token, localize) {
|
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
switch (token) {
|
|
case "q":
|
|
return String(quarter);
|
|
case "qq":
|
|
return (0, _index6.default)(quarter, 2);
|
|
case "qo":
|
|
return localize.ordinalNumber(quarter, {
|
|
unit: "quarter"
|
|
});
|
|
case "qqq":
|
|
return localize.quarter(quarter, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "qqqqq":
|
|
return localize.quarter(quarter, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqq":
|
|
default:
|
|
return localize.quarter(quarter, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
M: function(date, token, localize) {
|
|
var month = date.getUTCMonth();
|
|
switch (token) {
|
|
case "M":
|
|
case "MM":
|
|
return _index7.default.M(date, token);
|
|
case "Mo":
|
|
return localize.ordinalNumber(month + 1, {
|
|
unit: "month"
|
|
});
|
|
case "MMM":
|
|
return localize.month(month, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "MMMMM":
|
|
return localize.month(month, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMM":
|
|
default:
|
|
return localize.month(month, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
L: function(date, token, localize) {
|
|
var month = date.getUTCMonth();
|
|
switch (token) {
|
|
case "L":
|
|
return String(month + 1);
|
|
case "LL":
|
|
return (0, _index6.default)(month + 1, 2);
|
|
case "Lo":
|
|
return localize.ordinalNumber(month + 1, {
|
|
unit: "month"
|
|
});
|
|
case "LLL":
|
|
return localize.month(month, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "LLLLL":
|
|
return localize.month(month, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLL":
|
|
default:
|
|
return localize.month(month, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
w: function(date, token, localize, options) {
|
|
var week = (0, _index4.default)(date, options);
|
|
if (token === "wo") {
|
|
return localize.ordinalNumber(week, {
|
|
unit: "week"
|
|
});
|
|
}
|
|
return (0, _index6.default)(week, token.length);
|
|
},
|
|
I: function(date, token, localize) {
|
|
var isoWeek = (0, _index2.default)(date);
|
|
if (token === "Io") {
|
|
return localize.ordinalNumber(isoWeek, {
|
|
unit: "week"
|
|
});
|
|
}
|
|
return (0, _index6.default)(isoWeek, token.length);
|
|
},
|
|
d: function(date, token, localize) {
|
|
if (token === "do") {
|
|
return localize.ordinalNumber(date.getUTCDate(), {
|
|
unit: "date"
|
|
});
|
|
}
|
|
return _index7.default.d(date, token);
|
|
},
|
|
D: function(date, token, localize) {
|
|
var dayOfYear = (0, _index.default)(date);
|
|
if (token === "Do") {
|
|
return localize.ordinalNumber(dayOfYear, {
|
|
unit: "dayOfYear"
|
|
});
|
|
}
|
|
return (0, _index6.default)(dayOfYear, token.length);
|
|
},
|
|
E: function(date, token, localize) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
switch (token) {
|
|
case "E":
|
|
case "EE":
|
|
case "EEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "EEEE":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
e: function(date, token, localize, options) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
switch (token) {
|
|
case "e":
|
|
return String(localDayOfWeek);
|
|
case "ee":
|
|
return (0, _index6.default)(localDayOfWeek, 2);
|
|
case "eo":
|
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "eee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "eeeee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeeee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "eeee":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
c: function(date, token, localize, options) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
switch (token) {
|
|
case "c":
|
|
return String(localDayOfWeek);
|
|
case "cc":
|
|
return (0, _index6.default)(localDayOfWeek, token.length);
|
|
case "co":
|
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "ccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "ccccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "standalone"
|
|
});
|
|
case "cccc":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
i: function(date, token, localize) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
switch (token) {
|
|
case "i":
|
|
return String(isoDayOfWeek);
|
|
case "ii":
|
|
return (0, _index6.default)(isoDayOfWeek, token.length);
|
|
case "io":
|
|
return localize.ordinalNumber(isoDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "iii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "iiiii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "iiiiii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "iiii":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
a: function(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "aaa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}).toLowerCase();
|
|
case "aaaaa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaa":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
b: function(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue;
|
|
if (hours === 12) {
|
|
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
} else if (hours === 0) {
|
|
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
} else {
|
|
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
}
|
|
switch (token) {
|
|
case "b":
|
|
case "bb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "bbb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}).toLowerCase();
|
|
case "bbbbb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbb":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
B: function(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue;
|
|
if (hours >= 17) {
|
|
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
} else if (hours >= 12) {
|
|
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
} else if (hours >= 4) {
|
|
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
} else {
|
|
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
}
|
|
switch (token) {
|
|
case "B":
|
|
case "BB":
|
|
case "BBB":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "BBBBB":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBB":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
h: function(date, token, localize) {
|
|
if (token === "ho") {
|
|
var hours = date.getUTCHours() % 12;
|
|
if (hours === 0)
|
|
hours = 12;
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return _index7.default.h(date, token);
|
|
},
|
|
H: function(date, token, localize) {
|
|
if (token === "Ho") {
|
|
return localize.ordinalNumber(date.getUTCHours(), {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return _index7.default.H(date, token);
|
|
},
|
|
K: function(date, token, localize) {
|
|
var hours = date.getUTCHours() % 12;
|
|
if (token === "Ko") {
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return (0, _index6.default)(hours, token.length);
|
|
},
|
|
k: function(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
if (hours === 0)
|
|
hours = 24;
|
|
if (token === "ko") {
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return (0, _index6.default)(hours, token.length);
|
|
},
|
|
m: function(date, token, localize) {
|
|
if (token === "mo") {
|
|
return localize.ordinalNumber(date.getUTCMinutes(), {
|
|
unit: "minute"
|
|
});
|
|
}
|
|
return _index7.default.m(date, token);
|
|
},
|
|
s: function(date, token, localize) {
|
|
if (token === "so") {
|
|
return localize.ordinalNumber(date.getUTCSeconds(), {
|
|
unit: "second"
|
|
});
|
|
}
|
|
return _index7.default.s(date, token);
|
|
},
|
|
S: function(date, token) {
|
|
return _index7.default.S(date, token);
|
|
},
|
|
X: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
if (timezoneOffset === 0) {
|
|
return "Z";
|
|
}
|
|
switch (token) {
|
|
case "X":
|
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
case "XXXX":
|
|
case "XX":
|
|
return formatTimezone(timezoneOffset);
|
|
case "XXXXX":
|
|
case "XXX":
|
|
default:
|
|
return formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
x: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "x":
|
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
case "xxxx":
|
|
case "xx":
|
|
return formatTimezone(timezoneOffset);
|
|
case "xxxxx":
|
|
case "xxx":
|
|
default:
|
|
return formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
O: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "O":
|
|
case "OO":
|
|
case "OOO":
|
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
case "OOOO":
|
|
default:
|
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
z: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "z":
|
|
case "zz":
|
|
case "zzz":
|
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
case "zzzz":
|
|
default:
|
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
t: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timestamp = Math.floor(originalDate.getTime() / 1e3);
|
|
return (0, _index6.default)(timestamp, token.length);
|
|
},
|
|
T: function(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timestamp = originalDate.getTime();
|
|
return (0, _index6.default)(timestamp, token.length);
|
|
}
|
|
};
|
|
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
var sign = offset > 0 ? "-" : "+";
|
|
var absOffset = Math.abs(offset);
|
|
var hours = Math.floor(absOffset / 60);
|
|
var minutes = absOffset % 60;
|
|
if (minutes === 0) {
|
|
return sign + String(hours);
|
|
}
|
|
var delimiter = dirtyDelimiter || "";
|
|
return sign + String(hours) + delimiter + (0, _index6.default)(minutes, 2);
|
|
}
|
|
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
if (offset % 60 === 0) {
|
|
var sign = offset > 0 ? "-" : "+";
|
|
return sign + (0, _index6.default)(Math.abs(offset) / 60, 2);
|
|
}
|
|
return formatTimezone(offset, dirtyDelimiter);
|
|
}
|
|
function formatTimezone(offset, dirtyDelimiter) {
|
|
var delimiter = dirtyDelimiter || "";
|
|
var sign = offset > 0 ? "-" : "+";
|
|
var absOffset = Math.abs(offset);
|
|
var hours = (0, _index6.default)(Math.floor(absOffset / 60), 2);
|
|
var minutes = (0, _index6.default)(absOffset % 60, 2);
|
|
return sign + hours + delimiter + minutes;
|
|
}
|
|
var _default = formatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/longFormatters/index.js
|
|
var require_longFormatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/longFormatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
function dateLongFormatter(pattern, formatLong) {
|
|
switch (pattern) {
|
|
case "P":
|
|
return formatLong.date({
|
|
width: "short"
|
|
});
|
|
case "PP":
|
|
return formatLong.date({
|
|
width: "medium"
|
|
});
|
|
case "PPP":
|
|
return formatLong.date({
|
|
width: "long"
|
|
});
|
|
case "PPPP":
|
|
default:
|
|
return formatLong.date({
|
|
width: "full"
|
|
});
|
|
}
|
|
}
|
|
function timeLongFormatter(pattern, formatLong) {
|
|
switch (pattern) {
|
|
case "p":
|
|
return formatLong.time({
|
|
width: "short"
|
|
});
|
|
case "pp":
|
|
return formatLong.time({
|
|
width: "medium"
|
|
});
|
|
case "ppp":
|
|
return formatLong.time({
|
|
width: "long"
|
|
});
|
|
case "pppp":
|
|
default:
|
|
return formatLong.time({
|
|
width: "full"
|
|
});
|
|
}
|
|
}
|
|
function dateTimeLongFormatter(pattern, formatLong) {
|
|
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
var datePattern = matchResult[1];
|
|
var timePattern = matchResult[2];
|
|
if (!timePattern) {
|
|
return dateLongFormatter(pattern, formatLong);
|
|
}
|
|
var dateTimeFormat;
|
|
switch (datePattern) {
|
|
case "P":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "short"
|
|
});
|
|
break;
|
|
case "PP":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "medium"
|
|
});
|
|
break;
|
|
case "PPP":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "long"
|
|
});
|
|
break;
|
|
case "PPPP":
|
|
default:
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "full"
|
|
});
|
|
break;
|
|
}
|
|
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
}
|
|
var longFormatters = {
|
|
p: timeLongFormatter,
|
|
P: dateTimeLongFormatter
|
|
};
|
|
var _default = longFormatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js
|
|
var require_getTimezoneOffsetInMilliseconds = __commonJS({
|
|
"node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getTimezoneOffsetInMilliseconds;
|
|
function getTimezoneOffsetInMilliseconds(date) {
|
|
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
utcDate.setUTCFullYear(date.getFullYear());
|
|
return date.getTime() - utcDate.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/protectedTokens/index.js
|
|
var require_protectedTokens = __commonJS({
|
|
"node_modules/date-fns/_lib/protectedTokens/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
|
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
|
exports.throwProtectedError = throwProtectedError;
|
|
var protectedDayOfYearTokens = ["D", "DD"];
|
|
var protectedWeekYearTokens = ["YY", "YYYY"];
|
|
function isProtectedDayOfYearToken(token) {
|
|
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
|
}
|
|
function isProtectedWeekYearToken(token) {
|
|
return protectedWeekYearTokens.indexOf(token) !== -1;
|
|
}
|
|
function throwProtectedError(token, format, input) {
|
|
if (token === "YYYY") {
|
|
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
} else if (token === "YY") {
|
|
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
} else if (token === "D") {
|
|
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
} else if (token === "DD") {
|
|
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/format/index.js
|
|
var require_format = __commonJS({
|
|
"node_modules/date-fns/format/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = format;
|
|
var _index = _interopRequireDefault(require_isValid());
|
|
var _index2 = _interopRequireDefault(require_en_US());
|
|
var _index3 = _interopRequireDefault(require_subMilliseconds());
|
|
var _index4 = _interopRequireDefault(require_toDate());
|
|
var _index5 = _interopRequireDefault(require_formatters());
|
|
var _index6 = _interopRequireDefault(require_longFormatters());
|
|
var _index7 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index8 = require_protectedTokens();
|
|
var _index9 = _interopRequireDefault(require_toInteger());
|
|
var _index10 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
var doubleQuoteRegExp = /''/g;
|
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
|
|
(0, _index10.default)(2, arguments);
|
|
var formatStr = String(dirtyFormatStr);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale || _index2.default;
|
|
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
|
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index9.default)(localeFirstWeekContainsDate);
|
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index9.default)(options.firstWeekContainsDate);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index9.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index9.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
if (!locale.localize) {
|
|
throw new RangeError("locale must contain localize property");
|
|
}
|
|
if (!locale.formatLong) {
|
|
throw new RangeError("locale must contain formatLong property");
|
|
}
|
|
var originalDate = (0, _index4.default)(dirtyDate);
|
|
if (!(0, _index.default)(originalDate)) {
|
|
throw new RangeError("Invalid time value");
|
|
}
|
|
var timezoneOffset = (0, _index7.default)(originalDate);
|
|
var utcDate = (0, _index3.default)(originalDate, timezoneOffset);
|
|
var formatterOptions = {
|
|
firstWeekContainsDate,
|
|
weekStartsOn,
|
|
locale,
|
|
_originalDate: originalDate
|
|
};
|
|
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
|
|
var firstCharacter = substring[0];
|
|
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
var longFormatter = _index6.default[firstCharacter];
|
|
return longFormatter(substring, locale.formatLong, formatterOptions);
|
|
}
|
|
return substring;
|
|
}).join("").match(formattingTokensRegExp).map(function(substring) {
|
|
if (substring === "''") {
|
|
return "'";
|
|
}
|
|
var firstCharacter = substring[0];
|
|
if (firstCharacter === "'") {
|
|
return cleanEscapedString(substring);
|
|
}
|
|
var formatter = _index5.default[firstCharacter];
|
|
if (formatter) {
|
|
if (!options.useAdditionalWeekYearTokens && (0, _index8.isProtectedWeekYearToken)(substring)) {
|
|
(0, _index8.throwProtectedError)(substring, dirtyFormatStr, dirtyDate);
|
|
}
|
|
if (!options.useAdditionalDayOfYearTokens && (0, _index8.isProtectedDayOfYearToken)(substring)) {
|
|
(0, _index8.throwProtectedError)(substring, dirtyFormatStr, dirtyDate);
|
|
}
|
|
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
}
|
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
|
}
|
|
return substring;
|
|
}).join("");
|
|
return result;
|
|
}
|
|
function cleanEscapedString(input) {
|
|
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMinutes/index.js
|
|
var require_addMinutes = __commonJS({
|
|
"node_modules/date-fns/addMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMinutes;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_MINUTE = 6e4;
|
|
function addMinutes(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_MINUTE);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addHours/index.js
|
|
var require_addHours = __commonJS({
|
|
"node_modules/date-fns/addHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addHours;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_HOUR = 36e5;
|
|
function addHours(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_HOUR);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addDays/index.js
|
|
var require_addDays = __commonJS({
|
|
"node_modules/date-fns/addDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addDays;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addDays(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
if (isNaN(amount)) {
|
|
return new Date(NaN);
|
|
}
|
|
if (!amount) {
|
|
return date;
|
|
}
|
|
date.setDate(date.getDate() + amount);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addWeeks/index.js
|
|
var require_addWeeks = __commonJS({
|
|
"node_modules/date-fns/addWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addWeeks;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addDays());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addWeeks(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
var days = amount * 7;
|
|
return (0, _index2.default)(dirtyDate, days);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMonths/index.js
|
|
var require_addMonths = __commonJS({
|
|
"node_modules/date-fns/addMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMonths;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addMonths(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
if (isNaN(amount)) {
|
|
return new Date(NaN);
|
|
}
|
|
if (!amount) {
|
|
return date;
|
|
}
|
|
var dayOfMonth = date.getDate();
|
|
var endOfDesiredMonth = new Date(date.getTime());
|
|
endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
|
|
var daysInMonth = endOfDesiredMonth.getDate();
|
|
if (dayOfMonth >= daysInMonth) {
|
|
return endOfDesiredMonth;
|
|
} else {
|
|
date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
|
|
return date;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addYears/index.js
|
|
var require_addYears = __commonJS({
|
|
"node_modules/date-fns/addYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addYears;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMonths());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addYears(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * 12);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMinutes/index.js
|
|
var require_subMinutes = __commonJS({
|
|
"node_modules/date-fns/subMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMinutes;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMinutes());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMinutes(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subHours/index.js
|
|
var require_subHours = __commonJS({
|
|
"node_modules/date-fns/subHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subHours;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addHours());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subHours(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subDays/index.js
|
|
var require_subDays = __commonJS({
|
|
"node_modules/date-fns/subDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subDays;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addDays());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subDays(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subWeeks/index.js
|
|
var require_subWeeks = __commonJS({
|
|
"node_modules/date-fns/subWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subWeeks;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addWeeks());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subWeeks(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMonths/index.js
|
|
var require_subMonths = __commonJS({
|
|
"node_modules/date-fns/subMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMonths;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMonths());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMonths(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subYears/index.js
|
|
var require_subYears = __commonJS({
|
|
"node_modules/date-fns/subYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subYears;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addYears());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subYears(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getSeconds/index.js
|
|
var require_getSeconds = __commonJS({
|
|
"node_modules/date-fns/getSeconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getSeconds;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getSeconds(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var seconds = date.getSeconds();
|
|
return seconds;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getMinutes/index.js
|
|
var require_getMinutes = __commonJS({
|
|
"node_modules/date-fns/getMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getMinutes;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getMinutes(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var minutes = date.getMinutes();
|
|
return minutes;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getHours/index.js
|
|
var require_getHours = __commonJS({
|
|
"node_modules/date-fns/getHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getHours;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getHours(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var hours = date.getHours();
|
|
return hours;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDay/index.js
|
|
var require_getDay = __commonJS({
|
|
"node_modules/date-fns/getDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
return day;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDate/index.js
|
|
var require_getDate = __commonJS({
|
|
"node_modules/date-fns/getDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDate;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDate(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dayOfMonth = date.getDate();
|
|
return dayOfMonth;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfWeek/index.js
|
|
var require_startOfWeek = __commonJS({
|
|
"node_modules/date-fns/startOfWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_toInteger());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfWeek(dirtyDate, dirtyOptions) {
|
|
(0, _index3.default)(1, arguments);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index2.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index2.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setDate(date.getDate() - diff);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfISOWeek/index.js
|
|
var require_startOfISOWeek = __commonJS({
|
|
"node_modules/date-fns/startOfISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfISOWeek;
|
|
var _index = _interopRequireDefault(require_startOfWeek());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfISOWeek(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
return (0, _index.default)(dirtyDate, {
|
|
weekStartsOn: 1
|
|
});
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getISOWeekYear/index.js
|
|
var require_getISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/getISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getISOWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getFullYear();
|
|
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index2.default)(fourthOfJanuaryOfNextYear);
|
|
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index2.default)(fourthOfJanuaryOfThisYear);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfISOWeekYear/index.js
|
|
var require_startOfISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/startOfISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfISOWeekYear;
|
|
var _index = _interopRequireDefault(require_getISOWeekYear());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var year = (0, _index.default)(dirtyDate);
|
|
var fourthOfJanuary = new Date(0);
|
|
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
var date = (0, _index2.default)(fourthOfJanuary);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getISOWeek/index.js
|
|
var require_getISOWeek = __commonJS({
|
|
"node_modules/date-fns/getISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getISOWeek(dirtyDate) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getMonth/index.js
|
|
var require_getMonth = __commonJS({
|
|
"node_modules/date-fns/getMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var month = date.getMonth();
|
|
return month;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getQuarter/index.js
|
|
var require_getQuarter = __commonJS({
|
|
"node_modules/date-fns/getQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getQuarter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getQuarter(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var quarter = Math.floor(date.getMonth() / 3) + 1;
|
|
return quarter;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getYear/index.js
|
|
var require_getYear = __commonJS({
|
|
"node_modules/date-fns/getYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
return (0, _index.default)(dirtyDate).getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getTime/index.js
|
|
var require_getTime = __commonJS({
|
|
"node_modules/date-fns/getTime/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getTime;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getTime(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var timestamp = date.getTime();
|
|
return timestamp;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setSeconds/index.js
|
|
var require_setSeconds = __commonJS({
|
|
"node_modules/date-fns/setSeconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setSeconds;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setSeconds(dirtyDate, dirtySeconds) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var seconds = (0, _index.default)(dirtySeconds);
|
|
date.setSeconds(seconds);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setMinutes/index.js
|
|
var require_setMinutes = __commonJS({
|
|
"node_modules/date-fns/setMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setMinutes;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setMinutes(dirtyDate, dirtyMinutes) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var minutes = (0, _index.default)(dirtyMinutes);
|
|
date.setMinutes(minutes);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setHours/index.js
|
|
var require_setHours = __commonJS({
|
|
"node_modules/date-fns/setHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setHours;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setHours(dirtyDate, dirtyHours) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var hours = (0, _index.default)(dirtyHours);
|
|
date.setHours(hours);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDaysInMonth/index.js
|
|
var require_getDaysInMonth = __commonJS({
|
|
"node_modules/date-fns/getDaysInMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDaysInMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDaysInMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getFullYear();
|
|
var monthIndex = date.getMonth();
|
|
var lastDayOfMonth = new Date(0);
|
|
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
|
|
lastDayOfMonth.setHours(0, 0, 0, 0);
|
|
return lastDayOfMonth.getDate();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setMonth/index.js
|
|
var require_setMonth = __commonJS({
|
|
"node_modules/date-fns/setMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setMonth;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getDaysInMonth());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setMonth(dirtyDate, dirtyMonth) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var month = (0, _index.default)(dirtyMonth);
|
|
var year = date.getFullYear();
|
|
var day = date.getDate();
|
|
var dateWithDesiredMonth = new Date(0);
|
|
dateWithDesiredMonth.setFullYear(year, month, 15);
|
|
dateWithDesiredMonth.setHours(0, 0, 0, 0);
|
|
var daysInMonth = (0, _index3.default)(dateWithDesiredMonth);
|
|
date.setMonth(month, Math.min(day, daysInMonth));
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setQuarter/index.js
|
|
var require_setQuarter = __commonJS({
|
|
"node_modules/date-fns/setQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setQuarter;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_setMonth());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setQuarter(dirtyDate, dirtyQuarter) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var quarter = (0, _index.default)(dirtyQuarter);
|
|
var oldQuarter = Math.floor(date.getMonth() / 3) + 1;
|
|
var diff = quarter - oldQuarter;
|
|
return (0, _index3.default)(date, date.getMonth() + diff * 3);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setYear/index.js
|
|
var require_setYear = __commonJS({
|
|
"node_modules/date-fns/setYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setYear;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setYear(dirtyDate, dirtyYear) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var year = (0, _index.default)(dirtyYear);
|
|
if (isNaN(date.getTime())) {
|
|
return new Date(NaN);
|
|
}
|
|
date.setFullYear(year);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/min/index.js
|
|
var require_min = __commonJS({
|
|
"node_modules/date-fns/min/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = min;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function min(dirtyDatesArray) {
|
|
(0, _index2.default)(1, arguments);
|
|
var datesArray;
|
|
if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") {
|
|
datesArray = dirtyDatesArray;
|
|
} else if (typeof dirtyDatesArray === "object" && dirtyDatesArray !== null) {
|
|
datesArray = Array.prototype.slice.call(dirtyDatesArray);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
var result;
|
|
datesArray.forEach(function(dirtyDate) {
|
|
var currentDate = (0, _index.default)(dirtyDate);
|
|
if (result === void 0 || result > currentDate || isNaN(currentDate.getDate())) {
|
|
result = currentDate;
|
|
}
|
|
});
|
|
return result || new Date(NaN);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/max/index.js
|
|
var require_max = __commonJS({
|
|
"node_modules/date-fns/max/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = max;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function max(dirtyDatesArray) {
|
|
(0, _index2.default)(1, arguments);
|
|
var datesArray;
|
|
if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") {
|
|
datesArray = dirtyDatesArray;
|
|
} else if (typeof dirtyDatesArray === "object" && dirtyDatesArray !== null) {
|
|
datesArray = Array.prototype.slice.call(dirtyDatesArray);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
var result;
|
|
datesArray.forEach(function(dirtyDate) {
|
|
var currentDate = (0, _index.default)(dirtyDate);
|
|
if (result === void 0 || result < currentDate || isNaN(Number(currentDate))) {
|
|
result = currentDate;
|
|
}
|
|
});
|
|
return result || new Date(NaN);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfDay/index.js
|
|
var require_startOfDay = __commonJS({
|
|
"node_modules/date-fns/startOfDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarDays/index.js
|
|
var require_differenceInCalendarDays = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarDays;
|
|
var _index = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index2 = _interopRequireDefault(require_startOfDay());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_DAY = 864e5;
|
|
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index3.default)(2, arguments);
|
|
var startOfDayLeft = (0, _index2.default)(dirtyDateLeft);
|
|
var startOfDayRight = (0, _index2.default)(dirtyDateRight);
|
|
var timestampLeft = startOfDayLeft.getTime() - (0, _index.default)(startOfDayLeft);
|
|
var timestampRight = startOfDayRight.getTime() - (0, _index.default)(startOfDayRight);
|
|
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarMonths/index.js
|
|
var require_differenceInCalendarMonths = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarMonths;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
|
|
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
|
|
return yearDiff * 12 + monthDiff;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarWeeks/index.js
|
|
var require_differenceInCalendarWeeks = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarWeeks;
|
|
var _index = _interopRequireDefault(require_startOfWeek());
|
|
var _index2 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) {
|
|
(0, _index3.default)(2, arguments);
|
|
var startOfWeekLeft = (0, _index.default)(dirtyDateLeft, dirtyOptions);
|
|
var startOfWeekRight = (0, _index.default)(dirtyDateRight, dirtyOptions);
|
|
var timestampLeft = startOfWeekLeft.getTime() - (0, _index2.default)(startOfWeekLeft);
|
|
var timestampRight = startOfWeekRight.getTime() - (0, _index2.default)(startOfWeekRight);
|
|
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarYears/index.js
|
|
var require_differenceInCalendarYears = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarYears;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() - dateRight.getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfMonth/index.js
|
|
var require_startOfMonth = __commonJS({
|
|
"node_modules/date-fns/startOfMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setDate(1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfQuarter/index.js
|
|
var require_startOfQuarter = __commonJS({
|
|
"node_modules/date-fns/startOfQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfQuarter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfQuarter(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var currentMonth = date.getMonth();
|
|
var month = currentMonth - currentMonth % 3;
|
|
date.setMonth(month, 1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfYear/index.js
|
|
var require_startOfYear = __commonJS({
|
|
"node_modules/date-fns/startOfYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var cleanDate = (0, _index.default)(dirtyDate);
|
|
var date = new Date(0);
|
|
date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfDay/index.js
|
|
var require_endOfDay = __commonJS({
|
|
"node_modules/date-fns/endOfDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfWeek/index.js
|
|
var require_endOfWeek = __commonJS({
|
|
"node_modules/date-fns/endOfWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_toInteger());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfWeek(dirtyDate, dirtyOptions) {
|
|
(0, _index3.default)(1, arguments);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index2.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index2.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
|
|
date.setDate(date.getDate() + diff);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfMonth/index.js
|
|
var require_endOfMonth = __commonJS({
|
|
"node_modules/date-fns/endOfMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var month = date.getMonth();
|
|
date.setFullYear(date.getFullYear(), month + 1, 0);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isEqual/index.js
|
|
var require_isEqual = __commonJS({
|
|
"node_modules/date-fns/isEqual/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isEqual;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isEqual(dirtyLeftDate, dirtyRightDate) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyLeftDate);
|
|
var dateRight = (0, _index.default)(dirtyRightDate);
|
|
return dateLeft.getTime() === dateRight.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameDay/index.js
|
|
var require_isSameDay = __commonJS({
|
|
"node_modules/date-fns/isSameDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameDay;
|
|
var _index = _interopRequireDefault(require_startOfDay());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeftStartOfDay = (0, _index.default)(dirtyDateLeft);
|
|
var dateRightStartOfDay = (0, _index.default)(dirtyDateRight);
|
|
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameMonth/index.js
|
|
var require_isSameMonth = __commonJS({
|
|
"node_modules/date-fns/isSameMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameMonth(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameYear/index.js
|
|
var require_isSameYear = __commonJS({
|
|
"node_modules/date-fns/isSameYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameYear(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() === dateRight.getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameQuarter/index.js
|
|
var require_isSameQuarter = __commonJS({
|
|
"node_modules/date-fns/isSameQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameQuarter;
|
|
var _index = _interopRequireDefault(require_startOfQuarter());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameQuarter(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeftStartOfQuarter = (0, _index.default)(dirtyDateLeft);
|
|
var dateRightStartOfQuarter = (0, _index.default)(dirtyDateRight);
|
|
return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isAfter/index.js
|
|
var require_isAfter = __commonJS({
|
|
"node_modules/date-fns/isAfter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isAfter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
(0, _index2.default)(2, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dateToCompare = (0, _index.default)(dirtyDateToCompare);
|
|
return date.getTime() > dateToCompare.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isBefore/index.js
|
|
var require_isBefore = __commonJS({
|
|
"node_modules/date-fns/isBefore/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isBefore;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
(0, _index2.default)(2, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dateToCompare = (0, _index.default)(dirtyDateToCompare);
|
|
return date.getTime() < dateToCompare.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isWithinInterval/index.js
|
|
var require_isWithinInterval = __commonJS({
|
|
"node_modules/date-fns/isWithinInterval/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isWithinInterval;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isWithinInterval(dirtyDate, interval) {
|
|
(0, _index2.default)(2, arguments);
|
|
var time = (0, _index.default)(dirtyDate).getTime();
|
|
var startTime = (0, _index.default)(interval.start).getTime();
|
|
var endTime = (0, _index.default)(interval.end).getTime();
|
|
if (!(startTime <= endTime)) {
|
|
throw new RangeError("Invalid interval");
|
|
}
|
|
return time >= startTime && time <= endTime;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/assign/index.js
|
|
var require_assign = __commonJS({
|
|
"node_modules/date-fns/_lib/assign/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = assign;
|
|
function assign(target, dirtyObject) {
|
|
if (target == null) {
|
|
throw new TypeError("assign requires that input parameter not be null or undefined");
|
|
}
|
|
dirtyObject = dirtyObject || {};
|
|
for (var property in dirtyObject) {
|
|
if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {
|
|
target[property] = dirtyObject[property];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCDay/index.js
|
|
var require_setUTCDay = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {
|
|
(0, _index2.default)(2, arguments);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale;
|
|
var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index3.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index3.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = (0, _index3.default)(dirtyDay);
|
|
var currentDay = date.getUTCDay();
|
|
var remainder = day % 7;
|
|
var dayIndex = (remainder + 7) % 7;
|
|
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCISODay/index.js
|
|
var require_setUTCISODay = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCISODay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCISODay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCISODay(dirtyDate, dirtyDay) {
|
|
(0, _index2.default)(2, arguments);
|
|
var day = (0, _index3.default)(dirtyDay);
|
|
if (day % 7 === 0) {
|
|
day = day - 7;
|
|
}
|
|
var weekStartsOn = 1;
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var currentDay = date.getUTCDay();
|
|
var remainder = day % 7;
|
|
var dayIndex = (remainder + 7) % 7;
|
|
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCISOWeek/index.js
|
|
var require_setUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getUTCISOWeek());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var isoWeek = (0, _index.default)(dirtyISOWeek);
|
|
var diff = (0, _index3.default)(date) - isoWeek;
|
|
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCWeek/index.js
|
|
var require_setUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCWeek;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCWeek(dirtyDate, dirtyWeek, options) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var week = (0, _index.default)(dirtyWeek);
|
|
var diff = (0, _index3.default)(date, options) - week;
|
|
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/index.js
|
|
var require_parsers = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index2 = _interopRequireDefault(require_setUTCDay());
|
|
var _index3 = _interopRequireDefault(require_setUTCISODay());
|
|
var _index4 = _interopRequireDefault(require_setUTCISOWeek());
|
|
var _index5 = _interopRequireDefault(require_setUTCWeek());
|
|
var _index6 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
var _index7 = _interopRequireDefault(require_startOfUTCWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_HOUR = 36e5;
|
|
var MILLISECONDS_IN_MINUTE = 6e4;
|
|
var MILLISECONDS_IN_SECOND = 1e3;
|
|
var numericPatterns = {
|
|
month: /^(1[0-2]|0?\d)/,
|
|
date: /^(3[0-1]|[0-2]?\d)/,
|
|
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
week: /^(5[0-3]|[0-4]?\d)/,
|
|
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
hour11h: /^(1[0-1]|0?\d)/,
|
|
hour12h: /^(1[0-2]|0?\d)/,
|
|
minute: /^[0-5]?\d/,
|
|
second: /^[0-5]?\d/,
|
|
singleDigit: /^\d/,
|
|
twoDigits: /^\d{1,2}/,
|
|
threeDigits: /^\d{1,3}/,
|
|
fourDigits: /^\d{1,4}/,
|
|
anyDigitsSigned: /^-?\d+/,
|
|
singleDigitSigned: /^-?\d/,
|
|
twoDigitsSigned: /^-?\d{1,2}/,
|
|
threeDigitsSigned: /^-?\d{1,3}/,
|
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
};
|
|
var timezonePatterns = {
|
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
};
|
|
function parseNumericPattern(pattern, string, valueCallback) {
|
|
var matchResult = string.match(pattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
var value = parseInt(matchResult[0], 10);
|
|
return {
|
|
value: valueCallback ? valueCallback(value) : value,
|
|
rest: string.slice(matchResult[0].length)
|
|
};
|
|
}
|
|
function parseTimezonePattern(pattern, string) {
|
|
var matchResult = string.match(pattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
if (matchResult[0] === "Z") {
|
|
return {
|
|
value: 0,
|
|
rest: string.slice(1)
|
|
};
|
|
}
|
|
var sign = matchResult[1] === "+" ? 1 : -1;
|
|
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
return {
|
|
value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),
|
|
rest: string.slice(matchResult[0].length)
|
|
};
|
|
}
|
|
function parseAnyDigitsSigned(string, valueCallback) {
|
|
return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);
|
|
}
|
|
function parseNDigits(n, string, valueCallback) {
|
|
switch (n) {
|
|
case 1:
|
|
return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);
|
|
case 2:
|
|
return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);
|
|
case 3:
|
|
return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);
|
|
case 4:
|
|
return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);
|
|
default:
|
|
return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), string, valueCallback);
|
|
}
|
|
}
|
|
function parseNDigitsSigned(n, string, valueCallback) {
|
|
switch (n) {
|
|
case 1:
|
|
return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);
|
|
case 2:
|
|
return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);
|
|
case 3:
|
|
return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);
|
|
case 4:
|
|
return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);
|
|
default:
|
|
return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), string, valueCallback);
|
|
}
|
|
}
|
|
function dayPeriodEnumToHours(enumValue) {
|
|
switch (enumValue) {
|
|
case "morning":
|
|
return 4;
|
|
case "evening":
|
|
return 17;
|
|
case "pm":
|
|
case "noon":
|
|
case "afternoon":
|
|
return 12;
|
|
case "am":
|
|
case "midnight":
|
|
case "night":
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
var isCommonEra = currentYear > 0;
|
|
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
var result;
|
|
if (absCurrentYear <= 50) {
|
|
result = twoDigitYear || 100;
|
|
} else {
|
|
var rangeEnd = absCurrentYear + 50;
|
|
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
}
|
|
return isCommonEra ? result : 1 - result;
|
|
}
|
|
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
function isLeapYearIndex(year) {
|
|
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
}
|
|
var parsers = {
|
|
G: {
|
|
priority: 140,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "G":
|
|
case "GG":
|
|
case "GGG":
|
|
return match.era(string, {
|
|
width: "abbreviated"
|
|
}) || match.era(string, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGGG":
|
|
return match.era(string, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGG":
|
|
default:
|
|
return match.era(string, {
|
|
width: "wide"
|
|
}) || match.era(string, {
|
|
width: "abbreviated"
|
|
}) || match.era(string, {
|
|
width: "narrow"
|
|
});
|
|
}
|
|
},
|
|
set: function(date, flags, value, _options) {
|
|
flags.era = value;
|
|
date.setUTCFullYear(value, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["R", "u", "t", "T"]
|
|
},
|
|
y: {
|
|
priority: 130,
|
|
parse: function(string, token, match, _options) {
|
|
var valueCallback = function(year) {
|
|
return {
|
|
year,
|
|
isTwoDigitYear: token === "yy"
|
|
};
|
|
};
|
|
switch (token) {
|
|
case "y":
|
|
return parseNDigits(4, string, valueCallback);
|
|
case "yo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "year",
|
|
valueCallback
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string, valueCallback);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value.isTwoDigitYear || value.year > 0;
|
|
},
|
|
set: function(date, flags, value, _options) {
|
|
var currentYear = date.getUTCFullYear();
|
|
if (value.isTwoDigitYear) {
|
|
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
date.setUTCFullYear(year, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]
|
|
},
|
|
Y: {
|
|
priority: 130,
|
|
parse: function(string, token, match, _options) {
|
|
var valueCallback = function(year) {
|
|
return {
|
|
year,
|
|
isTwoDigitYear: token === "YY"
|
|
};
|
|
};
|
|
switch (token) {
|
|
case "Y":
|
|
return parseNDigits(4, string, valueCallback);
|
|
case "Yo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "year",
|
|
valueCallback
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string, valueCallback);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value.isTwoDigitYear || value.year > 0;
|
|
},
|
|
set: function(date, flags, value, options) {
|
|
var currentYear = (0, _index.default)(date, options);
|
|
if (value.isTwoDigitYear) {
|
|
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
|
|
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index7.default)(date, options);
|
|
}
|
|
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index7.default)(date, options);
|
|
},
|
|
incompatibleTokens: ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]
|
|
},
|
|
R: {
|
|
priority: 130,
|
|
parse: function(string, token, _match, _options) {
|
|
if (token === "R") {
|
|
return parseNDigitsSigned(4, string);
|
|
}
|
|
return parseNDigitsSigned(token.length, string);
|
|
},
|
|
set: function(_date, _flags, value, _options) {
|
|
var firstWeekOfYear = new Date(0);
|
|
firstWeekOfYear.setUTCFullYear(value, 0, 4);
|
|
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index6.default)(firstWeekOfYear);
|
|
},
|
|
incompatibleTokens: ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
|
|
},
|
|
u: {
|
|
priority: 130,
|
|
parse: function(string, token, _match, _options) {
|
|
if (token === "u") {
|
|
return parseNDigitsSigned(4, string);
|
|
}
|
|
return parseNDigitsSigned(token.length, string);
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCFullYear(value, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]
|
|
},
|
|
Q: {
|
|
priority: 120,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "Q":
|
|
case "QQ":
|
|
return parseNDigits(token.length, string);
|
|
case "Qo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "quarter"
|
|
});
|
|
case "QQQ":
|
|
return match.quarter(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.quarter(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQQ":
|
|
return match.quarter(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQ":
|
|
default:
|
|
return match.quarter(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.quarter(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.quarter(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 4;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMonth((value - 1) * 3, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
|
|
},
|
|
q: {
|
|
priority: 120,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "q":
|
|
case "qq":
|
|
return parseNDigits(token.length, string);
|
|
case "qo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "quarter"
|
|
});
|
|
case "qqq":
|
|
return match.quarter(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.quarter(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqqq":
|
|
return match.quarter(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqq":
|
|
default:
|
|
return match.quarter(string, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.quarter(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.quarter(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 4;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMonth((value - 1) * 3, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
|
|
},
|
|
M: {
|
|
priority: 110,
|
|
parse: function(string, token, match, _options) {
|
|
var valueCallback = function(value) {
|
|
return value - 1;
|
|
};
|
|
switch (token) {
|
|
case "M":
|
|
return parseNumericPattern(numericPatterns.month, string, valueCallback);
|
|
case "MM":
|
|
return parseNDigits(2, string, valueCallback);
|
|
case "Mo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "month",
|
|
valueCallback
|
|
});
|
|
case "MMM":
|
|
return match.month(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.month(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMMM":
|
|
return match.month(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMM":
|
|
default:
|
|
return match.month(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.month(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.month(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 11;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMonth(value, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]
|
|
},
|
|
L: {
|
|
priority: 110,
|
|
parse: function(string, token, match, _options) {
|
|
var valueCallback = function(value) {
|
|
return value - 1;
|
|
};
|
|
switch (token) {
|
|
case "L":
|
|
return parseNumericPattern(numericPatterns.month, string, valueCallback);
|
|
case "LL":
|
|
return parseNDigits(2, string, valueCallback);
|
|
case "Lo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "month",
|
|
valueCallback
|
|
});
|
|
case "LLL":
|
|
return match.month(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.month(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLLL":
|
|
return match.month(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLL":
|
|
default:
|
|
return match.month(string, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.month(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.month(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 11;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMonth(value, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]
|
|
},
|
|
w: {
|
|
priority: 100,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "w":
|
|
return parseNumericPattern(numericPatterns.week, string);
|
|
case "wo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "week"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 53;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
return (0, _index7.default)((0, _index5.default)(date, value, options), options);
|
|
},
|
|
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]
|
|
},
|
|
I: {
|
|
priority: 100,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "I":
|
|
return parseNumericPattern(numericPatterns.week, string);
|
|
case "Io":
|
|
return match.ordinalNumber(string, {
|
|
unit: "week"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 53;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
return (0, _index6.default)((0, _index4.default)(date, value, options), options);
|
|
},
|
|
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
|
|
},
|
|
d: {
|
|
priority: 90,
|
|
subPriority: 1,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "d":
|
|
return parseNumericPattern(numericPatterns.date, string);
|
|
case "do":
|
|
return match.ordinalNumber(string, {
|
|
unit: "date"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(date, value, _options) {
|
|
var year = date.getUTCFullYear();
|
|
var isLeapYear = isLeapYearIndex(year);
|
|
var month = date.getUTCMonth();
|
|
if (isLeapYear) {
|
|
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
} else {
|
|
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
}
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCDate(value);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]
|
|
},
|
|
D: {
|
|
priority: 90,
|
|
subPriority: 1,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "D":
|
|
case "DD":
|
|
return parseNumericPattern(numericPatterns.dayOfYear, string);
|
|
case "Do":
|
|
return match.ordinalNumber(string, {
|
|
unit: "date"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(date, value, _options) {
|
|
var year = date.getUTCFullYear();
|
|
var isLeapYear = isLeapYearIndex(year);
|
|
if (isLeapYear) {
|
|
return value >= 1 && value <= 366;
|
|
} else {
|
|
return value >= 1 && value <= 365;
|
|
}
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMonth(0, value);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]
|
|
},
|
|
E: {
|
|
priority: 90,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "E":
|
|
case "EE":
|
|
case "EEE":
|
|
return match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEE":
|
|
return match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEEE":
|
|
return match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEE":
|
|
default:
|
|
return match.day(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 6;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
date = (0, _index2.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["D", "i", "e", "c", "t", "T"]
|
|
},
|
|
e: {
|
|
priority: 90,
|
|
parse: function(string, token, match, options) {
|
|
var valueCallback = function(value) {
|
|
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
};
|
|
switch (token) {
|
|
case "e":
|
|
case "ee":
|
|
return parseNDigits(token.length, string, valueCallback);
|
|
case "eo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "day",
|
|
valueCallback
|
|
});
|
|
case "eee":
|
|
return match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeee":
|
|
return match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeeee":
|
|
return match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeee":
|
|
default:
|
|
return match.day(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 6;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
date = (0, _index2.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]
|
|
},
|
|
c: {
|
|
priority: 90,
|
|
parse: function(string, token, match, options) {
|
|
var valueCallback = function(value) {
|
|
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
};
|
|
switch (token) {
|
|
case "c":
|
|
case "cc":
|
|
return parseNDigits(token.length, string, valueCallback);
|
|
case "co":
|
|
return match.ordinalNumber(string, {
|
|
unit: "day",
|
|
valueCallback
|
|
});
|
|
case "ccc":
|
|
return match.day(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "ccccc":
|
|
return match.day(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccccc":
|
|
return match.day(string, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccc":
|
|
default:
|
|
return match.day(string, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 6;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
date = (0, _index2.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]
|
|
},
|
|
i: {
|
|
priority: 90,
|
|
parse: function(string, token, match, _options) {
|
|
var valueCallback = function(value) {
|
|
if (value === 0) {
|
|
return 7;
|
|
}
|
|
return value;
|
|
};
|
|
switch (token) {
|
|
case "i":
|
|
case "ii":
|
|
return parseNDigits(token.length, string);
|
|
case "io":
|
|
return match.ordinalNumber(string, {
|
|
unit: "day"
|
|
});
|
|
case "iii":
|
|
return match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting",
|
|
valueCallback
|
|
});
|
|
case "iiiii":
|
|
return match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting",
|
|
valueCallback
|
|
});
|
|
case "iiiiii":
|
|
return match.day(string, {
|
|
width: "short",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting",
|
|
valueCallback
|
|
});
|
|
case "iiii":
|
|
default:
|
|
return match.day(string, {
|
|
width: "wide",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "abbreviated",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "short",
|
|
context: "formatting",
|
|
valueCallback
|
|
}) || match.day(string, {
|
|
width: "narrow",
|
|
context: "formatting",
|
|
valueCallback
|
|
});
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 7;
|
|
},
|
|
set: function(date, _flags, value, options) {
|
|
date = (0, _index3.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]
|
|
},
|
|
a: {
|
|
priority: 80,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
case "aaa":
|
|
return match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaaa":
|
|
return match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaa":
|
|
default:
|
|
return match.dayPeriod(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["b", "B", "H", "k", "t", "T"]
|
|
},
|
|
b: {
|
|
priority: 80,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "b":
|
|
case "bb":
|
|
case "bbb":
|
|
return match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbbb":
|
|
return match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbb":
|
|
default:
|
|
return match.dayPeriod(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["a", "B", "H", "k", "t", "T"]
|
|
},
|
|
B: {
|
|
priority: 80,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "B":
|
|
case "BB":
|
|
case "BBB":
|
|
return match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBBB":
|
|
return match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBB":
|
|
default:
|
|
return match.dayPeriod(string, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(string, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["a", "b", "t", "T"]
|
|
},
|
|
h: {
|
|
priority: 70,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "h":
|
|
return parseNumericPattern(numericPatterns.hour12h, string);
|
|
case "ho":
|
|
return match.ordinalNumber(string, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 12;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
var isPM = date.getUTCHours() >= 12;
|
|
if (isPM && value < 12) {
|
|
date.setUTCHours(value + 12, 0, 0, 0);
|
|
} else if (!isPM && value === 12) {
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
} else {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
}
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["H", "K", "k", "t", "T"]
|
|
},
|
|
H: {
|
|
priority: 70,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "H":
|
|
return parseNumericPattern(numericPatterns.hour23h, string);
|
|
case "Ho":
|
|
return match.ordinalNumber(string, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 23;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"]
|
|
},
|
|
K: {
|
|
priority: 70,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "K":
|
|
return parseNumericPattern(numericPatterns.hour11h, string);
|
|
case "Ko":
|
|
return match.ordinalNumber(string, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 11;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
var isPM = date.getUTCHours() >= 12;
|
|
if (isPM && value < 12) {
|
|
date.setUTCHours(value + 12, 0, 0, 0);
|
|
} else {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
}
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["h", "H", "k", "t", "T"]
|
|
},
|
|
k: {
|
|
priority: 70,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "k":
|
|
return parseNumericPattern(numericPatterns.hour24h, string);
|
|
case "ko":
|
|
return match.ordinalNumber(string, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 1 && value <= 24;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
var hours = value <= 24 ? value % 24 : value;
|
|
date.setUTCHours(hours, 0, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"]
|
|
},
|
|
m: {
|
|
priority: 60,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "m":
|
|
return parseNumericPattern(numericPatterns.minute, string);
|
|
case "mo":
|
|
return match.ordinalNumber(string, {
|
|
unit: "minute"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 59;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMinutes(value, 0, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["t", "T"]
|
|
},
|
|
s: {
|
|
priority: 50,
|
|
parse: function(string, token, match, _options) {
|
|
switch (token) {
|
|
case "s":
|
|
return parseNumericPattern(numericPatterns.second, string);
|
|
case "so":
|
|
return match.ordinalNumber(string, {
|
|
unit: "second"
|
|
});
|
|
default:
|
|
return parseNDigits(token.length, string);
|
|
}
|
|
},
|
|
validate: function(_date, value, _options) {
|
|
return value >= 0 && value <= 59;
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCSeconds(value, 0);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["t", "T"]
|
|
},
|
|
S: {
|
|
priority: 30,
|
|
parse: function(string, token, _match, _options) {
|
|
var valueCallback = function(value) {
|
|
return Math.floor(value * Math.pow(10, -token.length + 3));
|
|
};
|
|
return parseNDigits(token.length, string, valueCallback);
|
|
},
|
|
set: function(date, _flags, value, _options) {
|
|
date.setUTCMilliseconds(value);
|
|
return date;
|
|
},
|
|
incompatibleTokens: ["t", "T"]
|
|
},
|
|
X: {
|
|
priority: 10,
|
|
parse: function(string, token, _match, _options) {
|
|
switch (token) {
|
|
case "X":
|
|
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
|
|
case "XX":
|
|
return parseTimezonePattern(timezonePatterns.basic, string);
|
|
case "XXXX":
|
|
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
|
|
case "XXXXX":
|
|
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
|
|
case "XXX":
|
|
default:
|
|
return parseTimezonePattern(timezonePatterns.extended, string);
|
|
}
|
|
},
|
|
set: function(date, flags, value, _options) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
return new Date(date.getTime() - value);
|
|
},
|
|
incompatibleTokens: ["t", "T", "x"]
|
|
},
|
|
x: {
|
|
priority: 10,
|
|
parse: function(string, token, _match, _options) {
|
|
switch (token) {
|
|
case "x":
|
|
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
|
|
case "xx":
|
|
return parseTimezonePattern(timezonePatterns.basic, string);
|
|
case "xxxx":
|
|
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
|
|
case "xxxxx":
|
|
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
|
|
case "xxx":
|
|
default:
|
|
return parseTimezonePattern(timezonePatterns.extended, string);
|
|
}
|
|
},
|
|
set: function(date, flags, value, _options) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
return new Date(date.getTime() - value);
|
|
},
|
|
incompatibleTokens: ["t", "T", "X"]
|
|
},
|
|
t: {
|
|
priority: 40,
|
|
parse: function(string, _token, _match, _options) {
|
|
return parseAnyDigitsSigned(string);
|
|
},
|
|
set: function(_date, _flags, value, _options) {
|
|
return [new Date(value * 1e3), {
|
|
timestampIsSet: true
|
|
}];
|
|
},
|
|
incompatibleTokens: "*"
|
|
},
|
|
T: {
|
|
priority: 20,
|
|
parse: function(string, _token, _match, _options) {
|
|
return parseAnyDigitsSigned(string);
|
|
},
|
|
set: function(_date, _flags, value, _options) {
|
|
return [new Date(value), {
|
|
timestampIsSet: true
|
|
}];
|
|
},
|
|
incompatibleTokens: "*"
|
|
}
|
|
};
|
|
var _default = parsers;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/index.js
|
|
var require_parse = __commonJS({
|
|
"node_modules/date-fns/parse/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = parse;
|
|
var _index = _interopRequireDefault(require_en_US());
|
|
var _index2 = _interopRequireDefault(require_subMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_toDate());
|
|
var _index4 = _interopRequireDefault(require_assign());
|
|
var _index5 = _interopRequireDefault(require_longFormatters());
|
|
var _index6 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index7 = require_protectedTokens();
|
|
var _index8 = _interopRequireDefault(require_toInteger());
|
|
var _index9 = _interopRequireDefault(require_parsers());
|
|
var _index10 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var TIMEZONE_UNIT_PRIORITY = 10;
|
|
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
var doubleQuoteRegExp = /''/g;
|
|
var notWhitespaceRegExp = /\S/;
|
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {
|
|
(0, _index10.default)(3, arguments);
|
|
var dateString = String(dirtyDateString);
|
|
var formatString = String(dirtyFormatString);
|
|
var options = dirtyOptions || {};
|
|
var locale = options.locale || _index.default;
|
|
if (!locale.match) {
|
|
throw new RangeError("locale must contain match property");
|
|
}
|
|
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
|
|
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0, _index8.default)(localeFirstWeekContainsDate);
|
|
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0, _index8.default)(options.firstWeekContainsDate);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
|
|
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0, _index8.default)(localeWeekStartsOn);
|
|
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0, _index8.default)(options.weekStartsOn);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
if (formatString === "") {
|
|
if (dateString === "") {
|
|
return (0, _index3.default)(dirtyReferenceDate);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
var subFnOptions = {
|
|
firstWeekContainsDate,
|
|
weekStartsOn,
|
|
locale
|
|
};
|
|
var setters = [{
|
|
priority: TIMEZONE_UNIT_PRIORITY,
|
|
subPriority: -1,
|
|
set: dateToSystemTimezone,
|
|
index: 0
|
|
}];
|
|
var i;
|
|
var tokens = formatString.match(longFormattingTokensRegExp).map(function(substring) {
|
|
var firstCharacter2 = substring[0];
|
|
if (firstCharacter2 === "p" || firstCharacter2 === "P") {
|
|
var longFormatter = _index5.default[firstCharacter2];
|
|
return longFormatter(substring, locale.formatLong, subFnOptions);
|
|
}
|
|
return substring;
|
|
}).join("").match(formattingTokensRegExp);
|
|
var usedTokens = [];
|
|
for (i = 0; i < tokens.length; i++) {
|
|
var token = tokens[i];
|
|
if (!options.useAdditionalWeekYearTokens && (0, _index7.isProtectedWeekYearToken)(token)) {
|
|
(0, _index7.throwProtectedError)(token, formatString, dirtyDateString);
|
|
}
|
|
if (!options.useAdditionalDayOfYearTokens && (0, _index7.isProtectedDayOfYearToken)(token)) {
|
|
(0, _index7.throwProtectedError)(token, formatString, dirtyDateString);
|
|
}
|
|
var firstCharacter = token[0];
|
|
var parser = _index9.default[firstCharacter];
|
|
if (parser) {
|
|
var incompatibleTokens = parser.incompatibleTokens;
|
|
if (Array.isArray(incompatibleTokens)) {
|
|
var incompatibleToken = void 0;
|
|
for (var _i = 0; _i < usedTokens.length; _i++) {
|
|
var usedToken = usedTokens[_i].token;
|
|
if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {
|
|
incompatibleToken = usedTokens[_i];
|
|
break;
|
|
}
|
|
}
|
|
if (incompatibleToken) {
|
|
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
|
|
}
|
|
} else if (parser.incompatibleTokens === "*" && usedTokens.length) {
|
|
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
|
|
}
|
|
usedTokens.push({
|
|
token: firstCharacter,
|
|
fullToken: token
|
|
});
|
|
var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);
|
|
if (!parseResult) {
|
|
return new Date(NaN);
|
|
}
|
|
setters.push({
|
|
priority: parser.priority,
|
|
subPriority: parser.subPriority || 0,
|
|
set: parser.set,
|
|
validate: parser.validate,
|
|
value: parseResult.value,
|
|
index: setters.length
|
|
});
|
|
dateString = parseResult.rest;
|
|
} else {
|
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
|
}
|
|
if (token === "''") {
|
|
token = "'";
|
|
} else if (firstCharacter === "'") {
|
|
token = cleanEscapedString(token);
|
|
}
|
|
if (dateString.indexOf(token) === 0) {
|
|
dateString = dateString.slice(token.length);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
}
|
|
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
|
|
return new Date(NaN);
|
|
}
|
|
var uniquePrioritySetters = setters.map(function(setter2) {
|
|
return setter2.priority;
|
|
}).sort(function(a, b) {
|
|
return b - a;
|
|
}).filter(function(priority, index, array) {
|
|
return array.indexOf(priority) === index;
|
|
}).map(function(priority) {
|
|
return setters.filter(function(setter2) {
|
|
return setter2.priority === priority;
|
|
}).sort(function(a, b) {
|
|
return b.subPriority - a.subPriority;
|
|
});
|
|
}).map(function(setterArray) {
|
|
return setterArray[0];
|
|
});
|
|
var date = (0, _index3.default)(dirtyReferenceDate);
|
|
if (isNaN(date)) {
|
|
return new Date(NaN);
|
|
}
|
|
var utcDate = (0, _index2.default)(date, (0, _index6.default)(date));
|
|
var flags = {};
|
|
for (i = 0; i < uniquePrioritySetters.length; i++) {
|
|
var setter = uniquePrioritySetters[i];
|
|
if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {
|
|
return new Date(NaN);
|
|
}
|
|
var result = setter.set(utcDate, flags, setter.value, subFnOptions);
|
|
if (result[0]) {
|
|
utcDate = result[0];
|
|
(0, _index4.default)(flags, result[1]);
|
|
} else {
|
|
utcDate = result;
|
|
}
|
|
}
|
|
return utcDate;
|
|
}
|
|
function dateToSystemTimezone(date, flags) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
var convertedDate = new Date(0);
|
|
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
|
return convertedDate;
|
|
}
|
|
function cleanEscapedString(input) {
|
|
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/constants/index.js
|
|
var require_constants = __commonJS({
|
|
"node_modules/date-fns/constants/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.secondsInMinute = exports.secondsInHour = exports.quartersInYear = exports.monthsInYear = exports.monthsInQuarter = exports.minutesInHour = exports.minTime = exports.millisecondsInSecond = exports.millisecondsInHour = exports.millisecondsInMinute = exports.maxTime = exports.daysInWeek = void 0;
|
|
var daysInWeek = 7;
|
|
exports.daysInWeek = daysInWeek;
|
|
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
exports.maxTime = maxTime;
|
|
var millisecondsInMinute = 6e4;
|
|
exports.millisecondsInMinute = millisecondsInMinute;
|
|
var millisecondsInHour = 36e5;
|
|
exports.millisecondsInHour = millisecondsInHour;
|
|
var millisecondsInSecond = 1e3;
|
|
exports.millisecondsInSecond = millisecondsInSecond;
|
|
var minTime = -maxTime;
|
|
exports.minTime = minTime;
|
|
var minutesInHour = 60;
|
|
exports.minutesInHour = minutesInHour;
|
|
var monthsInQuarter = 3;
|
|
exports.monthsInQuarter = monthsInQuarter;
|
|
var monthsInYear = 12;
|
|
exports.monthsInYear = monthsInYear;
|
|
var quartersInYear = 4;
|
|
exports.quartersInYear = quartersInYear;
|
|
var secondsInHour = 3600;
|
|
exports.secondsInHour = secondsInHour;
|
|
var secondsInMinute = 60;
|
|
exports.secondsInMinute = secondsInMinute;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parseISO/index.js
|
|
var require_parseISO = __commonJS({
|
|
"node_modules/date-fns/parseISO/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = parseISO;
|
|
var _index = require_constants();
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function parseISO(argument, dirtyOptions) {
|
|
(0, _index2.default)(1, arguments);
|
|
var options = dirtyOptions || {};
|
|
var additionalDigits = options.additionalDigits == null ? 2 : (0, _index3.default)(options.additionalDigits);
|
|
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
}
|
|
if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
|
|
return new Date(NaN);
|
|
}
|
|
var dateStrings = splitDateString(argument);
|
|
var date;
|
|
if (dateStrings.date) {
|
|
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
}
|
|
if (!date || isNaN(date.getTime())) {
|
|
return new Date(NaN);
|
|
}
|
|
var timestamp = date.getTime();
|
|
var time = 0;
|
|
var offset;
|
|
if (dateStrings.time) {
|
|
time = parseTime(dateStrings.time);
|
|
if (isNaN(time)) {
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
if (dateStrings.timezone) {
|
|
offset = parseTimezone(dateStrings.timezone);
|
|
if (isNaN(offset)) {
|
|
return new Date(NaN);
|
|
}
|
|
} else {
|
|
var dirtyDate = new Date(timestamp + time);
|
|
var result = new Date(0);
|
|
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
return result;
|
|
}
|
|
return new Date(timestamp + time + offset);
|
|
}
|
|
var patterns = {
|
|
dateTimeDelimiter: /[T ]/,
|
|
timeZoneDelimiter: /[Z ]/i,
|
|
timezone: /([Z+-].*)$/
|
|
};
|
|
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
function splitDateString(dateString) {
|
|
var dateStrings = {};
|
|
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
var timeString;
|
|
if (array.length > 2) {
|
|
return dateStrings;
|
|
}
|
|
if (/:/.test(array[0])) {
|
|
timeString = array[0];
|
|
} else {
|
|
dateStrings.date = array[0];
|
|
timeString = array[1];
|
|
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
}
|
|
}
|
|
if (timeString) {
|
|
var token = patterns.timezone.exec(timeString);
|
|
if (token) {
|
|
dateStrings.time = timeString.replace(token[1], "");
|
|
dateStrings.timezone = token[1];
|
|
} else {
|
|
dateStrings.time = timeString;
|
|
}
|
|
}
|
|
return dateStrings;
|
|
}
|
|
function parseYear(dateString, additionalDigits) {
|
|
var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
|
|
var captures = dateString.match(regex);
|
|
if (!captures)
|
|
return {
|
|
year: NaN,
|
|
restDateString: ""
|
|
};
|
|
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
return {
|
|
year: century === null ? year : century * 100,
|
|
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
};
|
|
}
|
|
function parseDate(dateString, year) {
|
|
if (year === null)
|
|
return new Date(NaN);
|
|
var captures = dateString.match(dateRegex);
|
|
if (!captures)
|
|
return new Date(NaN);
|
|
var isWeekDate = !!captures[4];
|
|
var dayOfYear = parseDateUnit(captures[1]);
|
|
var month = parseDateUnit(captures[2]) - 1;
|
|
var day = parseDateUnit(captures[3]);
|
|
var week = parseDateUnit(captures[4]);
|
|
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
if (isWeekDate) {
|
|
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
return new Date(NaN);
|
|
}
|
|
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
} else {
|
|
var date = new Date(0);
|
|
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
return new Date(NaN);
|
|
}
|
|
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
return date;
|
|
}
|
|
}
|
|
function parseDateUnit(value) {
|
|
return value ? parseInt(value) : 1;
|
|
}
|
|
function parseTime(timeString) {
|
|
var captures = timeString.match(timeRegex);
|
|
if (!captures)
|
|
return NaN;
|
|
var hours = parseTimeUnit(captures[1]);
|
|
var minutes = parseTimeUnit(captures[2]);
|
|
var seconds = parseTimeUnit(captures[3]);
|
|
if (!validateTime(hours, minutes, seconds)) {
|
|
return NaN;
|
|
}
|
|
return hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute + seconds * 1e3;
|
|
}
|
|
function parseTimeUnit(value) {
|
|
return value && parseFloat(value.replace(",", ".")) || 0;
|
|
}
|
|
function parseTimezone(timezoneString) {
|
|
if (timezoneString === "Z")
|
|
return 0;
|
|
var captures = timezoneString.match(timezoneRegex);
|
|
if (!captures)
|
|
return 0;
|
|
var sign = captures[1] === "+" ? -1 : 1;
|
|
var hours = parseInt(captures[2]);
|
|
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
if (!validateTimezone(hours, minutes)) {
|
|
return NaN;
|
|
}
|
|
return sign * (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute);
|
|
}
|
|
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
var date = new Date(0);
|
|
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
function isLeapYearIndex(year) {
|
|
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
}
|
|
function validateDate(year, month, date) {
|
|
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
}
|
|
function validateDayOfYearDate(year, dayOfYear) {
|
|
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
}
|
|
function validateWeekDate(_year, week, day) {
|
|
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
}
|
|
function validateTime(hours, minutes, seconds) {
|
|
if (hours === 24) {
|
|
return minutes === 0 && seconds === 0;
|
|
}
|
|
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
}
|
|
function validateTimezone(_hours, minutes) {
|
|
return minutes >= 0 && minutes <= 59;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-onclickoutside/dist/react-onclickoutside.cjs.js
|
|
var require_react_onclickoutside_cjs = __commonJS({
|
|
"node_modules/react-onclickoutside/dist/react-onclickoutside.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var react = require_react();
|
|
var reactDom = require_react_dom();
|
|
function _inheritsLoose(subClass, superClass) {
|
|
subClass.prototype = Object.create(superClass.prototype);
|
|
subClass.prototype.constructor = subClass;
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o, p) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
|
|
o2.__proto__ = p2;
|
|
return o2;
|
|
};
|
|
return _setPrototypeOf(o, p);
|
|
}
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null)
|
|
return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0)
|
|
continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function isNodeFound(current, componentNode, ignoreClass) {
|
|
if (current === componentNode) {
|
|
return true;
|
|
}
|
|
if (current.correspondingElement) {
|
|
return current.correspondingElement.classList.contains(ignoreClass);
|
|
}
|
|
return current.classList.contains(ignoreClass);
|
|
}
|
|
function findHighest(current, componentNode, ignoreClass) {
|
|
if (current === componentNode) {
|
|
return true;
|
|
}
|
|
while (current.parentNode || current.host) {
|
|
if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {
|
|
return true;
|
|
}
|
|
current = current.parentNode || current.host;
|
|
}
|
|
return current;
|
|
}
|
|
function clickedScrollbar(evt) {
|
|
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
|
|
}
|
|
var testPassiveEventSupport = function testPassiveEventSupport2() {
|
|
if (typeof window === "undefined" || typeof window.addEventListener !== "function") {
|
|
return;
|
|
}
|
|
var passive = false;
|
|
var options = Object.defineProperty({}, "passive", {
|
|
get: function get() {
|
|
passive = true;
|
|
}
|
|
});
|
|
var noop = function noop2() {
|
|
};
|
|
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
return passive;
|
|
};
|
|
function autoInc(seed) {
|
|
if (seed === void 0) {
|
|
seed = 0;
|
|
}
|
|
return function() {
|
|
return ++seed;
|
|
};
|
|
}
|
|
var uid = autoInc();
|
|
var passiveEventSupport;
|
|
var handlersMap = {};
|
|
var enabledInstances = {};
|
|
var touchEvents = ["touchstart", "touchmove"];
|
|
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
function getEventHandlerOptions(instance, eventName) {
|
|
var handlerOptions = null;
|
|
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
if (isTouchEvent && passiveEventSupport) {
|
|
handlerOptions = {
|
|
passive: !instance.props.preventDefault
|
|
};
|
|
}
|
|
return handlerOptions;
|
|
}
|
|
function onClickOutsideHOC(WrappedComponent, config) {
|
|
var _class, _temp;
|
|
var componentName = WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
return _temp = _class = /* @__PURE__ */ function(_Component) {
|
|
_inheritsLoose(onClickOutside, _Component);
|
|
function onClickOutside(props) {
|
|
var _this;
|
|
_this = _Component.call(this, props) || this;
|
|
_this.__outsideClickHandler = function(event) {
|
|
if (typeof _this.__clickOutsideHandlerProp === "function") {
|
|
_this.__clickOutsideHandlerProp(event);
|
|
return;
|
|
}
|
|
var instance = _this.getInstance();
|
|
if (typeof instance.props.handleClickOutside === "function") {
|
|
instance.props.handleClickOutside(event);
|
|
return;
|
|
}
|
|
if (typeof instance.handleClickOutside === "function") {
|
|
instance.handleClickOutside(event);
|
|
return;
|
|
}
|
|
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
};
|
|
_this.__getComponentNode = function() {
|
|
var instance = _this.getInstance();
|
|
if (config && typeof config.setClickOutsideRef === "function") {
|
|
return config.setClickOutsideRef()(instance);
|
|
}
|
|
if (typeof instance.setClickOutsideRef === "function") {
|
|
return instance.setClickOutsideRef();
|
|
}
|
|
return reactDom.findDOMNode(instance);
|
|
};
|
|
_this.enableOnClickOutside = function() {
|
|
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
return;
|
|
}
|
|
if (typeof passiveEventSupport === "undefined") {
|
|
passiveEventSupport = testPassiveEventSupport();
|
|
}
|
|
enabledInstances[_this._uid] = true;
|
|
var events = _this.props.eventTypes;
|
|
if (!events.forEach) {
|
|
events = [events];
|
|
}
|
|
handlersMap[_this._uid] = function(event) {
|
|
if (_this.componentNode === null)
|
|
return;
|
|
if (_this.props.preventDefault) {
|
|
event.preventDefault();
|
|
}
|
|
if (_this.props.stopPropagation) {
|
|
event.stopPropagation();
|
|
}
|
|
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
return;
|
|
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
return;
|
|
}
|
|
_this.__outsideClickHandler(event);
|
|
};
|
|
events.forEach(function(eventName) {
|
|
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
});
|
|
};
|
|
_this.disableOnClickOutside = function() {
|
|
delete enabledInstances[_this._uid];
|
|
var fn = handlersMap[_this._uid];
|
|
if (fn && typeof document !== "undefined") {
|
|
var events = _this.props.eventTypes;
|
|
if (!events.forEach) {
|
|
events = [events];
|
|
}
|
|
events.forEach(function(eventName) {
|
|
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
});
|
|
delete handlersMap[_this._uid];
|
|
}
|
|
};
|
|
_this.getRef = function(ref) {
|
|
return _this.instanceRef = ref;
|
|
};
|
|
_this._uid = uid();
|
|
return _this;
|
|
}
|
|
var _proto = onClickOutside.prototype;
|
|
_proto.getInstance = function getInstance() {
|
|
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
return this;
|
|
}
|
|
var ref = this.instanceRef;
|
|
return ref.getInstance ? ref.getInstance() : ref;
|
|
};
|
|
_proto.componentDidMount = function componentDidMount() {
|
|
if (typeof document === "undefined" || !document.createElement) {
|
|
return;
|
|
}
|
|
var instance = this.getInstance();
|
|
if (config && typeof config.handleClickOutside === "function") {
|
|
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
|
|
if (typeof this.__clickOutsideHandlerProp !== "function") {
|
|
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
}
|
|
}
|
|
this.componentNode = this.__getComponentNode();
|
|
if (this.props.disableOnClickOutside)
|
|
return;
|
|
this.enableOnClickOutside();
|
|
};
|
|
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
this.componentNode = this.__getComponentNode();
|
|
};
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
this.disableOnClickOutside();
|
|
};
|
|
_proto.render = function render() {
|
|
var _this$props = this.props;
|
|
_this$props.excludeScrollbar;
|
|
var props = _objectWithoutPropertiesLoose(_this$props, ["excludeScrollbar"]);
|
|
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
props.ref = this.getRef;
|
|
} else {
|
|
props.wrappedRef = this.getRef;
|
|
}
|
|
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
return react.createElement(WrappedComponent, props);
|
|
};
|
|
return onClickOutside;
|
|
}(react.Component), _class.displayName = "OnClickOutside(" + componentName + ")", _class.defaultProps = {
|
|
eventTypes: ["mousedown", "touchstart"],
|
|
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
preventDefault: false,
|
|
stopPropagation: false
|
|
}, _class.getClass = function() {
|
|
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
}, _temp;
|
|
}
|
|
exports.IGNORE_CLASS_NAME = IGNORE_CLASS_NAME;
|
|
exports.default = onClickOutsideHOC;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Manager.js
|
|
var require_Manager = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Manager.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Manager = Manager;
|
|
exports.ManagerReferenceNodeSetterContext = exports.ManagerReferenceNodeContext = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var ManagerReferenceNodeContext = React31.createContext();
|
|
exports.ManagerReferenceNodeContext = ManagerReferenceNodeContext;
|
|
var ManagerReferenceNodeSetterContext = React31.createContext();
|
|
exports.ManagerReferenceNodeSetterContext = ManagerReferenceNodeSetterContext;
|
|
function Manager(_ref) {
|
|
var children = _ref.children;
|
|
var _React$useState = React31.useState(null), referenceNode = _React$useState[0], setReferenceNode = _React$useState[1];
|
|
var hasUnmounted = React31.useRef(false);
|
|
React31.useEffect(function() {
|
|
return function() {
|
|
hasUnmounted.current = true;
|
|
};
|
|
}, []);
|
|
var handleSetReferenceNode = React31.useCallback(function(node) {
|
|
if (!hasUnmounted.current) {
|
|
setReferenceNode(node);
|
|
}
|
|
}, []);
|
|
return /* @__PURE__ */ React31.createElement(ManagerReferenceNodeContext.Provider, {
|
|
value: referenceNode
|
|
}, /* @__PURE__ */ React31.createElement(ManagerReferenceNodeSetterContext.Provider, {
|
|
value: handleSetReferenceNode
|
|
}, children));
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/utils.js
|
|
var require_utils5 = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/utils.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.useIsomorphicLayoutEffect = exports.fromEntries = exports.setRef = exports.safeInvoke = exports.unwrapArray = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var unwrapArray = function unwrapArray2(arg) {
|
|
return Array.isArray(arg) ? arg[0] : arg;
|
|
};
|
|
exports.unwrapArray = unwrapArray;
|
|
var safeInvoke = function safeInvoke2(fn) {
|
|
if (typeof fn === "function") {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
return fn.apply(void 0, args);
|
|
}
|
|
};
|
|
exports.safeInvoke = safeInvoke;
|
|
var setRef = function setRef2(ref, node) {
|
|
if (typeof ref === "function") {
|
|
return safeInvoke(ref, node);
|
|
} else if (ref != null) {
|
|
ref.current = node;
|
|
}
|
|
};
|
|
exports.setRef = setRef;
|
|
var fromEntries = function fromEntries2(entries) {
|
|
return entries.reduce(function(acc, _ref) {
|
|
var key = _ref[0], value = _ref[1];
|
|
acc[key] = value;
|
|
return acc;
|
|
}, {});
|
|
};
|
|
exports.fromEntries = fromEntries;
|
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? React31.useLayoutEffect : React31.useEffect;
|
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-fast-compare/index.js
|
|
var require_react_fast_compare = __commonJS({
|
|
"node_modules/react-fast-compare/index.js"(exports, module2) {
|
|
var hasElementType = typeof Element !== "undefined";
|
|
var hasMap = typeof Map === "function";
|
|
var hasSet = typeof Set === "function";
|
|
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
|
|
function equal(a, b) {
|
|
if (a === b)
|
|
return true;
|
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
if (a.constructor !== b.constructor)
|
|
return false;
|
|
var length, i, keys;
|
|
if (Array.isArray(a)) {
|
|
length = a.length;
|
|
if (length != b.length)
|
|
return false;
|
|
for (i = length; i-- !== 0; )
|
|
if (!equal(a[i], b[i]))
|
|
return false;
|
|
return true;
|
|
}
|
|
var it;
|
|
if (hasMap && a instanceof Map && b instanceof Map) {
|
|
if (a.size !== b.size)
|
|
return false;
|
|
it = a.entries();
|
|
while (!(i = it.next()).done)
|
|
if (!b.has(i.value[0]))
|
|
return false;
|
|
it = a.entries();
|
|
while (!(i = it.next()).done)
|
|
if (!equal(i.value[1], b.get(i.value[0])))
|
|
return false;
|
|
return true;
|
|
}
|
|
if (hasSet && a instanceof Set && b instanceof Set) {
|
|
if (a.size !== b.size)
|
|
return false;
|
|
it = a.entries();
|
|
while (!(i = it.next()).done)
|
|
if (!b.has(i.value[0]))
|
|
return false;
|
|
return true;
|
|
}
|
|
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
length = a.length;
|
|
if (length != b.length)
|
|
return false;
|
|
for (i = length; i-- !== 0; )
|
|
if (a[i] !== b[i])
|
|
return false;
|
|
return true;
|
|
}
|
|
if (a.constructor === RegExp)
|
|
return a.source === b.source && a.flags === b.flags;
|
|
if (a.valueOf !== Object.prototype.valueOf)
|
|
return a.valueOf() === b.valueOf();
|
|
if (a.toString !== Object.prototype.toString)
|
|
return a.toString() === b.toString();
|
|
keys = Object.keys(a);
|
|
length = keys.length;
|
|
if (length !== Object.keys(b).length)
|
|
return false;
|
|
for (i = length; i-- !== 0; )
|
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
return false;
|
|
if (hasElementType && a instanceof Element)
|
|
return false;
|
|
for (i = length; i-- !== 0; ) {
|
|
if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a.$$typeof) {
|
|
continue;
|
|
}
|
|
if (!equal(a[keys[i]], b[keys[i]]))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
return a !== a && b !== b;
|
|
}
|
|
module2.exports = function isEqual(a, b) {
|
|
try {
|
|
return equal(a, b);
|
|
} catch (error) {
|
|
if ((error.message || "").match(/stack|recursion/i)) {
|
|
console.warn("react-fast-compare cannot handle circular refs");
|
|
return false;
|
|
}
|
|
throw error;
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/usePopper.js
|
|
var require_usePopper = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/usePopper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.usePopper = void 0;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var ReactDOM3 = _interopRequireWildcard(require_react_dom());
|
|
var _core = require_popper();
|
|
var _reactFastCompare = _interopRequireDefault(require_react_fast_compare());
|
|
var _utils = require_utils5();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var EMPTY_MODIFIERS = [];
|
|
var usePopper = function usePopper2(referenceElement, popperElement, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var prevOptions = React31.useRef(null);
|
|
var optionsWithDefaults = {
|
|
onFirstUpdate: options.onFirstUpdate,
|
|
placement: options.placement || "bottom",
|
|
strategy: options.strategy || "absolute",
|
|
modifiers: options.modifiers || EMPTY_MODIFIERS
|
|
};
|
|
var _React$useState = React31.useState({
|
|
styles: {
|
|
popper: {
|
|
position: optionsWithDefaults.strategy,
|
|
left: "0",
|
|
top: "0"
|
|
},
|
|
arrow: {
|
|
position: "absolute"
|
|
}
|
|
},
|
|
attributes: {}
|
|
}), state = _React$useState[0], setState = _React$useState[1];
|
|
var updateStateModifier = React31.useMemo(function() {
|
|
return {
|
|
name: "updateState",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: function fn(_ref) {
|
|
var state2 = _ref.state;
|
|
var elements = Object.keys(state2.elements);
|
|
ReactDOM3.flushSync(function() {
|
|
setState({
|
|
styles: (0, _utils.fromEntries)(elements.map(function(element) {
|
|
return [element, state2.styles[element] || {}];
|
|
})),
|
|
attributes: (0, _utils.fromEntries)(elements.map(function(element) {
|
|
return [element, state2.attributes[element]];
|
|
}))
|
|
});
|
|
});
|
|
},
|
|
requires: ["computeStyles"]
|
|
};
|
|
}, []);
|
|
var popperOptions = React31.useMemo(function() {
|
|
var newOptions = {
|
|
onFirstUpdate: optionsWithDefaults.onFirstUpdate,
|
|
placement: optionsWithDefaults.placement,
|
|
strategy: optionsWithDefaults.strategy,
|
|
modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
|
|
name: "applyStyles",
|
|
enabled: false
|
|
}])
|
|
};
|
|
if ((0, _reactFastCompare["default"])(prevOptions.current, newOptions)) {
|
|
return prevOptions.current || newOptions;
|
|
} else {
|
|
prevOptions.current = newOptions;
|
|
return newOptions;
|
|
}
|
|
}, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
|
|
var popperInstanceRef = React31.useRef();
|
|
(0, _utils.useIsomorphicLayoutEffect)(function() {
|
|
if (popperInstanceRef.current) {
|
|
popperInstanceRef.current.setOptions(popperOptions);
|
|
}
|
|
}, [popperOptions]);
|
|
(0, _utils.useIsomorphicLayoutEffect)(function() {
|
|
if (referenceElement == null || popperElement == null) {
|
|
return;
|
|
}
|
|
var createPopper = options.createPopper || _core.createPopper;
|
|
var popperInstance = createPopper(referenceElement, popperElement, popperOptions);
|
|
popperInstanceRef.current = popperInstance;
|
|
return function() {
|
|
popperInstance.destroy();
|
|
popperInstanceRef.current = null;
|
|
};
|
|
}, [referenceElement, popperElement, options.createPopper]);
|
|
return {
|
|
state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
|
|
styles: state.styles,
|
|
attributes: state.attributes,
|
|
update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
|
|
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
|
|
};
|
|
};
|
|
exports.usePopper = usePopper;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Popper.js
|
|
var require_Popper = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Popper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Popper = Popper;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _Manager = require_Manager();
|
|
var _utils = require_utils5();
|
|
var _usePopper2 = require_usePopper();
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var NOOP = function NOOP2() {
|
|
return void 0;
|
|
};
|
|
var NOOP_PROMISE = function NOOP_PROMISE2() {
|
|
return Promise.resolve(null);
|
|
};
|
|
var EMPTY_MODIFIERS = [];
|
|
function Popper(_ref) {
|
|
var _ref$placement = _ref.placement, placement = _ref$placement === void 0 ? "bottom" : _ref$placement, _ref$strategy = _ref.strategy, strategy = _ref$strategy === void 0 ? "absolute" : _ref$strategy, _ref$modifiers = _ref.modifiers, modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers, referenceElement = _ref.referenceElement, onFirstUpdate = _ref.onFirstUpdate, innerRef = _ref.innerRef, children = _ref.children;
|
|
var referenceNode = React31.useContext(_Manager.ManagerReferenceNodeContext);
|
|
var _React$useState = React31.useState(null), popperElement = _React$useState[0], setPopperElement = _React$useState[1];
|
|
var _React$useState2 = React31.useState(null), arrowElement = _React$useState2[0], setArrowElement = _React$useState2[1];
|
|
React31.useEffect(function() {
|
|
(0, _utils.setRef)(innerRef, popperElement);
|
|
}, [innerRef, popperElement]);
|
|
var options = React31.useMemo(function() {
|
|
return {
|
|
placement,
|
|
strategy,
|
|
onFirstUpdate,
|
|
modifiers: [].concat(modifiers, [{
|
|
name: "arrow",
|
|
enabled: arrowElement != null,
|
|
options: {
|
|
element: arrowElement
|
|
}
|
|
}])
|
|
};
|
|
}, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
|
|
var _usePopper = (0, _usePopper2.usePopper)(referenceElement || referenceNode, popperElement, options), state = _usePopper.state, styles = _usePopper.styles, forceUpdate = _usePopper.forceUpdate, update = _usePopper.update;
|
|
var childrenProps = React31.useMemo(function() {
|
|
return {
|
|
ref: setPopperElement,
|
|
style: styles.popper,
|
|
placement: state ? state.placement : placement,
|
|
hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
|
|
isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
|
|
arrowProps: {
|
|
style: styles.arrow,
|
|
ref: setArrowElement
|
|
},
|
|
forceUpdate: forceUpdate || NOOP,
|
|
update: update || NOOP_PROMISE
|
|
};
|
|
}, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
|
|
return (0, _utils.unwrapArray)(children)(childrenProps);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/warning/warning.js
|
|
var require_warning = __commonJS({
|
|
"node_modules/warning/warning.js"(exports, module2) {
|
|
"use strict";
|
|
var __DEV__ = true;
|
|
var warning = function() {
|
|
};
|
|
if (__DEV__) {
|
|
printWarning = function printWarning2(format, args) {
|
|
var len = arguments.length;
|
|
args = new Array(len > 1 ? len - 1 : 0);
|
|
for (var key = 1; key < len; key++) {
|
|
args[key - 1] = arguments[key];
|
|
}
|
|
var argIndex = 0;
|
|
var message = "Warning: " + format.replace(/%s/g, function() {
|
|
return args[argIndex++];
|
|
});
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x) {
|
|
}
|
|
};
|
|
warning = function(condition, format, args) {
|
|
var len = arguments.length;
|
|
args = new Array(len > 2 ? len - 2 : 0);
|
|
for (var key = 2; key < len; key++) {
|
|
args[key - 2] = arguments[key];
|
|
}
|
|
if (format === void 0) {
|
|
throw new Error("`warning(condition, format, ...args)` requires a warning message argument");
|
|
}
|
|
if (!condition) {
|
|
printWarning.apply(null, [format].concat(args));
|
|
}
|
|
};
|
|
}
|
|
var printWarning;
|
|
module2.exports = warning;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Reference.js
|
|
var require_Reference = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Reference.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Reference = Reference;
|
|
var React31 = _interopRequireWildcard(require_react());
|
|
var _warning = _interopRequireDefault(require_warning());
|
|
var _Manager = require_Manager();
|
|
var _utils = require_utils5();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function Reference(_ref) {
|
|
var children = _ref.children, innerRef = _ref.innerRef;
|
|
var setReferenceNode = React31.useContext(_Manager.ManagerReferenceNodeSetterContext);
|
|
var refHandler = React31.useCallback(function(node) {
|
|
(0, _utils.setRef)(innerRef, node);
|
|
(0, _utils.safeInvoke)(setReferenceNode, node);
|
|
}, [innerRef, setReferenceNode]);
|
|
React31.useEffect(function() {
|
|
return function() {
|
|
return (0, _utils.setRef)(innerRef, null);
|
|
};
|
|
}, []);
|
|
React31.useEffect(function() {
|
|
(0, _warning["default"])(Boolean(setReferenceNode), "`Reference` should not be used outside of a `Manager` component.");
|
|
}, [setReferenceNode]);
|
|
return (0, _utils.unwrapArray)(children)({
|
|
ref: refHandler
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/index.js
|
|
var require_cjs2 = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "Popper", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Popper.Popper;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Manager", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Manager.Manager;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Reference", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Reference.Reference;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "usePopper", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _usePopper.usePopper;
|
|
}
|
|
});
|
|
var _Popper = require_Popper();
|
|
var _Manager = require_Manager();
|
|
var _Reference = require_Reference();
|
|
var _usePopper = require_usePopper();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-datepicker/dist/react-datepicker.min.js
|
|
var require_react_datepicker_min = __commonJS({
|
|
"node_modules/react-datepicker/dist/react-datepicker.min.js"(exports, module2) {
|
|
!function(e, t) {
|
|
typeof exports == "object" && typeof module2 != "undefined" ? t(exports, require_react(), require_prop_types(), require_classnames(), require_isDate(), require_isValid(), require_format(), require_addMinutes(), require_addHours(), require_addDays(), require_addWeeks(), require_addMonths(), require_addYears(), require_subMinutes(), require_subHours(), require_subDays(), require_subWeeks(), require_subMonths(), require_subYears(), require_getSeconds(), require_getMinutes(), require_getHours(), require_getDay(), require_getDate(), require_getISOWeek(), require_getMonth(), require_getQuarter(), require_getYear(), require_getTime(), require_setSeconds(), require_setMinutes(), require_setHours(), require_setMonth(), require_setQuarter(), require_setYear(), require_min(), require_max(), require_differenceInCalendarDays(), require_differenceInCalendarMonths(), require_differenceInCalendarWeeks(), require_differenceInCalendarYears(), require_startOfDay(), require_startOfWeek(), require_startOfMonth(), require_startOfQuarter(), require_startOfYear(), require_endOfDay(), require_endOfWeek(), require_endOfMonth(), require_isEqual(), require_isSameDay(), require_isSameMonth(), require_isSameYear(), require_isSameQuarter(), require_isAfter(), require_isBefore(), require_isWithinInterval(), require_toDate(), require_parse(), require_parseISO(), require_react_onclickoutside_cjs(), require_react_dom(), require_cjs2()) : typeof define == "function" && define.amd ? define(["exports", "react", "prop-types", "classnames", "date-fns/isDate", "date-fns/isValid", "date-fns/format", "date-fns/addMinutes", "date-fns/addHours", "date-fns/addDays", "date-fns/addWeeks", "date-fns/addMonths", "date-fns/addYears", "date-fns/subMinutes", "date-fns/subHours", "date-fns/subDays", "date-fns/subWeeks", "date-fns/subMonths", "date-fns/subYears", "date-fns/getSeconds", "date-fns/getMinutes", "date-fns/getHours", "date-fns/getDay", "date-fns/getDate", "date-fns/getISOWeek", "date-fns/getMonth", "date-fns/getQuarter", "date-fns/getYear", "date-fns/getTime", "date-fns/setSeconds", "date-fns/setMinutes", "date-fns/setHours", "date-fns/setMonth", "date-fns/setQuarter", "date-fns/setYear", "date-fns/min", "date-fns/max", "date-fns/differenceInCalendarDays", "date-fns/differenceInCalendarMonths", "date-fns/differenceInCalendarWeeks", "date-fns/differenceInCalendarYears", "date-fns/startOfDay", "date-fns/startOfWeek", "date-fns/startOfMonth", "date-fns/startOfQuarter", "date-fns/startOfYear", "date-fns/endOfDay", "date-fns/endOfWeek", "date-fns/endOfMonth", "date-fns/isEqual", "date-fns/isSameDay", "date-fns/isSameMonth", "date-fns/isSameYear", "date-fns/isSameQuarter", "date-fns/isAfter", "date-fns/isBefore", "date-fns/isWithinInterval", "date-fns/toDate", "date-fns/parse", "date-fns/parseISO", "react-onclickoutside", "react-dom", "react-popper"], t) : t((e = typeof globalThis != "undefined" ? globalThis : e || self).DatePicker = {}, e.React, e.PropTypes, e.classNames, e.isDate, e.isValidDate, e.format, e.addMinutes, e.addHours, e.addDays, e.addWeeks, e.addMonths, e.addYears, null, null, e.subDays, e.subWeeks, e.subMonths, e.subYears, e.getSeconds, e.getMinutes, e.getHours, e.getDay, e.getDate, e.getISOWeek, e.getMonth, e.getQuarter, e.getYear, e.getTime, e.setSeconds, e.setMinutes, e.setHours, e.setMonth, e.setQuarter, e.setYear, e.min, e.max, e.differenceInCalendarDays, e.differenceInCalendarMonths, null, e.differenceInCalendarYears, e.startOfDay, e.startOfWeek, e.startOfMonth, e.startOfQuarter, e.startOfYear, e.endOfDay, null, null, e.dfIsEqual, e.dfIsSameDay, e.dfIsSameMonth, e.dfIsSameYear, e.dfIsSameQuarter, e.isAfter, e.isBefore, e.isWithinInterval, e.toDate, e.parse, e.parseISO, e.onClickOutside, e.ReactDOM, e.ReactPopper);
|
|
}(exports, function(e, t, r, a, n, o, s, i, p, l, d, c, u, f, h, m, y, D, v, w, g, k, b, S, C, _, M, P, E, N, x, O, Y, I, T, L, R, F, A, q, W, B, K, H, j, Q, V, U, $, z, G, J, X, Z, ee, te, re, ae, ne, oe, se, ie, pe) {
|
|
"use strict";
|
|
function le(e2) {
|
|
return e2 && typeof e2 == "object" && "default" in e2 ? e2 : { default: e2 };
|
|
}
|
|
var de = le(t), ce = le(a), ue = le(n), fe = le(o), he = le(s), me = le(i), ye = le(p), De = le(l), ve = le(d), we = le(c), ge = le(u), ke = le(m), be = le(y), Se = le(D), Ce = le(v), _e = le(w), Me = le(g), Pe = le(k), Ee = le(b), Ne = le(S), xe = le(C), Oe = le(_), Ye = le(M), Ie = le(P), Te = le(E), Le = le(N), Re = le(x), Fe = le(O), Ae = le(Y), qe = le(I), We = le(T), Be = le(L), Ke = le(R), He = le(F), je = le(A), Qe = le(W), Ve = le(B), Ue = le(K), $e = le(H), ze = le(j), Ge = le(Q), Je = le(V), Xe = le(z), Ze = le(G), et = le(J), tt = le(X), rt = le(Z), at = le(ee), nt = le(te), ot = le(re), st = le(ae), it = le(ne), pt = le(oe), lt = le(se), dt = le(ie);
|
|
function ct(e2, t2) {
|
|
var r2 = Object.keys(e2);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var a2 = Object.getOwnPropertySymbols(e2);
|
|
t2 && (a2 = a2.filter(function(t3) {
|
|
return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
|
|
})), r2.push.apply(r2, a2);
|
|
}
|
|
return r2;
|
|
}
|
|
function ut(e2) {
|
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
var r2 = arguments[t2] != null ? arguments[t2] : {};
|
|
t2 % 2 ? ct(Object(r2), true).forEach(function(t3) {
|
|
Dt(e2, t3, r2[t3]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(r2)) : ct(Object(r2)).forEach(function(t3) {
|
|
Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(r2, t3));
|
|
});
|
|
}
|
|
return e2;
|
|
}
|
|
function ft(e2) {
|
|
return (ft = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e3) {
|
|
return typeof e3;
|
|
} : function(e3) {
|
|
return e3 && typeof Symbol == "function" && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
|
|
})(e2);
|
|
}
|
|
function ht(e2, t2) {
|
|
if (!(e2 instanceof t2))
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
function mt(e2, t2) {
|
|
for (var r2 = 0; r2 < t2.length; r2++) {
|
|
var a2 = t2[r2];
|
|
a2.enumerable = a2.enumerable || false, a2.configurable = true, "value" in a2 && (a2.writable = true), Object.defineProperty(e2, a2.key, a2);
|
|
}
|
|
}
|
|
function yt(e2, t2, r2) {
|
|
return t2 && mt(e2.prototype, t2), r2 && mt(e2, r2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
}
|
|
function Dt(e2, t2, r2) {
|
|
return t2 in e2 ? Object.defineProperty(e2, t2, { value: r2, enumerable: true, configurable: true, writable: true }) : e2[t2] = r2, e2;
|
|
}
|
|
function vt() {
|
|
return (vt = Object.assign || function(e2) {
|
|
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
var r2 = arguments[t2];
|
|
for (var a2 in r2)
|
|
Object.prototype.hasOwnProperty.call(r2, a2) && (e2[a2] = r2[a2]);
|
|
}
|
|
return e2;
|
|
}).apply(this, arguments);
|
|
}
|
|
function wt(e2, t2) {
|
|
if (typeof t2 != "function" && t2 !== null)
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
Object.defineProperty(e2, "prototype", { value: Object.create(t2 && t2.prototype, { constructor: { value: e2, writable: true, configurable: true } }), writable: false }), t2 && kt(e2, t2);
|
|
}
|
|
function gt(e2) {
|
|
return (gt = Object.setPrototypeOf ? Object.getPrototypeOf : function(e3) {
|
|
return e3.__proto__ || Object.getPrototypeOf(e3);
|
|
})(e2);
|
|
}
|
|
function kt(e2, t2) {
|
|
return (kt = Object.setPrototypeOf || function(e3, t3) {
|
|
return e3.__proto__ = t3, e3;
|
|
})(e2, t2);
|
|
}
|
|
function bt(e2) {
|
|
if (e2 === void 0)
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
return e2;
|
|
}
|
|
function St(e2, t2) {
|
|
if (t2 && (typeof t2 == "object" || typeof t2 == "function"))
|
|
return t2;
|
|
if (t2 !== void 0)
|
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
return bt(e2);
|
|
}
|
|
function Ct(e2) {
|
|
var t2 = function() {
|
|
if (typeof Reflect == "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy == "function")
|
|
return true;
|
|
try {
|
|
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
})), true;
|
|
} catch (e3) {
|
|
return false;
|
|
}
|
|
}();
|
|
return function() {
|
|
var r2, a2 = gt(e2);
|
|
if (t2) {
|
|
var n2 = gt(this).constructor;
|
|
r2 = Reflect.construct(a2, arguments, n2);
|
|
} else
|
|
r2 = a2.apply(this, arguments);
|
|
return St(this, r2);
|
|
};
|
|
}
|
|
function _t(e2) {
|
|
return function(e3) {
|
|
if (Array.isArray(e3))
|
|
return Mt(e3);
|
|
}(e2) || function(e3) {
|
|
if (typeof Symbol != "undefined" && e3[Symbol.iterator] != null || e3["@@iterator"] != null)
|
|
return Array.from(e3);
|
|
}(e2) || function(e3, t2) {
|
|
if (!e3)
|
|
return;
|
|
if (typeof e3 == "string")
|
|
return Mt(e3, t2);
|
|
var r2 = Object.prototype.toString.call(e3).slice(8, -1);
|
|
r2 === "Object" && e3.constructor && (r2 = e3.constructor.name);
|
|
if (r2 === "Map" || r2 === "Set")
|
|
return Array.from(e3);
|
|
if (r2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r2))
|
|
return Mt(e3, t2);
|
|
}(e2) || function() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}();
|
|
}
|
|
function Mt(e2, t2) {
|
|
(t2 == null || t2 > e2.length) && (t2 = e2.length);
|
|
for (var r2 = 0, a2 = new Array(t2); r2 < t2; r2++)
|
|
a2[r2] = e2[r2];
|
|
return a2;
|
|
}
|
|
function Pt(e2, t2) {
|
|
switch (e2) {
|
|
case "P":
|
|
return t2.date({ width: "short" });
|
|
case "PP":
|
|
return t2.date({ width: "medium" });
|
|
case "PPP":
|
|
return t2.date({ width: "long" });
|
|
case "PPPP":
|
|
default:
|
|
return t2.date({ width: "full" });
|
|
}
|
|
}
|
|
function Et(e2, t2) {
|
|
switch (e2) {
|
|
case "p":
|
|
return t2.time({ width: "short" });
|
|
case "pp":
|
|
return t2.time({ width: "medium" });
|
|
case "ppp":
|
|
return t2.time({ width: "long" });
|
|
case "pppp":
|
|
default:
|
|
return t2.time({ width: "full" });
|
|
}
|
|
}
|
|
var Nt = { p: Et, P: function(e2, t2) {
|
|
var r2, a2 = e2.match(/(P+)(p+)?/) || [], n2 = a2[1], o2 = a2[2];
|
|
if (!o2)
|
|
return Pt(e2, t2);
|
|
switch (n2) {
|
|
case "P":
|
|
r2 = t2.dateTime({ width: "short" });
|
|
break;
|
|
case "PP":
|
|
r2 = t2.dateTime({ width: "medium" });
|
|
break;
|
|
case "PPP":
|
|
r2 = t2.dateTime({ width: "long" });
|
|
break;
|
|
case "PPPP":
|
|
default:
|
|
r2 = t2.dateTime({ width: "full" });
|
|
}
|
|
return r2.replace("{{date}}", Pt(n2, t2)).replace("{{time}}", Et(o2, t2));
|
|
} }, xt = 12, Ot = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
function Yt(e2) {
|
|
var t2 = e2 ? typeof e2 == "string" || e2 instanceof String ? pt.default(e2) : st.default(e2) : new Date();
|
|
return Tt(t2) ? t2 : null;
|
|
}
|
|
function It(e2, t2, r2, a2, n2) {
|
|
var o2 = null, s2 = Xt(r2) || Xt(Jt()), i2 = true;
|
|
return Array.isArray(t2) ? (t2.forEach(function(t3) {
|
|
var p2 = it.default(e2, t3, new Date(), { locale: s2 });
|
|
a2 && (i2 = Tt(p2, n2) && e2 === Lt(p2, t3, r2)), Tt(p2, n2) && i2 && (o2 = p2);
|
|
}), o2) : (o2 = it.default(e2, t2, new Date(), { locale: s2 }), a2 ? i2 = Tt(o2) && e2 === Lt(o2, t2, r2) : Tt(o2) || (t2 = t2.match(Ot).map(function(e3) {
|
|
var t3 = e3[0];
|
|
return t3 === "p" || t3 === "P" ? s2 ? (0, Nt[t3])(e3, s2.formatLong) : t3 : e3;
|
|
}).join(""), e2.length > 0 && (o2 = it.default(e2, t2.slice(0, e2.length), new Date())), Tt(o2) || (o2 = new Date(e2))), Tt(o2) && i2 ? o2 : null);
|
|
}
|
|
function Tt(e2, t2) {
|
|
return t2 = t2 || new Date("1/1/1000"), fe.default(e2) && !nt.default(e2, t2);
|
|
}
|
|
function Lt(e2, t2, r2) {
|
|
if (r2 === "en")
|
|
return he.default(e2, t2, { awareOfUnicodeTokens: true });
|
|
var a2 = Xt(r2);
|
|
return r2 && !a2 && console.warn('A locale object was not found for the provided string ["'.concat(r2, '"].')), !a2 && Jt() && Xt(Jt()) && (a2 = Xt(Jt())), he.default(e2, t2, { locale: a2 || null, awareOfUnicodeTokens: true });
|
|
}
|
|
function Rt(e2, t2) {
|
|
var r2 = t2.dateFormat, a2 = t2.locale;
|
|
return e2 && Lt(e2, Array.isArray(r2) ? r2[0] : r2, a2) || "";
|
|
}
|
|
function Ft(e2, t2) {
|
|
var r2 = t2.hour, a2 = r2 === void 0 ? 0 : r2, n2 = t2.minute, o2 = n2 === void 0 ? 0 : n2, s2 = t2.second, i2 = s2 === void 0 ? 0 : s2;
|
|
return Fe.default(Re.default(Le.default(e2, i2), o2), a2);
|
|
}
|
|
function At(e2, t2) {
|
|
var r2 = t2 && Xt(t2) || Jt() && Xt(Jt());
|
|
return xe.default(e2, r2 ? { locale: r2 } : null);
|
|
}
|
|
function qt(e2, t2) {
|
|
return Lt(e2, "ddd", t2);
|
|
}
|
|
function Wt(e2) {
|
|
return Ve.default(e2);
|
|
}
|
|
function Bt(e2, t2, r2) {
|
|
var a2 = Xt(t2 || Jt());
|
|
return Ue.default(e2, { locale: a2, weekStartsOn: r2 });
|
|
}
|
|
function Kt(e2) {
|
|
return $e.default(e2);
|
|
}
|
|
function Ht(e2) {
|
|
return Ge.default(e2);
|
|
}
|
|
function jt(e2) {
|
|
return ze.default(e2);
|
|
}
|
|
function Qt(e2, t2) {
|
|
return e2 && t2 ? tt.default(e2, t2) : !e2 && !t2;
|
|
}
|
|
function Vt(e2, t2) {
|
|
return e2 && t2 ? et.default(e2, t2) : !e2 && !t2;
|
|
}
|
|
function Ut(e2, t2) {
|
|
return e2 && t2 ? rt.default(e2, t2) : !e2 && !t2;
|
|
}
|
|
function $t(e2, t2) {
|
|
return e2 && t2 ? Ze.default(e2, t2) : !e2 && !t2;
|
|
}
|
|
function zt(e2, t2) {
|
|
return e2 && t2 ? Xe.default(e2, t2) : !e2 && !t2;
|
|
}
|
|
function Gt(e2, t2, r2) {
|
|
var a2, n2 = Ve.default(t2), o2 = Je.default(r2);
|
|
try {
|
|
a2 = ot.default(e2, { start: n2, end: o2 });
|
|
} catch (e3) {
|
|
a2 = false;
|
|
}
|
|
return a2;
|
|
}
|
|
function Jt() {
|
|
return (typeof window != "undefined" ? window : globalThis).__localeId__;
|
|
}
|
|
function Xt(e2) {
|
|
if (typeof e2 == "string") {
|
|
var t2 = typeof window != "undefined" ? window : globalThis;
|
|
return t2.__localeData__ ? t2.__localeData__[e2] : null;
|
|
}
|
|
return e2;
|
|
}
|
|
function Zt(e2, t2) {
|
|
return Lt(Ae.default(Yt(), e2), "LLLL", t2);
|
|
}
|
|
function er(e2, t2) {
|
|
return Lt(Ae.default(Yt(), e2), "LLL", t2);
|
|
}
|
|
function tr(e2, t2) {
|
|
return Lt(qe.default(Yt(), e2), "QQQ", t2);
|
|
}
|
|
function rr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.maxDate, n2 = t2.excludeDates, o2 = t2.excludeDateIntervals, s2 = t2.includeDates, i2 = t2.includeDateIntervals, p2 = t2.filterDate;
|
|
return lr(e2, { minDate: r2, maxDate: a2 }) || n2 && n2.some(function(t3) {
|
|
return $t(e2, t3);
|
|
}) || o2 && o2.some(function(t3) {
|
|
var r3 = t3.start, a3 = t3.end;
|
|
return ot.default(e2, { start: r3, end: a3 });
|
|
}) || s2 && !s2.some(function(t3) {
|
|
return $t(e2, t3);
|
|
}) || i2 && !i2.some(function(t3) {
|
|
var r3 = t3.start, a3 = t3.end;
|
|
return ot.default(e2, { start: r3, end: a3 });
|
|
}) || p2 && !p2(Yt(e2)) || false;
|
|
}
|
|
function ar(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.excludeDates, a2 = t2.excludeDateIntervals;
|
|
return a2 && a2.length > 0 ? a2.some(function(t3) {
|
|
var r3 = t3.start, a3 = t3.end;
|
|
return ot.default(e2, { start: r3, end: a3 });
|
|
}) : r2 && r2.some(function(t3) {
|
|
return $t(e2, t3);
|
|
}) || false;
|
|
}
|
|
function nr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.maxDate, n2 = t2.excludeDates, o2 = t2.includeDates, s2 = t2.filterDate;
|
|
return lr(e2, { minDate: r2, maxDate: a2 }) || n2 && n2.some(function(t3) {
|
|
return Vt(e2, t3);
|
|
}) || o2 && !o2.some(function(t3) {
|
|
return Vt(e2, t3);
|
|
}) || s2 && !s2(Yt(e2)) || false;
|
|
}
|
|
function or(e2, t2, r2, a2) {
|
|
var n2 = Ie.default(e2), o2 = Oe.default(e2), s2 = Ie.default(t2), i2 = Oe.default(t2), p2 = Ie.default(a2);
|
|
return n2 === s2 && n2 === p2 ? o2 <= r2 && r2 <= i2 : n2 < s2 ? p2 === n2 && o2 <= r2 || p2 === s2 && i2 >= r2 || p2 < s2 && p2 > n2 : void 0;
|
|
}
|
|
function sr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.maxDate, n2 = t2.excludeDates, o2 = t2.includeDates, s2 = t2.filterDate;
|
|
return lr(e2, { minDate: r2, maxDate: a2 }) || n2 && n2.some(function(t3) {
|
|
return Ut(e2, t3);
|
|
}) || o2 && !o2.some(function(t3) {
|
|
return Ut(e2, t3);
|
|
}) || s2 && !s2(Yt(e2)) || false;
|
|
}
|
|
function ir(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.maxDate, n2 = new Date(e2, 0, 1);
|
|
return lr(n2, { minDate: r2, maxDate: a2 }) || false;
|
|
}
|
|
function pr(e2, t2, r2, a2) {
|
|
var n2 = Ie.default(e2), o2 = Ye.default(e2), s2 = Ie.default(t2), i2 = Ye.default(t2), p2 = Ie.default(a2);
|
|
return n2 === s2 && n2 === p2 ? o2 <= r2 && r2 <= i2 : n2 < s2 ? p2 === n2 && o2 <= r2 || p2 === s2 && i2 >= r2 || p2 < s2 && p2 > n2 : void 0;
|
|
}
|
|
function lr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.maxDate;
|
|
return r2 && He.default(e2, r2) < 0 || a2 && He.default(e2, a2) > 0;
|
|
}
|
|
function dr(e2, t2) {
|
|
return t2.some(function(t3) {
|
|
return Pe.default(t3) === Pe.default(e2) && Me.default(t3) === Me.default(e2);
|
|
});
|
|
}
|
|
function cr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.excludeTimes, a2 = t2.includeTimes, n2 = t2.filterTime;
|
|
return r2 && dr(e2, r2) || a2 && !dr(e2, a2) || n2 && !n2(e2) || false;
|
|
}
|
|
function ur(e2, t2) {
|
|
var r2 = t2.minTime, a2 = t2.maxTime;
|
|
if (!r2 || !a2)
|
|
throw new Error("Both minTime and maxTime props required");
|
|
var n2, o2 = Yt(), s2 = Fe.default(Re.default(o2, Me.default(e2)), Pe.default(e2)), i2 = Fe.default(Re.default(o2, Me.default(r2)), Pe.default(r2)), p2 = Fe.default(Re.default(o2, Me.default(a2)), Pe.default(a2));
|
|
try {
|
|
n2 = !ot.default(s2, { start: i2, end: p2 });
|
|
} catch (e3) {
|
|
n2 = false;
|
|
}
|
|
return n2;
|
|
}
|
|
function fr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.includeDates, n2 = Se.default(e2, 1);
|
|
return r2 && je.default(r2, n2) > 0 || a2 && a2.every(function(e3) {
|
|
return je.default(e3, n2) > 0;
|
|
}) || false;
|
|
}
|
|
function hr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.maxDate, a2 = t2.includeDates, n2 = we.default(e2, 1);
|
|
return r2 && je.default(n2, r2) > 0 || a2 && a2.every(function(e3) {
|
|
return je.default(n2, e3) > 0;
|
|
}) || false;
|
|
}
|
|
function mr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.minDate, a2 = t2.includeDates, n2 = Ce.default(e2, 1);
|
|
return r2 && Qe.default(r2, n2) > 0 || a2 && a2.every(function(e3) {
|
|
return Qe.default(e3, n2) > 0;
|
|
}) || false;
|
|
}
|
|
function yr(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r2 = t2.maxDate, a2 = t2.includeDates, n2 = ge.default(e2, 1);
|
|
return r2 && Qe.default(n2, r2) > 0 || a2 && a2.every(function(e3) {
|
|
return Qe.default(n2, e3) > 0;
|
|
}) || false;
|
|
}
|
|
function Dr(e2) {
|
|
var t2 = e2.minDate, r2 = e2.includeDates;
|
|
if (r2 && t2) {
|
|
var a2 = r2.filter(function(e3) {
|
|
return He.default(e3, t2) >= 0;
|
|
});
|
|
return Be.default(a2);
|
|
}
|
|
return r2 ? Be.default(r2) : t2;
|
|
}
|
|
function vr(e2) {
|
|
var t2 = e2.maxDate, r2 = e2.includeDates;
|
|
if (r2 && t2) {
|
|
var a2 = r2.filter(function(e3) {
|
|
return He.default(e3, t2) <= 0;
|
|
});
|
|
return Ke.default(a2);
|
|
}
|
|
return r2 ? Ke.default(r2) : t2;
|
|
}
|
|
function wr() {
|
|
for (var e2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "react-datepicker__day--highlighted", r2 = new Map(), a2 = 0, n2 = e2.length; a2 < n2; a2++) {
|
|
var o2 = e2[a2];
|
|
if (ue.default(o2)) {
|
|
var s2 = Lt(o2, "MM.dd.yyyy"), i2 = r2.get(s2) || [];
|
|
i2.includes(t2) || (i2.push(t2), r2.set(s2, i2));
|
|
} else if (ft(o2) === "object") {
|
|
var p2 = Object.keys(o2), l2 = p2[0], d2 = o2[p2[0]];
|
|
if (typeof l2 == "string" && d2.constructor === Array)
|
|
for (var c2 = 0, u2 = d2.length; c2 < u2; c2++) {
|
|
var f2 = Lt(d2[c2], "MM.dd.yyyy"), h2 = r2.get(f2) || [];
|
|
h2.includes(l2) || (h2.push(l2), r2.set(f2, h2));
|
|
}
|
|
}
|
|
}
|
|
return r2;
|
|
}
|
|
function gr(e2, t2, r2, a2, n2) {
|
|
for (var o2 = n2.length, s2 = [], i2 = 0; i2 < o2; i2++) {
|
|
var p2 = me.default(ye.default(e2, Pe.default(n2[i2])), Me.default(n2[i2])), l2 = me.default(e2, (r2 + 1) * a2);
|
|
at.default(p2, t2) && nt.default(p2, l2) && s2.push(n2[i2]);
|
|
}
|
|
return s2;
|
|
}
|
|
function kr(e2) {
|
|
return e2 < 10 ? "0".concat(e2) : "".concat(e2);
|
|
}
|
|
function br(e2) {
|
|
var t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : xt, r2 = Math.ceil(Ie.default(e2) / t2) * t2, a2 = r2 - (t2 - 1);
|
|
return { startPeriod: a2, endPeriod: r2 };
|
|
}
|
|
function Sr(e2, t2, r2, a2) {
|
|
for (var n2 = [], o2 = 0; o2 < 2 * t2 + 1; o2++) {
|
|
var s2 = e2 + t2 - o2, i2 = true;
|
|
r2 && (i2 = Ie.default(r2) <= s2), a2 && i2 && (i2 = Ie.default(a2) >= s2), i2 && n2.push(s2);
|
|
}
|
|
return n2;
|
|
}
|
|
var Cr = function(e2) {
|
|
wt(a2, e2);
|
|
var r2 = Ct(a2);
|
|
function a2(e3) {
|
|
var n2;
|
|
ht(this, a2), Dt(bt(n2 = r2.call(this, e3)), "renderOptions", function() {
|
|
var e4 = n2.props.year, t2 = n2.state.yearsList.map(function(t3) {
|
|
return de.default.createElement("div", { className: e4 === t3 ? "react-datepicker__year-option react-datepicker__year-option--selected_year" : "react-datepicker__year-option", key: t3, onClick: n2.onChange.bind(bt(n2), t3), "aria-selected": e4 === t3 ? "true" : void 0 }, e4 === t3 ? de.default.createElement("span", { className: "react-datepicker__year-option--selected" }, "\u2713") : "", t3);
|
|
}), r3 = n2.props.minDate ? Ie.default(n2.props.minDate) : null, a3 = n2.props.maxDate ? Ie.default(n2.props.maxDate) : null;
|
|
return a3 && n2.state.yearsList.find(function(e5) {
|
|
return e5 === a3;
|
|
}) || t2.unshift(de.default.createElement("div", { className: "react-datepicker__year-option", key: "upcoming", onClick: n2.incrementYears }, de.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming" }))), r3 && n2.state.yearsList.find(function(e5) {
|
|
return e5 === r3;
|
|
}) || t2.push(de.default.createElement("div", { className: "react-datepicker__year-option", key: "previous", onClick: n2.decrementYears }, de.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous" }))), t2;
|
|
}), Dt(bt(n2), "onChange", function(e4) {
|
|
n2.props.onChange(e4);
|
|
}), Dt(bt(n2), "handleClickOutside", function() {
|
|
n2.props.onCancel();
|
|
}), Dt(bt(n2), "shiftYears", function(e4) {
|
|
var t2 = n2.state.yearsList.map(function(t3) {
|
|
return t3 + e4;
|
|
});
|
|
n2.setState({ yearsList: t2 });
|
|
}), Dt(bt(n2), "incrementYears", function() {
|
|
return n2.shiftYears(1);
|
|
}), Dt(bt(n2), "decrementYears", function() {
|
|
return n2.shiftYears(-1);
|
|
});
|
|
var o2 = e3.yearDropdownItemNumber, s2 = e3.scrollableYearDropdown, i2 = o2 || (s2 ? 10 : 5);
|
|
return n2.state = { yearsList: Sr(n2.props.year, i2, n2.props.minDate, n2.props.maxDate) }, n2.dropdownRef = t.createRef(), n2;
|
|
}
|
|
return yt(a2, [{ key: "componentDidMount", value: function() {
|
|
var e3 = this.dropdownRef.current;
|
|
e3 && (e3.scrollTop = e3.scrollHeight / 2 - e3.clientHeight / 2);
|
|
} }, { key: "render", value: function() {
|
|
var e3 = ce.default({ "react-datepicker__year-dropdown": true, "react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown });
|
|
return de.default.createElement("div", { className: e3, ref: this.dropdownRef }, this.renderOptions());
|
|
} }]), a2;
|
|
}(de.default.Component), _r = lt.default(Cr), Mr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function() {
|
|
for (var t3 = e3.props.minDate ? Ie.default(e3.props.minDate) : 1900, r3 = e3.props.maxDate ? Ie.default(e3.props.maxDate) : 2100, a3 = [], n3 = t3; n3 <= r3; n3++)
|
|
a3.push(de.default.createElement("option", { key: n3, value: n3 }, n3));
|
|
return a3;
|
|
}), Dt(bt(e3), "onSelectChange", function(t3) {
|
|
e3.onChange(t3.target.value);
|
|
}), Dt(bt(e3), "renderSelectMode", function() {
|
|
return de.default.createElement("select", { value: e3.props.year, className: "react-datepicker__year-select", onChange: e3.onSelectChange }, e3.renderSelectOptions());
|
|
}), Dt(bt(e3), "renderReadView", function(t3) {
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t3 ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function(t4) {
|
|
return e3.toggleDropdown(t4);
|
|
} }, de.default.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, e3.props.year));
|
|
}), Dt(bt(e3), "renderDropdown", function() {
|
|
return de.default.createElement(_r, { key: "dropdown", year: e3.props.year, onChange: e3.onChange, onCancel: e3.toggleDropdown, minDate: e3.props.minDate, maxDate: e3.props.maxDate, scrollableYearDropdown: e3.props.scrollableYearDropdown, yearDropdownItemNumber: e3.props.yearDropdownItemNumber });
|
|
}), Dt(bt(e3), "renderScrollMode", function() {
|
|
var t3 = e3.state.dropdownVisible, r3 = [e3.renderReadView(!t3)];
|
|
return t3 && r3.unshift(e3.renderDropdown()), r3;
|
|
}), Dt(bt(e3), "onChange", function(t3) {
|
|
e3.toggleDropdown(), t3 !== e3.props.year && e3.props.onChange(t3);
|
|
}), Dt(bt(e3), "toggleDropdown", function(t3) {
|
|
e3.setState({ dropdownVisible: !e3.state.dropdownVisible }, function() {
|
|
e3.props.adjustDateOnChange && e3.handleYearChange(e3.props.date, t3);
|
|
});
|
|
}), Dt(bt(e3), "handleYearChange", function(t3, r3) {
|
|
e3.onSelect(t3, r3), e3.setOpen();
|
|
}), Dt(bt(e3), "onSelect", function(t3, r3) {
|
|
e3.props.onSelect && e3.props.onSelect(t3, r3);
|
|
}), Dt(bt(e3), "setOpen", function() {
|
|
e3.props.setOpen && e3.props.setOpen(true);
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3;
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode();
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode();
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r2;
|
|
}(de.default.Component), Pr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "isSelectedMonth", function(t3) {
|
|
return e3.props.month === t3;
|
|
}), Dt(bt(e3), "renderOptions", function() {
|
|
return e3.props.monthNames.map(function(t3, r3) {
|
|
return de.default.createElement("div", { className: e3.isSelectedMonth(r3) ? "react-datepicker__month-option react-datepicker__month-option--selected_month" : "react-datepicker__month-option", key: t3, onClick: e3.onChange.bind(bt(e3), r3), "aria-selected": e3.isSelectedMonth(r3) ? "true" : void 0 }, e3.isSelectedMonth(r3) ? de.default.createElement("span", { className: "react-datepicker__month-option--selected" }, "\u2713") : "", t3);
|
|
});
|
|
}), Dt(bt(e3), "onChange", function(t3) {
|
|
return e3.props.onChange(t3);
|
|
}), Dt(bt(e3), "handleClickOutside", function() {
|
|
return e3.props.onCancel();
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__month-dropdown" }, this.renderOptions());
|
|
} }]), r2;
|
|
}(de.default.Component), Er = lt.default(Pr), Nr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function(e4) {
|
|
return e4.map(function(e5, t3) {
|
|
return de.default.createElement("option", { key: t3, value: t3 }, e5);
|
|
});
|
|
}), Dt(bt(e3), "renderSelectMode", function(t3) {
|
|
return de.default.createElement("select", { value: e3.props.month, className: "react-datepicker__month-select", onChange: function(t4) {
|
|
return e3.onChange(t4.target.value);
|
|
} }, e3.renderSelectOptions(t3));
|
|
}), Dt(bt(e3), "renderReadView", function(t3, r3) {
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t3 ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: e3.toggleDropdown }, de.default.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, r3[e3.props.month]));
|
|
}), Dt(bt(e3), "renderDropdown", function(t3) {
|
|
return de.default.createElement(Er, { key: "dropdown", month: e3.props.month, monthNames: t3, onChange: e3.onChange, onCancel: e3.toggleDropdown });
|
|
}), Dt(bt(e3), "renderScrollMode", function(t3) {
|
|
var r3 = e3.state.dropdownVisible, a3 = [e3.renderReadView(!r3, t3)];
|
|
return r3 && a3.unshift(e3.renderDropdown(t3)), a3;
|
|
}), Dt(bt(e3), "onChange", function(t3) {
|
|
e3.toggleDropdown(), t3 !== e3.props.month && e3.props.onChange(t3);
|
|
}), Dt(bt(e3), "toggleDropdown", function() {
|
|
return e3.setState({ dropdownVisible: !e3.state.dropdownVisible });
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3, t3 = this, r3 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function(e4) {
|
|
return er(e4, t3.props.locale);
|
|
} : function(e4) {
|
|
return Zt(e4, t3.props.locale);
|
|
});
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode(r3);
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode(r3);
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r2;
|
|
}(de.default.Component);
|
|
function xr(e2, t2) {
|
|
for (var r2 = [], a2 = Kt(e2), n2 = Kt(t2); !at.default(a2, n2); )
|
|
r2.push(Yt(a2)), a2 = we.default(a2, 1);
|
|
return r2;
|
|
}
|
|
var Or = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "renderOptions", function() {
|
|
return a2.state.monthYearsList.map(function(e4) {
|
|
var t3 = Te.default(e4), r3 = Qt(a2.props.date, e4) && Vt(a2.props.date, e4);
|
|
return de.default.createElement("div", { className: r3 ? "react-datepicker__month-year-option--selected_month-year" : "react-datepicker__month-year-option", key: t3, onClick: a2.onChange.bind(bt(a2), t3), "aria-selected": r3 ? "true" : void 0 }, r3 ? de.default.createElement("span", { className: "react-datepicker__month-year-option--selected" }, "\u2713") : "", Lt(e4, a2.props.dateFormat, a2.props.locale));
|
|
});
|
|
}), Dt(bt(a2), "onChange", function(e4) {
|
|
return a2.props.onChange(e4);
|
|
}), Dt(bt(a2), "handleClickOutside", function() {
|
|
a2.props.onCancel();
|
|
}), a2.state = { monthYearsList: xr(a2.props.minDate, a2.props.maxDate) }, a2;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3 = ce.default({ "react-datepicker__month-year-dropdown": true, "react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown });
|
|
return de.default.createElement("div", { className: e3 }, this.renderOptions());
|
|
} }]), r2;
|
|
}(de.default.Component), Yr = lt.default(Or), Ir = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function() {
|
|
for (var t3 = Kt(e3.props.minDate), r3 = Kt(e3.props.maxDate), a3 = []; !at.default(t3, r3); ) {
|
|
var n3 = Te.default(t3);
|
|
a3.push(de.default.createElement("option", { key: n3, value: n3 }, Lt(t3, e3.props.dateFormat, e3.props.locale))), t3 = we.default(t3, 1);
|
|
}
|
|
return a3;
|
|
}), Dt(bt(e3), "onSelectChange", function(t3) {
|
|
e3.onChange(t3.target.value);
|
|
}), Dt(bt(e3), "renderSelectMode", function() {
|
|
return de.default.createElement("select", { value: Te.default(Kt(e3.props.date)), className: "react-datepicker__month-year-select", onChange: e3.onSelectChange }, e3.renderSelectOptions());
|
|
}), Dt(bt(e3), "renderReadView", function(t3) {
|
|
var r3 = Lt(e3.props.date, e3.props.dateFormat, e3.props.locale);
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t3 ? "visible" : "hidden" }, className: "react-datepicker__month-year-read-view", onClick: function(t4) {
|
|
return e3.toggleDropdown(t4);
|
|
} }, de.default.createElement("span", { className: "react-datepicker__month-year-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__month-year-read-view--selected-month-year" }, r3));
|
|
}), Dt(bt(e3), "renderDropdown", function() {
|
|
return de.default.createElement(Yr, { key: "dropdown", date: e3.props.date, dateFormat: e3.props.dateFormat, onChange: e3.onChange, onCancel: e3.toggleDropdown, minDate: e3.props.minDate, maxDate: e3.props.maxDate, scrollableMonthYearDropdown: e3.props.scrollableMonthYearDropdown, locale: e3.props.locale });
|
|
}), Dt(bt(e3), "renderScrollMode", function() {
|
|
var t3 = e3.state.dropdownVisible, r3 = [e3.renderReadView(!t3)];
|
|
return t3 && r3.unshift(e3.renderDropdown()), r3;
|
|
}), Dt(bt(e3), "onChange", function(t3) {
|
|
e3.toggleDropdown();
|
|
var r3 = Yt(parseInt(t3));
|
|
Qt(e3.props.date, r3) && Vt(e3.props.date, r3) || e3.props.onChange(r3);
|
|
}), Dt(bt(e3), "toggleDropdown", function() {
|
|
return e3.setState({ dropdownVisible: !e3.state.dropdownVisible });
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3;
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode();
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode();
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r2;
|
|
}(de.default.Component), Tr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "dayEl", de.default.createRef()), Dt(bt(e3), "handleClick", function(t3) {
|
|
!e3.isDisabled() && e3.props.onClick && e3.props.onClick(t3);
|
|
}), Dt(bt(e3), "handleMouseEnter", function(t3) {
|
|
!e3.isDisabled() && e3.props.onMouseEnter && e3.props.onMouseEnter(t3);
|
|
}), Dt(bt(e3), "handleOnKeyDown", function(t3) {
|
|
t3.key === " " && (t3.preventDefault(), t3.key = "Enter"), e3.props.handleOnKeyDown(t3);
|
|
}), Dt(bt(e3), "isSameDay", function(t3) {
|
|
return $t(e3.props.day, t3);
|
|
}), Dt(bt(e3), "isKeyboardSelected", function() {
|
|
return !e3.props.disabledKeyboardNavigation && !e3.isSameDay(e3.props.selected) && e3.isSameDay(e3.props.preSelection);
|
|
}), Dt(bt(e3), "isDisabled", function() {
|
|
return rr(e3.props.day, e3.props);
|
|
}), Dt(bt(e3), "isExcluded", function() {
|
|
return ar(e3.props.day, e3.props);
|
|
}), Dt(bt(e3), "getHighLightedClass", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.highlightDates;
|
|
if (!n3)
|
|
return false;
|
|
var o3 = Lt(a3, "MM.dd.yyyy");
|
|
return n3.get(o3);
|
|
}), Dt(bt(e3), "isInRange", function() {
|
|
var t3 = e3.props, r3 = t3.day, a3 = t3.startDate, n3 = t3.endDate;
|
|
return !(!a3 || !n3) && Gt(r3, a3, n3);
|
|
}), Dt(bt(e3), "isInSelectingRange", function() {
|
|
var t3, r3 = e3.props, a3 = r3.day, n3 = r3.selectsStart, o3 = r3.selectsEnd, s2 = r3.selectsRange, i2 = r3.selectsDisabledDaysInRange, p2 = r3.startDate, l2 = r3.endDate, d2 = (t3 = e3.props.selectingDate) !== null && t3 !== void 0 ? t3 : e3.props.preSelection;
|
|
return !(!(n3 || o3 || s2) || !d2 || !i2 && e3.isDisabled()) && (n3 && l2 && (nt.default(d2, l2) || zt(d2, l2)) ? Gt(a3, d2, l2) : (o3 && p2 && (at.default(d2, p2) || zt(d2, p2)) || !(!s2 || !p2 || l2 || !at.default(d2, p2) && !zt(d2, p2))) && Gt(a3, p2, d2));
|
|
}), Dt(bt(e3), "isSelectingRangeStart", function() {
|
|
var t3;
|
|
if (!e3.isInSelectingRange())
|
|
return false;
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.selectsStart, s2 = (t3 = e3.props.selectingDate) !== null && t3 !== void 0 ? t3 : e3.props.preSelection;
|
|
return $t(a3, o3 ? s2 : n3);
|
|
}), Dt(bt(e3), "isSelectingRangeEnd", function() {
|
|
var t3;
|
|
if (!e3.isInSelectingRange())
|
|
return false;
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.endDate, o3 = r3.selectsEnd, s2 = (t3 = e3.props.selectingDate) !== null && t3 !== void 0 ? t3 : e3.props.preSelection;
|
|
return $t(a3, o3 ? s2 : n3);
|
|
}), Dt(bt(e3), "isRangeStart", function() {
|
|
var t3 = e3.props, r3 = t3.day, a3 = t3.startDate, n3 = t3.endDate;
|
|
return !(!a3 || !n3) && $t(a3, r3);
|
|
}), Dt(bt(e3), "isRangeEnd", function() {
|
|
var t3 = e3.props, r3 = t3.day, a3 = t3.startDate, n3 = t3.endDate;
|
|
return !(!a3 || !n3) && $t(n3, r3);
|
|
}), Dt(bt(e3), "isWeekend", function() {
|
|
var t3 = Ee.default(e3.props.day);
|
|
return t3 === 0 || t3 === 6;
|
|
}), Dt(bt(e3), "isAfterMonth", function() {
|
|
return e3.props.month !== void 0 && (e3.props.month + 1) % 12 === Oe.default(e3.props.day);
|
|
}), Dt(bt(e3), "isBeforeMonth", function() {
|
|
return e3.props.month !== void 0 && (Oe.default(e3.props.day) + 1) % 12 === e3.props.month;
|
|
}), Dt(bt(e3), "isCurrentDay", function() {
|
|
return e3.isSameDay(Yt());
|
|
}), Dt(bt(e3), "isSelected", function() {
|
|
return e3.isSameDay(e3.props.selected);
|
|
}), Dt(bt(e3), "getClassNames", function(t3) {
|
|
var r3 = e3.props.dayClassName ? e3.props.dayClassName(t3) : void 0;
|
|
return ce.default("react-datepicker__day", r3, "react-datepicker__day--" + qt(e3.props.day), { "react-datepicker__day--disabled": e3.isDisabled(), "react-datepicker__day--excluded": e3.isExcluded(), "react-datepicker__day--selected": e3.isSelected(), "react-datepicker__day--keyboard-selected": e3.isKeyboardSelected(), "react-datepicker__day--range-start": e3.isRangeStart(), "react-datepicker__day--range-end": e3.isRangeEnd(), "react-datepicker__day--in-range": e3.isInRange(), "react-datepicker__day--in-selecting-range": e3.isInSelectingRange(), "react-datepicker__day--selecting-range-start": e3.isSelectingRangeStart(), "react-datepicker__day--selecting-range-end": e3.isSelectingRangeEnd(), "react-datepicker__day--today": e3.isCurrentDay(), "react-datepicker__day--weekend": e3.isWeekend(), "react-datepicker__day--outside-month": e3.isAfterMonth() || e3.isBeforeMonth() }, e3.getHighLightedClass("react-datepicker__day--highlighted"));
|
|
}), Dt(bt(e3), "getAriaLabel", function() {
|
|
var t3 = e3.props, r3 = t3.day, a3 = t3.ariaLabelPrefixWhenEnabled, n3 = a3 === void 0 ? "Choose" : a3, o3 = t3.ariaLabelPrefixWhenDisabled, s2 = o3 === void 0 ? "Not available" : o3, i2 = e3.isDisabled() || e3.isExcluded() ? s2 : n3;
|
|
return "".concat(i2, " ").concat(Lt(r3, "PPPP", e3.props.locale));
|
|
}), Dt(bt(e3), "getTabIndex", function(t3, r3) {
|
|
var a3 = t3 || e3.props.selected, n3 = r3 || e3.props.preSelection;
|
|
return e3.isKeyboardSelected() || e3.isSameDay(a3) && $t(n3, a3) ? 0 : -1;
|
|
}), Dt(bt(e3), "handleFocusDay", function() {
|
|
var t3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r3 = false;
|
|
e3.getTabIndex() === 0 && !t3.isInputFocused && e3.isSameDay(e3.props.preSelection) && (document.activeElement && document.activeElement !== document.body || (r3 = true), e3.props.inline && !e3.props.shouldFocusDayInline && (r3 = false), e3.props.containerRef && e3.props.containerRef.current && e3.props.containerRef.current.contains(document.activeElement) && document.activeElement.classList.contains("react-datepicker__day") && (r3 = true)), r3 && e3.dayEl.current.focus({ preventScroll: true });
|
|
}), Dt(bt(e3), "renderDayContents", function() {
|
|
return e3.props.monthShowsDuplicateDaysEnd && e3.isAfterMonth() || e3.props.monthShowsDuplicateDaysStart && e3.isBeforeMonth() ? null : e3.props.renderDayContents ? e3.props.renderDayContents(Ne.default(e3.props.day), e3.props.day) : Ne.default(e3.props.day);
|
|
}), Dt(bt(e3), "render", function() {
|
|
return de.default.createElement("div", { ref: e3.dayEl, className: e3.getClassNames(e3.props.day), onKeyDown: e3.handleOnKeyDown, onClick: e3.handleClick, onMouseEnter: e3.handleMouseEnter, tabIndex: e3.getTabIndex(), "aria-label": e3.getAriaLabel(), role: "option", "aria-disabled": e3.isDisabled(), "aria-current": e3.isCurrentDay() ? "date" : void 0, "aria-selected": e3.isSelected() }, e3.renderDayContents());
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "componentDidMount", value: function() {
|
|
this.handleFocusDay();
|
|
} }, { key: "componentDidUpdate", value: function(e3) {
|
|
this.handleFocusDay(e3);
|
|
} }]), r2;
|
|
}(de.default.Component), Lr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "handleClick", function(t3) {
|
|
e3.props.onClick && e3.props.onClick(t3);
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3 = this.props, t3 = e3.weekNumber, r3 = e3.ariaLabelPrefix, a2 = r3 === void 0 ? "week " : r3, n2 = { "react-datepicker__week-number": true, "react-datepicker__week-number--clickable": !!e3.onClick };
|
|
return de.default.createElement("div", { className: ce.default(n2), "aria-label": "".concat(a2, " ").concat(this.props.weekNumber), onClick: this.handleClick }, t3);
|
|
} }]), r2;
|
|
}(de.default.Component), Rr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "handleDayClick", function(t3, r3) {
|
|
e3.props.onDayClick && e3.props.onDayClick(t3, r3);
|
|
}), Dt(bt(e3), "handleDayMouseEnter", function(t3) {
|
|
e3.props.onDayMouseEnter && e3.props.onDayMouseEnter(t3);
|
|
}), Dt(bt(e3), "handleWeekClick", function(t3, r3, a3) {
|
|
typeof e3.props.onWeekSelect == "function" && e3.props.onWeekSelect(t3, r3, a3), e3.props.shouldCloseOnSelect && e3.props.setOpen(false);
|
|
}), Dt(bt(e3), "formatWeekNumber", function(t3) {
|
|
return e3.props.formatWeekNumber ? e3.props.formatWeekNumber(t3) : At(t3);
|
|
}), Dt(bt(e3), "renderDays", function() {
|
|
var t3 = Bt(e3.props.day, e3.props.locale, e3.props.calendarStartDay), r3 = [], a3 = e3.formatWeekNumber(t3);
|
|
if (e3.props.showWeekNumber) {
|
|
var n3 = e3.props.onWeekSelect ? e3.handleWeekClick.bind(bt(e3), t3, a3) : void 0;
|
|
r3.push(de.default.createElement(Lr, { key: "W", weekNumber: a3, onClick: n3, ariaLabelPrefix: e3.props.ariaLabelPrefix }));
|
|
}
|
|
return r3.concat([0, 1, 2, 3, 4, 5, 6].map(function(r4) {
|
|
var a4 = De.default(t3, r4);
|
|
return de.default.createElement(Tr, { ariaLabelPrefixWhenEnabled: e3.props.chooseDayAriaLabelPrefix, ariaLabelPrefixWhenDisabled: e3.props.disabledDayAriaLabelPrefix, key: a4.valueOf(), day: a4, month: e3.props.month, onClick: e3.handleDayClick.bind(bt(e3), a4), onMouseEnter: e3.handleDayMouseEnter.bind(bt(e3), a4), minDate: e3.props.minDate, maxDate: e3.props.maxDate, excludeDates: e3.props.excludeDates, excludeDateIntervals: e3.props.excludeDateIntervals, includeDates: e3.props.includeDates, includeDateIntervals: e3.props.includeDateIntervals, highlightDates: e3.props.highlightDates, selectingDate: e3.props.selectingDate, filterDate: e3.props.filterDate, preSelection: e3.props.preSelection, selected: e3.props.selected, selectsStart: e3.props.selectsStart, selectsEnd: e3.props.selectsEnd, selectsRange: e3.props.selectsRange, selectsDisabledDaysInRange: e3.props.selectsDisabledDaysInRange, startDate: e3.props.startDate, endDate: e3.props.endDate, dayClassName: e3.props.dayClassName, renderDayContents: e3.props.renderDayContents, disabledKeyboardNavigation: e3.props.disabledKeyboardNavigation, handleOnKeyDown: e3.props.handleOnKeyDown, isInputFocused: e3.props.isInputFocused, containerRef: e3.props.containerRef, inline: e3.props.inline, shouldFocusDayInline: e3.props.shouldFocusDayInline, monthShowsDuplicateDaysEnd: e3.props.monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: e3.props.monthShowsDuplicateDaysStart, locale: e3.props.locale });
|
|
}));
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__week" }, this.renderDays());
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { shouldCloseOnSelect: true };
|
|
} }]), r2;
|
|
}(de.default.Component), Fr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "MONTH_REFS", _t(Array(12)).map(function() {
|
|
return de.default.createRef();
|
|
})), Dt(bt(e3), "isDisabled", function(t3) {
|
|
return rr(t3, e3.props);
|
|
}), Dt(bt(e3), "isExcluded", function(t3) {
|
|
return ar(t3, e3.props);
|
|
}), Dt(bt(e3), "handleDayClick", function(t3, r3) {
|
|
e3.props.onDayClick && e3.props.onDayClick(t3, r3, e3.props.orderInDisplay);
|
|
}), Dt(bt(e3), "handleDayMouseEnter", function(t3) {
|
|
e3.props.onDayMouseEnter && e3.props.onDayMouseEnter(t3);
|
|
}), Dt(bt(e3), "handleMouseLeave", function() {
|
|
e3.props.onMouseLeave && e3.props.onMouseLeave();
|
|
}), Dt(bt(e3), "isRangeStartMonth", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate;
|
|
return !(!n3 || !o3) && Vt(Ae.default(a3, t3), n3);
|
|
}), Dt(bt(e3), "isRangeStartQuarter", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate;
|
|
return !(!n3 || !o3) && Ut(qe.default(a3, t3), n3);
|
|
}), Dt(bt(e3), "isRangeEndMonth", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate;
|
|
return !(!n3 || !o3) && Vt(Ae.default(a3, t3), o3);
|
|
}), Dt(bt(e3), "isRangeEndQuarter", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate;
|
|
return !(!n3 || !o3) && Ut(qe.default(a3, t3), o3);
|
|
}), Dt(bt(e3), "isWeekInMonth", function(t3) {
|
|
var r3 = e3.props.day, a3 = De.default(t3, 6);
|
|
return Vt(t3, r3) || Vt(a3, r3);
|
|
}), Dt(bt(e3), "isCurrentMonth", function(e4, t3) {
|
|
return Ie.default(e4) === Ie.default(Yt()) && t3 === Oe.default(Yt());
|
|
}), Dt(bt(e3), "isSelectedMonth", function(e4, t3, r3) {
|
|
return Oe.default(e4) === t3 && Ie.default(e4) === Ie.default(r3);
|
|
}), Dt(bt(e3), "isSelectedQuarter", function(e4, t3, r3) {
|
|
return Ye.default(e4) === t3 && Ie.default(e4) === Ie.default(r3);
|
|
}), Dt(bt(e3), "renderWeeks", function() {
|
|
for (var t3 = [], r3 = e3.props.fixedHeight, a3 = 0, n3 = false, o3 = Bt(Kt(e3.props.day), e3.props.locale, e3.props.calendarStartDay); t3.push(de.default.createElement(Rr, { ariaLabelPrefix: e3.props.weekAriaLabelPrefix, chooseDayAriaLabelPrefix: e3.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: e3.props.disabledDayAriaLabelPrefix, key: a3, day: o3, month: Oe.default(e3.props.day), onDayClick: e3.handleDayClick, onDayMouseEnter: e3.handleDayMouseEnter, onWeekSelect: e3.props.onWeekSelect, formatWeekNumber: e3.props.formatWeekNumber, locale: e3.props.locale, minDate: e3.props.minDate, maxDate: e3.props.maxDate, excludeDates: e3.props.excludeDates, excludeDateIntervals: e3.props.excludeDateIntervals, includeDates: e3.props.includeDates, includeDateIntervals: e3.props.includeDateIntervals, inline: e3.props.inline, shouldFocusDayInline: e3.props.shouldFocusDayInline, highlightDates: e3.props.highlightDates, selectingDate: e3.props.selectingDate, filterDate: e3.props.filterDate, preSelection: e3.props.preSelection, selected: e3.props.selected, selectsStart: e3.props.selectsStart, selectsEnd: e3.props.selectsEnd, selectsRange: e3.props.selectsRange, selectsDisabledDaysInRange: e3.props.selectsDisabledDaysInRange, showWeekNumber: e3.props.showWeekNumbers, startDate: e3.props.startDate, endDate: e3.props.endDate, dayClassName: e3.props.dayClassName, setOpen: e3.props.setOpen, shouldCloseOnSelect: e3.props.shouldCloseOnSelect, disabledKeyboardNavigation: e3.props.disabledKeyboardNavigation, renderDayContents: e3.props.renderDayContents, handleOnKeyDown: e3.props.handleOnKeyDown, isInputFocused: e3.props.isInputFocused, containerRef: e3.props.containerRef, calendarStartDay: e3.props.calendarStartDay, monthShowsDuplicateDaysEnd: e3.props.monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: e3.props.monthShowsDuplicateDaysStart })), !n3; ) {
|
|
a3++, o3 = ve.default(o3, 1);
|
|
var s2 = r3 && a3 >= 6, i2 = !r3 && !e3.isWeekInMonth(o3);
|
|
if (s2 || i2) {
|
|
if (!e3.props.peekNextMonth)
|
|
break;
|
|
n3 = true;
|
|
}
|
|
}
|
|
return t3;
|
|
}), Dt(bt(e3), "onMonthClick", function(t3, r3) {
|
|
e3.handleDayClick(Kt(Ae.default(e3.props.day, r3)), t3);
|
|
}), Dt(bt(e3), "handleMonthNavigation", function(t3, r3) {
|
|
e3.isDisabled(r3) || e3.isExcluded(r3) || (e3.props.setPreSelection(r3), e3.MONTH_REFS[t3].current && e3.MONTH_REFS[t3].current.focus());
|
|
}), Dt(bt(e3), "onMonthKeyDown", function(t3, r3) {
|
|
var a3 = t3.key;
|
|
if (!e3.props.disabledKeyboardNavigation)
|
|
switch (a3) {
|
|
case "Enter":
|
|
e3.onMonthClick(t3, r3), e3.props.setPreSelection(e3.props.selected);
|
|
break;
|
|
case "ArrowRight":
|
|
e3.handleMonthNavigation(r3 === 11 ? 0 : r3 + 1, we.default(e3.props.preSelection, 1));
|
|
break;
|
|
case "ArrowLeft":
|
|
e3.handleMonthNavigation(r3 === 0 ? 11 : r3 - 1, Se.default(e3.props.preSelection, 1));
|
|
}
|
|
}), Dt(bt(e3), "onQuarterClick", function(t3, r3) {
|
|
e3.handleDayClick(jt(qe.default(e3.props.day, r3)), t3);
|
|
}), Dt(bt(e3), "getMonthClassNames", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate, s2 = r3.selected, i2 = r3.minDate, p2 = r3.maxDate, l2 = r3.preSelection, d2 = r3.monthClassName, c2 = d2 ? d2(a3) : void 0;
|
|
return ce.default("react-datepicker__month-text", "react-datepicker__month-".concat(t3), c2, { "react-datepicker__month--disabled": (i2 || p2) && nr(Ae.default(a3, t3), e3.props), "react-datepicker__month--selected": e3.isSelectedMonth(a3, t3, s2), "react-datepicker__month-text--keyboard-selected": Oe.default(l2) === t3, "react-datepicker__month--in-range": or(n3, o3, t3, a3), "react-datepicker__month--range-start": e3.isRangeStartMonth(t3), "react-datepicker__month--range-end": e3.isRangeEndMonth(t3), "react-datepicker__month-text--today": e3.isCurrentMonth(a3, t3) });
|
|
}), Dt(bt(e3), "getTabIndex", function(t3) {
|
|
var r3 = Oe.default(e3.props.preSelection);
|
|
return e3.props.disabledKeyboardNavigation || t3 !== r3 ? "-1" : "0";
|
|
}), Dt(bt(e3), "getAriaLabel", function(t3) {
|
|
var r3 = e3.props, a3 = r3.chooseDayAriaLabelPrefix, n3 = a3 === void 0 ? "Choose" : a3, o3 = r3.disabledDayAriaLabelPrefix, s2 = o3 === void 0 ? "Not available" : o3, i2 = r3.day, p2 = Ae.default(i2, t3), l2 = e3.isDisabled(p2) || e3.isExcluded(p2) ? s2 : n3;
|
|
return "".concat(l2, " ").concat(Lt(p2, "MMMM yyyy"));
|
|
}), Dt(bt(e3), "getQuarterClassNames", function(t3) {
|
|
var r3 = e3.props, a3 = r3.day, n3 = r3.startDate, o3 = r3.endDate, s2 = r3.selected, i2 = r3.minDate, p2 = r3.maxDate;
|
|
return ce.default("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(t3), { "react-datepicker__quarter--disabled": (i2 || p2) && sr(qe.default(a3, t3), e3.props), "react-datepicker__quarter--selected": e3.isSelectedQuarter(a3, t3, s2), "react-datepicker__quarter--in-range": pr(n3, o3, t3, a3), "react-datepicker__quarter--range-start": e3.isRangeStartQuarter(t3), "react-datepicker__quarter--range-end": e3.isRangeEndQuarter(t3) });
|
|
}), Dt(bt(e3), "renderMonths", function() {
|
|
var t3 = e3.props, r3 = t3.showFullMonthYearPicker, a3 = t3.showTwoColumnMonthYearPicker, n3 = t3.showFourColumnMonthYearPicker, o3 = t3.locale, s2 = t3.day, i2 = t3.selected;
|
|
return (n3 ? [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] : a3 ? [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]] : [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]).map(function(t4, a4) {
|
|
return de.default.createElement("div", { className: "react-datepicker__month-wrapper", key: a4 }, t4.map(function(t5, a5) {
|
|
return de.default.createElement("div", { ref: e3.MONTH_REFS[t5], key: a5, onClick: function(r4) {
|
|
e3.onMonthClick(r4, t5);
|
|
}, onKeyDown: function(r4) {
|
|
e3.onMonthKeyDown(r4, t5);
|
|
}, tabIndex: e3.getTabIndex(t5), className: e3.getMonthClassNames(t5), role: "option", "aria-label": e3.getAriaLabel(t5), "aria-current": e3.isCurrentMonth(s2, t5) ? "date" : void 0, "aria-selected": e3.isSelectedMonth(s2, t5, i2) }, r3 ? Zt(t5, o3) : er(t5, o3));
|
|
}));
|
|
});
|
|
}), Dt(bt(e3), "renderQuarters", function() {
|
|
var t3 = e3.props, r3 = t3.day, a3 = t3.selected;
|
|
return de.default.createElement("div", { className: "react-datepicker__quarter-wrapper" }, [1, 2, 3, 4].map(function(t4, n3) {
|
|
return de.default.createElement("div", { key: n3, role: "option", onClick: function(r4) {
|
|
e3.onQuarterClick(r4, t4);
|
|
}, className: e3.getQuarterClassNames(t4), "aria-selected": e3.isSelectedQuarter(r3, t4, a3) }, tr(t4, e3.props.locale));
|
|
}));
|
|
}), Dt(bt(e3), "getClassNames", function() {
|
|
var t3 = e3.props;
|
|
t3.day;
|
|
var r3 = t3.selectingDate, a3 = t3.selectsStart, n3 = t3.selectsEnd, o3 = t3.showMonthYearPicker, s2 = t3.showQuarterYearPicker;
|
|
return ce.default("react-datepicker__month", { "react-datepicker__month--selecting-range": r3 && (a3 || n3) }, { "react-datepicker__monthPicker": o3 }, { "react-datepicker__quarterPicker": s2 });
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3 = this.props, t3 = e3.showMonthYearPicker, r3 = e3.showQuarterYearPicker, a2 = e3.day, n2 = e3.ariaLabelPrefix, o2 = n2 === void 0 ? "month " : n2;
|
|
return de.default.createElement("div", { className: this.getClassNames(), onMouseLeave: this.handleMouseLeave, "aria-label": "".concat(o2, " ").concat(Lt(a2, "yyyy-MM")), role: "listbox" }, t3 ? this.renderMonths() : r3 ? this.renderQuarters() : this.renderWeeks());
|
|
} }]), r2;
|
|
}(de.default.Component), Ar = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
var e3;
|
|
ht(this, r2);
|
|
for (var a2 = arguments.length, n2 = new Array(a2), o2 = 0; o2 < a2; o2++)
|
|
n2[o2] = arguments[o2];
|
|
return Dt(bt(e3 = t2.call.apply(t2, [this].concat(n2))), "state", { height: null }), Dt(bt(e3), "handleClick", function(t3) {
|
|
(e3.props.minTime || e3.props.maxTime) && ur(t3, e3.props) || (e3.props.excludeTimes || e3.props.includeTimes || e3.props.filterTime) && cr(t3, e3.props) || e3.props.onChange(t3);
|
|
}), Dt(bt(e3), "isSelectedTime", function(t3, r3, a3) {
|
|
return e3.props.selected && r3 === Pe.default(t3) && a3 === Me.default(t3);
|
|
}), Dt(bt(e3), "liClasses", function(t3, r3, a3) {
|
|
var n3 = ["react-datepicker__time-list-item", e3.props.timeClassName ? e3.props.timeClassName(t3, r3, a3) : void 0];
|
|
return e3.isSelectedTime(t3, r3, a3) && n3.push("react-datepicker__time-list-item--selected"), ((e3.props.minTime || e3.props.maxTime) && ur(t3, e3.props) || (e3.props.excludeTimes || e3.props.includeTimes || e3.props.filterTime) && cr(t3, e3.props)) && n3.push("react-datepicker__time-list-item--disabled"), e3.props.injectTimes && (60 * Pe.default(t3) + Me.default(t3)) % e3.props.intervals != 0 && n3.push("react-datepicker__time-list-item--injected"), n3.join(" ");
|
|
}), Dt(bt(e3), "handleOnKeyDown", function(t3, r3) {
|
|
t3.key === " " && (t3.preventDefault(), t3.key = "Enter"), t3.key === "Enter" && e3.handleClick(r3), e3.props.handleOnKeyDown(t3);
|
|
}), Dt(bt(e3), "renderTimes", function() {
|
|
for (var t3 = [], r3 = e3.props.format ? e3.props.format : "p", a3 = e3.props.intervals, n3 = Wt(Yt(e3.props.selected)), o3 = 1440 / a3, s2 = e3.props.injectTimes && e3.props.injectTimes.sort(function(e4, t4) {
|
|
return e4 - t4;
|
|
}), i2 = e3.props.selected || e3.props.openToDate || Yt(), p2 = Pe.default(i2), l2 = Me.default(i2), d2 = Fe.default(Re.default(n3, l2), p2), c2 = 0; c2 < o3; c2++) {
|
|
var u2 = me.default(n3, c2 * a3);
|
|
if (t3.push(u2), s2) {
|
|
var f2 = gr(n3, u2, c2, a3, s2);
|
|
t3 = t3.concat(f2);
|
|
}
|
|
}
|
|
return t3.map(function(t4, a4) {
|
|
return de.default.createElement("li", { key: a4, onClick: e3.handleClick.bind(bt(e3), t4), className: e3.liClasses(t4, p2, l2), ref: function(r4) {
|
|
(nt.default(t4, d2) || zt(t4, d2)) && (e3.centerLi = r4);
|
|
}, onKeyDown: function(r4) {
|
|
e3.handleOnKeyDown(r4, t4);
|
|
}, tabIndex: "0", "aria-selected": e3.isSelectedTime(t4, p2, l2) ? "true" : void 0 }, Lt(t4, r3, e3.props.locale));
|
|
});
|
|
}), e3;
|
|
}
|
|
return yt(r2, [{ key: "componentDidMount", value: function() {
|
|
this.list.scrollTop = r2.calcCenterPosition(this.props.monthRef ? this.props.monthRef.clientHeight - this.header.clientHeight : this.list.clientHeight, this.centerLi), this.props.monthRef && this.header && this.setState({ height: this.props.monthRef.clientHeight - this.header.clientHeight });
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this, t3 = this.state.height;
|
|
return de.default.createElement("div", { className: "react-datepicker__time-container ".concat(this.props.todayButton ? "react-datepicker__time-container--with-today-button" : "") }, de.default.createElement("div", { className: "react-datepicker__header react-datepicker__header--time ".concat(this.props.showTimeSelectOnly ? "react-datepicker__header--time--only" : ""), ref: function(t4) {
|
|
e3.header = t4;
|
|
} }, de.default.createElement("div", { className: "react-datepicker-time__header" }, this.props.timeCaption)), de.default.createElement("div", { className: "react-datepicker__time" }, de.default.createElement("div", { className: "react-datepicker__time-box" }, de.default.createElement("ul", { className: "react-datepicker__time-list", ref: function(t4) {
|
|
e3.list = t4;
|
|
}, style: t3 ? { height: t3 } : {}, tabIndex: "0" }, this.renderTimes()))));
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { intervals: 30, onTimeChange: function() {
|
|
}, todayButton: null, timeCaption: "Time" };
|
|
} }]), r2;
|
|
}(de.default.Component);
|
|
Dt(Ar, "calcCenterPosition", function(e2, t2) {
|
|
return t2.offsetTop - (e2 / 2 - t2.clientHeight / 2);
|
|
});
|
|
var qr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "YEAR_REFS", _t(Array(a2.props.yearItemNumber)).map(function() {
|
|
return de.default.createRef();
|
|
})), Dt(bt(a2), "isDisabled", function(e4) {
|
|
return rr(e4, a2.props);
|
|
}), Dt(bt(a2), "isExcluded", function(e4) {
|
|
return ar(e4, a2.props);
|
|
}), Dt(bt(a2), "updateFocusOnPaginate", function(e4) {
|
|
var t3 = function() {
|
|
this.YEAR_REFS[e4].current.focus();
|
|
}.bind(bt(a2));
|
|
window.requestAnimationFrame(t3);
|
|
}), Dt(bt(a2), "handleYearClick", function(e4, t3) {
|
|
a2.props.onDayClick && a2.props.onDayClick(e4, t3);
|
|
}), Dt(bt(a2), "handleYearNavigation", function(e4, t3) {
|
|
var r3 = a2.props, n2 = r3.date, o2 = r3.yearItemNumber, s2 = br(n2, o2).startPeriod;
|
|
a2.isDisabled(t3) || a2.isExcluded(t3) || (a2.props.setPreSelection(t3), e4 - s2 == -1 ? a2.updateFocusOnPaginate(o2 - 1) : e4 - s2 === o2 ? a2.updateFocusOnPaginate(0) : a2.YEAR_REFS[e4 - s2].current.focus());
|
|
}), Dt(bt(a2), "isSameDay", function(e4, t3) {
|
|
return $t(e4, t3);
|
|
}), Dt(bt(a2), "isCurrentYear", function(e4) {
|
|
return e4 === Ie.default(Yt());
|
|
}), Dt(bt(a2), "isKeyboardSelected", function(e4) {
|
|
var t3 = Ht(We.default(a2.props.date, e4));
|
|
return !a2.props.disabledKeyboardNavigation && !a2.props.inline && !$t(t3, Ht(a2.props.selected)) && $t(t3, Ht(a2.props.preSelection));
|
|
}), Dt(bt(a2), "onYearClick", function(e4, t3) {
|
|
var r3 = a2.props.date;
|
|
a2.handleYearClick(Ht(We.default(r3, t3)), e4);
|
|
}), Dt(bt(a2), "onYearKeyDown", function(e4, t3) {
|
|
var r3 = e4.key;
|
|
if (!a2.props.disabledKeyboardNavigation)
|
|
switch (r3) {
|
|
case "Enter":
|
|
a2.onYearClick(e4, t3), a2.props.setPreSelection(a2.props.selected);
|
|
break;
|
|
case "ArrowRight":
|
|
a2.handleYearNavigation(t3 + 1, ge.default(a2.props.preSelection, 1));
|
|
break;
|
|
case "ArrowLeft":
|
|
a2.handleYearNavigation(t3 - 1, Ce.default(a2.props.preSelection, 1));
|
|
}
|
|
}), Dt(bt(a2), "getYearClassNames", function(e4) {
|
|
var t3 = a2.props, r3 = t3.minDate, n2 = t3.maxDate, o2 = t3.selected;
|
|
return ce.default("react-datepicker__year-text", { "react-datepicker__year-text--selected": e4 === Ie.default(o2), "react-datepicker__year-text--disabled": (r3 || n2) && ir(e4, a2.props), "react-datepicker__year-text--keyboard-selected": a2.isKeyboardSelected(e4), "react-datepicker__year-text--today": a2.isCurrentYear(e4) });
|
|
}), Dt(bt(a2), "getYearTabIndex", function(e4) {
|
|
return a2.props.disabledKeyboardNavigation ? "-1" : e4 === Ie.default(a2.props.preSelection) ? "0" : "-1";
|
|
}), a2;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
for (var e3 = this, t3 = [], r3 = this.props, a2 = br(r3.date, r3.yearItemNumber), n2 = a2.startPeriod, o2 = a2.endPeriod, s2 = function(r4) {
|
|
t3.push(de.default.createElement("div", { ref: e3.YEAR_REFS[r4 - n2], onClick: function(t4) {
|
|
e3.onYearClick(t4, r4);
|
|
}, onKeyDown: function(t4) {
|
|
e3.onYearKeyDown(t4, r4);
|
|
}, tabIndex: e3.getYearTabIndex(r4), className: e3.getYearClassNames(r4), key: r4, "aria-current": e3.isCurrentYear(r4) ? "date" : void 0 }, r4));
|
|
}, i2 = n2; i2 <= o2; i2++)
|
|
s2(i2);
|
|
return de.default.createElement("div", { className: "react-datepicker__year" }, de.default.createElement("div", { className: "react-datepicker__year-wrapper" }, t3));
|
|
} }]), r2;
|
|
}(de.default.Component), Wr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "onTimeChange", function(e4) {
|
|
a2.setState({ time: e4 });
|
|
var t3 = new Date();
|
|
t3.setHours(e4.split(":")[0]), t3.setMinutes(e4.split(":")[1]), a2.props.onChange(t3);
|
|
}), Dt(bt(a2), "renderTimeInput", function() {
|
|
var e4 = a2.state.time, t3 = a2.props, r3 = t3.date, n2 = t3.timeString, o2 = t3.customTimeInput;
|
|
return o2 ? de.default.cloneElement(o2, { date: r3, value: e4, onChange: a2.onTimeChange }) : de.default.createElement("input", { type: "time", className: "react-datepicker-time__input", placeholder: "Time", name: "time-input", required: true, value: e4, onChange: function(e5) {
|
|
a2.onTimeChange(e5.target.value || n2);
|
|
} });
|
|
}), a2.state = { time: a2.props.timeString }, a2;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__input-time-container" }, de.default.createElement("div", { className: "react-datepicker-time__caption" }, this.props.timeInputLabel), de.default.createElement("div", { className: "react-datepicker-time__input-container" }, de.default.createElement("div", { className: "react-datepicker-time__input" }, this.renderTimeInput())));
|
|
} }], [{ key: "getDerivedStateFromProps", value: function(e3, t3) {
|
|
return e3.timeString !== t3.time ? { time: e3.timeString } : null;
|
|
} }]), r2;
|
|
}(de.default.Component);
|
|
function Br(e2) {
|
|
var t2 = e2.className, r2 = e2.children, a2 = e2.showPopperArrow, n2 = e2.arrowProps, o2 = n2 === void 0 ? {} : n2;
|
|
return de.default.createElement("div", { className: t2 }, a2 && de.default.createElement("div", vt({ className: "react-datepicker__triangle" }, o2)), r2);
|
|
}
|
|
var Kr = ["react-datepicker__year-select", "react-datepicker__month-select", "react-datepicker__month-year-select"], Hr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "handleClickOutside", function(e4) {
|
|
a2.props.onClickOutside(e4);
|
|
}), Dt(bt(a2), "setClickOutsideRef", function() {
|
|
return a2.containerRef.current;
|
|
}), Dt(bt(a2), "handleDropdownFocus", function(e4) {
|
|
(function() {
|
|
var e5 = ((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).className || "").split(/\s+/);
|
|
return Kr.some(function(t3) {
|
|
return e5.indexOf(t3) >= 0;
|
|
});
|
|
})(e4.target) && a2.props.onDropdownFocus();
|
|
}), Dt(bt(a2), "getDateInView", function() {
|
|
var e4 = a2.props, t3 = e4.preSelection, r3 = e4.selected, n2 = e4.openToDate, o2 = Dr(a2.props), s2 = vr(a2.props), i2 = Yt(), p2 = n2 || r3 || t3;
|
|
return p2 || (o2 && nt.default(i2, o2) ? o2 : s2 && at.default(i2, s2) ? s2 : i2);
|
|
}), Dt(bt(a2), "increaseMonth", function() {
|
|
a2.setState(function(e4) {
|
|
var t3 = e4.date;
|
|
return { date: we.default(t3, 1) };
|
|
}, function() {
|
|
return a2.handleMonthChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "decreaseMonth", function() {
|
|
a2.setState(function(e4) {
|
|
var t3 = e4.date;
|
|
return { date: Se.default(t3, 1) };
|
|
}, function() {
|
|
return a2.handleMonthChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "handleDayClick", function(e4, t3, r3) {
|
|
a2.props.onSelect(e4, t3, r3), a2.props.setPreSelection && a2.props.setPreSelection(e4);
|
|
}), Dt(bt(a2), "handleDayMouseEnter", function(e4) {
|
|
a2.setState({ selectingDate: e4 }), a2.props.onDayMouseEnter && a2.props.onDayMouseEnter(e4);
|
|
}), Dt(bt(a2), "handleMonthMouseLeave", function() {
|
|
a2.setState({ selectingDate: null }), a2.props.onMonthMouseLeave && a2.props.onMonthMouseLeave();
|
|
}), Dt(bt(a2), "handleYearChange", function(e4) {
|
|
a2.props.onYearChange && a2.props.onYearChange(e4), a2.props.adjustDateOnChange && (a2.props.onSelect && a2.props.onSelect(e4), a2.props.setOpen && a2.props.setOpen(true)), a2.props.setPreSelection && a2.props.setPreSelection(e4);
|
|
}), Dt(bt(a2), "handleMonthChange", function(e4) {
|
|
a2.props.onMonthChange && a2.props.onMonthChange(e4), a2.props.adjustDateOnChange && (a2.props.onSelect && a2.props.onSelect(e4), a2.props.setOpen && a2.props.setOpen(true)), a2.props.setPreSelection && a2.props.setPreSelection(e4);
|
|
}), Dt(bt(a2), "handleMonthYearChange", function(e4) {
|
|
a2.handleYearChange(e4), a2.handleMonthChange(e4);
|
|
}), Dt(bt(a2), "changeYear", function(e4) {
|
|
a2.setState(function(t3) {
|
|
var r3 = t3.date;
|
|
return { date: We.default(r3, e4) };
|
|
}, function() {
|
|
return a2.handleYearChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "changeMonth", function(e4) {
|
|
a2.setState(function(t3) {
|
|
var r3 = t3.date;
|
|
return { date: Ae.default(r3, e4) };
|
|
}, function() {
|
|
return a2.handleMonthChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "changeMonthYear", function(e4) {
|
|
a2.setState(function(t3) {
|
|
var r3 = t3.date;
|
|
return { date: We.default(Ae.default(r3, Oe.default(e4)), Ie.default(e4)) };
|
|
}, function() {
|
|
return a2.handleMonthYearChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "header", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : a2.state.date, t3 = Bt(e4, a2.props.locale, a2.props.calendarStartDay), r3 = [];
|
|
return a2.props.showWeekNumbers && r3.push(de.default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, a2.props.weekLabel || "#")), r3.concat([0, 1, 2, 3, 4, 5, 6].map(function(e5) {
|
|
var r4 = De.default(t3, e5), n2 = a2.formatWeekday(r4, a2.props.locale), o2 = a2.props.weekDayClassName ? a2.props.weekDayClassName(r4) : void 0;
|
|
return de.default.createElement("div", { key: e5, className: ce.default("react-datepicker__day-name", o2) }, n2);
|
|
}));
|
|
}), Dt(bt(a2), "formatWeekday", function(e4, t3) {
|
|
return a2.props.formatWeekDay ? function(e5, t4, r3) {
|
|
return t4(Lt(e5, "EEEE", r3));
|
|
}(e4, a2.props.formatWeekDay, t3) : a2.props.useWeekdaysShort ? function(e5, t4) {
|
|
return Lt(e5, "EEE", t4);
|
|
}(e4, t3) : function(e5, t4) {
|
|
return Lt(e5, "EEEEEE", t4);
|
|
}(e4, t3);
|
|
}), Dt(bt(a2), "decreaseYear", function() {
|
|
a2.setState(function(e4) {
|
|
var t3 = e4.date;
|
|
return { date: Ce.default(t3, a2.props.showYearPicker ? a2.props.yearItemNumber : 1) };
|
|
}, function() {
|
|
return a2.handleYearChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "renderPreviousButton", function() {
|
|
if (!a2.props.renderCustomHeader) {
|
|
var e4;
|
|
switch (true) {
|
|
case a2.props.showMonthYearPicker:
|
|
e4 = mr(a2.state.date, a2.props);
|
|
break;
|
|
case a2.props.showYearPicker:
|
|
e4 = function(e5) {
|
|
var t4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r4 = t4.minDate, a3 = t4.yearItemNumber, n3 = a3 === void 0 ? xt : a3, o3 = br(Ht(Ce.default(e5, n3)), n3).endPeriod, s3 = r4 && Ie.default(r4);
|
|
return s3 && s3 > o3 || false;
|
|
}(a2.state.date, a2.props);
|
|
break;
|
|
default:
|
|
e4 = fr(a2.state.date, a2.props);
|
|
}
|
|
if ((a2.props.forceShowMonthNavigation || a2.props.showDisabledMonthNavigation || !e4) && !a2.props.showTimeSelectOnly) {
|
|
var t3 = ["react-datepicker__navigation", "react-datepicker__navigation--previous"], r3 = a2.decreaseMonth;
|
|
(a2.props.showMonthYearPicker || a2.props.showQuarterYearPicker || a2.props.showYearPicker) && (r3 = a2.decreaseYear), e4 && a2.props.showDisabledMonthNavigation && (t3.push("react-datepicker__navigation--previous--disabled"), r3 = null);
|
|
var n2 = a2.props.showMonthYearPicker || a2.props.showQuarterYearPicker || a2.props.showYearPicker, o2 = a2.props, s2 = o2.previousMonthButtonLabel, i2 = o2.previousYearButtonLabel, p2 = a2.props, l2 = p2.previousMonthAriaLabel, d2 = l2 === void 0 ? typeof s2 == "string" ? s2 : "Previous Month" : l2, c2 = p2.previousYearAriaLabel, u2 = c2 === void 0 ? typeof i2 == "string" ? i2 : "Previous Year" : c2;
|
|
return de.default.createElement("button", { type: "button", className: t3.join(" "), onClick: r3, onKeyDown: a2.props.handleOnKeyDown, "aria-label": n2 ? u2 : d2 }, de.default.createElement("span", { className: ["react-datepicker__navigation-icon", "react-datepicker__navigation-icon--previous"].join(" ") }, n2 ? a2.props.previousYearButtonLabel : a2.props.previousMonthButtonLabel));
|
|
}
|
|
}
|
|
}), Dt(bt(a2), "increaseYear", function() {
|
|
a2.setState(function(e4) {
|
|
var t3 = e4.date;
|
|
return { date: ge.default(t3, a2.props.showYearPicker ? a2.props.yearItemNumber : 1) };
|
|
}, function() {
|
|
return a2.handleYearChange(a2.state.date);
|
|
});
|
|
}), Dt(bt(a2), "renderNextButton", function() {
|
|
if (!a2.props.renderCustomHeader) {
|
|
var e4;
|
|
switch (true) {
|
|
case a2.props.showMonthYearPicker:
|
|
e4 = yr(a2.state.date, a2.props);
|
|
break;
|
|
case a2.props.showYearPicker:
|
|
e4 = function(e5) {
|
|
var t4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r4 = t4.maxDate, a3 = t4.yearItemNumber, n3 = a3 === void 0 ? xt : a3, o3 = br(ge.default(e5, n3), n3).startPeriod, s3 = r4 && Ie.default(r4);
|
|
return s3 && s3 < o3 || false;
|
|
}(a2.state.date, a2.props);
|
|
break;
|
|
default:
|
|
e4 = hr(a2.state.date, a2.props);
|
|
}
|
|
if ((a2.props.forceShowMonthNavigation || a2.props.showDisabledMonthNavigation || !e4) && !a2.props.showTimeSelectOnly) {
|
|
var t3 = ["react-datepicker__navigation", "react-datepicker__navigation--next"];
|
|
a2.props.showTimeSelect && t3.push("react-datepicker__navigation--next--with-time"), a2.props.todayButton && t3.push("react-datepicker__navigation--next--with-today-button");
|
|
var r3 = a2.increaseMonth;
|
|
(a2.props.showMonthYearPicker || a2.props.showQuarterYearPicker || a2.props.showYearPicker) && (r3 = a2.increaseYear), e4 && a2.props.showDisabledMonthNavigation && (t3.push("react-datepicker__navigation--next--disabled"), r3 = null);
|
|
var n2 = a2.props.showMonthYearPicker || a2.props.showQuarterYearPicker || a2.props.showYearPicker, o2 = a2.props, s2 = o2.nextMonthButtonLabel, i2 = o2.nextYearButtonLabel, p2 = a2.props, l2 = p2.nextMonthAriaLabel, d2 = l2 === void 0 ? typeof s2 == "string" ? s2 : "Next Month" : l2, c2 = p2.nextYearAriaLabel, u2 = c2 === void 0 ? typeof i2 == "string" ? i2 : "Next Year" : c2;
|
|
return de.default.createElement("button", { type: "button", className: t3.join(" "), onClick: r3, onKeyDown: a2.props.handleOnKeyDown, "aria-label": n2 ? u2 : d2 }, de.default.createElement("span", { className: ["react-datepicker__navigation-icon", "react-datepicker__navigation-icon--next"].join(" ") }, n2 ? a2.props.nextYearButtonLabel : a2.props.nextMonthButtonLabel));
|
|
}
|
|
}
|
|
}), Dt(bt(a2), "renderCurrentMonth", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : a2.state.date, t3 = ["react-datepicker__current-month"];
|
|
return a2.props.showYearDropdown && t3.push("react-datepicker__current-month--hasYearDropdown"), a2.props.showMonthDropdown && t3.push("react-datepicker__current-month--hasMonthDropdown"), a2.props.showMonthYearDropdown && t3.push("react-datepicker__current-month--hasMonthYearDropdown"), de.default.createElement("div", { className: t3.join(" ") }, Lt(e4, a2.props.dateFormat, a2.props.locale));
|
|
}), Dt(bt(a2), "renderYearDropdown", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
|
|
if (a2.props.showYearDropdown && !e4)
|
|
return de.default.createElement(Mr, { adjustDateOnChange: a2.props.adjustDateOnChange, date: a2.state.date, onSelect: a2.props.onSelect, setOpen: a2.props.setOpen, dropdownMode: a2.props.dropdownMode, onChange: a2.changeYear, minDate: a2.props.minDate, maxDate: a2.props.maxDate, year: Ie.default(a2.state.date), scrollableYearDropdown: a2.props.scrollableYearDropdown, yearDropdownItemNumber: a2.props.yearDropdownItemNumber });
|
|
}), Dt(bt(a2), "renderMonthDropdown", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
|
|
if (a2.props.showMonthDropdown && !e4)
|
|
return de.default.createElement(Nr, { dropdownMode: a2.props.dropdownMode, locale: a2.props.locale, onChange: a2.changeMonth, month: Oe.default(a2.state.date), useShortMonthInDropdown: a2.props.useShortMonthInDropdown });
|
|
}), Dt(bt(a2), "renderMonthYearDropdown", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
|
|
if (a2.props.showMonthYearDropdown && !e4)
|
|
return de.default.createElement(Ir, { dropdownMode: a2.props.dropdownMode, locale: a2.props.locale, dateFormat: a2.props.dateFormat, onChange: a2.changeMonthYear, minDate: a2.props.minDate, maxDate: a2.props.maxDate, date: a2.state.date, scrollableMonthYearDropdown: a2.props.scrollableMonthYearDropdown });
|
|
}), Dt(bt(a2), "renderTodayButton", function() {
|
|
if (a2.props.todayButton && !a2.props.showTimeSelectOnly)
|
|
return de.default.createElement("div", { className: "react-datepicker__today-button", onClick: function(e4) {
|
|
return a2.props.onSelect(Ve.default(Yt()), e4);
|
|
} }, a2.props.todayButton);
|
|
}), Dt(bt(a2), "renderDefaultHeader", function(e4) {
|
|
var t3 = e4.monthDate, r3 = e4.i;
|
|
return de.default.createElement("div", { className: "react-datepicker__header ".concat(a2.props.showTimeSelect ? "react-datepicker__header--has-time-select" : "") }, a2.renderCurrentMonth(t3), de.default.createElement("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(a2.props.dropdownMode), onFocus: a2.handleDropdownFocus }, a2.renderMonthDropdown(r3 !== 0), a2.renderMonthYearDropdown(r3 !== 0), a2.renderYearDropdown(r3 !== 0)), de.default.createElement("div", { className: "react-datepicker__day-names" }, a2.header(t3)));
|
|
}), Dt(bt(a2), "renderCustomHeader", function() {
|
|
var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t3 = e4.monthDate, r3 = e4.i;
|
|
if (a2.props.showTimeSelect && !a2.state.monthContainer || a2.props.showTimeSelectOnly)
|
|
return null;
|
|
var n2 = fr(a2.state.date, a2.props), o2 = hr(a2.state.date, a2.props), s2 = mr(a2.state.date, a2.props), i2 = yr(a2.state.date, a2.props), p2 = !a2.props.showMonthYearPicker && !a2.props.showQuarterYearPicker && !a2.props.showYearPicker;
|
|
return de.default.createElement("div", { className: "react-datepicker__header react-datepicker__header--custom", onFocus: a2.props.onDropdownFocus }, a2.props.renderCustomHeader(ut(ut({}, a2.state), {}, { customHeaderCount: r3, monthDate: t3, changeMonth: a2.changeMonth, changeYear: a2.changeYear, decreaseMonth: a2.decreaseMonth, increaseMonth: a2.increaseMonth, decreaseYear: a2.decreaseYear, increaseYear: a2.increaseYear, prevMonthButtonDisabled: n2, nextMonthButtonDisabled: o2, prevYearButtonDisabled: s2, nextYearButtonDisabled: i2 })), p2 && de.default.createElement("div", { className: "react-datepicker__day-names" }, a2.header(t3)));
|
|
}), Dt(bt(a2), "renderYearHeader", function() {
|
|
var e4 = a2.state.date, t3 = a2.props, r3 = t3.showYearPicker, n2 = br(e4, t3.yearItemNumber), o2 = n2.startPeriod, s2 = n2.endPeriod;
|
|
return de.default.createElement("div", { className: "react-datepicker__header react-datepicker-year-header" }, r3 ? "".concat(o2, " - ").concat(s2) : Ie.default(e4));
|
|
}), Dt(bt(a2), "renderHeader", function(e4) {
|
|
switch (true) {
|
|
case a2.props.renderCustomHeader !== void 0:
|
|
return a2.renderCustomHeader(e4);
|
|
case (a2.props.showMonthYearPicker || a2.props.showQuarterYearPicker || a2.props.showYearPicker):
|
|
return a2.renderYearHeader(e4);
|
|
default:
|
|
return a2.renderDefaultHeader(e4);
|
|
}
|
|
}), Dt(bt(a2), "renderMonths", function() {
|
|
if (!a2.props.showTimeSelectOnly && !a2.props.showYearPicker) {
|
|
for (var e4 = [], t3 = a2.props.showPreviousMonths ? a2.props.monthsShown - 1 : 0, r3 = Se.default(a2.state.date, t3), n2 = 0; n2 < a2.props.monthsShown; ++n2) {
|
|
var o2 = n2 - a2.props.monthSelectedIn, s2 = we.default(r3, o2), i2 = "month-".concat(n2), p2 = n2 < a2.props.monthsShown - 1, l2 = n2 > 0;
|
|
e4.push(de.default.createElement("div", { key: i2, ref: function(e5) {
|
|
a2.monthContainer = e5;
|
|
}, className: "react-datepicker__month-container" }, a2.renderHeader({ monthDate: s2, i: n2 }), de.default.createElement(Fr, { chooseDayAriaLabelPrefix: a2.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: a2.props.disabledDayAriaLabelPrefix, weekAriaLabelPrefix: a2.props.weekAriaLabelPrefix, ariaLabelPrefix: a2.props.monthAriaLabelPrefix, onChange: a2.changeMonthYear, day: s2, dayClassName: a2.props.dayClassName, calendarStartDay: a2.props.calendarStartDay, monthClassName: a2.props.monthClassName, onDayClick: a2.handleDayClick, handleOnKeyDown: a2.props.handleOnDayKeyDown, onDayMouseEnter: a2.handleDayMouseEnter, onMouseLeave: a2.handleMonthMouseLeave, onWeekSelect: a2.props.onWeekSelect, orderInDisplay: n2, formatWeekNumber: a2.props.formatWeekNumber, locale: a2.props.locale, minDate: a2.props.minDate, maxDate: a2.props.maxDate, excludeDates: a2.props.excludeDates, excludeDateIntervals: a2.props.excludeDateIntervals, highlightDates: a2.props.highlightDates, selectingDate: a2.state.selectingDate, includeDates: a2.props.includeDates, includeDateIntervals: a2.props.includeDateIntervals, inline: a2.props.inline, shouldFocusDayInline: a2.props.shouldFocusDayInline, fixedHeight: a2.props.fixedHeight, filterDate: a2.props.filterDate, preSelection: a2.props.preSelection, setPreSelection: a2.props.setPreSelection, selected: a2.props.selected, selectsStart: a2.props.selectsStart, selectsEnd: a2.props.selectsEnd, selectsRange: a2.props.selectsRange, selectsDisabledDaysInRange: a2.props.selectsDisabledDaysInRange, showWeekNumbers: a2.props.showWeekNumbers, startDate: a2.props.startDate, endDate: a2.props.endDate, peekNextMonth: a2.props.peekNextMonth, setOpen: a2.props.setOpen, shouldCloseOnSelect: a2.props.shouldCloseOnSelect, renderDayContents: a2.props.renderDayContents, disabledKeyboardNavigation: a2.props.disabledKeyboardNavigation, showMonthYearPicker: a2.props.showMonthYearPicker, showFullMonthYearPicker: a2.props.showFullMonthYearPicker, showTwoColumnMonthYearPicker: a2.props.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker: a2.props.showFourColumnMonthYearPicker, showYearPicker: a2.props.showYearPicker, showQuarterYearPicker: a2.props.showQuarterYearPicker, isInputFocused: a2.props.isInputFocused, containerRef: a2.containerRef, monthShowsDuplicateDaysEnd: p2, monthShowsDuplicateDaysStart: l2 })));
|
|
}
|
|
return e4;
|
|
}
|
|
}), Dt(bt(a2), "renderYears", function() {
|
|
if (!a2.props.showTimeSelectOnly)
|
|
return a2.props.showYearPicker ? de.default.createElement("div", { className: "react-datepicker__year--container" }, a2.renderHeader(), de.default.createElement(qr, vt({ onDayClick: a2.handleDayClick, date: a2.state.date }, a2.props))) : void 0;
|
|
}), Dt(bt(a2), "renderTimeSection", function() {
|
|
if (a2.props.showTimeSelect && (a2.state.monthContainer || a2.props.showTimeSelectOnly))
|
|
return de.default.createElement(Ar, { selected: a2.props.selected, openToDate: a2.props.openToDate, onChange: a2.props.onTimeChange, timeClassName: a2.props.timeClassName, format: a2.props.timeFormat, includeTimes: a2.props.includeTimes, intervals: a2.props.timeIntervals, minTime: a2.props.minTime, maxTime: a2.props.maxTime, excludeTimes: a2.props.excludeTimes, filterTime: a2.props.filterTime, timeCaption: a2.props.timeCaption, todayButton: a2.props.todayButton, showMonthDropdown: a2.props.showMonthDropdown, showMonthYearDropdown: a2.props.showMonthYearDropdown, showYearDropdown: a2.props.showYearDropdown, withPortal: a2.props.withPortal, monthRef: a2.state.monthContainer, injectTimes: a2.props.injectTimes, locale: a2.props.locale, handleOnKeyDown: a2.props.handleOnKeyDown, showTimeSelectOnly: a2.props.showTimeSelectOnly });
|
|
}), Dt(bt(a2), "renderInputTimeSection", function() {
|
|
var e4 = new Date(a2.props.selected), t3 = Tt(e4) && Boolean(a2.props.selected) ? "".concat(kr(e4.getHours()), ":").concat(kr(e4.getMinutes())) : "";
|
|
if (a2.props.showTimeInput)
|
|
return de.default.createElement(Wr, { date: e4, timeString: t3, timeInputLabel: a2.props.timeInputLabel, onChange: a2.props.onTimeChange, customTimeInput: a2.props.customTimeInput });
|
|
}), a2.containerRef = de.default.createRef(), a2.state = { date: a2.getDateInView(), selectingDate: null, monthContainer: null }, a2;
|
|
}
|
|
return yt(r2, [{ key: "componentDidMount", value: function() {
|
|
var e3 = this;
|
|
this.props.showTimeSelect && (this.assignMonthContainer = void e3.setState({ monthContainer: e3.monthContainer }));
|
|
} }, { key: "componentDidUpdate", value: function(e3) {
|
|
this.props.preSelection && !$t(this.props.preSelection, e3.preSelection) ? this.setState({ date: this.props.preSelection }) : this.props.openToDate && !$t(this.props.openToDate, e3.openToDate) && this.setState({ date: this.props.openToDate });
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this.props.container || Br;
|
|
return de.default.createElement("div", { ref: this.containerRef }, de.default.createElement(e3, { className: ce.default("react-datepicker", this.props.className, { "react-datepicker--time-only": this.props.showTimeSelectOnly }), showPopperArrow: this.props.showPopperArrow, arrowProps: this.props.arrowProps }, this.renderPreviousButton(), this.renderNextButton(), this.renderMonths(), this.renderYears(), this.renderTodayButton(), this.renderTimeSection(), this.renderInputTimeSection(), this.props.children));
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { onDropdownFocus: function() {
|
|
}, monthsShown: 1, monthSelectedIn: 0, forceShowMonthNavigation: false, timeCaption: "Time", previousYearButtonLabel: "Previous Year", nextYearButtonLabel: "Next Year", previousMonthButtonLabel: "Previous Month", nextMonthButtonLabel: "Next Month", customTimeInput: null, yearItemNumber: xt };
|
|
} }]), r2;
|
|
}(de.default.Component), jr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), (a2 = t2.call(this, e3)).el = document.createElement("div"), a2;
|
|
}
|
|
return yt(r2, [{ key: "componentDidMount", value: function() {
|
|
this.portalRoot = (this.props.portalHost || document).getElementById(this.props.portalId), this.portalRoot || (this.portalRoot = document.createElement("div"), this.portalRoot.setAttribute("id", this.props.portalId), (this.props.portalHost || document.body).appendChild(this.portalRoot)), this.portalRoot.appendChild(this.el);
|
|
} }, { key: "componentWillUnmount", value: function() {
|
|
this.portalRoot.removeChild(this.el);
|
|
} }, { key: "render", value: function() {
|
|
return dt.default.createPortal(this.props.children, this.el);
|
|
} }]), r2;
|
|
}(de.default.Component), Qr = function(e2) {
|
|
return !e2.disabled && e2.tabIndex !== -1;
|
|
}, Vr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "getTabChildren", function() {
|
|
return Array.prototype.slice.call(a2.tabLoopRef.current.querySelectorAll("[tabindex], a, button, input, select, textarea"), 1, -1).filter(Qr);
|
|
}), Dt(bt(a2), "handleFocusStart", function(e4) {
|
|
var t3 = a2.getTabChildren();
|
|
t3 && t3.length > 1 && t3[t3.length - 1].focus();
|
|
}), Dt(bt(a2), "handleFocusEnd", function(e4) {
|
|
var t3 = a2.getTabChildren();
|
|
t3 && t3.length > 1 && t3[0].focus();
|
|
}), a2.tabLoopRef = de.default.createRef(), a2;
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
return this.props.enableTabLoop ? de.default.createElement("div", { className: "react-datepicker__tab-loop", ref: this.tabLoopRef }, de.default.createElement("div", { className: "react-datepicker__tab-loop__start", tabIndex: "0", onFocus: this.handleFocusStart }), this.props.children, de.default.createElement("div", { className: "react-datepicker__tab-loop__end", tabIndex: "0", onFocus: this.handleFocusEnd })) : this.props.children;
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { enableTabLoop: true };
|
|
} }]), r2;
|
|
}(de.default.Component), Ur = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2() {
|
|
return ht(this, r2), t2.apply(this, arguments);
|
|
}
|
|
return yt(r2, [{ key: "render", value: function() {
|
|
var e3, t3 = this.props, r3 = t3.className, a2 = t3.wrapperClassName, n2 = t3.hidePopper, o2 = t3.popperComponent, s2 = t3.popperModifiers, i2 = t3.popperPlacement, p2 = t3.popperProps, l2 = t3.targetComponent, d2 = t3.enableTabLoop, c2 = t3.popperOnKeyDown, u2 = t3.portalId, f2 = t3.portalHost;
|
|
if (!n2) {
|
|
var h2 = ce.default("react-datepicker-popper", r3);
|
|
e3 = de.default.createElement(pe.Popper, vt({ modifiers: s2, placement: i2 }, p2), function(e4) {
|
|
var t4 = e4.ref, r4 = e4.style, a3 = e4.placement, n3 = e4.arrowProps;
|
|
return de.default.createElement(Vr, { enableTabLoop: d2 }, de.default.createElement("div", { ref: t4, style: r4, className: h2, "data-placement": a3, onKeyDown: c2 }, de.default.cloneElement(o2, { arrowProps: n3 })));
|
|
});
|
|
}
|
|
this.props.popperContainer && (e3 = de.default.createElement(this.props.popperContainer, {}, e3)), u2 && !n2 && (e3 = de.default.createElement(jr, { portalId: u2, portalHost: f2 }, e3));
|
|
var m2 = ce.default("react-datepicker-wrapper", a2);
|
|
return de.default.createElement(pe.Manager, { className: "react-datepicker-manager" }, de.default.createElement(pe.Reference, null, function(e4) {
|
|
var t4 = e4.ref;
|
|
return de.default.createElement("div", { ref: t4, className: m2 }, l2);
|
|
}), e3);
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { hidePopper: true, popperModifiers: [], popperProps: {}, popperPlacement: "bottom-start" };
|
|
} }]), r2;
|
|
}(de.default.Component), $r = "react-datepicker-ignore-onclickoutside", zr = lt.default(Hr);
|
|
var Gr = "Date input not valid.", Jr = function(e2) {
|
|
wt(r2, e2);
|
|
var t2 = Ct(r2);
|
|
function r2(e3) {
|
|
var a2;
|
|
return ht(this, r2), Dt(bt(a2 = t2.call(this, e3)), "getPreSelection", function() {
|
|
return a2.props.openToDate ? a2.props.openToDate : a2.props.selectsEnd && a2.props.startDate ? a2.props.startDate : a2.props.selectsStart && a2.props.endDate ? a2.props.endDate : Yt();
|
|
}), Dt(bt(a2), "calcInitialState", function() {
|
|
var e4, t3 = a2.getPreSelection(), r3 = Dr(a2.props), n2 = vr(a2.props), o2 = r3 && nt.default(t3, Ve.default(r3)) ? r3 : n2 && at.default(t3, Je.default(n2)) ? n2 : t3;
|
|
return { open: a2.props.startOpen || false, preventFocus: false, preSelection: (e4 = a2.props.selectsRange ? a2.props.startDate : a2.props.selected) !== null && e4 !== void 0 ? e4 : o2, highlightDates: wr(a2.props.highlightDates), focused: false, shouldFocusDayInline: false };
|
|
}), Dt(bt(a2), "clearPreventFocusTimeout", function() {
|
|
a2.preventFocusTimeout && clearTimeout(a2.preventFocusTimeout);
|
|
}), Dt(bt(a2), "setFocus", function() {
|
|
a2.input && a2.input.focus && a2.input.focus({ preventScroll: true });
|
|
}), Dt(bt(a2), "setBlur", function() {
|
|
a2.input && a2.input.blur && a2.input.blur(), a2.cancelFocusInput();
|
|
}), Dt(bt(a2), "setOpen", function(e4) {
|
|
var t3 = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
a2.setState({ open: e4, preSelection: e4 && a2.state.open ? a2.state.preSelection : a2.calcInitialState().preSelection, lastPreSelectChange: Zr }, function() {
|
|
e4 || a2.setState(function(e5) {
|
|
return { focused: !!t3 && e5.focused };
|
|
}, function() {
|
|
!t3 && a2.setBlur(), a2.setState({ inputValue: null });
|
|
});
|
|
});
|
|
}), Dt(bt(a2), "inputOk", function() {
|
|
return ue.default(a2.state.preSelection);
|
|
}), Dt(bt(a2), "isCalendarOpen", function() {
|
|
return a2.props.open === void 0 ? a2.state.open && !a2.props.disabled && !a2.props.readOnly : a2.props.open;
|
|
}), Dt(bt(a2), "handleFocus", function(e4) {
|
|
a2.state.preventFocus || (a2.props.onFocus(e4), a2.props.preventOpenOnFocus || a2.props.readOnly || a2.setOpen(true)), a2.setState({ focused: true });
|
|
}), Dt(bt(a2), "cancelFocusInput", function() {
|
|
clearTimeout(a2.inputFocusTimeout), a2.inputFocusTimeout = null;
|
|
}), Dt(bt(a2), "deferFocusInput", function() {
|
|
a2.cancelFocusInput(), a2.inputFocusTimeout = setTimeout(function() {
|
|
return a2.setFocus();
|
|
}, 1);
|
|
}), Dt(bt(a2), "handleDropdownFocus", function() {
|
|
a2.cancelFocusInput();
|
|
}), Dt(bt(a2), "handleBlur", function(e4) {
|
|
(!a2.state.open || a2.props.withPortal || a2.props.showTimeInput) && a2.props.onBlur(e4), a2.setState({ focused: false });
|
|
}), Dt(bt(a2), "handleCalendarClickOutside", function(e4) {
|
|
a2.props.inline || a2.setOpen(false), a2.props.onClickOutside(e4), a2.props.withPortal && e4.preventDefault();
|
|
}), Dt(bt(a2), "handleChange", function() {
|
|
for (var e4 = arguments.length, t3 = new Array(e4), r3 = 0; r3 < e4; r3++)
|
|
t3[r3] = arguments[r3];
|
|
var n2 = t3[0];
|
|
if (!a2.props.onChangeRaw || (a2.props.onChangeRaw.apply(bt(a2), t3), typeof n2.isDefaultPrevented == "function" && !n2.isDefaultPrevented())) {
|
|
a2.setState({ inputValue: n2.target.value, lastPreSelectChange: Xr });
|
|
var o2 = It(n2.target.value, a2.props.dateFormat, a2.props.locale, a2.props.strictParsing, a2.props.minDate);
|
|
!o2 && n2.target.value || a2.setSelected(o2, n2, true);
|
|
}
|
|
}), Dt(bt(a2), "handleSelect", function(e4, t3, r3) {
|
|
if (a2.setState({ preventFocus: true }, function() {
|
|
return a2.preventFocusTimeout = setTimeout(function() {
|
|
return a2.setState({ preventFocus: false });
|
|
}, 50), a2.preventFocusTimeout;
|
|
}), a2.props.onChangeRaw && a2.props.onChangeRaw(t3), a2.setSelected(e4, t3, false, r3), !a2.props.shouldCloseOnSelect || a2.props.showTimeSelect)
|
|
a2.setPreSelection(e4);
|
|
else if (!a2.props.inline) {
|
|
a2.props.selectsRange || a2.setOpen(false);
|
|
var n2 = a2.props, o2 = n2.startDate, s2 = n2.endDate;
|
|
!o2 || s2 || nt.default(e4, o2) || a2.setOpen(false);
|
|
}
|
|
}), Dt(bt(a2), "setSelected", function(e4, t3, r3, n2) {
|
|
var o2 = e4;
|
|
if (o2 === null || !rr(o2, a2.props)) {
|
|
var s2 = a2.props, i2 = s2.onChange, p2 = s2.selectsRange, l2 = s2.startDate, d2 = s2.endDate;
|
|
if (!zt(a2.props.selected, o2) || a2.props.allowSameDay || p2)
|
|
if (o2 !== null && (!a2.props.selected || r3 && (a2.props.showTimeSelect || a2.props.showTimeSelectOnly || a2.props.showTimeInput) || (o2 = Ft(o2, { hour: Pe.default(a2.props.selected), minute: Me.default(a2.props.selected), second: _e.default(a2.props.selected) })), a2.props.inline || a2.setState({ preSelection: o2 }), a2.props.focusSelectedMonth || a2.setState({ monthSelectedIn: n2 })), p2) {
|
|
var c2 = l2 && !d2, u2 = l2 && d2;
|
|
!l2 && !d2 ? i2([o2, null], t3) : c2 && (nt.default(o2, l2) ? i2([o2, null], t3) : i2([l2, o2], t3)), u2 && i2([o2, null], t3);
|
|
} else
|
|
i2(o2, t3);
|
|
r3 || (a2.props.onSelect(o2, t3), a2.setState({ inputValue: null }));
|
|
}
|
|
}), Dt(bt(a2), "setPreSelection", function(e4) {
|
|
var t3 = a2.props.minDate !== void 0, r3 = a2.props.maxDate !== void 0, n2 = true;
|
|
if (e4) {
|
|
var o2 = Ve.default(e4);
|
|
if (t3 && r3)
|
|
n2 = Gt(e4, a2.props.minDate, a2.props.maxDate);
|
|
else if (t3) {
|
|
var s2 = Ve.default(a2.props.minDate);
|
|
n2 = at.default(e4, s2) || zt(o2, s2);
|
|
} else if (r3) {
|
|
var i2 = Je.default(a2.props.maxDate);
|
|
n2 = nt.default(e4, i2) || zt(o2, i2);
|
|
}
|
|
}
|
|
n2 && a2.setState({ preSelection: e4 });
|
|
}), Dt(bt(a2), "handleTimeChange", function(e4) {
|
|
var t3 = Ft(a2.props.selected ? a2.props.selected : a2.getPreSelection(), { hour: Pe.default(e4), minute: Me.default(e4) });
|
|
a2.setState({ preSelection: t3 }), a2.props.onChange(t3), a2.props.shouldCloseOnSelect && a2.setOpen(false), a2.props.showTimeInput && a2.setOpen(true), a2.setState({ inputValue: null });
|
|
}), Dt(bt(a2), "onInputClick", function() {
|
|
a2.props.disabled || a2.props.readOnly || a2.setOpen(true), a2.props.onInputClick();
|
|
}), Dt(bt(a2), "onInputKeyDown", function(e4) {
|
|
a2.props.onKeyDown(e4);
|
|
var t3 = e4.key;
|
|
if (a2.state.open || a2.props.inline || a2.props.preventOpenOnFocus) {
|
|
if (a2.state.open) {
|
|
if (t3 === "ArrowDown" || t3 === "ArrowUp") {
|
|
e4.preventDefault();
|
|
var r3 = a2.calendar.componentNode && a2.calendar.componentNode.querySelector('.react-datepicker__day[tabindex="0"]');
|
|
return void (r3 && r3.focus({ preventScroll: true }));
|
|
}
|
|
var n2 = Yt(a2.state.preSelection);
|
|
t3 === "Enter" ? (e4.preventDefault(), a2.inputOk() && a2.state.lastPreSelectChange === Zr ? (a2.handleSelect(n2, e4), !a2.props.shouldCloseOnSelect && a2.setPreSelection(n2)) : a2.setOpen(false)) : t3 === "Escape" && (e4.preventDefault(), a2.setOpen(false)), a2.inputOk() || a2.props.onInputError({ code: 1, msg: Gr });
|
|
}
|
|
} else
|
|
t3 !== "ArrowDown" && t3 !== "ArrowUp" && t3 !== "Enter" || a2.onInputClick();
|
|
}), Dt(bt(a2), "onDayKeyDown", function(e4) {
|
|
a2.props.onKeyDown(e4);
|
|
var t3 = e4.key, r3 = Yt(a2.state.preSelection);
|
|
if (t3 === "Enter")
|
|
e4.preventDefault(), a2.handleSelect(r3, e4), !a2.props.shouldCloseOnSelect && a2.setPreSelection(r3);
|
|
else if (t3 === "Escape")
|
|
e4.preventDefault(), a2.setOpen(false), a2.inputOk() || a2.props.onInputError({ code: 1, msg: Gr });
|
|
else if (!a2.props.disabledKeyboardNavigation) {
|
|
var n2;
|
|
switch (t3) {
|
|
case "ArrowLeft":
|
|
n2 = ke.default(r3, 1);
|
|
break;
|
|
case "ArrowRight":
|
|
n2 = De.default(r3, 1);
|
|
break;
|
|
case "ArrowUp":
|
|
n2 = be.default(r3, 1);
|
|
break;
|
|
case "ArrowDown":
|
|
n2 = ve.default(r3, 1);
|
|
break;
|
|
case "PageUp":
|
|
n2 = Se.default(r3, 1);
|
|
break;
|
|
case "PageDown":
|
|
n2 = we.default(r3, 1);
|
|
break;
|
|
case "Home":
|
|
n2 = Ce.default(r3, 1);
|
|
break;
|
|
case "End":
|
|
n2 = ge.default(r3, 1);
|
|
}
|
|
if (!n2)
|
|
return void (a2.props.onInputError && a2.props.onInputError({ code: 1, msg: Gr }));
|
|
if (e4.preventDefault(), a2.setState({ lastPreSelectChange: Zr }), a2.props.adjustDateOnChange && a2.setSelected(n2), a2.setPreSelection(n2), a2.props.inline) {
|
|
var o2 = Oe.default(r3), s2 = Oe.default(n2), i2 = Ie.default(r3), p2 = Ie.default(n2);
|
|
o2 !== s2 || i2 !== p2 ? a2.setState({ shouldFocusDayInline: true }) : a2.setState({ shouldFocusDayInline: false });
|
|
}
|
|
}
|
|
}), Dt(bt(a2), "onPopperKeyDown", function(e4) {
|
|
e4.key === "Escape" && (e4.preventDefault(), a2.setState({ preventFocus: true }, function() {
|
|
a2.setOpen(false), setTimeout(function() {
|
|
a2.setFocus(), a2.setState({ preventFocus: false });
|
|
});
|
|
}));
|
|
}), Dt(bt(a2), "onClearClick", function(e4) {
|
|
e4 && e4.preventDefault && e4.preventDefault(), a2.props.selectsRange ? a2.props.onChange([null, null], e4) : a2.props.onChange(null, e4), a2.setState({ inputValue: null });
|
|
}), Dt(bt(a2), "clear", function() {
|
|
a2.onClearClick();
|
|
}), Dt(bt(a2), "onScroll", function(e4) {
|
|
typeof a2.props.closeOnScroll == "boolean" && a2.props.closeOnScroll ? e4.target !== document && e4.target !== document.documentElement && e4.target !== document.body || a2.setOpen(false) : typeof a2.props.closeOnScroll == "function" && a2.props.closeOnScroll(e4) && a2.setOpen(false);
|
|
}), Dt(bt(a2), "renderCalendar", function() {
|
|
return a2.props.inline || a2.isCalendarOpen() ? de.default.createElement(zr, { ref: function(e4) {
|
|
a2.calendar = e4;
|
|
}, locale: a2.props.locale, calendarStartDay: a2.props.calendarStartDay, chooseDayAriaLabelPrefix: a2.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: a2.props.disabledDayAriaLabelPrefix, weekAriaLabelPrefix: a2.props.weekAriaLabelPrefix, monthAriaLabelPrefix: a2.props.monthAriaLabelPrefix, adjustDateOnChange: a2.props.adjustDateOnChange, setOpen: a2.setOpen, shouldCloseOnSelect: a2.props.shouldCloseOnSelect, dateFormat: a2.props.dateFormatCalendar, useWeekdaysShort: a2.props.useWeekdaysShort, formatWeekDay: a2.props.formatWeekDay, dropdownMode: a2.props.dropdownMode, selected: a2.props.selected, preSelection: a2.state.preSelection, onSelect: a2.handleSelect, onWeekSelect: a2.props.onWeekSelect, openToDate: a2.props.openToDate, minDate: a2.props.minDate, maxDate: a2.props.maxDate, selectsStart: a2.props.selectsStart, selectsEnd: a2.props.selectsEnd, selectsRange: a2.props.selectsRange, startDate: a2.props.startDate, endDate: a2.props.endDate, excludeDates: a2.props.excludeDates, excludeDateIntervals: a2.props.excludeDateIntervals, filterDate: a2.props.filterDate, onClickOutside: a2.handleCalendarClickOutside, formatWeekNumber: a2.props.formatWeekNumber, highlightDates: a2.state.highlightDates, includeDates: a2.props.includeDates, includeDateIntervals: a2.props.includeDateIntervals, includeTimes: a2.props.includeTimes, injectTimes: a2.props.injectTimes, inline: a2.props.inline, shouldFocusDayInline: a2.state.shouldFocusDayInline, peekNextMonth: a2.props.peekNextMonth, showMonthDropdown: a2.props.showMonthDropdown, showPreviousMonths: a2.props.showPreviousMonths, useShortMonthInDropdown: a2.props.useShortMonthInDropdown, showMonthYearDropdown: a2.props.showMonthYearDropdown, showWeekNumbers: a2.props.showWeekNumbers, showYearDropdown: a2.props.showYearDropdown, withPortal: a2.props.withPortal, forceShowMonthNavigation: a2.props.forceShowMonthNavigation, showDisabledMonthNavigation: a2.props.showDisabledMonthNavigation, scrollableYearDropdown: a2.props.scrollableYearDropdown, scrollableMonthYearDropdown: a2.props.scrollableMonthYearDropdown, todayButton: a2.props.todayButton, weekLabel: a2.props.weekLabel, outsideClickIgnoreClass: $r, fixedHeight: a2.props.fixedHeight, monthsShown: a2.props.monthsShown, monthSelectedIn: a2.state.monthSelectedIn, onDropdownFocus: a2.handleDropdownFocus, onMonthChange: a2.props.onMonthChange, onYearChange: a2.props.onYearChange, dayClassName: a2.props.dayClassName, weekDayClassName: a2.props.weekDayClassName, monthClassName: a2.props.monthClassName, timeClassName: a2.props.timeClassName, showTimeSelect: a2.props.showTimeSelect, showTimeSelectOnly: a2.props.showTimeSelectOnly, onTimeChange: a2.handleTimeChange, timeFormat: a2.props.timeFormat, timeIntervals: a2.props.timeIntervals, minTime: a2.props.minTime, maxTime: a2.props.maxTime, excludeTimes: a2.props.excludeTimes, filterTime: a2.props.filterTime, timeCaption: a2.props.timeCaption, className: a2.props.calendarClassName, container: a2.props.calendarContainer, yearItemNumber: a2.props.yearItemNumber, yearDropdownItemNumber: a2.props.yearDropdownItemNumber, previousMonthAriaLabel: a2.props.previousMonthAriaLabel, previousMonthButtonLabel: a2.props.previousMonthButtonLabel, nextMonthAriaLabel: a2.props.nextMonthAriaLabel, nextMonthButtonLabel: a2.props.nextMonthButtonLabel, previousYearAriaLabel: a2.props.previousYearAriaLabel, previousYearButtonLabel: a2.props.previousYearButtonLabel, nextYearAriaLabel: a2.props.nextYearAriaLabel, nextYearButtonLabel: a2.props.nextYearButtonLabel, timeInputLabel: a2.props.timeInputLabel, disabledKeyboardNavigation: a2.props.disabledKeyboardNavigation, renderCustomHeader: a2.props.renderCustomHeader, popperProps: a2.props.popperProps, renderDayContents: a2.props.renderDayContents, onDayMouseEnter: a2.props.onDayMouseEnter, onMonthMouseLeave: a2.props.onMonthMouseLeave, selectsDisabledDaysInRange: a2.props.selectsDisabledDaysInRange, showTimeInput: a2.props.showTimeInput, showMonthYearPicker: a2.props.showMonthYearPicker, showFullMonthYearPicker: a2.props.showFullMonthYearPicker, showTwoColumnMonthYearPicker: a2.props.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker: a2.props.showFourColumnMonthYearPicker, showYearPicker: a2.props.showYearPicker, showQuarterYearPicker: a2.props.showQuarterYearPicker, showPopperArrow: a2.props.showPopperArrow, excludeScrollbar: a2.props.excludeScrollbar, handleOnKeyDown: a2.props.onKeyDown, handleOnDayKeyDown: a2.onDayKeyDown, isInputFocused: a2.state.focused, customTimeInput: a2.props.customTimeInput, setPreSelection: a2.setPreSelection }, a2.props.children) : null;
|
|
}), Dt(bt(a2), "renderDateInput", function() {
|
|
var e4, t3 = ce.default(a2.props.className, Dt({}, $r, a2.state.open)), r3 = a2.props.customInput || de.default.createElement("input", { type: "text" }), n2 = a2.props.customInputRef || "ref", o2 = typeof a2.props.value == "string" ? a2.props.value : typeof a2.state.inputValue == "string" ? a2.state.inputValue : a2.props.selectsRange ? function(e5, t4, r4) {
|
|
if (!e5)
|
|
return "";
|
|
var a3 = Rt(e5, r4), n3 = t4 ? Rt(t4, r4) : "";
|
|
return "".concat(a3, " - ").concat(n3);
|
|
}(a2.props.startDate, a2.props.endDate, a2.props) : Rt(a2.props.selected, a2.props);
|
|
return de.default.cloneElement(r3, (Dt(e4 = {}, n2, function(e5) {
|
|
a2.input = e5;
|
|
}), Dt(e4, "value", o2), Dt(e4, "onBlur", a2.handleBlur), Dt(e4, "onChange", a2.handleChange), Dt(e4, "onClick", a2.onInputClick), Dt(e4, "onFocus", a2.handleFocus), Dt(e4, "onKeyDown", a2.onInputKeyDown), Dt(e4, "id", a2.props.id), Dt(e4, "name", a2.props.name), Dt(e4, "autoFocus", a2.props.autoFocus), Dt(e4, "placeholder", a2.props.placeholderText), Dt(e4, "disabled", a2.props.disabled), Dt(e4, "autoComplete", a2.props.autoComplete), Dt(e4, "className", ce.default(r3.props.className, t3)), Dt(e4, "title", a2.props.title), Dt(e4, "readOnly", a2.props.readOnly), Dt(e4, "required", a2.props.required), Dt(e4, "tabIndex", a2.props.tabIndex), Dt(e4, "aria-describedby", a2.props.ariaDescribedBy), Dt(e4, "aria-invalid", a2.props.ariaInvalid), Dt(e4, "aria-labelledby", a2.props.ariaLabelledBy), Dt(e4, "aria-required", a2.props.ariaRequired), e4));
|
|
}), Dt(bt(a2), "renderClearButton", function() {
|
|
var e4 = a2.props, t3 = e4.isClearable, r3 = e4.selected, n2 = e4.startDate, o2 = e4.endDate, s2 = e4.clearButtonTitle, i2 = e4.clearButtonClassName, p2 = i2 === void 0 ? "" : i2, l2 = e4.ariaLabelClose, d2 = l2 === void 0 ? "Close" : l2;
|
|
return !t3 || r3 == null && n2 == null && o2 == null ? null : de.default.createElement("button", { type: "button", className: "react-datepicker__close-icon ".concat(p2).trim(), "aria-label": d2, onClick: a2.onClearClick, title: s2, tabIndex: -1 });
|
|
}), a2.state = a2.calcInitialState(), a2;
|
|
}
|
|
return yt(r2, [{ key: "componentDidMount", value: function() {
|
|
window.addEventListener("scroll", this.onScroll, true);
|
|
} }, { key: "componentDidUpdate", value: function(e3, t3) {
|
|
var r3, a2;
|
|
e3.inline && (r3 = e3.selected, a2 = this.props.selected, r3 && a2 ? Oe.default(r3) !== Oe.default(a2) || Ie.default(r3) !== Ie.default(a2) : r3 !== a2) && this.setPreSelection(this.props.selected), this.state.monthSelectedIn !== void 0 && e3.monthsShown !== this.props.monthsShown && this.setState({ monthSelectedIn: 0 }), e3.highlightDates !== this.props.highlightDates && this.setState({ highlightDates: wr(this.props.highlightDates) }), t3.focused || zt(e3.selected, this.props.selected) || this.setState({ inputValue: null }), t3.open !== this.state.open && (t3.open === false && this.state.open === true && this.props.onCalendarOpen(), t3.open === true && this.state.open === false && this.props.onCalendarClose());
|
|
} }, { key: "componentWillUnmount", value: function() {
|
|
this.clearPreventFocusTimeout(), window.removeEventListener("scroll", this.onScroll, true);
|
|
} }, { key: "renderInputContainer", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__input-container" }, this.renderDateInput(), this.renderClearButton());
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this.renderCalendar();
|
|
if (this.props.inline)
|
|
return e3;
|
|
if (this.props.withPortal) {
|
|
var t3 = this.state.open ? de.default.createElement("div", { className: "react-datepicker__portal" }, e3) : null;
|
|
return this.state.open && this.props.portalId && (t3 = de.default.createElement(jr, { portalId: this.props.portalId, portalHost: this.props.portalHost }, t3)), de.default.createElement("div", null, this.renderInputContainer(), t3);
|
|
}
|
|
return de.default.createElement(Ur, { className: this.props.popperClassName, wrapperClassName: this.props.wrapperClassName, hidePopper: !this.isCalendarOpen(), portalId: this.props.portalId, portalHost: this.props.portalHost, popperModifiers: this.props.popperModifiers, targetComponent: this.renderInputContainer(), popperContainer: this.props.popperContainer, popperComponent: e3, popperPlacement: this.props.popperPlacement, popperProps: this.props.popperProps, popperOnKeyDown: this.onPopperKeyDown, enableTabLoop: this.props.enableTabLoop });
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { allowSameDay: false, dateFormat: "MM/dd/yyyy", dateFormatCalendar: "LLLL yyyy", onChange: function() {
|
|
}, disabled: false, disabledKeyboardNavigation: false, dropdownMode: "scroll", onFocus: function() {
|
|
}, onBlur: function() {
|
|
}, onKeyDown: function() {
|
|
}, onInputClick: function() {
|
|
}, onSelect: function() {
|
|
}, onClickOutside: function() {
|
|
}, onMonthChange: function() {
|
|
}, onCalendarOpen: function() {
|
|
}, onCalendarClose: function() {
|
|
}, preventOpenOnFocus: false, onYearChange: function() {
|
|
}, onInputError: function() {
|
|
}, monthsShown: 1, readOnly: false, withPortal: false, selectsDisabledDaysInRange: false, shouldCloseOnSelect: true, showTimeSelect: false, showTimeInput: false, showPreviousMonths: false, showMonthYearPicker: false, showFullMonthYearPicker: false, showTwoColumnMonthYearPicker: false, showFourColumnMonthYearPicker: false, showYearPicker: false, showQuarterYearPicker: false, strictParsing: false, timeIntervals: 30, timeCaption: "Time", previousMonthAriaLabel: "Previous Month", previousMonthButtonLabel: "Previous Month", nextMonthAriaLabel: "Next Month", nextMonthButtonLabel: "Next Month", previousYearAriaLabel: "Previous Year", previousYearButtonLabel: "Previous Year", nextYearAriaLabel: "Next Year", nextYearButtonLabel: "Next Year", timeInputLabel: "Time", enableTabLoop: true, yearItemNumber: xt, renderDayContents: function(e3) {
|
|
return e3;
|
|
}, focusSelectedMonth: false, showPopperArrow: true, excludeScrollbar: true, customTimeInput: null, calendarStartDay: void 0 };
|
|
} }]), r2;
|
|
}(de.default.Component), Xr = "input", Zr = "navigate";
|
|
e.CalendarContainer = Br, e.default = Jr, e.getDefaultLocale = Jt, e.registerLocale = function(e2, t2) {
|
|
var r2 = typeof window != "undefined" ? window : globalThis;
|
|
r2.__localeData__ || (r2.__localeData__ = {}), r2.__localeData__[e2] = t2;
|
|
}, e.setDefaultLocale = function(e2) {
|
|
(typeof window != "undefined" ? window : globalThis).__localeId__ = e2;
|
|
}, Object.defineProperty(e, "__esModule", { value: true });
|
|
});
|
|
}
|
|
});
|
|
|
|
// main.ts
|
|
__export(exports, {
|
|
default: () => NltPlugin
|
|
});
|
|
var import_obsidian4 = __toModule(require("obsidian"));
|
|
|
|
// src/NLTTable.tsx
|
|
var import_obsidian2 = __toModule(require("obsidian"));
|
|
var import_react31 = __toModule(require_react());
|
|
var import_react_dom2 = __toModule(require_react_dom());
|
|
|
|
// src/app/App.tsx
|
|
var import_react30 = __toModule(require_react());
|
|
|
|
// src/app/components/EditableTd/index.tsx
|
|
var import_react22 = __toModule(require_react());
|
|
var import_obsidian = __toModule(require("obsidian"));
|
|
|
|
// src/app/components/TextCell/index.tsx
|
|
var import_react = __toModule(require_react());
|
|
|
|
// node_modules/html-react-parser/index.mjs
|
|
var import_index = __toModule(require_html_react_parser());
|
|
var domToReact = import_index.default.domToReact;
|
|
var htmlToDOM = import_index.default.htmlToDOM;
|
|
var attributesToProps = import_index.default.attributesToProps;
|
|
var Element2 = import_index.default.Element;
|
|
var html_react_parser_default = import_index.default;
|
|
|
|
// src/app/services/string/toLink/index.ts
|
|
var toExternalLink = (url) => {
|
|
return `<a tabIndex={-1} href="${url}" target="_blank" rel="noopener">${url}</a>`;
|
|
};
|
|
var toFileLink = (fileName) => {
|
|
return `<a tabIndex={-1} data-href="${fileName}" href="${fileName}" class="internal-link" target="_blank" rel="noopener">${fileName}</a>`;
|
|
};
|
|
|
|
// src/app/services/string/strippers/index.ts
|
|
var stripPound = (tag) => {
|
|
return tag.replace("#", "");
|
|
};
|
|
var stripLink = (input) => {
|
|
const replaceWithSquareBrackets = (input.match(/class="internal-link"/) || []).length !== 0;
|
|
return input.replace(/<a.*?>/, replaceWithSquareBrackets ? "[[" : "").replace(/<\/a>/, replaceWithSquareBrackets ? "]]" : "");
|
|
};
|
|
var stripLinks = (input) => {
|
|
const matches = input.match(/<a.*?>.*?<\/a>/g) || [];
|
|
matches.forEach((match) => {
|
|
input = input.replace(match, stripLink(match));
|
|
});
|
|
return input;
|
|
};
|
|
var stripSquareBrackets = (input) => {
|
|
input = input.replace(/^\[\[/, "");
|
|
input = input.replace(/]]$/, "");
|
|
return input;
|
|
};
|
|
var sanitizeHTML = (innerHTML) => {
|
|
const temp = document.createElement("div");
|
|
temp.textContent = innerHTML;
|
|
return temp.innerHTML;
|
|
};
|
|
|
|
// src/app/services/string/regex/index.ts
|
|
var MARKDOWN_CELLS_REGEX = new RegExp(/[ \t]{0,}[^|\r\n]+[ \t]{0,}\|/g);
|
|
var MARKDOWN_ROWS_REGEX = new RegExp(/(\|[ ]{0,}.*[ ]{0,}\|){1,}/g);
|
|
var TAG_REGEX = new RegExp(/^[#][^\s]+$/);
|
|
var MARKDOWN_HYPHEN_CELL_REGEX = new RegExp(/[ \t]{0,}[-]{3,}[ \t]{0,}\|/);
|
|
var NUMBER_REGEX = new RegExp(/^\d+$/);
|
|
var EXTERNAL_LINK_REGEX = new RegExp(/https{0,1}:\/\/[^\s]*/g);
|
|
var TAGS_REGEX = new RegExp(/#[^ \t]+/g);
|
|
var FILE_LINK_REGEX = new RegExp(/\[\[[^\n\r\]]+]]/g);
|
|
var TABLE_ID_REGEX = new RegExp(/^table-id-[a-zA-Z0-9-]{1,}$/);
|
|
var ROW_ID_REGEX = new RegExp(/^row-id-[a-zA-Z0-9-]{1,}$/);
|
|
var COLUMN_ID_REGEX = new RegExp(/^column-id-[a-zA-Z0-9-]{1,}$/);
|
|
var LINE_BREAK_CHARACTER_REGEX = (flags) => new RegExp(/<br>/, flags);
|
|
var AMPERSAND_CHARACTER_REGEX = (flags) => new RegExp(/&amp;/, flags);
|
|
var BOLD_CHARACTER_STRONG_REGEX = (flags) => new RegExp(/<strong>.{1,}?;\/strong>/, flags);
|
|
var BOLD_CHARACTER_B_REGEX = (flags) => new RegExp(/<b>.{1,}?;\/b>/, flags);
|
|
var BOLD_CHARACTER_STRONG_PIECES_REGEX = new RegExp(/(<strong>).{1,}?(<\/strong>)/);
|
|
var BOLD_CHARACTER_B_PIECES_REGEX = new RegExp(/(<b>).{1,}?(<\/b>)/);
|
|
var ITALIC_CHARACTER_EM_REGEX = (flags) => new RegExp(/<em>.{1,}?<\/em>/, flags);
|
|
var ITALIC_CHARACTER_I_REGEX = (flags) => new RegExp(/<i>.{1,}?<\/i>/, flags);
|
|
var ITALIC_CHARACTER_EM_PIECES_REGEX = new RegExp(/(<em>).{1,}?(<\/em>)/);
|
|
var ITALIC_CHARACTER_I_PIECES_REGEX = new RegExp(/(<i>).{1,}?(<\/i>)/);
|
|
var HIGHLIGHT_CHARACTER_REGEX = (flags) => new RegExp(/<mark>.{1,}?<\/mark>/, flags);
|
|
var HIGHLIGHT_CHARACTER_PIECES_REGEX = new RegExp(/(<mark>).{1,}?(<\/mark>)/);
|
|
var UNDERLINE_CHARACTER_REGEX = (flags) => new RegExp(/<u>.{1,}?<\/u>/, flags);
|
|
var UNDERLINE_CHARACTER_PIECES_REGEX = new RegExp(/(<u>).{1,}?(<\/u>)/);
|
|
var BOLD_MARKDOWN_REGEX = (flags) => new RegExp(/\*\*.{1,}?\*\*/, flags);
|
|
var ITALIC_MARKDOWN_REGEX = (flags) => new RegExp(/\*.{1,}?\*/, flags);
|
|
var HIGHLIGHT_MARKDOWN_REGEX = (flags) => new RegExp(/==.{1,}?==/, flags);
|
|
var BOLD_MARKDOWN_PIECES_REGEX = new RegExp(/(\*\*).{1,}(\*\*)/);
|
|
var ITALIC_MARKDOWN_PIECES_REGEX = new RegExp(/(\*).{1,}(\*)/);
|
|
var HIGHLIGHT_MARKDOWN_PIECES_REGEX = new RegExp(/(==).{1,}(==)/);
|
|
var DATE_REGEX = new RegExp(/^\d{4}\/\d{2}\/\d{2}$/);
|
|
var CHECKBOX_REGEX = new RegExp(/^\[[x ]{0,1}\]$/);
|
|
var CHECKBOX_CHECKED_REGEX = new RegExp(/^\[[x]\]$/);
|
|
|
|
// src/app/services/string/validators/index.ts
|
|
var isNumber = (input) => {
|
|
return (input.match(NUMBER_REGEX) || []).length !== 0;
|
|
};
|
|
var isDate = (input) => {
|
|
return (input.match(DATE_REGEX) || []).length !== 0;
|
|
};
|
|
var isCheckBox = (input) => {
|
|
return (input.match(CHECKBOX_REGEX) || []).length !== 0;
|
|
};
|
|
var isCheckBoxChecked = (input) => {
|
|
return (input.match(CHECKBOX_CHECKED_REGEX) || []).length !== 0;
|
|
};
|
|
|
|
// src/app/constants.ts
|
|
var DEBUG = {
|
|
LOAD_APP_DATA: {
|
|
PARSED_TABLE: false,
|
|
DATA: false,
|
|
IDS: false,
|
|
TYPES: false,
|
|
MARKDOWN: false
|
|
},
|
|
APP: false,
|
|
SAVE_APP_DATA: false,
|
|
EDITABLE_TD: false,
|
|
FOCUS_PROVIDER: false,
|
|
MENU_PROVIDER: false
|
|
};
|
|
var TABBABLE_ELEMENT_TYPE = {
|
|
UNFOCUSED: "unfocused",
|
|
BUTTON: "button",
|
|
HEADER: "header",
|
|
CELL: "cell"
|
|
};
|
|
var CONTENT_TYPE = {
|
|
TEXT: "text",
|
|
NUMBER: "number",
|
|
TAG: "tag",
|
|
DATE: "date",
|
|
CHECKBOX: "checkbox",
|
|
MULTI_TAG: "multi-tag"
|
|
};
|
|
var COLOR = {
|
|
LIGHT_GRAY: "light gray",
|
|
GRAY: "gray",
|
|
BROWN: "brown",
|
|
ORANGE: "orange",
|
|
YELLOW: "yellow",
|
|
GREEN: "green",
|
|
BLUE: "blue",
|
|
PURPLE: "purple",
|
|
PINK: "pink",
|
|
RED: "red"
|
|
};
|
|
var ICON = {
|
|
KEYBOARD_ARROW_UP: "KeyboardArrowUp",
|
|
KEYBOARD_ARROW_DOWN: "KeyboardArrowDown",
|
|
KEYBOARD_DOUBLE_ARROW_UP: "KeyboardDoubleArrowUp",
|
|
KEYBOARD_DOUBLE_ARROW_DOWN: "KeyboardDoubleArrowDown",
|
|
KEYBOARD_ARROW_LEFT: "KeyboardArrowLeft",
|
|
KEYBOARD_ARROW_RIGHT: "KeyboardArrowRight",
|
|
KEYBOARD_DOUBLE_ARROW_LEFT: "KeyboardDoubleArrowLeft",
|
|
KEYBOARD_DOUBLE_ARROW_RIGHT: "KeyboardDoubleArrowRight",
|
|
KEYBOARD_BACKSPACE: "KeyboardBackspace",
|
|
DELETE: "Delete",
|
|
MORE_VERT: "MoreVert",
|
|
SORT: "Sort",
|
|
MOVE_UP: "MoveUp",
|
|
MOVE_DOWN: "MoveDown",
|
|
TEXT_SNIPPET: "TextSnippet",
|
|
EDIT: "Edit",
|
|
MORE_HORIZ: "MoreHoriz"
|
|
};
|
|
var MENU_LEVEL = {
|
|
ONE: 1,
|
|
TWO: 2,
|
|
THREE: 3
|
|
};
|
|
var BREAK_LINE_TAG = "<br>";
|
|
var AMPERSAND = "&";
|
|
var BOLD_TAG_MARKDOWN = "**";
|
|
var ITALIC_TAG_MARKDOWN = "*";
|
|
var HIGHLIGHT_TAG_MARKDOWN = "==";
|
|
var UNDERLINE_TAG_START = "<u>";
|
|
var UNDERLINE_TAG_CLOSE = "</u>";
|
|
var ITALIC_TAG_START = "<i>";
|
|
var ITALIC_TAG_CLOSE = "</i>";
|
|
var BOLD_TAG_START = "<b>";
|
|
var BOLD_TAG_CLOSE = "</b>";
|
|
var HIGHLIGHT_TAG_START = "<mark>";
|
|
var HIGHLIGHT_TAG_CLOSE = "</mark>";
|
|
|
|
// src/app/services/string/matchers/index.ts
|
|
var matchBoldMarkdown = (input) => {
|
|
return input.match(BOLD_MARKDOWN_REGEX("g")) || [];
|
|
};
|
|
var matchItalicMarkdown = (input) => {
|
|
return input.match(ITALIC_MARKDOWN_REGEX("g")) || [];
|
|
};
|
|
var matchHighlightMarkdown = (input) => {
|
|
return input.match(HIGHLIGHT_MARKDOWN_REGEX("g")) || [];
|
|
};
|
|
var matchBoldMarkdownPieces = (input) => {
|
|
return input.match(BOLD_MARKDOWN_PIECES_REGEX) || [];
|
|
};
|
|
var matchItalicMarkdownPieces = (input) => {
|
|
return input.match(ITALIC_MARKDOWN_PIECES_REGEX) || [];
|
|
};
|
|
var matchHighlightMarkdownPieces = (input) => {
|
|
return input.match(HIGHLIGHT_MARKDOWN_PIECES_REGEX) || [];
|
|
};
|
|
var matchBoldTags = (input) => {
|
|
return [
|
|
...input.match(BOLD_CHARACTER_B_REGEX("g")) || [],
|
|
...input.match(BOLD_CHARACTER_STRONG_REGEX("g")) || []
|
|
];
|
|
};
|
|
var matchBoldTagBPieces = (input) => {
|
|
return input.match(BOLD_CHARACTER_B_PIECES_REGEX);
|
|
};
|
|
var matchBoldTagStrongPieces = (input) => {
|
|
return input.match(BOLD_CHARACTER_STRONG_PIECES_REGEX);
|
|
};
|
|
var matchItalicTags = (input) => {
|
|
return [
|
|
...input.match(ITALIC_CHARACTER_I_REGEX("g")) || [],
|
|
...input.match(ITALIC_CHARACTER_EM_REGEX("g")) || []
|
|
];
|
|
};
|
|
var matchItalicTagEmPieces = (input) => {
|
|
return input.match(ITALIC_CHARACTER_EM_PIECES_REGEX) || [];
|
|
};
|
|
var matchItalicTagIPieces = (input) => {
|
|
return input.match(ITALIC_CHARACTER_I_PIECES_REGEX) || [];
|
|
};
|
|
var matchHighlightTags = (input) => {
|
|
return input.match(HIGHLIGHT_CHARACTER_REGEX("g")) || [];
|
|
};
|
|
var matchHighlightTagPieces = (input) => {
|
|
return input.match(HIGHLIGHT_CHARACTER_PIECES_REGEX) || [];
|
|
};
|
|
var matchUnderlineTags = (input) => {
|
|
return input.match(UNDERLINE_CHARACTER_REGEX("g")) || [];
|
|
};
|
|
var matchUnderlineTagPieces = (input) => {
|
|
return input.match(UNDERLINE_CHARACTER_PIECES_REGEX) || [];
|
|
};
|
|
var matchURLs = (input) => {
|
|
return input.match(EXTERNAL_LINK_REGEX) || [];
|
|
};
|
|
var matchFileLinks = (input) => {
|
|
return input.match(FILE_LINK_REGEX) || [];
|
|
};
|
|
var findContentType = (content, columnContentType) => {
|
|
if (content === "")
|
|
return columnContentType;
|
|
if (columnContentType === CONTENT_TYPE.TEXT)
|
|
return CONTENT_TYPE.TEXT;
|
|
if (columnContentType === CONTENT_TYPE.TAG)
|
|
return CONTENT_TYPE.TAG;
|
|
if (isNumber(content))
|
|
return CONTENT_TYPE.NUMBER;
|
|
if (isDate(content))
|
|
return CONTENT_TYPE.DATE;
|
|
if (isCheckBox(content))
|
|
return CONTENT_TYPE.CHECKBOX;
|
|
return CONTENT_TYPE.TEXT;
|
|
};
|
|
|
|
// src/app/services/string/parsers/index.ts
|
|
var parseFileLinks = (input) => {
|
|
const matches = matchFileLinks(input);
|
|
matches.forEach((match) => {
|
|
const replacement = toFileLink(stripSquareBrackets(match));
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseURLs = (input) => {
|
|
const matches = matchURLs(input);
|
|
matches.forEach((match) => {
|
|
const replacement = toExternalLink(match);
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseBoldMarkdown = (input) => {
|
|
const matches = matchBoldMarkdown(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
const pieces = matchBoldMarkdownPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], BOLD_TAG_START);
|
|
replacement = replacement.replace(pieces[2], BOLD_TAG_CLOSE);
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseItalicMarkdown = (input) => {
|
|
const matches = matchItalicMarkdown(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
const pieces = matchItalicMarkdownPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], ITALIC_TAG_START);
|
|
replacement = replacement.replace(pieces[2], ITALIC_TAG_CLOSE);
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseHighlightMarkdown = (input) => {
|
|
const matches = matchHighlightMarkdown(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
const pieces = matchHighlightMarkdownPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], HIGHLIGHT_TAG_START);
|
|
replacement = replacement.replace(pieces[2], HIGHLIGHT_TAG_CLOSE);
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseBoldTags = (input) => {
|
|
const matches = matchBoldTags(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
let pieces = [];
|
|
if (match.includes("<strong")) {
|
|
pieces = matchBoldTagStrongPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], BOLD_TAG_MARKDOWN);
|
|
replacement = replacement.replace(pieces[2], BOLD_TAG_MARKDOWN);
|
|
}
|
|
} else {
|
|
pieces = matchBoldTagBPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], BOLD_TAG_START);
|
|
replacement = replacement.replace(pieces[2], BOLD_TAG_CLOSE);
|
|
}
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseItalicTags = (input) => {
|
|
const matches = matchItalicTags(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
let pieces = [];
|
|
if (match.includes("<em")) {
|
|
pieces = matchItalicTagEmPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], ITALIC_TAG_MARKDOWN);
|
|
replacement = replacement.replace(pieces[2], ITALIC_TAG_MARKDOWN);
|
|
}
|
|
} else {
|
|
pieces = matchItalicTagIPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], ITALIC_TAG_START);
|
|
replacement = replacement.replace(pieces[2], ITALIC_TAG_CLOSE);
|
|
}
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseHighlightTags = (input) => {
|
|
const matches = matchHighlightTags(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
const pieces = matchHighlightTagPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], HIGHLIGHT_TAG_MARKDOWN);
|
|
replacement = replacement.replace(pieces[2], HIGHLIGHT_TAG_MARKDOWN);
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var parseUnderlineTags = (input) => {
|
|
const matches = matchUnderlineTags(input);
|
|
matches.forEach((match) => {
|
|
let replacement = match;
|
|
const pieces = matchUnderlineTagPieces(match);
|
|
if (pieces.length >= 3) {
|
|
replacement = replacement.replace(pieces[1], UNDERLINE_TAG_START);
|
|
replacement = replacement.replace(pieces[2], UNDERLINE_TAG_CLOSE);
|
|
}
|
|
input = input.replace(match, replacement);
|
|
});
|
|
return input;
|
|
};
|
|
var dateToString = (date) => {
|
|
const year = date.getFullYear();
|
|
const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
const day = ("0" + date.getDate()).slice(-2);
|
|
return `${year}/${month}/${day}`;
|
|
};
|
|
|
|
// src/app/components/TextCell/index.tsx
|
|
function TextCell({ text }) {
|
|
text = parseURLs(text);
|
|
text = parseFileLinks(text);
|
|
text = parseBoldMarkdown(text);
|
|
text = parseItalicMarkdown(text);
|
|
text = parseHighlightMarkdown(text);
|
|
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
className: "NLT__text-cell"
|
|
}, html_react_parser_default(text));
|
|
}
|
|
|
|
// src/app/components/TagCell/index.tsx
|
|
var import_react2 = __toModule(require_react());
|
|
var import_Close = __toModule(require_Close());
|
|
|
|
// src/app/services/color/index.ts
|
|
var findColorClass = (color) => {
|
|
switch (color) {
|
|
case COLOR.LIGHT_GRAY:
|
|
return "NLT__color--light-gray";
|
|
case COLOR.GRAY:
|
|
return "NLT__color--gray";
|
|
case COLOR.BROWN:
|
|
return "NLT__color--brown";
|
|
case COLOR.ORANGE:
|
|
return "NLT__color--orange";
|
|
case COLOR.YELLOW:
|
|
return "NLT__color--yellow";
|
|
case COLOR.GREEN:
|
|
return "NLT__color--green";
|
|
case COLOR.BLUE:
|
|
return "NLT__color--blue";
|
|
case COLOR.PURPLE:
|
|
return "NLT__color--purple";
|
|
case COLOR.PINK:
|
|
return "NLT__color--pink";
|
|
case COLOR.RED:
|
|
return "NLT__color--red";
|
|
default:
|
|
return "";
|
|
}
|
|
};
|
|
|
|
// src/app/components/TagCell/index.tsx
|
|
function TagCell({
|
|
cellId,
|
|
id,
|
|
content,
|
|
color,
|
|
showRemove,
|
|
selectable,
|
|
style,
|
|
isCreate,
|
|
showLink = false,
|
|
onRemoveClick
|
|
}) {
|
|
let tagClass = "NLT__tag";
|
|
tagClass += " " + findColorClass(color);
|
|
let cellClass = "NLT__tag-cell";
|
|
if (selectable)
|
|
cellClass += " NLT__selectable";
|
|
if (content === "")
|
|
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null);
|
|
if (showLink) {
|
|
}
|
|
content = stripPound(content);
|
|
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
className: cellClass,
|
|
style
|
|
}, isCreate && /* @__PURE__ */ import_react2.default.createElement("div", null, "Create\xA0"), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
className: tagClass
|
|
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
className: "NLT__tag-content"
|
|
}, html_react_parser_default(content)), showRemove && /* @__PURE__ */ import_react2.default.createElement(import_Close.default, {
|
|
className: "NLT__icon--md NLT__margin-left NLT__icon--selectable",
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onRemoveClick(cellId, id);
|
|
}
|
|
})));
|
|
}
|
|
|
|
// src/app/components/ErrorCell/index.tsx
|
|
var import_react3 = __toModule(require_react());
|
|
function ErrorCell({ expectedType, type }) {
|
|
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
className: "NLT__error"
|
|
}, "Invalid data. Type: ", type, " Expected type: ", expectedType);
|
|
}
|
|
|
|
// src/app/components/CheckboxCell/index.tsx
|
|
var import_react4 = __toModule(require_react());
|
|
function CheckboxCell({ isChecked, onCheckboxChange }) {
|
|
return /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
className: "NLT__checkbox-cell",
|
|
onClick: () => onCheckboxChange(!isChecked)
|
|
}, /* @__PURE__ */ import_react4.default.createElement("input", {
|
|
className: "task-list-item-checkbox",
|
|
type: "checkbox",
|
|
checked: isChecked,
|
|
onChange: () => {
|
|
},
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onCheckboxChange(!isChecked);
|
|
}
|
|
}));
|
|
}
|
|
|
|
// src/app/components/DateCell/index.tsx
|
|
var import_react5 = __toModule(require_react());
|
|
function DateCell({ text }) {
|
|
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
className: "NLT__date-cell"
|
|
}, text);
|
|
}
|
|
|
|
// src/app/components/NumberCell/index.tsx
|
|
var import_react6 = __toModule(require_react());
|
|
function NumberCell({ number }) {
|
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
className: "NLT__number-cell"
|
|
}, number);
|
|
}
|
|
|
|
// src/app/components/NumberCellEdit/index.tsx
|
|
var import_react11 = __toModule(require_react());
|
|
|
|
// src/app/services/hooks/index.ts
|
|
var import_react9 = __toModule(require_react());
|
|
|
|
// src/app/components/MenuProvider/index.tsx
|
|
var import_react8 = __toModule(require_react());
|
|
|
|
// src/app/services/appData/state/cell.ts
|
|
var Cell = class {
|
|
constructor(id, rowId, headerId, type) {
|
|
this.id = id;
|
|
this.rowId = rowId;
|
|
this.headerId = headerId;
|
|
this.type = type;
|
|
}
|
|
toString() {
|
|
return "";
|
|
}
|
|
length() {
|
|
return 0;
|
|
}
|
|
};
|
|
var TextCell2 = class extends Cell {
|
|
constructor(id, rowId, headerId, text = "") {
|
|
super(id, rowId, headerId, CONTENT_TYPE.TEXT);
|
|
this.text = text;
|
|
}
|
|
length() {
|
|
return this.text.length;
|
|
}
|
|
toString() {
|
|
return this.text;
|
|
}
|
|
};
|
|
var NumberCell2 = class extends Cell {
|
|
constructor(id, rowId, headerId, number = -1) {
|
|
super(id, rowId, headerId, CONTENT_TYPE.NUMBER);
|
|
this.number = number;
|
|
}
|
|
length() {
|
|
if (this.number === -1)
|
|
return 0;
|
|
return this.number.toString().length;
|
|
}
|
|
toString() {
|
|
if (this.number === -1)
|
|
return "";
|
|
return this.number.toString();
|
|
}
|
|
};
|
|
var TagCell2 = class extends Cell {
|
|
constructor(id, rowId, headerId) {
|
|
super(id, rowId, headerId, CONTENT_TYPE.TAG);
|
|
}
|
|
};
|
|
var CheckBoxCell = class extends Cell {
|
|
constructor(id, rowId, headerId, isChecked = false) {
|
|
super(id, rowId, headerId, CONTENT_TYPE.CHECKBOX);
|
|
this.isChecked = isChecked;
|
|
}
|
|
length() {
|
|
if (this.isChecked) {
|
|
return "[x]".length;
|
|
} else {
|
|
return "[ ]".length;
|
|
}
|
|
}
|
|
toString() {
|
|
if (this.isChecked) {
|
|
return "[x]";
|
|
} else {
|
|
return "[ ]";
|
|
}
|
|
}
|
|
};
|
|
var DateCell2 = class extends Cell {
|
|
constructor(id, rowId, headerId, date) {
|
|
super(id, rowId, headerId, CONTENT_TYPE.DATE);
|
|
this.date = date;
|
|
}
|
|
length() {
|
|
if (this.date !== null) {
|
|
return "YYYY/MM/DD".length;
|
|
} else {
|
|
return 0;
|
|
}
|
|
}
|
|
toString() {
|
|
if (this.date !== null) {
|
|
const day = ("0" + this.date.getDate()).slice(-2);
|
|
const month = ("0" + (this.date.getMonth() + 1)).slice(-2);
|
|
const year = this.date.getFullYear();
|
|
return `${year}/${month}/${day}`;
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
};
|
|
|
|
// src/app/services/appData/external/saveUtils.ts
|
|
var sortAppDataForSave = (data) => {
|
|
const obj = __spreadValues({}, data);
|
|
obj.rows.sort((a, b) => a.initialIndex - b.initialIndex);
|
|
return obj;
|
|
};
|
|
var appDataToMarkdown = (data) => {
|
|
const columnCharLengths = calcColumnCharLengths(data);
|
|
const buffer = new AppDataStringBuffer();
|
|
buffer.createRow();
|
|
data.headers.forEach((header, i) => {
|
|
buffer.writeColumn(header.content, columnCharLengths[i]);
|
|
});
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length; i++) {
|
|
const content = Array(columnCharLengths[i]).fill("-").join("");
|
|
buffer.writeColumn(content, columnCharLengths[i]);
|
|
}
|
|
data.rows.forEach((row) => {
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length; i++) {
|
|
const cell = data.cells.find((cell2) => cell2.rowId === row.id && cell2.headerId === data.headers[i].id);
|
|
if (cell.type === CONTENT_TYPE.TAG) {
|
|
const tags = data.tags.filter((tag) => tag.selected.includes(cell.id));
|
|
let content = "";
|
|
tags.forEach((tag, j) => {
|
|
if (tag.content === "")
|
|
return;
|
|
if (j === 0)
|
|
content += tag.content;
|
|
else
|
|
content += " " + tag.content;
|
|
});
|
|
buffer.writeColumn(content, columnCharLengths[i]);
|
|
} else {
|
|
buffer.writeColumn(cell.toString(), columnCharLengths[i]);
|
|
}
|
|
}
|
|
});
|
|
return buffer.toString();
|
|
};
|
|
var findTableRegex = (headers, rows) => {
|
|
const regex = [];
|
|
regex[0] = findHeaderRow(headers);
|
|
regex[1] = findHyphenRow(headers.length);
|
|
for (let i = 0; i < rows.length; i++) {
|
|
regex[i + 2] = findRow(headers.length);
|
|
}
|
|
const expression = new RegExp(regex.join("\n"));
|
|
return expression;
|
|
};
|
|
var findHeaderRow = (headers) => {
|
|
let regex = "\\|";
|
|
headers.forEach((header) => {
|
|
regex += `[ \\t]{0,}${header.content}[ \\t]{0,}\\|`;
|
|
});
|
|
return regex;
|
|
};
|
|
var findHyphenRow = (numColumns) => {
|
|
let regex = "\\|";
|
|
for (let i = 0; i < numColumns; i++)
|
|
regex += "[ \\t]{0,}[-]{3,}[ \\t]{0,}\\|";
|
|
return regex;
|
|
};
|
|
var findRow = (numColumns) => {
|
|
let regex = "\\|";
|
|
for (let i = 0; i < numColumns; i++)
|
|
regex += ".*\\|";
|
|
return regex;
|
|
};
|
|
var AppDataStringBuffer = class {
|
|
constructor() {
|
|
this.string = "";
|
|
}
|
|
createRow() {
|
|
if (this.string !== "")
|
|
this.string += "\n";
|
|
this.string += "|";
|
|
}
|
|
writeColumn(content, columnCharLength) {
|
|
this.string += " ";
|
|
this.string += content;
|
|
const numWhiteSpace = columnCharLength - content.length;
|
|
for (let i = 0; i < numWhiteSpace; i++)
|
|
this.string += " ";
|
|
this.string += " ";
|
|
this.string += "|";
|
|
}
|
|
toString() {
|
|
return this.string;
|
|
}
|
|
};
|
|
var calcColumnCharLengths = (data) => {
|
|
const columnCharLengths = [];
|
|
data.headers.forEach((header, i) => {
|
|
columnCharLengths[i] = header.content.length;
|
|
});
|
|
data.cells.forEach((cell) => {
|
|
if (cell instanceof Cell) {
|
|
const index = data.headers.findIndex((header) => header.id === cell.headerId);
|
|
if (cell.type === CONTENT_TYPE.TAG) {
|
|
const arr = data.tags.filter((tag) => tag.selected.includes(cell.id));
|
|
let content = "";
|
|
arr.forEach((tag, i) => {
|
|
if (tag.content !== "") {
|
|
if (i === 0)
|
|
content += tag.content;
|
|
else
|
|
content += " " + tag.content;
|
|
}
|
|
});
|
|
if (columnCharLengths[index] < content.length)
|
|
columnCharLengths[index] = content.length;
|
|
} else {
|
|
if (columnCharLengths[index] < cell.length())
|
|
columnCharLengths[index] = cell.length();
|
|
}
|
|
}
|
|
});
|
|
return columnCharLengths;
|
|
};
|
|
|
|
// src/app/services/appData/debug/index.ts
|
|
var logFunc = (componentName, functionName, args = {}) => {
|
|
console.log(`[${componentName}]: ${functionName}(${Object.keys(args).join(", ")})`);
|
|
if (Object.keys(args).length !== 0)
|
|
console.log(args);
|
|
};
|
|
var appDataIdsToMarkdown = (data) => {
|
|
const columnCharLengths = calcColumnCharLengths(data);
|
|
const buffer = new AppDataStringBuffer();
|
|
buffer.createRow();
|
|
data.headers.forEach((header, i) => {
|
|
buffer.writeColumn(header.content, columnCharLengths[i]);
|
|
});
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length + 1; i++) {
|
|
const content = Array(columnCharLengths[i]).fill("-").join("");
|
|
buffer.writeColumn(content, columnCharLengths[i]);
|
|
}
|
|
data.rows.forEach((row) => {
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length; i++) {
|
|
const cell = data.cells.find((cell2) => cell2.rowId === row.id && cell2.headerId === data.headers[i].id);
|
|
if (cell.type === CONTENT_TYPE.TAG) {
|
|
const tagIds = data.tags.filter((tag) => tag.selected.includes(cell.id)).map((tag) => tag.id);
|
|
buffer.writeColumn(tagIds.join(", "), columnCharLengths[i]);
|
|
} else {
|
|
buffer.writeColumn(cell.id, columnCharLengths[i]);
|
|
}
|
|
}
|
|
});
|
|
return buffer.toString();
|
|
};
|
|
var appDataTypesToMarkdown = (data) => {
|
|
const columnCharLengths = calcColumnCharLengths(data);
|
|
const buffer = new AppDataStringBuffer();
|
|
buffer.createRow();
|
|
data.headers.forEach((header, i) => {
|
|
buffer.writeColumn(header.content, columnCharLengths[i]);
|
|
});
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length; i++) {
|
|
const content = Array(columnCharLengths[i]).fill("-").join("");
|
|
buffer.writeColumn(content, columnCharLengths[i]);
|
|
}
|
|
data.rows.forEach((row) => {
|
|
buffer.createRow();
|
|
for (let i = 0; i < data.headers.length; i++) {
|
|
const cell = data.cells.find((cell2) => cell2.rowId === row.id && cell2.headerId === data.headers[i].id);
|
|
buffer.writeColumn(cell.type, columnCharLengths[i]);
|
|
}
|
|
});
|
|
return buffer.toString();
|
|
};
|
|
|
|
// src/app/components/FocusProvider/index.tsx
|
|
var import_react7 = __toModule(require_react());
|
|
|
|
// node_modules/uuid/dist/esm-browser/rng.js
|
|
var getRandomValues;
|
|
var rnds8 = new Uint8Array(16);
|
|
function rng() {
|
|
if (!getRandomValues) {
|
|
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
|
|
if (!getRandomValues) {
|
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
}
|
|
}
|
|
return getRandomValues(rnds8);
|
|
}
|
|
|
|
// node_modules/uuid/dist/esm-browser/regex.js
|
|
var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
|
|
// node_modules/uuid/dist/esm-browser/validate.js
|
|
function validate(uuid) {
|
|
return typeof uuid === "string" && regex_default.test(uuid);
|
|
}
|
|
var validate_default = validate;
|
|
|
|
// node_modules/uuid/dist/esm-browser/stringify.js
|
|
var byteToHex = [];
|
|
for (i = 0; i < 256; ++i) {
|
|
byteToHex.push((i + 256).toString(16).substr(1));
|
|
}
|
|
var i;
|
|
function stringify(arr) {
|
|
var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
if (!validate_default(uuid)) {
|
|
throw TypeError("Stringified UUID is invalid");
|
|
}
|
|
return uuid;
|
|
}
|
|
var stringify_default = stringify;
|
|
|
|
// node_modules/uuid/dist/esm-browser/v4.js
|
|
function v4(options, buf, offset) {
|
|
options = options || {};
|
|
var rnds = options.random || (options.rng || rng)();
|
|
rnds[6] = rnds[6] & 15 | 64;
|
|
rnds[8] = rnds[8] & 63 | 128;
|
|
if (buf) {
|
|
offset = offset || 0;
|
|
for (var i = 0; i < 16; ++i) {
|
|
buf[offset + i] = rnds[i];
|
|
}
|
|
return buf;
|
|
}
|
|
return stringify_default(rnds);
|
|
}
|
|
var v4_default = v4;
|
|
|
|
// src/app/services/appData/external/loadUtils.ts
|
|
var import_crc_32 = __toModule(require_crc32());
|
|
|
|
// src/app/components/HeaderMenu/constants.ts
|
|
var SUBMENU = {
|
|
EDIT: {
|
|
name: "edit",
|
|
content: "Edit",
|
|
icon: ICON.EDIT
|
|
},
|
|
SORT: {
|
|
name: "sort",
|
|
content: "Sort",
|
|
icon: ICON.SORT
|
|
},
|
|
MOVE: {
|
|
name: "move",
|
|
content: "Move",
|
|
icon: ICON.MOVE_UP
|
|
},
|
|
INSERT: {
|
|
name: "insert",
|
|
content: "Insert",
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_RIGHT
|
|
},
|
|
TYPE: {
|
|
name: "type",
|
|
content: "Type",
|
|
icon: ICON.TEXT_SNIPPET
|
|
}
|
|
};
|
|
var TYPE_ITEMS = [
|
|
{ name: "text", content: "Text", type: CONTENT_TYPE.TEXT },
|
|
{ name: "number", content: "Number", type: CONTENT_TYPE.NUMBER },
|
|
{ name: "tag", content: "Tag", type: CONTENT_TYPE.TAG },
|
|
{ name: "date", content: "Date", type: CONTENT_TYPE.DATE },
|
|
{ name: "checkbox", content: "Checkbox", type: CONTENT_TYPE.CHECKBOX }
|
|
];
|
|
var SORT = {
|
|
DEFAULT: {
|
|
name: "default",
|
|
content: "Default",
|
|
icon: ICON.SORT
|
|
},
|
|
ASC: {
|
|
name: "asc",
|
|
content: "Ascending",
|
|
icon: ICON.KEYBOARD_ARROW_UP
|
|
},
|
|
DESC: {
|
|
name: "desc",
|
|
content: "Descending",
|
|
icon: ICON.KEYBOARD_ARROW_DOWN
|
|
}
|
|
};
|
|
|
|
// src/app/services/appData/state/header.ts
|
|
var initialHeader = (id, initialIndex, content) => {
|
|
return {
|
|
id,
|
|
initialIndex,
|
|
content,
|
|
sortName: SORT.DEFAULT.name,
|
|
width: "100px",
|
|
type: CONTENT_TYPE.TEXT
|
|
};
|
|
};
|
|
|
|
// src/app/services/appData/state/row.ts
|
|
var initialRow = (id, initialIndex, creationTime) => {
|
|
return {
|
|
id,
|
|
initialIndex,
|
|
creationTime
|
|
};
|
|
};
|
|
|
|
// src/app/services/random/index.ts
|
|
var randomColor = () => {
|
|
const index = Math.floor(Math.random() * Object.keys(COLOR).length);
|
|
return Object.values(COLOR)[index];
|
|
};
|
|
var getCurrentTimeWithOffset = () => {
|
|
return Math.round(Date.now() - Math.random() * 1e3);
|
|
};
|
|
|
|
// src/app/services/appData/external/loadUtils.ts
|
|
var parseTableFromEl = (el) => {
|
|
const table = [];
|
|
const tr = el.getElementsByTagName("tr");
|
|
const th = tr[0].getElementsByTagName("th");
|
|
let row = [];
|
|
for (let i = 0; i < th.length; i++)
|
|
row.push(th[i].textContent);
|
|
table.push(row);
|
|
for (let i = 1; i < tr.length; i++) {
|
|
const td = tr[i].getElementsByTagName("td");
|
|
row = [];
|
|
for (let j = 0; j < td.length; j++) {
|
|
let sanitized = sanitizeHTML(td[j].innerHTML);
|
|
sanitized = stripLinks(sanitized);
|
|
row.push(sanitized);
|
|
}
|
|
table.push(row);
|
|
}
|
|
return table;
|
|
};
|
|
var findCurrentViewType = (el) => {
|
|
let currentViewType = "reading";
|
|
if (el.className.includes("markdown-rendered"))
|
|
currentViewType = "live-preview";
|
|
return currentViewType;
|
|
};
|
|
var findTableIndex = (headers) => {
|
|
return "0";
|
|
};
|
|
var findAppData = (parsedTable) => {
|
|
const headers = [];
|
|
const rows = [];
|
|
const cells = [];
|
|
const tags = [];
|
|
parsedTable.forEach((parsedRow, i) => {
|
|
if (i === 0) {
|
|
parsedRow.forEach((th, j) => {
|
|
headers.push(initialHeader(v4_default(), j, th));
|
|
});
|
|
} else {
|
|
const row = initialRow(v4_default(), i - 1, getCurrentTimeWithOffset());
|
|
parsedRow.forEach((td, j) => {
|
|
const cell = findTextCell(v4_default(), row.id, headers[j].id, td);
|
|
cells.push(cell);
|
|
});
|
|
rows.push(row);
|
|
}
|
|
});
|
|
return {
|
|
headers,
|
|
rows,
|
|
cells,
|
|
tags
|
|
};
|
|
};
|
|
var findTextCell = (cellId, rowId, headerId, content) => {
|
|
content = content.replace(LINE_BREAK_CHARACTER_REGEX("g"), BREAK_LINE_TAG);
|
|
content = content.replace(AMPERSAND_CHARACTER_REGEX("g"), AMPERSAND);
|
|
content = parseBoldTags(content);
|
|
content = parseItalicTags(content);
|
|
content = parseHighlightTags(content);
|
|
content = parseUnderlineTags(content);
|
|
return new TextCell2(cellId, rowId, headerId, content);
|
|
};
|
|
var findNumberCell = (cellId, rowId, headerId, content) => {
|
|
const number = content === "" ? -1 : parseInt(content);
|
|
return new NumberCell2(cellId, rowId, headerId, number);
|
|
};
|
|
var findTagCell = (cellId, rowId, headerId) => {
|
|
return new TagCell2(cellId, rowId, headerId);
|
|
};
|
|
var findCheckboxCell = (cellId, rowId, headerId, content) => {
|
|
const isChecked = isCheckBoxChecked(content);
|
|
return new CheckBoxCell(cellId, rowId, headerId, isChecked);
|
|
};
|
|
var findDateCell = (cellId, rowId, headerId, content) => {
|
|
const date = content === "" ? null : new Date(content);
|
|
return new DateCell2(cellId, rowId, headerId, date);
|
|
};
|
|
var findNewCell = (cellId, rowId, headerId, headerType, content = "") => {
|
|
const cellType = findContentType(content, headerType);
|
|
switch (cellType) {
|
|
case CONTENT_TYPE.TEXT:
|
|
return findTextCell(cellId, rowId, headerId, content);
|
|
case CONTENT_TYPE.NUMBER:
|
|
return findNumberCell(cellId, rowId, headerId, content);
|
|
case CONTENT_TYPE.TAG:
|
|
return findTagCell(cellId, rowId, headerId);
|
|
case CONTENT_TYPE.DATE:
|
|
return findDateCell(cellId, rowId, headerId, content);
|
|
case CONTENT_TYPE.CHECKBOX:
|
|
return findCheckboxCell(cellId, rowId, headerId, content);
|
|
default:
|
|
return new Cell(cellId, rowId, headerId);
|
|
}
|
|
};
|
|
|
|
// src/app/components/FocusProvider/index.tsx
|
|
var FocusContext = import_react7.default.createContext(false);
|
|
var useTableFocus = () => {
|
|
return (0, import_react7.useContext)(FocusContext);
|
|
};
|
|
var COMPONENT_NAME = "FocusProvider";
|
|
function FocusProvider({
|
|
children,
|
|
plugin,
|
|
tableIndex,
|
|
sourcePath,
|
|
el
|
|
}) {
|
|
const [isFocused, setFocus] = (0, import_react7.useState)(false);
|
|
function handleFocus() {
|
|
if (DEBUG.FOCUS_PROVIDER)
|
|
logFunc(COMPONENT_NAME, "handleFocus");
|
|
setFocus(true);
|
|
plugin.focusTable(tableIndex, sourcePath, findCurrentViewType(el));
|
|
}
|
|
function handleBlur() {
|
|
if (DEBUG.FOCUS_PROVIDER)
|
|
logFunc(COMPONENT_NAME, "handleBlur");
|
|
setFocus(false);
|
|
plugin.blurTable();
|
|
}
|
|
const divRef = (0, import_react7.useCallback)((node) => {
|
|
if (node) {
|
|
if (plugin.focused) {
|
|
if (plugin.focused.sourcePath === sourcePath && plugin.focused.tableIndex === tableIndex) {
|
|
setTimeout(() => {
|
|
handleFocus();
|
|
}, 1);
|
|
}
|
|
}
|
|
}
|
|
}, []);
|
|
(0, import_react7.useEffect)(() => {
|
|
function handleMouseUp(e) {
|
|
if (e.target instanceof Element) {
|
|
let el2 = e.target;
|
|
let isFocused2 = false;
|
|
while (el2) {
|
|
if (el2.className === "view-content")
|
|
break;
|
|
if (typeof el2.className === "string") {
|
|
if (el2.className.includes("NLT")) {
|
|
isFocused2 = true;
|
|
break;
|
|
}
|
|
}
|
|
el2 = el2.parentElement;
|
|
}
|
|
if (isFocused2) {
|
|
handleFocus();
|
|
} else {
|
|
handleBlur();
|
|
}
|
|
}
|
|
}
|
|
window.addEventListener("mouseup", handleMouseUp);
|
|
return () => window.removeEventListener("mouseup", handleMouseUp);
|
|
}, []);
|
|
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
ref: divRef,
|
|
onClick: (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
}, /* @__PURE__ */ import_react7.default.createElement(FocusContext.Provider, {
|
|
value: isFocused
|
|
}, children));
|
|
}
|
|
|
|
// src/app/components/MenuProvider/index.tsx
|
|
var MenuContext = import_react8.default.createContext(null);
|
|
var COMPONENT_NAME2 = "MenuProvider";
|
|
var useMenu = (id, level) => {
|
|
const { openMenu, closeMenu, isMenuOpen, isMenuRequestingClose } = (0, import_react8.useContext)(MenuContext);
|
|
return {
|
|
isMenuOpen: isMenuOpen(id),
|
|
isMenuRequestingClose: isMenuRequestingClose(id),
|
|
openMenu: () => openMenu(id, level),
|
|
closeMenu: () => closeMenu(id)
|
|
};
|
|
};
|
|
function MenuProvider({ children }) {
|
|
const [openMenus, setOpenMenus] = (0, import_react8.useState)([]);
|
|
const isFocused = useTableFocus();
|
|
function canOpenMenu(level) {
|
|
if (openMenus.length === 0)
|
|
return true;
|
|
if (openMenus.every((menu) => menu.level < level))
|
|
return true;
|
|
return false;
|
|
}
|
|
function openMenu(id, level) {
|
|
if (DEBUG.MENU_PROVIDER)
|
|
logFunc(COMPONENT_NAME2, "openMenu", { id, level });
|
|
if (canOpenMenu(level)) {
|
|
setOpenMenus((prevState) => [
|
|
...prevState,
|
|
{ id, level, isRequestingClose: false }
|
|
]);
|
|
}
|
|
}
|
|
function isMenuRequestingClose(id) {
|
|
const menu = openMenus.find((menu2) => menu2.id === id);
|
|
if (menu) {
|
|
if (menu.isRequestingClose) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isMenuOpen(id) {
|
|
if (openMenus.find((menu) => menu.id === id))
|
|
return true;
|
|
return false;
|
|
}
|
|
function closeAllMenus() {
|
|
return __async(this, null, function* () {
|
|
if (DEBUG.MENU_PROVIDER)
|
|
logFunc(COMPONENT_NAME2, "closeAllMenus");
|
|
for (let i = 0; i < openMenus.length; i++) {
|
|
const menu = openMenus[i];
|
|
requestMenuClose(menu.id);
|
|
}
|
|
});
|
|
}
|
|
function requestMenuClose(id) {
|
|
if (DEBUG.MENU_PROVIDER)
|
|
logFunc(COMPONENT_NAME2, "requestMenuClose", { id });
|
|
setOpenMenus((prevState) => {
|
|
return prevState.map((menu) => {
|
|
if (menu.id === id) {
|
|
return __spreadProps(__spreadValues({}, menu), {
|
|
isRequestingClose: true
|
|
});
|
|
}
|
|
return menu;
|
|
});
|
|
});
|
|
}
|
|
function closeMenu(id) {
|
|
return __async(this, null, function* () {
|
|
if (DEBUG.MENU_PROVIDER)
|
|
logFunc(COMPONENT_NAME2, "closeMenu", { id });
|
|
if (isMenuOpen(id)) {
|
|
setOpenMenus((prevState) => prevState.filter((menu) => menu.id !== id));
|
|
}
|
|
});
|
|
}
|
|
function handleClick(e) {
|
|
return __async(this, null, function* () {
|
|
if (isFocused && openMenus.length !== 0) {
|
|
if (e.target instanceof HTMLElement) {
|
|
let el = e.target;
|
|
while (el.id === "" && el.className !== "NLT__app") {
|
|
el = el.parentElement;
|
|
}
|
|
const menu = findTopMenu();
|
|
if (el.id !== menu.id) {
|
|
yield requestMenuClose(menu.id);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function handleKeyUp(e) {
|
|
return __async(this, null, function* () {
|
|
if (isFocused && openMenus.length !== 0) {
|
|
if (e.key === "Enter") {
|
|
const menu = findTopMenu();
|
|
yield requestMenuClose(menu.id);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function findTopMenu() {
|
|
let topMenu = openMenus[0];
|
|
openMenus.forEach((menu) => {
|
|
if (menu.level > topMenu.level)
|
|
topMenu = menu;
|
|
});
|
|
return topMenu;
|
|
}
|
|
(0, import_react8.useEffect)(() => {
|
|
if (DEBUG.MENU_PROVIDER)
|
|
logFunc(COMPONENT_NAME2, "useEffect", { isFocused });
|
|
function handleBlur() {
|
|
return __async(this, null, function* () {
|
|
yield closeAllMenus();
|
|
});
|
|
}
|
|
if (!isFocused)
|
|
handleBlur();
|
|
}, [isFocused]);
|
|
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
onMouseDown: (e) => e.preventDefault(),
|
|
onClick: handleClick,
|
|
onKeyUp: handleKeyUp
|
|
}, /* @__PURE__ */ import_react8.default.createElement(MenuContext.Provider, {
|
|
value: {
|
|
isMenuOpen,
|
|
openMenu,
|
|
isMenuRequestingClose,
|
|
closeMenu
|
|
}
|
|
}, children));
|
|
}
|
|
|
|
// src/app/services/hooks/index.ts
|
|
var useMenuId = () => {
|
|
const [menuId] = (0, import_react9.useState)(v4_default());
|
|
return menuId;
|
|
};
|
|
var useCompare = (value) => {
|
|
const prevValue = usePrevious(value);
|
|
return prevValue !== value;
|
|
};
|
|
var usePrevious = (value) => {
|
|
const ref = (0, import_react9.useRef)();
|
|
(0, import_react9.useEffect)(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref.current;
|
|
};
|
|
var useTextareaRef = (isOpen, value) => {
|
|
const lengthHasChanged = useCompare(value.length);
|
|
return (0, import_react9.useCallback)((node) => {
|
|
if (node) {
|
|
if (isOpen && !lengthHasChanged) {
|
|
node.selectionStart = value.length;
|
|
node.selectionEnd = value.length;
|
|
if (node instanceof HTMLElement) {
|
|
setTimeout(() => {
|
|
node.focus();
|
|
}, 1);
|
|
}
|
|
}
|
|
}
|
|
}, [isOpen, value.length]);
|
|
};
|
|
var useDidMountEffect = (func, deps) => {
|
|
const didMount = (0, import_react9.useRef)(false);
|
|
(0, import_react9.useEffect)(() => {
|
|
if (didMount.current)
|
|
func();
|
|
else
|
|
didMount.current = true;
|
|
}, deps);
|
|
};
|
|
var useMenuRef = (menuId, menuLevel, content = "") => {
|
|
const [menuPosition, setMenuPosition] = (0, import_react9.useState)({
|
|
top: 0,
|
|
left: 0,
|
|
width: 0,
|
|
height: 0,
|
|
time: 0
|
|
});
|
|
const [shouldOpenMenu, setOpenMenu] = (0, import_react9.useState)(false);
|
|
const resizeTime = useResizeTime();
|
|
const { isMenuOpen, openMenu, closeMenu, isMenuRequestingClose } = useMenu(menuId, menuLevel);
|
|
(0, import_react9.useEffect)(() => {
|
|
if (menuPosition.time !== 0 && shouldOpenMenu) {
|
|
openMenu();
|
|
setOpenMenu(false);
|
|
}
|
|
}, [menuPosition.time, shouldOpenMenu]);
|
|
const menuRef = (0, import_react9.useCallback)((node) => {
|
|
if (node instanceof HTMLElement) {
|
|
const { top, left, width, height } = node.getBoundingClientRect();
|
|
setMenuPosition({ top, left, width, height, time: Date.now() });
|
|
}
|
|
}, [resizeTime, shouldOpenMenu, content.length]);
|
|
return {
|
|
menuPosition,
|
|
openMenu: () => setOpenMenu(true),
|
|
closeMenu,
|
|
isMenuRequestingClose,
|
|
isMenuOpen,
|
|
menuRef
|
|
};
|
|
};
|
|
var useDisableScroll = (isOpen) => {
|
|
const scroll = (0, import_react9.useRef)({
|
|
top: 0,
|
|
left: 0
|
|
});
|
|
const el = document.getElementsByClassName("NLT__app")[0];
|
|
function handleScroll() {
|
|
if (el) {
|
|
const { top, left } = scroll.current;
|
|
el.scrollTo(left, top);
|
|
}
|
|
}
|
|
(0, import_react9.useEffect)(() => {
|
|
if (el instanceof HTMLElement) {
|
|
if (isOpen) {
|
|
scroll.current = {
|
|
top: el.scrollTop,
|
|
left: el.scrollLeft
|
|
};
|
|
el.addEventListener("scroll", handleScroll);
|
|
} else {
|
|
el.removeEventListener("scroll", handleScroll);
|
|
}
|
|
}
|
|
return () => {
|
|
if (el) {
|
|
el.removeEventListener("scroll", handleScroll);
|
|
}
|
|
};
|
|
}, [isOpen]);
|
|
};
|
|
var useResizeTime = () => {
|
|
const [resizeTime, setResizeTime] = (0, import_react9.useState)(0);
|
|
(0, import_react9.useEffect)(() => {
|
|
function handleResize() {
|
|
setResizeTime(Date.now());
|
|
}
|
|
setTimeout(() => {
|
|
const el = document.getElementsByClassName("view-content")[0];
|
|
if (el) {
|
|
new ResizeObserver(handleResize).observe(el);
|
|
handleResize();
|
|
}
|
|
}, 1);
|
|
}, []);
|
|
return resizeTime;
|
|
};
|
|
|
|
// src/app/components/Menu/index.tsx
|
|
var import_react10 = __toModule(require_react());
|
|
var import_react_dom = __toModule(require_react_dom());
|
|
function Menu({
|
|
id,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
children,
|
|
width,
|
|
height
|
|
}) {
|
|
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, isOpen && import_react_dom.default.createPortal(/* @__PURE__ */ import_react10.default.createElement("div", {
|
|
className: "NLT__menu",
|
|
id,
|
|
onMouseDown: (e) => e.preventDefault()
|
|
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
className: "NLT__menu-container",
|
|
style: {
|
|
top: `${top}px`,
|
|
left: `${left}px`,
|
|
width: width ? `${width}px` : "fit-content",
|
|
height: height ? `${height}px` : "fit-content"
|
|
}
|
|
}, children)), document.body));
|
|
}
|
|
|
|
// src/app/components/NumberCellEdit/index.tsx
|
|
function NumberCellEdit({
|
|
menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height,
|
|
value,
|
|
onInputChange
|
|
}) {
|
|
const inputRef = useTextareaRef(isOpen, value);
|
|
function handleInputChange(value2) {
|
|
value2 = value2.replace("\n", "");
|
|
return onInputChange(value2);
|
|
}
|
|
return /* @__PURE__ */ import_react11.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height
|
|
}, /* @__PURE__ */ import_react11.default.createElement("textarea", {
|
|
className: "NLT__textarea",
|
|
ref: inputRef,
|
|
autoFocus: true,
|
|
value,
|
|
onChange: (e) => handleInputChange(e.target.value)
|
|
}));
|
|
}
|
|
|
|
// src/app/components/TextCellEdit/index.tsx
|
|
var import_react12 = __toModule(require_react());
|
|
function TextCellEdit({
|
|
menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height,
|
|
value,
|
|
onInputChange
|
|
}) {
|
|
const inputRef = useTextareaRef(isOpen, value);
|
|
function handleTextareaChange(value2) {
|
|
value2 = value2.replace("\n", "");
|
|
onInputChange(value2);
|
|
}
|
|
return /* @__PURE__ */ import_react12.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height
|
|
}, /* @__PURE__ */ import_react12.default.createElement("textarea", {
|
|
className: "NLT__textarea",
|
|
ref: inputRef,
|
|
autoFocus: true,
|
|
value,
|
|
onChange: (e) => handleTextareaChange(e.target.value)
|
|
}));
|
|
}
|
|
|
|
// src/app/components/TagCellEdit/index.tsx
|
|
var import_react20 = __toModule(require_react());
|
|
|
|
// src/app/components/TagCellEdit/component/SelectableTag/index.tsx
|
|
var import_react18 = __toModule(require_react());
|
|
|
|
// src/app/components/IconButton/index.tsx
|
|
var import_react15 = __toModule(require_react());
|
|
|
|
// src/app/services/icon/index.tsx
|
|
var import_react13 = __toModule(require_react());
|
|
var import_MoreVert = __toModule(require_MoreVert());
|
|
var import_Delete = __toModule(require_Delete());
|
|
var import_Sort = __toModule(require_Sort());
|
|
var import_KeyboardArrowDown = __toModule(require_KeyboardArrowDown());
|
|
var import_KeyboardArrowUp = __toModule(require_KeyboardArrowUp());
|
|
var import_KeyboardDoubleArrowUp = __toModule(require_KeyboardDoubleArrowUp());
|
|
var import_KeyboardDoubleArrowDown = __toModule(require_KeyboardDoubleArrowDown());
|
|
var import_KeyboardArrowLeft = __toModule(require_KeyboardArrowLeft());
|
|
var import_KeyboardArrowRight = __toModule(require_KeyboardArrowRight());
|
|
var import_KeyboardDoubleArrowLeft = __toModule(require_KeyboardDoubleArrowLeft());
|
|
var import_KeyboardDoubleArrowRight = __toModule(require_KeyboardDoubleArrowRight());
|
|
var import_KeyboardBackspace = __toModule(require_KeyboardBackspace());
|
|
var import_MoveUp = __toModule(require_MoveUp());
|
|
var import_MoveDown = __toModule(require_MoveDown());
|
|
var import_TextSnippet = __toModule(require_TextSnippet());
|
|
var import_Edit = __toModule(require_Edit());
|
|
|
|
// node_modules/@mui/icons-material/esm/utils/createSvgIcon.js
|
|
var import_utils = __toModule(require_utils4());
|
|
|
|
// node_modules/@mui/icons-material/esm/MoreHoriz.js
|
|
var import_jsx_runtime = __toModule(require_jsx_runtime());
|
|
var MoreHoriz_default = (0, import_utils.createSvgIcon)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
}), "MoreHoriz");
|
|
|
|
// src/app/services/icon/index.tsx
|
|
var findIcon = (icon, className) => {
|
|
switch (icon) {
|
|
case ICON.KEYBOARD_ARROW_UP:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardArrowUp.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_ARROW_DOWN:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardArrowDown.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_DOUBLE_ARROW_UP:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardDoubleArrowUp.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_DOUBLE_ARROW_DOWN:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardDoubleArrowDown.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_ARROW_LEFT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardArrowLeft.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_ARROW_RIGHT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardArrowRight.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_DOUBLE_ARROW_LEFT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardDoubleArrowLeft.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_DOUBLE_ARROW_RIGHT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardDoubleArrowRight.default, {
|
|
className
|
|
});
|
|
case ICON.DELETE:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_Delete.default, {
|
|
className
|
|
});
|
|
case ICON.MORE_VERT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_MoreVert.default, {
|
|
className
|
|
});
|
|
case ICON.SORT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_Sort.default, {
|
|
className
|
|
});
|
|
case ICON.KEYBOARD_BACKSPACE:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_KeyboardBackspace.default, {
|
|
className
|
|
});
|
|
case ICON.MOVE_UP:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_MoveUp.default, {
|
|
className
|
|
});
|
|
case ICON.MOVE_DOWN:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_MoveDown.default, {
|
|
className
|
|
});
|
|
case ICON.TEXT_SNIPPET:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_TextSnippet.default, {
|
|
className
|
|
});
|
|
case ICON.EDIT:
|
|
return /* @__PURE__ */ import_react13.default.createElement(import_Edit.default, {
|
|
className
|
|
});
|
|
case ICON.MORE_HORIZ:
|
|
return /* @__PURE__ */ import_react13.default.createElement(MoreHoriz_default, {
|
|
className
|
|
});
|
|
default:
|
|
return "";
|
|
}
|
|
};
|
|
|
|
// src/app/components/Button/index.tsx
|
|
var import_react14 = __toModule(require_react());
|
|
function Button({ style, children, hasIcon, onClick }) {
|
|
let className = "NLT__button";
|
|
if (hasIcon)
|
|
className += " NLT__button--icon";
|
|
return /* @__PURE__ */ import_react14.default.createElement("button", {
|
|
style,
|
|
className,
|
|
tabIndex: -1,
|
|
"aria-hidden": "true",
|
|
onClick: (e) => onClick(e)
|
|
}, children);
|
|
}
|
|
|
|
// src/app/components/IconButton/index.tsx
|
|
function IconButton({ id, icon, onClick }) {
|
|
return /* @__PURE__ */ import_react15.default.createElement(Button, {
|
|
hasIcon: true,
|
|
onClick
|
|
}, findIcon(icon, "NLT__icon--md"));
|
|
}
|
|
|
|
// src/app/components/TagColorMenu/index.tsx
|
|
var import_react17 = __toModule(require_react());
|
|
|
|
// src/app/components/TagColorMenu/components/ColorItem/index.tsx
|
|
var import_react16 = __toModule(require_react());
|
|
|
|
// src/app/services/string/adders/index.ts
|
|
var uppercaseFirst = (input) => {
|
|
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
};
|
|
|
|
// src/app/components/TagColorMenu/components/ColorItem/index.tsx
|
|
function ColorItem({ color, isSelected, onColorClick }) {
|
|
let containerClass = "NLT__color-item NLT__selectable";
|
|
if (isSelected)
|
|
containerClass += " NLT__selected";
|
|
const colorClass = findColorClass(color);
|
|
let squareClass = "NLT__color-item-square";
|
|
squareClass += " " + colorClass;
|
|
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
className: containerClass,
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onColorClick(color);
|
|
}
|
|
}, /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
className: squareClass
|
|
}), /* @__PURE__ */ import_react16.default.createElement("div", null, uppercaseFirst(color)));
|
|
}
|
|
|
|
// src/app/components/TagColorMenu/index.tsx
|
|
function TagColorMenu({
|
|
menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
selectedColor,
|
|
onColorClick
|
|
}) {
|
|
return /* @__PURE__ */ import_react17.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top,
|
|
left
|
|
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
className: "NLT__tag-color-menu"
|
|
}, /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
className: "NLT__tag-color-menu-title"
|
|
}, "Colors"), /* @__PURE__ */ import_react17.default.createElement("div", {
|
|
className: "NLT__tag-color-container"
|
|
}, Object.values(COLOR).map((color) => /* @__PURE__ */ import_react17.default.createElement(ColorItem, {
|
|
key: color,
|
|
color,
|
|
onColorClick,
|
|
isSelected: selectedColor === color
|
|
})))));
|
|
}
|
|
|
|
// src/app/components/TagCellEdit/component/SelectableTag/index.tsx
|
|
function SelectableTag({
|
|
id,
|
|
content,
|
|
color,
|
|
onClick,
|
|
onColorChange
|
|
}) {
|
|
const menuId = useMenuId();
|
|
const {
|
|
menuPosition,
|
|
menuRef,
|
|
isMenuOpen,
|
|
openMenu,
|
|
closeMenu,
|
|
isMenuRequestingClose
|
|
} = useMenuRef(menuId, MENU_LEVEL.TWO);
|
|
(0, import_react18.useEffect)(() => {
|
|
if (isMenuRequestingClose) {
|
|
closeMenu();
|
|
}
|
|
}, [isMenuRequestingClose]);
|
|
function handleColorChange(color2) {
|
|
onColorChange(id, color2);
|
|
closeMenu();
|
|
}
|
|
let tagClass = "NLT__tag";
|
|
tagClass += " " + findColorClass(color);
|
|
return /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
ref: menuRef,
|
|
className: "NLT__selectable-tag NLT__selectable",
|
|
onClick: () => onClick(id)
|
|
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
className: tagClass
|
|
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
className: "NLT__tag-content"
|
|
}, html_react_parser_default(content))), /* @__PURE__ */ import_react18.default.createElement(IconButton, {
|
|
icon: ICON.MORE_HORIZ,
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
openMenu();
|
|
}
|
|
}), /* @__PURE__ */ import_react18.default.createElement(TagColorMenu, {
|
|
menuId,
|
|
isOpen: isMenuOpen,
|
|
selectedColor: color,
|
|
top: menuPosition.top - 77,
|
|
left: menuPosition.left + 110,
|
|
onColorClick: (color2) => handleColorChange(color2)
|
|
}));
|
|
}
|
|
|
|
// src/app/components/TagCellEdit/component/CreateTag/index.tsx
|
|
var import_react19 = __toModule(require_react());
|
|
function CreateTag({ content, color, onAddTag }) {
|
|
return /* @__PURE__ */ import_react19.default.createElement("div", {
|
|
className: "NLT__create-tag NLT__selectable",
|
|
onClick: () => {
|
|
onAddTag(content);
|
|
}
|
|
}, /* @__PURE__ */ import_react19.default.createElement("div", null, "Create\xA0"), /* @__PURE__ */ import_react19.default.createElement(TagCell, {
|
|
content,
|
|
color,
|
|
hideLink: true
|
|
}));
|
|
}
|
|
|
|
// src/app/components/TagCellEdit/index.tsx
|
|
function TagCellEdit({
|
|
menuId,
|
|
isOpen,
|
|
inputText,
|
|
top,
|
|
left,
|
|
color,
|
|
cellId,
|
|
tags,
|
|
onInputChange,
|
|
onTagClick,
|
|
onAddTag,
|
|
onColorChange,
|
|
onRemoveTagClick
|
|
}) {
|
|
function handleTextChange(e) {
|
|
if (e.target.value.match(/\s/))
|
|
return;
|
|
onInputChange(e.target.value);
|
|
}
|
|
function renderSelectableTags() {
|
|
const filteredTags = tags.filter((tag) => tag.content.includes(inputText));
|
|
const found = tags.find((tag) => tag.content === inputText);
|
|
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, !found && inputText !== "" && /* @__PURE__ */ import_react20.default.createElement(CreateTag, {
|
|
key: "create-tag",
|
|
content: inputText,
|
|
color,
|
|
onAddTag
|
|
}), filteredTags.map((tag) => /* @__PURE__ */ import_react20.default.createElement(SelectableTag, {
|
|
key: tag.id,
|
|
id: tag.id,
|
|
color: tag.color,
|
|
content: tag.content,
|
|
onColorChange,
|
|
onClick: onTagClick
|
|
})));
|
|
}
|
|
return /* @__PURE__ */ import_react20.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top,
|
|
left
|
|
}, /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
className: "NLT__tag-menu"
|
|
}, /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
className: "NLT__tag-menu-container"
|
|
}, /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
className: "NLT__tag-menu-top"
|
|
}, tags.filter((tag) => tag.selected.includes(cellId) === true).map((tag) => /* @__PURE__ */ import_react20.default.createElement(TagCell, {
|
|
key: tag.id,
|
|
cellId,
|
|
id: tag.id,
|
|
hideLink: true,
|
|
color: tag.color,
|
|
content: tag.content,
|
|
showRemove: true,
|
|
onRemoveClick: onRemoveTagClick
|
|
})), /* @__PURE__ */ import_react20.default.createElement("input", {
|
|
className: "NLT__tag-input",
|
|
autoFocus: true,
|
|
type: "text",
|
|
value: inputText,
|
|
onChange: handleTextChange
|
|
})), /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
className: "NLT__tag-menu-bottom"
|
|
}, /* @__PURE__ */ import_react20.default.createElement("p", {
|
|
className: "NLT__tag-menu-text"
|
|
}, "Select an option or create one"), /* @__PURE__ */ import_react20.default.createElement("div", null, renderSelectableTags())))));
|
|
}
|
|
|
|
// src/app/components/DateCellEdit/index.tsx
|
|
var import_react21 = __toModule(require_react());
|
|
var import_react_datepicker = __toModule(require_react_datepicker_min());
|
|
function DateCellEdit({
|
|
menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height,
|
|
selectedDate,
|
|
onDateChange
|
|
}) {
|
|
return /* @__PURE__ */ import_react21.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top,
|
|
left,
|
|
width,
|
|
height
|
|
}, /* @__PURE__ */ import_react21.default.createElement(import_react_datepicker.default, {
|
|
className: "NLT__date-input",
|
|
autoFocus: true,
|
|
selected: selectedDate,
|
|
onChange: onDateChange,
|
|
dateFormat: "yyyy/MM/dd",
|
|
showYearDropdown: true,
|
|
dateFormatCalendar: "MMMM",
|
|
yearDropdownItemNumber: 15,
|
|
scrollableYearDropdown: true
|
|
}));
|
|
}
|
|
|
|
// src/app/components/EditableTd/index.tsx
|
|
var COMPONENT_NAME3 = "EditableTd";
|
|
function EditableTd({
|
|
headerType,
|
|
cell,
|
|
width,
|
|
tags,
|
|
tagUpdate,
|
|
onRemoveTagClick,
|
|
onColorChange,
|
|
onTagClick,
|
|
onContentChange,
|
|
onSaveContent,
|
|
onAddTag
|
|
}) {
|
|
const [tagInputText, setTagInputText] = (0, import_react22.useState)("");
|
|
const [tagColor] = (0, import_react22.useState)(randomColor());
|
|
const menuId = useMenuId();
|
|
const content = cell.toString();
|
|
const {
|
|
menuPosition,
|
|
menuRef,
|
|
isMenuOpen,
|
|
openMenu,
|
|
closeMenu,
|
|
isMenuRequestingClose
|
|
} = useMenuRef(menuId, MENU_LEVEL.ONE, content);
|
|
useDisableScroll(isMenuOpen);
|
|
const { id, headerId, type } = cell;
|
|
const [wasContentUpdated, setContentUpdate] = (0, import_react22.useState)(false);
|
|
const isInvalidContent = type !== headerType;
|
|
useDidMountEffect(() => {
|
|
if (DEBUG.EDITABLE_TD)
|
|
logFunc(COMPONENT_NAME3, "useDidMountEffect", {
|
|
tagUpdate
|
|
});
|
|
if (tagUpdate.cellId === id) {
|
|
closeMenu();
|
|
onSaveContent();
|
|
}
|
|
}, [tagUpdate.cellId, tagUpdate.time]);
|
|
(0, import_react22.useEffect)(() => {
|
|
if (DEBUG.EDITABLE_TD)
|
|
logFunc(COMPONENT_NAME3, "useEffect", {
|
|
isMenuRequestingClose
|
|
});
|
|
if (isMenuRequestingClose) {
|
|
if (headerType === CONTENT_TYPE.TAG) {
|
|
if (tagInputText !== "") {
|
|
const tag = tags.find((tag2) => tag2.content === tagInputText);
|
|
if (tag) {
|
|
onTagClick(id, tag.id);
|
|
} else {
|
|
onAddTag(id, headerId, tagInputText, tagColor);
|
|
}
|
|
setTagInputText("");
|
|
} else {
|
|
closeMenu();
|
|
}
|
|
} else {
|
|
closeMenu();
|
|
if (wasContentUpdated) {
|
|
onSaveContent();
|
|
setContentUpdate(false);
|
|
}
|
|
}
|
|
}
|
|
}, [isMenuRequestingClose]);
|
|
function handleCellContextClick(e) {
|
|
return __async(this, null, function* () {
|
|
if (DEBUG.EDITABLE_TD)
|
|
console.log("[EditableTd] handleCellContextClick()");
|
|
try {
|
|
yield navigator.clipboard.writeText(content);
|
|
new import_obsidian.Notice("Cell text copied");
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
});
|
|
}
|
|
function handleCellClick(e) {
|
|
if (DEBUG.EDITABLE_TD)
|
|
console.log("[EditableTd] handleCellClick()");
|
|
const el = e.target;
|
|
if (el.nodeName === "A")
|
|
return;
|
|
openMenu();
|
|
}
|
|
function handleAddTag(value) {
|
|
onAddTag(id, headerId, value, tagColor);
|
|
}
|
|
function handleTagClick(tagId) {
|
|
onTagClick(id, tagId);
|
|
}
|
|
function handleTextInputChange(value) {
|
|
onContentChange(id, headerType, value);
|
|
setContentUpdate(true);
|
|
}
|
|
function handleNumberInputChange(value) {
|
|
onContentChange(id, headerType, value);
|
|
setContentUpdate(true);
|
|
}
|
|
function handleDateChange(date) {
|
|
const content2 = dateToString(date);
|
|
onContentChange(id, headerType, content2);
|
|
setContentUpdate(true);
|
|
}
|
|
function handleCheckboxChange(isChecked) {
|
|
let content2 = isChecked ? "[x]" : "[ ]";
|
|
onContentChange(id, headerType, content2);
|
|
setContentUpdate(true);
|
|
}
|
|
function renderCell() {
|
|
if (isInvalidContent) {
|
|
return /* @__PURE__ */ import_react22.default.createElement(ErrorCell, {
|
|
expectedType: headerType,
|
|
type
|
|
});
|
|
}
|
|
switch (type) {
|
|
case CONTENT_TYPE.TEXT:
|
|
return /* @__PURE__ */ import_react22.default.createElement(TextCell, {
|
|
text: content
|
|
});
|
|
case CONTENT_TYPE.NUMBER:
|
|
return /* @__PURE__ */ import_react22.default.createElement(NumberCell, {
|
|
number: content
|
|
});
|
|
case CONTENT_TYPE.TAG: {
|
|
const tag = tags.find((tag2) => tag2.selected.includes(id));
|
|
if (tag)
|
|
return /* @__PURE__ */ import_react22.default.createElement(TagCell, {
|
|
style: { overflow: "hidden" },
|
|
content: tag.content,
|
|
color: tag.color,
|
|
showLink: true
|
|
});
|
|
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null);
|
|
}
|
|
case CONTENT_TYPE.DATE:
|
|
return /* @__PURE__ */ import_react22.default.createElement(DateCell, {
|
|
text: content
|
|
});
|
|
case CONTENT_TYPE.CHECKBOX:
|
|
return /* @__PURE__ */ import_react22.default.createElement(CheckboxCell, {
|
|
isChecked: content.includes("x"),
|
|
onCheckboxChange: handleCheckboxChange
|
|
});
|
|
default:
|
|
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null);
|
|
}
|
|
}
|
|
function renderCellMenu() {
|
|
switch (headerType) {
|
|
case CONTENT_TYPE.TEXT:
|
|
return /* @__PURE__ */ import_react22.default.createElement(TextCellEdit, {
|
|
menuId,
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top,
|
|
left: menuPosition.left,
|
|
width: menuPosition.width,
|
|
height: menuPosition.height,
|
|
value: content,
|
|
onInputChange: handleTextInputChange
|
|
});
|
|
case CONTENT_TYPE.NUMBER:
|
|
return /* @__PURE__ */ import_react22.default.createElement(NumberCellEdit, {
|
|
menuId,
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top,
|
|
left: menuPosition.left,
|
|
width: menuPosition.width,
|
|
height: menuPosition.height,
|
|
value: content,
|
|
onInputChange: handleNumberInputChange
|
|
});
|
|
case CONTENT_TYPE.TAG:
|
|
return /* @__PURE__ */ import_react22.default.createElement(TagCellEdit, {
|
|
cellId: id,
|
|
inputText: tagInputText,
|
|
tags,
|
|
menuId,
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top,
|
|
left: menuPosition.left,
|
|
color: tagColor,
|
|
onInputChange: setTagInputText,
|
|
onColorChange,
|
|
onAddTag: handleAddTag,
|
|
onRemoveTagClick,
|
|
onTagClick: handleTagClick
|
|
});
|
|
case CONTENT_TYPE.DATE:
|
|
return /* @__PURE__ */ import_react22.default.createElement(DateCellEdit, {
|
|
menuId,
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top,
|
|
left: menuPosition.left,
|
|
width: menuPosition.width,
|
|
height: menuPosition.height,
|
|
selectedDate: isDate(content) ? new Date(content) : new Date(),
|
|
onDateChange: handleDateChange
|
|
});
|
|
default:
|
|
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null);
|
|
}
|
|
}
|
|
return /* @__PURE__ */ import_react22.default.createElement("td", {
|
|
className: "NLT__td",
|
|
ref: menuRef,
|
|
onClick: handleCellClick,
|
|
onContextMenu: handleCellContextClick
|
|
}, /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
className: "NLT__td-container",
|
|
style: { width }
|
|
}, renderCell()), renderCellMenu());
|
|
}
|
|
|
|
// src/app/components/Table/index.tsx
|
|
var import_react23 = __toModule(require_react());
|
|
var Table = (0, import_react23.forwardRef)(({ headers, rows, onAddColumn, onAddRow }, ref) => {
|
|
return /* @__PURE__ */ import_react23.default.createElement("table", {
|
|
className: "NLT__table"
|
|
}, /* @__PURE__ */ import_react23.default.createElement("thead", {
|
|
className: "NLT__thead"
|
|
}, /* @__PURE__ */ import_react23.default.createElement("tr", null, headers.map((header) => /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, {
|
|
key: header.id
|
|
}, header.component)), /* @__PURE__ */ import_react23.default.createElement("th", {
|
|
className: "NLT__th"
|
|
}, /* @__PURE__ */ import_react23.default.createElement(Button, {
|
|
onClick: () => onAddColumn()
|
|
}, "New")))), /* @__PURE__ */ import_react23.default.createElement("tbody", {
|
|
className: "NLT__tbody"
|
|
}, rows.map((row) => /* @__PURE__ */ import_react23.default.createElement("tr", {
|
|
key: row.id
|
|
}, row.component))), /* @__PURE__ */ import_react23.default.createElement("tfoot", {
|
|
className: "NLT__tfoot"
|
|
}, /* @__PURE__ */ import_react23.default.createElement("tr", null, /* @__PURE__ */ import_react23.default.createElement("td", {
|
|
className: "NLT__td"
|
|
}, /* @__PURE__ */ import_react23.default.createElement(Button, {
|
|
style: { marginTop: "5px" },
|
|
onClick: () => onAddRow()
|
|
}, "New")), headers.map((header) => /* @__PURE__ */ import_react23.default.createElement("td", {
|
|
key: header.id,
|
|
className: "NLT__td"
|
|
})))));
|
|
});
|
|
var Table_default = Table;
|
|
|
|
// src/app/components/RowMenu/index.tsx
|
|
var import_react26 = __toModule(require_react());
|
|
|
|
// src/app/components/RowMenu/components/RowMenuItem/index.tsx
|
|
var import_react25 = __toModule(require_react());
|
|
|
|
// src/app/components/IconText/index.tsx
|
|
var import_react24 = __toModule(require_react());
|
|
function IconText({ iconText, icon }) {
|
|
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
className: "NLT__icon-text NLT__selectable"
|
|
}, icon !== "" && findIcon(icon, "NLT__icon--md NLT__margin-right"), /* @__PURE__ */ import_react24.default.createElement("p", null, iconText));
|
|
}
|
|
|
|
// src/app/components/RowMenu/components/RowMenuItem/index.tsx
|
|
function RowMenuItem({ icon, iconText, onClick }) {
|
|
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
onClick: () => onClick(),
|
|
className: "NLT__drag-menu-item"
|
|
}, /* @__PURE__ */ import_react25.default.createElement(IconText, {
|
|
icon,
|
|
iconText
|
|
}));
|
|
}
|
|
|
|
// src/app/components/RowMenu/constants.ts
|
|
var DRAG_MENU_ITEM = {
|
|
MOVE_UP: {
|
|
name: "move-up",
|
|
content: "Move Up",
|
|
icon: ICON.MOVE_UP,
|
|
rule: "first"
|
|
},
|
|
MOVE_DOWN: {
|
|
name: "move-down",
|
|
content: "Move Down",
|
|
icon: ICON.MOVE_DOWN,
|
|
rule: "last"
|
|
},
|
|
INSERT_ABOVE: {
|
|
name: "insert-above",
|
|
content: "Insert Above",
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_UP
|
|
},
|
|
INSERT_BELOW: {
|
|
name: "insert-below",
|
|
content: "Insert Below",
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_DOWN
|
|
},
|
|
DELETE: {
|
|
name: "delete",
|
|
content: "Delete",
|
|
icon: ICON.DELETE
|
|
}
|
|
};
|
|
|
|
// src/app/components/RowMenu/index.tsx
|
|
function RowMenu({
|
|
rowId,
|
|
isFirstRow,
|
|
isLastRow,
|
|
onMoveRowClick,
|
|
onDeleteClick,
|
|
onInsertRowClick
|
|
}) {
|
|
const menuId = useMenuId();
|
|
const {
|
|
menuPosition,
|
|
menuRef,
|
|
isMenuOpen,
|
|
openMenu,
|
|
closeMenu,
|
|
isMenuRequestingClose
|
|
} = useMenuRef(menuId, MENU_LEVEL.ONE);
|
|
(0, import_react26.useEffect)(() => {
|
|
if (isMenuRequestingClose) {
|
|
closeMenu();
|
|
}
|
|
}, [isMenuRequestingClose]);
|
|
useDisableScroll(isMenuOpen);
|
|
function handleButtonClick(e) {
|
|
openMenu();
|
|
}
|
|
function handleDeleteClick(id) {
|
|
onDeleteClick(id);
|
|
closeMenu();
|
|
}
|
|
function handleInsertRowClick(id, insertBelow) {
|
|
onInsertRowClick(id, insertBelow);
|
|
closeMenu();
|
|
}
|
|
function handleMoveRowClick(id, moveBelow) {
|
|
onMoveRowClick(id, moveBelow);
|
|
closeMenu();
|
|
}
|
|
return /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
ref: menuRef
|
|
}, /* @__PURE__ */ import_react26.default.createElement(IconButton, {
|
|
icon: ICON.MORE_VERT,
|
|
onClick: handleButtonClick
|
|
}), /* @__PURE__ */ import_react26.default.createElement(Menu, {
|
|
id: menuId,
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top + menuPosition.height,
|
|
left: menuPosition.left - menuPosition.width - 65
|
|
}, /* @__PURE__ */ import_react26.default.createElement("div", {
|
|
className: "NLT__drag-menu"
|
|
}, Object.values(DRAG_MENU_ITEM).map((item) => {
|
|
if (item.name === DRAG_MENU_ITEM.MOVE_UP.name) {
|
|
if (isFirstRow)
|
|
return;
|
|
}
|
|
if (item.name === DRAG_MENU_ITEM.MOVE_DOWN.name) {
|
|
if (isLastRow)
|
|
return;
|
|
}
|
|
return /* @__PURE__ */ import_react26.default.createElement(RowMenuItem, {
|
|
key: item.name,
|
|
icon: item.icon,
|
|
iconText: item.content,
|
|
onClick: () => {
|
|
switch (item.name) {
|
|
case DRAG_MENU_ITEM.MOVE_UP.name:
|
|
handleMoveRowClick(rowId, false);
|
|
break;
|
|
case DRAG_MENU_ITEM.MOVE_DOWN.name:
|
|
handleMoveRowClick(rowId, true);
|
|
break;
|
|
case DRAG_MENU_ITEM.INSERT_ABOVE.name:
|
|
handleInsertRowClick(rowId, false);
|
|
break;
|
|
case DRAG_MENU_ITEM.INSERT_BELOW.name:
|
|
handleInsertRowClick(rowId, true);
|
|
break;
|
|
case DRAG_MENU_ITEM.DELETE.name:
|
|
handleDeleteClick(rowId);
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
}))));
|
|
}
|
|
|
|
// src/app/components/EditableTh/index.tsx
|
|
var import_react29 = __toModule(require_react());
|
|
|
|
// src/app/components/HeaderMenu/index.tsx
|
|
var import_react28 = __toModule(require_react());
|
|
|
|
// src/app/components/HeaderMenu/components/HeaderMenuItem/index.tsx
|
|
var import_react27 = __toModule(require_react());
|
|
function HeaderMenuItem({
|
|
icon = "",
|
|
iconText,
|
|
onClick,
|
|
selected = false
|
|
}) {
|
|
let className = "NLT__header-menu-item NLT__selectable";
|
|
if (selected)
|
|
className += " NLT__selected";
|
|
return /* @__PURE__ */ import_react27.default.createElement("li", {
|
|
className,
|
|
onClick: () => onClick()
|
|
}, /* @__PURE__ */ import_react27.default.createElement(IconText, {
|
|
iconText,
|
|
icon
|
|
}));
|
|
}
|
|
|
|
// src/app/components/HeaderMenu/index.tsx
|
|
function HeaderMenu({
|
|
isOpen,
|
|
top,
|
|
left,
|
|
id,
|
|
menuId,
|
|
content,
|
|
type,
|
|
sortName,
|
|
inFirstHeader,
|
|
inLastHeader,
|
|
onTypeSelect,
|
|
onSortSelect,
|
|
onDeleteClick,
|
|
onOutsideClick,
|
|
onInsertColumnClick,
|
|
onMoveColumnClick,
|
|
onClose
|
|
}) {
|
|
const [inputText, setInputText] = (0, import_react28.useState)("");
|
|
const [submenu, setSubmenu] = (0, import_react28.useState)(null);
|
|
const lastLength = (0, import_react28.useRef)(0);
|
|
(0, import_react28.useEffect)(() => {
|
|
if (!isOpen) {
|
|
if (inputText.length !== lastLength.current) {
|
|
lastLength.current = inputText.length;
|
|
if (inputText !== content) {
|
|
onOutsideClick(id, inputText);
|
|
}
|
|
}
|
|
setSubmenu(null);
|
|
}
|
|
}, [isOpen, inputText.length, lastLength.current]);
|
|
(0, import_react28.useEffect)(() => {
|
|
setInputText(content);
|
|
}, [content]);
|
|
function renderTypeItems() {
|
|
return TYPE_ITEMS.map((item) => {
|
|
return /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
key: item.name,
|
|
icon: "",
|
|
iconText: item.content,
|
|
onClick: () => handleTypeSelect(id, item.type),
|
|
selected: item.type === type
|
|
});
|
|
});
|
|
}
|
|
function renderSortItems() {
|
|
return /* @__PURE__ */ import_react28.default.createElement("ul", {
|
|
className: "NLT__header-menu-ul"
|
|
}, Object.values(SORT).map((item) => /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
key: item.name,
|
|
icon: item.icon,
|
|
iconText: `Sort ${item.content}`,
|
|
onClick: () => handleSortSelect(id, type, item.name),
|
|
selected: sortName === item.name
|
|
})));
|
|
}
|
|
function renderInsertItems() {
|
|
return /* @__PURE__ */ import_react28.default.createElement("ul", {
|
|
className: "NLT__header-menu-ul"
|
|
}, /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_LEFT,
|
|
iconText: "Insert Left",
|
|
onClick: () => handleInsertColumnClick(id, false)
|
|
}), /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_RIGHT,
|
|
iconText: "Insert Right",
|
|
onClick: () => handleInsertColumnClick(id, true)
|
|
}));
|
|
}
|
|
function renderMoveItems() {
|
|
return /* @__PURE__ */ import_react28.default.createElement("ul", {
|
|
className: "NLT__header-menu-ul"
|
|
}, !inFirstHeader && /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_LEFT,
|
|
iconText: "Move Left",
|
|
onClick: () => handleMoveColumnClick(id, false)
|
|
}), !inLastHeader && /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
icon: ICON.KEYBOARD_DOUBLE_ARROW_RIGHT,
|
|
iconText: "Move Right",
|
|
onClick: () => handleMoveColumnClick(id, true)
|
|
}));
|
|
}
|
|
function renderEditItems() {
|
|
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
style: { marginBottom: "10px" }
|
|
}, /* @__PURE__ */ import_react28.default.createElement("input", {
|
|
className: "NLT__input NLT__header-menu-input",
|
|
autoFocus: true,
|
|
type: "text",
|
|
value: inputText,
|
|
onChange: (e) => setInputText(e.target.value)
|
|
})), /* @__PURE__ */ import_react28.default.createElement(Button, {
|
|
onClick: () => handleDeleteClick(id)
|
|
}, "Delete"));
|
|
}
|
|
function handleMoveColumnClick(id2, moveRight) {
|
|
onMoveColumnClick(id2, moveRight);
|
|
onClose();
|
|
}
|
|
function handleSortSelect(id2, type2, sortName2) {
|
|
onSortSelect(id2, type2, sortName2);
|
|
onClose();
|
|
}
|
|
function handleInsertColumnClick(id2, insertRight) {
|
|
onInsertColumnClick(id2, insertRight);
|
|
onClose();
|
|
}
|
|
function handleTypeSelect(id2, type2) {
|
|
onTypeSelect(id2, type2);
|
|
onClose();
|
|
}
|
|
function handleDeleteClick(id2) {
|
|
onDeleteClick(id2);
|
|
onClose();
|
|
}
|
|
function renderMenu() {
|
|
return Object.values(SUBMENU).map((item) => /* @__PURE__ */ import_react28.default.createElement(HeaderMenuItem, {
|
|
key: item.name,
|
|
iconText: item.content,
|
|
icon: item.icon,
|
|
onClick: () => setSubmenu(item)
|
|
}));
|
|
}
|
|
function Submenu() {
|
|
function renderSubmenuItems() {
|
|
switch (submenu.name) {
|
|
case SUBMENU.EDIT.name:
|
|
return renderEditItems();
|
|
case SUBMENU.INSERT.name:
|
|
return renderInsertItems();
|
|
case SUBMENU.SORT.name:
|
|
return renderSortItems();
|
|
case SUBMENU.MOVE.name:
|
|
return renderMoveItems();
|
|
case SUBMENU.TYPE.name:
|
|
return renderTypeItems();
|
|
default:
|
|
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null);
|
|
}
|
|
}
|
|
return /* @__PURE__ */ import_react28.default.createElement("div", null, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
className: "NLT__header-menu-header-container"
|
|
}, /* @__PURE__ */ import_react28.default.createElement(IconButton, {
|
|
icon: ICON.KEYBOARD_BACKSPACE,
|
|
onClick: () => setSubmenu(null)
|
|
}), /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
className: "NLT__header-menu-header"
|
|
}, submenu.content)), renderSubmenuItems());
|
|
}
|
|
return /* @__PURE__ */ import_react28.default.createElement(Menu, {
|
|
isOpen,
|
|
id: menuId,
|
|
top,
|
|
left
|
|
}, /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
className: "NLT__header-menu"
|
|
}, submenu !== null ? /* @__PURE__ */ import_react28.default.createElement(Submenu, null) : renderMenu()));
|
|
}
|
|
|
|
// src/app/components/EditableTh/index.tsx
|
|
function EditableTh({
|
|
id,
|
|
index,
|
|
width,
|
|
content,
|
|
type,
|
|
sortName,
|
|
inFirstHeader,
|
|
inLastHeader,
|
|
onWidthChange,
|
|
onInsertColumnClick,
|
|
onMoveColumnClick,
|
|
onSortSelect,
|
|
onTypeSelect,
|
|
onDeleteClick,
|
|
onSaveClick
|
|
}) {
|
|
const dragRef = (0, import_react29.useRef)(false);
|
|
const menuId = useMenuId();
|
|
const {
|
|
menuPosition,
|
|
menuRef,
|
|
isMenuOpen,
|
|
openMenu,
|
|
closeMenu,
|
|
isMenuRequestingClose
|
|
} = useMenuRef(menuId, MENU_LEVEL.ONE);
|
|
useDisableScroll(isMenuOpen);
|
|
(0, import_react29.useEffect)(() => {
|
|
if (isMenuRequestingClose) {
|
|
closeMenu();
|
|
}
|
|
}, [isMenuRequestingClose]);
|
|
function handleHeaderClick(e) {
|
|
if (dragRef.current)
|
|
return;
|
|
openMenu();
|
|
}
|
|
function handleMouseMove(e) {
|
|
const target = e.target;
|
|
if (target instanceof HTMLElement) {
|
|
let width2 = e.pageX - menuPosition.left - 17;
|
|
width2 = parseInt(width2.toString());
|
|
if (width2 < 30)
|
|
return;
|
|
dragRef.current = true;
|
|
onWidthChange(id, width2);
|
|
}
|
|
}
|
|
function handleClose() {
|
|
closeMenu();
|
|
}
|
|
function handleDrag(e) {
|
|
removeEventListeners();
|
|
}
|
|
function handleMouseUp(e) {
|
|
removeEventListeners();
|
|
}
|
|
function removeEventListeners() {
|
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
window.removeEventListener("drag", removeEventListeners);
|
|
window.removeEventListener("mouseup", removeEventListeners);
|
|
setTimeout(() => {
|
|
dragRef.current = false;
|
|
}, 50);
|
|
}
|
|
return /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement("th", {
|
|
className: "NLT__th NLT__selectable",
|
|
ref: menuRef,
|
|
onClick: handleHeaderClick
|
|
}, /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
className: "NLT__header-content-container"
|
|
}, /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
className: "NLT__header-content",
|
|
style: { width }
|
|
}, content), /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
className: "NLT__header-resize-container"
|
|
}, /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
className: "NLT__header-resize",
|
|
onMouseDown: () => {
|
|
window.addEventListener("mousemove", handleMouseMove);
|
|
window.addEventListener("mouseup", handleMouseUp);
|
|
window.addEventListener("drag", handleDrag);
|
|
},
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
}
|
|
})))), /* @__PURE__ */ import_react29.default.createElement(HeaderMenu, {
|
|
isOpen: isMenuOpen,
|
|
top: menuPosition.top,
|
|
left: menuPosition.left,
|
|
id,
|
|
menuId,
|
|
content,
|
|
index,
|
|
sortName,
|
|
type,
|
|
inFirstHeader,
|
|
inLastHeader,
|
|
onOutsideClick: onSaveClick,
|
|
onSortSelect,
|
|
onMoveColumnClick,
|
|
onInsertColumnClick,
|
|
onTypeSelect,
|
|
onDeleteClick,
|
|
onClose: handleClose
|
|
}));
|
|
}
|
|
|
|
// src/app/services/appData/state/tag.ts
|
|
var initialTag = (id, headerId, cellId, content, color) => {
|
|
return {
|
|
id,
|
|
headerId,
|
|
content,
|
|
color,
|
|
selected: [cellId]
|
|
};
|
|
};
|
|
|
|
// src/app/services/appData/external/persist.ts
|
|
var persistAppData = (plugin, settings, appData, sourcePath, tableIndex, viewType) => __async(void 0, null, function* () {
|
|
if (!settings.state[sourcePath])
|
|
settings.state[sourcePath] = {};
|
|
settings.state[sourcePath][tableIndex] = {
|
|
data: appData,
|
|
viewType,
|
|
shouldUpdate: true
|
|
};
|
|
yield plugin.saveData(settings);
|
|
});
|
|
|
|
// src/app/services/appData/external/save.ts
|
|
var saveAppData = (plugin, settings, app2, oldAppData, newAppData, sourcePath, tableIndex, viewType) => __async(void 0, null, function* () {
|
|
const markdown = appDataToMarkdown(newAppData);
|
|
try {
|
|
const file = app2.workspace.getActiveFile();
|
|
const fileContent = yield app2.vault.cachedRead(file);
|
|
let newContent = fileContent.replace(findTableRegex(oldAppData.headers, oldAppData.rows), markdown);
|
|
if (DEBUG.SAVE_APP_DATA) {
|
|
console.log("saveAppData - New app data:");
|
|
console.log(markdown);
|
|
}
|
|
yield persistAppData(plugin, settings, newAppData, sourcePath, tableIndex, viewType);
|
|
yield app2.vault.modify(file, newContent);
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
});
|
|
|
|
// src/app/services/appData/internal/add.ts
|
|
var addRow = (data) => {
|
|
const rowId = v4_default();
|
|
const tags = [];
|
|
const cells = data.headers.map((header, i) => {
|
|
return findNewCell(v4_default(), rowId, header.id, header.type);
|
|
});
|
|
return __spreadProps(__spreadValues({}, data), {
|
|
rows: [...data.rows, initialRow(rowId, data.rows.length, Date.now())],
|
|
cells: [...data.cells, ...cells],
|
|
tags: [...data.tags, ...tags]
|
|
});
|
|
};
|
|
var addColumn = (data) => {
|
|
const header = initialHeader(v4_default(), data.headers.length, "New Column");
|
|
const cells = [...data.cells];
|
|
data.rows.forEach((row) => {
|
|
cells.push(findNewCell(v4_default(), row.id, header.id, CONTENT_TYPE.TEXT));
|
|
});
|
|
return __spreadProps(__spreadValues({}, data), {
|
|
headers: [...data.headers, header],
|
|
cells
|
|
});
|
|
};
|
|
|
|
// src/app/App.tsx
|
|
var COMPONENT_NAME4 = "App";
|
|
function App({
|
|
plugin,
|
|
settings,
|
|
data,
|
|
sourcePath,
|
|
tableIndex,
|
|
el
|
|
}) {
|
|
const [oldAppData, setOldAppData] = (0, import_react30.useState)(data);
|
|
const [appData, setAppData] = (0, import_react30.useState)(data);
|
|
const [debounceUpdate, setDebounceUpdate] = (0, import_react30.useState)(0);
|
|
const [tagUpdate, setTagUpdate] = (0, import_react30.useState)({
|
|
time: 0,
|
|
cellId: ""
|
|
});
|
|
const [saveTime, setSaveTime] = (0, import_react30.useState)(0);
|
|
(0, import_react30.useEffect)(() => {
|
|
for (let i = 0; i < appData.headers.length; i++) {
|
|
const header = appData.headers[i];
|
|
if (header.sortName !== SORT.DEFAULT.name)
|
|
sortRows(header.id, header.type, header.sortName);
|
|
}
|
|
}, []);
|
|
(0, import_react30.useEffect)(() => {
|
|
function handleUpdate() {
|
|
return __async(this, null, function* () {
|
|
if (saveTime === 0)
|
|
return;
|
|
try {
|
|
const oldData = sortAppDataForSave(oldAppData);
|
|
const saveData = sortAppDataForSave(appData);
|
|
yield saveAppData(plugin, settings, app, oldData, saveData, sourcePath, tableIndex, findCurrentViewType(el));
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
});
|
|
}
|
|
handleUpdate();
|
|
}, [saveTime]);
|
|
(0, import_react30.useEffect)(() => {
|
|
let intervalId = null;
|
|
function startTimer() {
|
|
intervalId = setInterval(() => {
|
|
if (Date.now() - debounceUpdate < 250)
|
|
return;
|
|
clearInterval(intervalId);
|
|
setDebounceUpdate(0);
|
|
setSaveTime(Date.now());
|
|
}, 100);
|
|
}
|
|
if (debounceUpdate !== 0)
|
|
startTimer();
|
|
return () => clearInterval(intervalId);
|
|
}, [debounceUpdate]);
|
|
(0, import_react30.useEffect)(() => {
|
|
let intervalId = null;
|
|
function startTimer() {
|
|
intervalId = setInterval(() => __async(this, null, function* () {
|
|
if (settings.state[sourcePath]) {
|
|
if (settings.state[sourcePath][tableIndex]) {
|
|
const { shouldUpdate, viewType } = settings.state[sourcePath][tableIndex];
|
|
const currentViewType = findCurrentViewType(el);
|
|
if (shouldUpdate && viewType !== currentViewType) {
|
|
clearInterval(intervalId);
|
|
settings.state[sourcePath][tableIndex].shouldUpdate = false;
|
|
yield plugin.saveSettings();
|
|
const savedData = settings.state[sourcePath][tableIndex].data;
|
|
setOldAppData(savedData);
|
|
setAppData(savedData);
|
|
startTimer();
|
|
}
|
|
}
|
|
}
|
|
}), 500);
|
|
}
|
|
startTimer();
|
|
return () => clearInterval(intervalId);
|
|
}, []);
|
|
function handleAddColumn() {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleAddColumn called.");
|
|
setAppData((prevState) => addColumn(prevState));
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleAddRow() {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleAddRow called.");
|
|
setAppData((prevState) => addRow(prevState));
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleHeaderSave(id, updatedContent) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleHeaderSave called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers: prevState.headers.map((header) => {
|
|
if (header.id === id)
|
|
return __spreadProps(__spreadValues({}, header), {
|
|
content: updatedContent
|
|
});
|
|
return header;
|
|
})
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleHeaderTypeSelect(id, cellType) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleHeaderTypeSelect called.");
|
|
const header = appData.headers.find((header2) => header2.id === id);
|
|
if (header.type === cellType)
|
|
return;
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers: prevState.headers.map((header2) => {
|
|
if (id === header2.id)
|
|
return __spreadProps(__spreadValues({}, header2), { type: cellType });
|
|
return header2;
|
|
}),
|
|
cells: prevState.cells.map((cell) => {
|
|
if (cell.headerId === id) {
|
|
let content = cell.toString();
|
|
if (cellType === CONTENT_TYPE.CHECKBOX)
|
|
content = "[ ]";
|
|
return findNewCell(cell.id, cell.rowId, cell.headerId, cellType, content);
|
|
}
|
|
return cell;
|
|
})
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleHeaderSortSelect(id, type, sortName) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleHeaderSort called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers: prevState.headers.map((header) => {
|
|
if (id === header.id)
|
|
return __spreadProps(__spreadValues({}, header), { sortName });
|
|
return __spreadProps(__spreadValues({}, header), { sortName: SORT.DEFAULT.name });
|
|
})
|
|
});
|
|
});
|
|
sortRows(id, type, sortName);
|
|
}
|
|
function handleCellContentSave() {
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleCellContentChange(id, headerType, content) {
|
|
if (DEBUG.APP) {
|
|
logFunc(COMPONENT_NAME4, "handleCellContentChange", {
|
|
id,
|
|
headerType,
|
|
content
|
|
});
|
|
}
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
cells: prevState.cells.map((cell) => {
|
|
if (cell.id === id) {
|
|
return findNewCell(cell.id, cell.rowId, cell.headerId, headerType, content);
|
|
}
|
|
return cell;
|
|
})
|
|
});
|
|
});
|
|
}
|
|
function handleAddTag(cellId, headerId, content, color) {
|
|
if (DEBUG.APP) {
|
|
logFunc(COMPONENT_NAME4, "handleAddTag", {
|
|
cellId,
|
|
headerId,
|
|
content,
|
|
color
|
|
});
|
|
}
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
tags: [
|
|
...removeTagReferences(prevState.tags, cellId),
|
|
initialTag(v4_default(), headerId, cellId, content, color)
|
|
]
|
|
});
|
|
});
|
|
setTagUpdate({ cellId, time: Date.now() });
|
|
}
|
|
function removeTagReferences(tags, cellId) {
|
|
return tags.map((tag) => {
|
|
return __spreadProps(__spreadValues({}, tag), {
|
|
selected: tag.selected.filter((id) => id !== cellId)
|
|
});
|
|
}).filter((tag) => tag.selected.length !== 0);
|
|
}
|
|
function handleTagClick(cellId, tagId) {
|
|
if (DEBUG.APP) {
|
|
logFunc(COMPONENT_NAME4, "handleTagClick", {
|
|
cellId,
|
|
tagId
|
|
});
|
|
}
|
|
const found = appData.tags.find((tag) => tag.id === tagId);
|
|
if (!found.selected.includes(cellId)) {
|
|
let arr = removeTagReferences(appData.tags, cellId);
|
|
arr = arr.map((tag) => {
|
|
if (tag.id === tagId) {
|
|
return __spreadProps(__spreadValues({}, tag), {
|
|
selected: [...tag.selected, cellId]
|
|
});
|
|
}
|
|
return tag;
|
|
});
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
tags: arr
|
|
});
|
|
});
|
|
}
|
|
setTagUpdate({ cellId, time: Date.now() });
|
|
}
|
|
function handleRemoveTagClick(cellId) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleRemoveTagClick called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
tags: removeTagReferences(prevState.tags, cellId)
|
|
});
|
|
});
|
|
}
|
|
function sortRows(headerId, headerType, sortName) {
|
|
setAppData((prevState) => {
|
|
const arr = [...prevState.rows];
|
|
arr.sort((a, b) => {
|
|
const cellA = appData.cells.find((cell) => cell.headerId === headerId && cell.rowId === a.id);
|
|
const cellB = appData.cells.find((cell) => cell.headerId === headerId && cell.rowId === b.id);
|
|
if (sortName === SORT.ASC.name) {
|
|
if (headerType === CONTENT_TYPE.TAG) {
|
|
const tagA = appData.tags.find((tag) => tag.selected.includes(cellA.id));
|
|
const tagB = appData.tags.find((tag) => tag.selected.includes(cellB.id));
|
|
return tagA.content.localeCompare(tagB.content);
|
|
} else {
|
|
return cellA.toString().localeCompare(cellB.toString());
|
|
}
|
|
} else if (sortName === SORT.DESC.name) {
|
|
if (headerType === CONTENT_TYPE.TAG) {
|
|
const tagA = appData.tags.find((tag) => tag.selected.includes(cellA.id));
|
|
const tagB = appData.tags.find((tag) => tag.selected.includes(cellB.id));
|
|
return tagB.content.localeCompare(tagA.content);
|
|
} else {
|
|
return cellB.toString().localeCompare(cellA.toString());
|
|
}
|
|
} else {
|
|
return a.creationTime - b.creationTime;
|
|
}
|
|
});
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
rows: arr
|
|
});
|
|
});
|
|
}
|
|
function handleDeleteHeaderClick(id) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleDeleteHeaderClick called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers: prevState.headers.filter((header) => header.id !== id),
|
|
cells: prevState.cells.filter((cell) => cell.headerId !== id)
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleDeleteRowClick(rowId) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleDeleteRowClick called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
rows: prevState.rows.filter((row) => row.id !== rowId),
|
|
cells: prevState.cells.filter((cell) => cell.rowId !== rowId)
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleMoveRowClick(id, moveBelow) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleMoveRowClick called.");
|
|
setAppData((prevState) => {
|
|
const index = prevState.rows.findIndex((row) => row.id === id);
|
|
const moveIndex = moveBelow ? index + 1 : index - 1;
|
|
const rows = [...prevState.rows];
|
|
const oldTime = rows[moveIndex].creationTime;
|
|
const newTime = rows[index].creationTime;
|
|
const old = rows[moveIndex];
|
|
rows[moveIndex] = rows[index];
|
|
rows[moveIndex].creationTime = oldTime;
|
|
rows[index] = old;
|
|
rows[index].creationTime = newTime;
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
rows
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleWidthChange(id, newWidth) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleWidthChange called.");
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers: prevState.headers.map((header) => {
|
|
if (header.id === id) {
|
|
return __spreadProps(__spreadValues({}, header), {
|
|
width: `${newWidth}px`
|
|
});
|
|
}
|
|
return header;
|
|
})
|
|
});
|
|
});
|
|
setDebounceUpdate(Date.now());
|
|
}
|
|
function handleMoveColumnClick(id, moveRight) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleMoveColumnClick called.");
|
|
setAppData((prevState) => {
|
|
const index = prevState.headers.findIndex((header) => header.id === id);
|
|
const moveIndex = moveRight ? index + 1 : index - 1;
|
|
const headers = [...prevState.headers];
|
|
const old = headers[moveIndex];
|
|
headers[moveIndex] = headers[index];
|
|
headers[index] = old;
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleInsertColumnClick(id, insertRight) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleInsertColumnClick called.");
|
|
setAppData((prevState) => {
|
|
const header = prevState.headers.find((header2) => header2.id === id);
|
|
const index = prevState.headers.indexOf(header);
|
|
const insertIndex = insertRight ? index + 1 : index;
|
|
const headerToInsert = initialHeader(v4_default(), prevState.headers.length, "New Column");
|
|
const cells = prevState.rows.map((row) => findNewCell(v4_default(), row.id, headerToInsert.id, headerToInsert.type));
|
|
const headers = [...prevState.headers];
|
|
headers.splice(insertIndex, 0, headerToInsert);
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
headers,
|
|
cells: [...prevState.cells, ...cells]
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleInsertRowClick(id, insertBelow = false) {
|
|
if (DEBUG.APP)
|
|
console.log("[App]: handleHeaderInsertRowClick called.");
|
|
const rowId = v4_default();
|
|
setAppData((prevState) => {
|
|
const tags = [];
|
|
const cells = prevState.headers.map((header) => findNewCell(v4_default(), rowId, header.id, header.type));
|
|
const rows = [...prevState.rows];
|
|
const index = prevState.rows.findIndex((row) => row.id === id);
|
|
const insertIndex = insertBelow ? index + 1 : index;
|
|
rows.splice(insertIndex, 0, initialRow(rowId, prevState.rows.length, Date.now()));
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
rows,
|
|
cells: [...prevState.cells, ...cells],
|
|
tags: [...prevState.tags, ...tags]
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
function handleChangeColor(tagId, color) {
|
|
setAppData((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
tags: prevState.tags.map((tag) => {
|
|
if (tag.id === tagId) {
|
|
return __spreadProps(__spreadValues({}, tag), {
|
|
color
|
|
});
|
|
}
|
|
return tag;
|
|
})
|
|
});
|
|
});
|
|
setSaveTime(Date.now());
|
|
}
|
|
return /* @__PURE__ */ import_react30.default.createElement("div", {
|
|
className: "NLT__app",
|
|
tabIndex: 0
|
|
}, /* @__PURE__ */ import_react30.default.createElement(Table_default, {
|
|
headers: appData.headers.map((header, j) => {
|
|
const { id, content, width, type, sortName } = header;
|
|
return __spreadProps(__spreadValues({}, header), {
|
|
component: /* @__PURE__ */ import_react30.default.createElement(EditableTh, {
|
|
key: id,
|
|
id,
|
|
width,
|
|
index: j,
|
|
content,
|
|
type,
|
|
sortName,
|
|
inFirstHeader: j === 0,
|
|
inLastHeader: j === appData.headers.length - 1,
|
|
onSortSelect: handleHeaderSortSelect,
|
|
onInsertColumnClick: handleInsertColumnClick,
|
|
onMoveColumnClick: handleMoveColumnClick,
|
|
onWidthChange: handleWidthChange,
|
|
onDeleteClick: handleDeleteHeaderClick,
|
|
onSaveClick: handleHeaderSave,
|
|
onTypeSelect: handleHeaderTypeSelect
|
|
})
|
|
});
|
|
}),
|
|
rows: appData.rows.map((row, i) => {
|
|
return __spreadProps(__spreadValues({}, row), {
|
|
component: /* @__PURE__ */ import_react30.default.createElement(import_react30.default.Fragment, null, appData.headers.map((header, j) => {
|
|
const cell = appData.cells.find((cell2) => cell2.rowId === row.id && cell2.headerId === header.id);
|
|
return /* @__PURE__ */ import_react30.default.createElement(EditableTd, {
|
|
key: cell.id,
|
|
cell,
|
|
headerType: header.type,
|
|
width: header.width,
|
|
tagUpdate,
|
|
tags: appData.tags.filter((tag) => tag.headerId === header.id),
|
|
onTagClick: handleTagClick,
|
|
onRemoveTagClick: handleRemoveTagClick,
|
|
onContentChange: handleCellContentChange,
|
|
onSaveContent: handleCellContentSave,
|
|
onColorChange: handleChangeColor,
|
|
onAddTag: handleAddTag
|
|
});
|
|
}), /* @__PURE__ */ import_react30.default.createElement("td", {
|
|
className: "NLT__td"
|
|
}, /* @__PURE__ */ import_react30.default.createElement(RowMenu, {
|
|
rowId: row.id,
|
|
isFirstRow: i === 0,
|
|
isLastRow: i === appData.rows.length - 1,
|
|
onMoveRowClick: handleMoveRowClick,
|
|
onDeleteClick: handleDeleteRowClick,
|
|
onInsertRowClick: handleInsertRowClick
|
|
})))
|
|
});
|
|
}),
|
|
onAddColumn: handleAddColumn,
|
|
onAddRow: handleAddRow
|
|
}));
|
|
}
|
|
|
|
// src/app/services/appData/external/merge.ts
|
|
var updateAppDataFromSavedState = (oldData, newData) => {
|
|
const updated = __spreadValues({}, newData);
|
|
newData.headers.forEach((_header, i) => {
|
|
if (i < oldData.headers.length) {
|
|
const { sortName, width, type } = oldData.headers[i];
|
|
updated.headers[i].sortName = sortName;
|
|
updated.headers[i].width = width;
|
|
updated.headers[i].type = type;
|
|
}
|
|
});
|
|
newData.cells.forEach((c, i) => {
|
|
const content = c.toString();
|
|
const { id, rowId, headerId } = c;
|
|
const header = newData.headers.find((header2) => header2.id === headerId);
|
|
const cell = findNewCell(id, rowId, headerId, header.type, content);
|
|
updated.cells[i] = cell;
|
|
if (cell.type === CONTENT_TYPE.TAG) {
|
|
const index = updated.tags.findIndex((tag) => tag.content === content);
|
|
if (index !== -1) {
|
|
updated.tags[index].selected.push(id);
|
|
} else {
|
|
updated.tags.push(initialTag(v4_default(), headerId, id, content, randomColor()));
|
|
}
|
|
}
|
|
});
|
|
newData.rows.forEach((_row, i) => {
|
|
if (i < oldData.headers.length) {
|
|
const { creationTime } = oldData.rows[i];
|
|
updated.rows[i].creationTime = creationTime;
|
|
}
|
|
});
|
|
newData.rows.forEach((_row, i) => {
|
|
if (i < oldData.headers.length) {
|
|
const { creationTime } = oldData.rows[i];
|
|
updated.rows[i].creationTime = creationTime;
|
|
}
|
|
});
|
|
newData.tags.forEach((tag, i) => {
|
|
if (i < oldData.tags.length) {
|
|
if (oldData.tags[i].content === tag.content) {
|
|
const { color } = oldData.tags[i];
|
|
updated.tags[i].color = color;
|
|
}
|
|
}
|
|
});
|
|
return updated;
|
|
};
|
|
|
|
// src/app/services/appData/external/load.ts
|
|
var loadAppData = (plugin, settings, el, sourcePath) => __async(void 0, null, function* () {
|
|
const parsedTable = parseTableFromEl(el);
|
|
if (DEBUG.LOAD_APP_DATA.PARSED_TABLE) {
|
|
console.log("[load][loadAppData]: parsedTableFromEl");
|
|
console.log(parsedTable);
|
|
}
|
|
const tableIndex = findTableIndex(parsedTable[0]);
|
|
if (settings.excludedFiles.includes(sourcePath)) {
|
|
console.log(`Excluding file path: ${sourcePath}`);
|
|
return { tableIndex, data: null };
|
|
}
|
|
if (settings.appData[sourcePath]) {
|
|
if (settings.appData[sourcePath][tableIndex]) {
|
|
const data2 = settings.appData[sourcePath][tableIndex];
|
|
settings.state[sourcePath] = {};
|
|
settings.state[sourcePath][tableIndex] = {
|
|
data: data2,
|
|
viewType: "live-preview",
|
|
shouldUpdate: false
|
|
};
|
|
delete settings.appData[sourcePath][tableIndex];
|
|
yield plugin.saveSettings();
|
|
}
|
|
}
|
|
const viewType = findCurrentViewType(el);
|
|
if (settings.state[sourcePath]) {
|
|
if (settings.state[sourcePath][tableIndex]) {
|
|
if (settings.state[sourcePath][tableIndex].data) {
|
|
const oldData = settings.state[sourcePath][tableIndex].data;
|
|
if (DEBUG.LOAD_APP_DATA.DATA) {
|
|
console.log("[load]: loadAppData");
|
|
console.log("Loading from cache.");
|
|
console.log(`Table: ${tableIndex}, View: ${viewType}`);
|
|
console.log(oldData);
|
|
}
|
|
const data2 = findAppData(parsedTable);
|
|
const updated = updateAppDataFromSavedState(oldData, data2);
|
|
if (DEBUG.LOAD_APP_DATA.IDS)
|
|
console.log(appDataIdsToMarkdown(data2));
|
|
if (DEBUG.LOAD_APP_DATA.TYPES)
|
|
console.log(appDataTypesToMarkdown(data2));
|
|
if (DEBUG.LOAD_APP_DATA.MARKDOWN)
|
|
console.log(appDataToMarkdown(data2));
|
|
return { tableIndex, data: updated };
|
|
}
|
|
}
|
|
}
|
|
const data = findAppData(parsedTable);
|
|
if (DEBUG.LOAD_APP_DATA.DATA) {
|
|
console.log("[load]: loadAppData");
|
|
console.log("Loading new.");
|
|
console.log(`Table: ${tableIndex}, View: ${viewType}`);
|
|
console.log(data);
|
|
}
|
|
if (DEBUG.LOAD_APP_DATA.IDS)
|
|
console.log(appDataIdsToMarkdown(data));
|
|
if (DEBUG.LOAD_APP_DATA.TYPES)
|
|
console.log(appDataTypesToMarkdown(data));
|
|
if (DEBUG.LOAD_APP_DATA.MARKDOWN)
|
|
console.log(appDataToMarkdown(data));
|
|
settings.state[sourcePath] = {};
|
|
settings.state[sourcePath][tableIndex] = {
|
|
data,
|
|
shouldUpdate: false,
|
|
viewType: findCurrentViewType(el)
|
|
};
|
|
yield plugin.saveSettings();
|
|
return { tableIndex, data };
|
|
});
|
|
|
|
// src/NLTTable.tsx
|
|
var NLTTable = class extends import_obsidian2.MarkdownRenderChild {
|
|
constructor(containerEl, app2, plugin, settings, sourcePath) {
|
|
super(containerEl);
|
|
this.app = app2;
|
|
this.plugin = plugin;
|
|
this.settings = settings;
|
|
this.sourcePath = sourcePath;
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
const { tableIndex, data } = yield loadAppData(this.plugin, this.settings, this.containerEl, this.sourcePath);
|
|
if (data) {
|
|
this.el = this.containerEl.createEl("div");
|
|
import_react_dom2.default.render(/* @__PURE__ */ import_react31.default.createElement(FocusProvider, {
|
|
plugin: this.plugin,
|
|
sourcePath: this.sourcePath,
|
|
tableIndex,
|
|
el: this.el
|
|
}, /* @__PURE__ */ import_react31.default.createElement(MenuProvider, null, /* @__PURE__ */ import_react31.default.createElement(App, {
|
|
plugin: this.plugin,
|
|
settings: this.settings,
|
|
data,
|
|
sourcePath: this.sourcePath,
|
|
tableIndex,
|
|
el: this.containerEl
|
|
}))), this.el);
|
|
this.containerEl.children[0].replaceWith(this.el);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/app/services/settings/index.ts
|
|
var DEFAULT_SETTINGS = {
|
|
appData: {},
|
|
state: {},
|
|
focusedElement: { id: "-1", type: TABBABLE_ELEMENT_TYPE.UNFOCUSED },
|
|
excludedFiles: []
|
|
};
|
|
|
|
// src/app/services/appData/mock/index.ts
|
|
var createEmptyMarkdownTable = () => {
|
|
const rows = [];
|
|
rows[0] = "| New Column |";
|
|
rows[1] = "| ---------- |";
|
|
return rows.join("\n");
|
|
};
|
|
|
|
// NltSettingsTab.ts
|
|
var import_obsidian3 = __toModule(require("obsidian"));
|
|
var NltSettingsTab = class extends import_obsidian3.PluginSettingTab {
|
|
constructor(app2, plugin) {
|
|
super(app2, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
let { containerEl } = this;
|
|
containerEl.empty();
|
|
new import_obsidian3.Setting(containerEl).setName("Excluded tables").setDesc("File paths whose tables will not be rendered as a Notion-Like table. Please separate different paths by commas e.g. folder/note1.md, folder/note2.md, note3.md").addText((text) => text.setValue(this.plugin.settings.excludedFiles.join(",")).onChange((value) => __async(this, null, function* () {
|
|
const paths = value.split(",");
|
|
this.plugin.settings.excludedFiles = paths;
|
|
yield this.plugin.saveSettings();
|
|
})));
|
|
}
|
|
};
|
|
|
|
// main.ts
|
|
var NltPlugin = class extends import_obsidian4.Plugin {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.focused = null;
|
|
this.focusTable = (tableIndex, sourcePath, viewType) => {
|
|
this.focused = {
|
|
tableIndex,
|
|
sourcePath,
|
|
viewType
|
|
};
|
|
};
|
|
this.blurTable = () => {
|
|
this.focused = null;
|
|
};
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
yield this.loadSettings();
|
|
yield this.forcePostProcessorReload();
|
|
this.registerMarkdownPostProcessor((element, context) => {
|
|
const table = element.getElementsByTagName("table");
|
|
if (table.length === 1) {
|
|
context.addChild(new NLTTable(element, this.app, this, this.settings, context.sourcePath));
|
|
}
|
|
});
|
|
this.addSettingTab(new NltSettingsTab(this.app, this));
|
|
this.registerCommands();
|
|
this.registerEvents();
|
|
});
|
|
}
|
|
registerEvents() {
|
|
this.registerEvent(this.app.vault.on("rename", (file, oldPath) => {
|
|
if (this.settings.state[oldPath]) {
|
|
const newPath = file.path;
|
|
const data = __spreadValues({}, this.settings.state[oldPath]);
|
|
delete this.settings.state[oldPath];
|
|
this.settings.state[newPath] = data;
|
|
this.saveSettings();
|
|
}
|
|
}));
|
|
}
|
|
registerCommands() {
|
|
this.addCommand({
|
|
id: "nlt-add-table",
|
|
name: "Add table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "=" }],
|
|
editorCallback: (editor) => {
|
|
editor.replaceSelection(createEmptyMarkdownTable());
|
|
}
|
|
});
|
|
this.addCommand({
|
|
id: "nlt-add-column",
|
|
name: "Add column to focused table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "\\" }],
|
|
callback: () => __async(this, null, function* () {
|
|
if (this.focused) {
|
|
const { tableIndex, sourcePath, viewType } = this.focused;
|
|
const oldData = this.settings.state[sourcePath][tableIndex].data;
|
|
const newData = addColumn(oldData);
|
|
yield saveAppData(this, this.settings, app, oldData, newData, sourcePath, tableIndex, viewType);
|
|
} else {
|
|
new import_obsidian4.Notice("No table focused. Please click a table to preform this operation.");
|
|
}
|
|
})
|
|
});
|
|
this.addCommand({
|
|
id: "nlt-add-row",
|
|
name: "Add row to focused table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "Enter" }],
|
|
callback: () => __async(this, null, function* () {
|
|
if (this.focused) {
|
|
const { tableIndex, sourcePath, viewType } = this.focused;
|
|
const oldData = this.settings.state[sourcePath][tableIndex].data;
|
|
const newData = addRow(oldData);
|
|
yield saveAppData(this, this.settings, app, oldData, newData, sourcePath, tableIndex, viewType);
|
|
} else {
|
|
new import_obsidian4.Notice("No table focused. Please click a table to preform this operation.");
|
|
}
|
|
})
|
|
});
|
|
}
|
|
loadSettings() {
|
|
return __async(this, null, function* () {
|
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
|
});
|
|
}
|
|
saveSettings() {
|
|
return __async(this, null, function* () {
|
|
yield this.saveData(this.settings);
|
|
});
|
|
}
|
|
onunload() {
|
|
return __async(this, null, function* () {
|
|
yield this.forcePostProcessorReload();
|
|
});
|
|
}
|
|
forcePostProcessorReload() {
|
|
return __async(this, null, function* () {
|
|
this.app.workspace.iterateAllLeaves((leaf) => {
|
|
const view = leaf.view;
|
|
if (view.getViewType() === "markdown") {
|
|
if (view instanceof import_obsidian4.MarkdownView)
|
|
view.previewMode.rerender(true);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
};
|
|
/*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*/
|
|
/*!
|
|
Copyright (c) 2018 Jed Watson.
|
|
Licensed under the MIT License (MIT), see
|
|
http://jedwatson.github.io/classnames
|
|
*/
|
|
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
|
/**
|
|
* Checks if an event is supported in the current execution environment.
|
|
*
|
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
* `reset`, `load`, `error`, and `select`.
|
|
*
|
|
* Borrows from Modernizr.
|
|
*
|
|
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
* @return {boolean} True if the event is supported.
|
|
* @internal
|
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
*/
|
|
/** @license MUI v5.0.0-alpha.71
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license MUI v5.4.4
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license MUI v5.5.0
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v0.20.2
|
|
* scheduler-tracing.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v0.20.2
|
|
* scheduler.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v16.13.1
|
|
* react-is.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v17.0.2
|
|
* react-dom.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v17.0.2
|
|
* react-is.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v17.0.2
|
|
* react-jsx-runtime.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v17.0.2
|
|
* react.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|