ai-speedometer 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-speedometer +86 -937
- package/package.json +5 -3
package/dist/ai-speedometer
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
3
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
20
4
|
var __export = (target, all) => {
|
|
21
5
|
for (var name in all)
|
|
22
6
|
__defProp(target, name, {
|
|
@@ -2049,838 +2033,8 @@ var init_headless = __esm(() => {
|
|
|
2049
2033
|
init_benchmark();
|
|
2050
2034
|
});
|
|
2051
2035
|
|
|
2052
|
-
// node_modules/react/cjs/react.development.js
|
|
2053
|
-
var require_react_development = __commonJS((exports, module) => {
|
|
2054
|
-
(function() {
|
|
2055
|
-
function defineDeprecationWarning(methodName, info) {
|
|
2056
|
-
Object.defineProperty(Component.prototype, methodName, {
|
|
2057
|
-
get: function() {
|
|
2058
|
-
console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
2059
|
-
}
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
function getIteratorFn(maybeIterable) {
|
|
2063
|
-
if (maybeIterable === null || typeof maybeIterable !== "object")
|
|
2064
|
-
return null;
|
|
2065
|
-
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
2066
|
-
return typeof maybeIterable === "function" ? maybeIterable : null;
|
|
2067
|
-
}
|
|
2068
|
-
function warnNoop(publicInstance, callerName) {
|
|
2069
|
-
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
2070
|
-
var warningKey = publicInstance + "." + callerName;
|
|
2071
|
-
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, publicInstance), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
2072
|
-
}
|
|
2073
|
-
function Component(props, context, updater) {
|
|
2074
|
-
this.props = props;
|
|
2075
|
-
this.context = context;
|
|
2076
|
-
this.refs = emptyObject;
|
|
2077
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
2078
|
-
}
|
|
2079
|
-
function ComponentDummy() {}
|
|
2080
|
-
function PureComponent(props, context, updater) {
|
|
2081
|
-
this.props = props;
|
|
2082
|
-
this.context = context;
|
|
2083
|
-
this.refs = emptyObject;
|
|
2084
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
2085
|
-
}
|
|
2086
|
-
function noop() {}
|
|
2087
|
-
function testStringCoercion(value) {
|
|
2088
|
-
return "" + value;
|
|
2089
|
-
}
|
|
2090
|
-
function checkKeyStringCoercion(value) {
|
|
2091
|
-
try {
|
|
2092
|
-
testStringCoercion(value);
|
|
2093
|
-
var JSCompiler_inline_result = false;
|
|
2094
|
-
} catch (e) {
|
|
2095
|
-
JSCompiler_inline_result = true;
|
|
2096
|
-
}
|
|
2097
|
-
if (JSCompiler_inline_result) {
|
|
2098
|
-
JSCompiler_inline_result = console;
|
|
2099
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
2100
|
-
var JSCompiler_inline_result$jscomp$0 = typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
2101
|
-
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
|
2102
|
-
return testStringCoercion(value);
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
function getComponentNameFromType(type) {
|
|
2106
|
-
if (type == null)
|
|
2107
|
-
return null;
|
|
2108
|
-
if (typeof type === "function")
|
|
2109
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
2110
|
-
if (typeof type === "string")
|
|
2111
|
-
return type;
|
|
2112
|
-
switch (type) {
|
|
2113
|
-
case REACT_FRAGMENT_TYPE:
|
|
2114
|
-
return "Fragment";
|
|
2115
|
-
case REACT_PROFILER_TYPE:
|
|
2116
|
-
return "Profiler";
|
|
2117
|
-
case REACT_STRICT_MODE_TYPE:
|
|
2118
|
-
return "StrictMode";
|
|
2119
|
-
case REACT_SUSPENSE_TYPE:
|
|
2120
|
-
return "Suspense";
|
|
2121
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2122
|
-
return "SuspenseList";
|
|
2123
|
-
case REACT_ACTIVITY_TYPE:
|
|
2124
|
-
return "Activity";
|
|
2125
|
-
}
|
|
2126
|
-
if (typeof type === "object")
|
|
2127
|
-
switch (typeof type.tag === "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
|
2128
|
-
case REACT_PORTAL_TYPE:
|
|
2129
|
-
return "Portal";
|
|
2130
|
-
case REACT_CONTEXT_TYPE:
|
|
2131
|
-
return type.displayName || "Context";
|
|
2132
|
-
case REACT_CONSUMER_TYPE:
|
|
2133
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
2134
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2135
|
-
var innerType = type.render;
|
|
2136
|
-
type = type.displayName;
|
|
2137
|
-
type || (type = innerType.displayName || innerType.name || "", type = type !== "" ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
2138
|
-
return type;
|
|
2139
|
-
case REACT_MEMO_TYPE:
|
|
2140
|
-
return innerType = type.displayName || null, innerType !== null ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
2141
|
-
case REACT_LAZY_TYPE:
|
|
2142
|
-
innerType = type._payload;
|
|
2143
|
-
type = type._init;
|
|
2144
|
-
try {
|
|
2145
|
-
return getComponentNameFromType(type(innerType));
|
|
2146
|
-
} catch (x) {}
|
|
2147
|
-
}
|
|
2148
|
-
return null;
|
|
2149
|
-
}
|
|
2150
|
-
function getTaskName(type) {
|
|
2151
|
-
if (type === REACT_FRAGMENT_TYPE)
|
|
2152
|
-
return "<>";
|
|
2153
|
-
if (typeof type === "object" && type !== null && type.$$typeof === REACT_LAZY_TYPE)
|
|
2154
|
-
return "<...>";
|
|
2155
|
-
try {
|
|
2156
|
-
var name = getComponentNameFromType(type);
|
|
2157
|
-
return name ? "<" + name + ">" : "<...>";
|
|
2158
|
-
} catch (x) {
|
|
2159
|
-
return "<...>";
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
function getOwner() {
|
|
2163
|
-
var dispatcher = ReactSharedInternals.A;
|
|
2164
|
-
return dispatcher === null ? null : dispatcher.getOwner();
|
|
2165
|
-
}
|
|
2166
|
-
function UnknownOwner() {
|
|
2167
|
-
return Error("react-stack-top-frame");
|
|
2168
|
-
}
|
|
2169
|
-
function hasValidKey(config) {
|
|
2170
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
2171
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
2172
|
-
if (getter && getter.isReactWarning)
|
|
2173
|
-
return false;
|
|
2174
|
-
}
|
|
2175
|
-
return config.key !== undefined;
|
|
2176
|
-
}
|
|
2177
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
2178
|
-
function warnAboutAccessingKey() {
|
|
2179
|
-
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
|
2180
|
-
}
|
|
2181
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
2182
|
-
Object.defineProperty(props, "key", {
|
|
2183
|
-
get: warnAboutAccessingKey,
|
|
2184
|
-
configurable: true
|
|
2185
|
-
});
|
|
2186
|
-
}
|
|
2187
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
2188
|
-
var componentName = getComponentNameFromType(this.type);
|
|
2189
|
-
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
|
2190
|
-
componentName = this.props.ref;
|
|
2191
|
-
return componentName !== undefined ? componentName : null;
|
|
2192
|
-
}
|
|
2193
|
-
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
2194
|
-
var refProp = props.ref;
|
|
2195
|
-
type = {
|
|
2196
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
2197
|
-
type,
|
|
2198
|
-
key,
|
|
2199
|
-
props,
|
|
2200
|
-
_owner: owner
|
|
2201
|
-
};
|
|
2202
|
-
(refProp !== undefined ? refProp : null) !== null ? Object.defineProperty(type, "ref", {
|
|
2203
|
-
enumerable: false,
|
|
2204
|
-
get: elementRefGetterWithDeprecationWarning
|
|
2205
|
-
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
2206
|
-
type._store = {};
|
|
2207
|
-
Object.defineProperty(type._store, "validated", {
|
|
2208
|
-
configurable: false,
|
|
2209
|
-
enumerable: false,
|
|
2210
|
-
writable: true,
|
|
2211
|
-
value: 0
|
|
2212
|
-
});
|
|
2213
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
2214
|
-
configurable: false,
|
|
2215
|
-
enumerable: false,
|
|
2216
|
-
writable: true,
|
|
2217
|
-
value: null
|
|
2218
|
-
});
|
|
2219
|
-
Object.defineProperty(type, "_debugStack", {
|
|
2220
|
-
configurable: false,
|
|
2221
|
-
enumerable: false,
|
|
2222
|
-
writable: true,
|
|
2223
|
-
value: debugStack
|
|
2224
|
-
});
|
|
2225
|
-
Object.defineProperty(type, "_debugTask", {
|
|
2226
|
-
configurable: false,
|
|
2227
|
-
enumerable: false,
|
|
2228
|
-
writable: true,
|
|
2229
|
-
value: debugTask
|
|
2230
|
-
});
|
|
2231
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
2232
|
-
return type;
|
|
2233
|
-
}
|
|
2234
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
|
2235
|
-
newKey = ReactElement(oldElement.type, newKey, oldElement.props, oldElement._owner, oldElement._debugStack, oldElement._debugTask);
|
|
2236
|
-
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
2237
|
-
return newKey;
|
|
2238
|
-
}
|
|
2239
|
-
function validateChildKeys(node) {
|
|
2240
|
-
isValidElement(node) ? node._store && (node._store.validated = 1) : typeof node === "object" && node !== null && node.$$typeof === REACT_LAZY_TYPE && (node._payload.status === "fulfilled" ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
2241
|
-
}
|
|
2242
|
-
function isValidElement(object) {
|
|
2243
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2244
|
-
}
|
|
2245
|
-
function escape(key) {
|
|
2246
|
-
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
2247
|
-
return "$" + key.replace(/[=:]/g, function(match) {
|
|
2248
|
-
return escaperLookup[match];
|
|
2249
|
-
});
|
|
2250
|
-
}
|
|
2251
|
-
function getElementKey(element, index) {
|
|
2252
|
-
return typeof element === "object" && element !== null && element.key != null ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
2253
|
-
}
|
|
2254
|
-
function resolveThenable(thenable) {
|
|
2255
|
-
switch (thenable.status) {
|
|
2256
|
-
case "fulfilled":
|
|
2257
|
-
return thenable.value;
|
|
2258
|
-
case "rejected":
|
|
2259
|
-
throw thenable.reason;
|
|
2260
|
-
default:
|
|
2261
|
-
switch (typeof thenable.status === "string" ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
|
|
2262
|
-
thenable.status === "pending" && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
2263
|
-
}, function(error) {
|
|
2264
|
-
thenable.status === "pending" && (thenable.status = "rejected", thenable.reason = error);
|
|
2265
|
-
})), thenable.status) {
|
|
2266
|
-
case "fulfilled":
|
|
2267
|
-
return thenable.value;
|
|
2268
|
-
case "rejected":
|
|
2269
|
-
throw thenable.reason;
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
throw thenable;
|
|
2273
|
-
}
|
|
2274
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
2275
|
-
var type = typeof children;
|
|
2276
|
-
if (type === "undefined" || type === "boolean")
|
|
2277
|
-
children = null;
|
|
2278
|
-
var invokeCallback = false;
|
|
2279
|
-
if (children === null)
|
|
2280
|
-
invokeCallback = true;
|
|
2281
|
-
else
|
|
2282
|
-
switch (type) {
|
|
2283
|
-
case "bigint":
|
|
2284
|
-
case "string":
|
|
2285
|
-
case "number":
|
|
2286
|
-
invokeCallback = true;
|
|
2287
|
-
break;
|
|
2288
|
-
case "object":
|
|
2289
|
-
switch (children.$$typeof) {
|
|
2290
|
-
case REACT_ELEMENT_TYPE:
|
|
2291
|
-
case REACT_PORTAL_TYPE:
|
|
2292
|
-
invokeCallback = true;
|
|
2293
|
-
break;
|
|
2294
|
-
case REACT_LAZY_TYPE:
|
|
2295
|
-
return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
if (invokeCallback) {
|
|
2299
|
-
invokeCallback = children;
|
|
2300
|
-
callback = callback(invokeCallback);
|
|
2301
|
-
var childKey = nameSoFar === "" ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
2302
|
-
isArrayImpl(callback) ? (escapedPrefix = "", childKey != null && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
2303
|
-
return c;
|
|
2304
|
-
})) : callback != null && (isValidElement(callback) && (callback.key != null && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(callback, escapedPrefix + (callback.key == null || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + childKey), nameSoFar !== "" && invokeCallback != null && isValidElement(invokeCallback) && invokeCallback.key == null && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
2305
|
-
return 1;
|
|
2306
|
-
}
|
|
2307
|
-
invokeCallback = 0;
|
|
2308
|
-
childKey = nameSoFar === "" ? "." : nameSoFar + ":";
|
|
2309
|
-
if (isArrayImpl(children))
|
|
2310
|
-
for (var i = 0;i < children.length; i++)
|
|
2311
|
-
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
2312
|
-
else if (i = getIteratorFn(children), typeof i === "function")
|
|
2313
|
-
for (i === children.entries && (didWarnAboutMaps || console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), didWarnAboutMaps = true), children = i.call(children), i = 0;!(nameSoFar = children.next()).done; )
|
|
2314
|
-
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
2315
|
-
else if (type === "object") {
|
|
2316
|
-
if (typeof children.then === "function")
|
|
2317
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
|
2318
|
-
array = String(children);
|
|
2319
|
-
throw Error("Objects are not valid as a React child (found: " + (array === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead.");
|
|
2320
|
-
}
|
|
2321
|
-
return invokeCallback;
|
|
2322
|
-
}
|
|
2323
|
-
function mapChildren(children, func, context) {
|
|
2324
|
-
if (children == null)
|
|
2325
|
-
return children;
|
|
2326
|
-
var result = [], count = 0;
|
|
2327
|
-
mapIntoArray(children, result, "", "", function(child) {
|
|
2328
|
-
return func.call(context, child, count++);
|
|
2329
|
-
});
|
|
2330
|
-
return result;
|
|
2331
|
-
}
|
|
2332
|
-
function lazyInitializer(payload) {
|
|
2333
|
-
if (payload._status === -1) {
|
|
2334
|
-
var ioInfo = payload._ioInfo;
|
|
2335
|
-
ioInfo != null && (ioInfo.start = ioInfo.end = performance.now());
|
|
2336
|
-
ioInfo = payload._result;
|
|
2337
|
-
var thenable = ioInfo();
|
|
2338
|
-
thenable.then(function(moduleObject) {
|
|
2339
|
-
if (payload._status === 0 || payload._status === -1) {
|
|
2340
|
-
payload._status = 1;
|
|
2341
|
-
payload._result = moduleObject;
|
|
2342
|
-
var _ioInfo = payload._ioInfo;
|
|
2343
|
-
_ioInfo != null && (_ioInfo.end = performance.now());
|
|
2344
|
-
thenable.status === undefined && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
2345
|
-
}
|
|
2346
|
-
}, function(error) {
|
|
2347
|
-
if (payload._status === 0 || payload._status === -1) {
|
|
2348
|
-
payload._status = 2;
|
|
2349
|
-
payload._result = error;
|
|
2350
|
-
var _ioInfo2 = payload._ioInfo;
|
|
2351
|
-
_ioInfo2 != null && (_ioInfo2.end = performance.now());
|
|
2352
|
-
thenable.status === undefined && (thenable.status = "rejected", thenable.reason = error);
|
|
2353
|
-
}
|
|
2354
|
-
});
|
|
2355
|
-
ioInfo = payload._ioInfo;
|
|
2356
|
-
if (ioInfo != null) {
|
|
2357
|
-
ioInfo.value = thenable;
|
|
2358
|
-
var displayName = thenable.displayName;
|
|
2359
|
-
typeof displayName === "string" && (ioInfo.name = displayName);
|
|
2360
|
-
}
|
|
2361
|
-
payload._status === -1 && (payload._status = 0, payload._result = thenable);
|
|
2362
|
-
}
|
|
2363
|
-
if (payload._status === 1)
|
|
2364
|
-
return ioInfo = payload._result, ioInfo === undefined && console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2365
|
-
|
|
2366
|
-
Your code should look like:
|
|
2367
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
2368
|
-
|
|
2369
|
-
Did you accidentally put curly braces around the import?`, ioInfo), "default" in ioInfo || console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2370
|
-
|
|
2371
|
-
Your code should look like:
|
|
2372
|
-
const MyComponent = lazy(() => import('./MyComponent'))`, ioInfo), ioInfo.default;
|
|
2373
|
-
throw payload._result;
|
|
2374
|
-
}
|
|
2375
|
-
function resolveDispatcher() {
|
|
2376
|
-
var dispatcher = ReactSharedInternals.H;
|
|
2377
|
-
dispatcher === null && console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2378
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
2379
|
-
2. You might be breaking the Rules of Hooks
|
|
2380
|
-
3. You might have more than one copy of React in the same app
|
|
2381
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`);
|
|
2382
|
-
return dispatcher;
|
|
2383
|
-
}
|
|
2384
|
-
function releaseAsyncTransition() {
|
|
2385
|
-
ReactSharedInternals.asyncTransitions--;
|
|
2386
|
-
}
|
|
2387
|
-
function enqueueTask(task) {
|
|
2388
|
-
if (enqueueTaskImpl === null)
|
|
2389
|
-
try {
|
|
2390
|
-
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
2391
|
-
enqueueTaskImpl = (module && module[requireString]).call(module, "timers").setImmediate;
|
|
2392
|
-
} catch (_err) {
|
|
2393
|
-
enqueueTaskImpl = function(callback) {
|
|
2394
|
-
didWarnAboutMessageChannel === false && (didWarnAboutMessageChannel = true, typeof MessageChannel === "undefined" && console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
|
|
2395
|
-
var channel = new MessageChannel;
|
|
2396
|
-
channel.port1.onmessage = callback;
|
|
2397
|
-
channel.port2.postMessage(undefined);
|
|
2398
|
-
};
|
|
2399
|
-
}
|
|
2400
|
-
return enqueueTaskImpl(task);
|
|
2401
|
-
}
|
|
2402
|
-
function aggregateErrors(errors) {
|
|
2403
|
-
return 1 < errors.length && typeof AggregateError === "function" ? new AggregateError(errors) : errors[0];
|
|
2404
|
-
}
|
|
2405
|
-
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
2406
|
-
prevActScopeDepth !== actScopeDepth - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
|
2407
|
-
actScopeDepth = prevActScopeDepth;
|
|
2408
|
-
}
|
|
2409
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2410
|
-
var queue = ReactSharedInternals.actQueue;
|
|
2411
|
-
if (queue !== null)
|
|
2412
|
-
if (queue.length !== 0)
|
|
2413
|
-
try {
|
|
2414
|
-
flushActQueue(queue);
|
|
2415
|
-
enqueueTask(function() {
|
|
2416
|
-
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2417
|
-
});
|
|
2418
|
-
return;
|
|
2419
|
-
} catch (error) {
|
|
2420
|
-
ReactSharedInternals.thrownErrors.push(error);
|
|
2421
|
-
}
|
|
2422
|
-
else
|
|
2423
|
-
ReactSharedInternals.actQueue = null;
|
|
2424
|
-
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
2425
|
-
}
|
|
2426
|
-
function flushActQueue(queue) {
|
|
2427
|
-
if (!isFlushing) {
|
|
2428
|
-
isFlushing = true;
|
|
2429
|
-
var i = 0;
|
|
2430
|
-
try {
|
|
2431
|
-
for (;i < queue.length; i++) {
|
|
2432
|
-
var callback = queue[i];
|
|
2433
|
-
do {
|
|
2434
|
-
ReactSharedInternals.didUsePromise = false;
|
|
2435
|
-
var continuation = callback(false);
|
|
2436
|
-
if (continuation !== null) {
|
|
2437
|
-
if (ReactSharedInternals.didUsePromise) {
|
|
2438
|
-
queue[i] = callback;
|
|
2439
|
-
queue.splice(0, i);
|
|
2440
|
-
return;
|
|
2441
|
-
}
|
|
2442
|
-
callback = continuation;
|
|
2443
|
-
} else
|
|
2444
|
-
break;
|
|
2445
|
-
} while (1);
|
|
2446
|
-
}
|
|
2447
|
-
queue.length = 0;
|
|
2448
|
-
} catch (error) {
|
|
2449
|
-
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
2450
|
-
} finally {
|
|
2451
|
-
isFlushing = false;
|
|
2452
|
-
}
|
|
2453
|
-
}
|
|
2454
|
-
}
|
|
2455
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
2456
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
2457
|
-
isMounted: function() {
|
|
2458
|
-
return false;
|
|
2459
|
-
},
|
|
2460
|
-
enqueueForceUpdate: function(publicInstance) {
|
|
2461
|
-
warnNoop(publicInstance, "forceUpdate");
|
|
2462
|
-
},
|
|
2463
|
-
enqueueReplaceState: function(publicInstance) {
|
|
2464
|
-
warnNoop(publicInstance, "replaceState");
|
|
2465
|
-
},
|
|
2466
|
-
enqueueSetState: function(publicInstance) {
|
|
2467
|
-
warnNoop(publicInstance, "setState");
|
|
2468
|
-
}
|
|
2469
|
-
}, assign = Object.assign, emptyObject = {};
|
|
2470
|
-
Object.freeze(emptyObject);
|
|
2471
|
-
Component.prototype.isReactComponent = {};
|
|
2472
|
-
Component.prototype.setState = function(partialState, callback) {
|
|
2473
|
-
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null)
|
|
2474
|
-
throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
2475
|
-
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
2476
|
-
};
|
|
2477
|
-
Component.prototype.forceUpdate = function(callback) {
|
|
2478
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
2479
|
-
};
|
|
2480
|
-
var deprecatedAPIs = {
|
|
2481
|
-
isMounted: [
|
|
2482
|
-
"isMounted",
|
|
2483
|
-
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
2484
|
-
],
|
|
2485
|
-
replaceState: [
|
|
2486
|
-
"replaceState",
|
|
2487
|
-
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
2488
|
-
]
|
|
2489
|
-
};
|
|
2490
|
-
for (fnName in deprecatedAPIs)
|
|
2491
|
-
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
2492
|
-
ComponentDummy.prototype = Component.prototype;
|
|
2493
|
-
deprecatedAPIs = PureComponent.prototype = new ComponentDummy;
|
|
2494
|
-
deprecatedAPIs.constructor = PureComponent;
|
|
2495
|
-
assign(deprecatedAPIs, Component.prototype);
|
|
2496
|
-
deprecatedAPIs.isPureReactComponent = true;
|
|
2497
|
-
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
2498
|
-
H: null,
|
|
2499
|
-
A: null,
|
|
2500
|
-
T: null,
|
|
2501
|
-
S: null,
|
|
2502
|
-
actQueue: null,
|
|
2503
|
-
asyncTransitions: 0,
|
|
2504
|
-
isBatchingLegacy: false,
|
|
2505
|
-
didScheduleLegacyUpdate: false,
|
|
2506
|
-
didUsePromise: false,
|
|
2507
|
-
thrownErrors: [],
|
|
2508
|
-
getCurrentStack: null,
|
|
2509
|
-
recentlyCreatedOwnerStacks: 0
|
|
2510
|
-
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
2511
|
-
return null;
|
|
2512
|
-
};
|
|
2513
|
-
deprecatedAPIs = {
|
|
2514
|
-
react_stack_bottom_frame: function(callStackForError) {
|
|
2515
|
-
return callStackForError();
|
|
2516
|
-
}
|
|
2517
|
-
};
|
|
2518
|
-
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
2519
|
-
var didWarnAboutElementRef = {};
|
|
2520
|
-
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(deprecatedAPIs, UnknownOwner)();
|
|
2521
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
2522
|
-
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = typeof reportError === "function" ? reportError : function(error) {
|
|
2523
|
-
if (typeof window === "object" && typeof window.ErrorEvent === "function") {
|
|
2524
|
-
var event = new window.ErrorEvent("error", {
|
|
2525
|
-
bubbles: true,
|
|
2526
|
-
cancelable: true,
|
|
2527
|
-
message: typeof error === "object" && error !== null && typeof error.message === "string" ? String(error.message) : String(error),
|
|
2528
|
-
error
|
|
2529
|
-
});
|
|
2530
|
-
if (!window.dispatchEvent(event))
|
|
2531
|
-
return;
|
|
2532
|
-
} else if (typeof process === "object" && typeof process.emit === "function") {
|
|
2533
|
-
process.emit("uncaughtException", error);
|
|
2534
|
-
return;
|
|
2535
|
-
}
|
|
2536
|
-
console.error(error);
|
|
2537
|
-
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = typeof queueMicrotask === "function" ? function(callback) {
|
|
2538
|
-
queueMicrotask(function() {
|
|
2539
|
-
return queueMicrotask(callback);
|
|
2540
|
-
});
|
|
2541
|
-
} : enqueueTask;
|
|
2542
|
-
deprecatedAPIs = Object.freeze({
|
|
2543
|
-
__proto__: null,
|
|
2544
|
-
c: function(size) {
|
|
2545
|
-
return resolveDispatcher().useMemoCache(size);
|
|
2546
|
-
}
|
|
2547
|
-
});
|
|
2548
|
-
var fnName = {
|
|
2549
|
-
map: mapChildren,
|
|
2550
|
-
forEach: function(children, forEachFunc, forEachContext) {
|
|
2551
|
-
mapChildren(children, function() {
|
|
2552
|
-
forEachFunc.apply(this, arguments);
|
|
2553
|
-
}, forEachContext);
|
|
2554
|
-
},
|
|
2555
|
-
count: function(children) {
|
|
2556
|
-
var n = 0;
|
|
2557
|
-
mapChildren(children, function() {
|
|
2558
|
-
n++;
|
|
2559
|
-
});
|
|
2560
|
-
return n;
|
|
2561
|
-
},
|
|
2562
|
-
toArray: function(children) {
|
|
2563
|
-
return mapChildren(children, function(child) {
|
|
2564
|
-
return child;
|
|
2565
|
-
}) || [];
|
|
2566
|
-
},
|
|
2567
|
-
only: function(children) {
|
|
2568
|
-
if (!isValidElement(children))
|
|
2569
|
-
throw Error("React.Children.only expected to receive a single React element child.");
|
|
2570
|
-
return children;
|
|
2571
|
-
}
|
|
2572
|
-
};
|
|
2573
|
-
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
2574
|
-
exports.Children = fnName;
|
|
2575
|
-
exports.Component = Component;
|
|
2576
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2577
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2578
|
-
exports.PureComponent = PureComponent;
|
|
2579
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2580
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2581
|
-
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
2582
|
-
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
2583
|
-
exports.act = function(callback) {
|
|
2584
|
-
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
2585
|
-
actScopeDepth++;
|
|
2586
|
-
var queue = ReactSharedInternals.actQueue = prevActQueue !== null ? prevActQueue : [], didAwaitActCall = false;
|
|
2587
|
-
try {
|
|
2588
|
-
var result = callback();
|
|
2589
|
-
} catch (error) {
|
|
2590
|
-
ReactSharedInternals.thrownErrors.push(error);
|
|
2591
|
-
}
|
|
2592
|
-
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
2593
|
-
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
2594
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
2595
|
-
var thenable = result;
|
|
2596
|
-
queueSeveralMicrotasks(function() {
|
|
2597
|
-
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
|
|
2598
|
-
});
|
|
2599
|
-
return {
|
|
2600
|
-
then: function(resolve, reject) {
|
|
2601
|
-
didAwaitActCall = true;
|
|
2602
|
-
thenable.then(function(returnValue) {
|
|
2603
|
-
popActScope(prevActQueue, prevActScopeDepth);
|
|
2604
|
-
if (prevActScopeDepth === 0) {
|
|
2605
|
-
try {
|
|
2606
|
-
flushActQueue(queue), enqueueTask(function() {
|
|
2607
|
-
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2608
|
-
});
|
|
2609
|
-
} catch (error$0) {
|
|
2610
|
-
ReactSharedInternals.thrownErrors.push(error$0);
|
|
2611
|
-
}
|
|
2612
|
-
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
2613
|
-
var _thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
|
|
2614
|
-
ReactSharedInternals.thrownErrors.length = 0;
|
|
2615
|
-
reject(_thrownError);
|
|
2616
|
-
}
|
|
2617
|
-
} else
|
|
2618
|
-
resolve(returnValue);
|
|
2619
|
-
}, function(error) {
|
|
2620
|
-
popActScope(prevActQueue, prevActScopeDepth);
|
|
2621
|
-
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
2622
|
-
});
|
|
2623
|
-
}
|
|
2624
|
-
};
|
|
2625
|
-
}
|
|
2626
|
-
var returnValue$jscomp$0 = result;
|
|
2627
|
-
popActScope(prevActQueue, prevActScopeDepth);
|
|
2628
|
-
prevActScopeDepth === 0 && (flushActQueue(queue), queue.length !== 0 && queueSeveralMicrotasks(function() {
|
|
2629
|
-
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"));
|
|
2630
|
-
}), ReactSharedInternals.actQueue = null);
|
|
2631
|
-
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
2632
|
-
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
2633
|
-
return {
|
|
2634
|
-
then: function(resolve, reject) {
|
|
2635
|
-
didAwaitActCall = true;
|
|
2636
|
-
prevActScopeDepth === 0 ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
2637
|
-
return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve, reject);
|
|
2638
|
-
})) : resolve(returnValue$jscomp$0);
|
|
2639
|
-
}
|
|
2640
|
-
};
|
|
2641
|
-
};
|
|
2642
|
-
exports.cache = function(fn) {
|
|
2643
|
-
return function() {
|
|
2644
|
-
return fn.apply(null, arguments);
|
|
2645
|
-
};
|
|
2646
|
-
};
|
|
2647
|
-
exports.cacheSignal = function() {
|
|
2648
|
-
return null;
|
|
2649
|
-
};
|
|
2650
|
-
exports.captureOwnerStack = function() {
|
|
2651
|
-
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
2652
|
-
return getCurrentStack === null ? null : getCurrentStack();
|
|
2653
|
-
};
|
|
2654
|
-
exports.cloneElement = function(element, config, children) {
|
|
2655
|
-
if (element === null || element === undefined)
|
|
2656
|
-
throw Error("The argument must be a React element, but you passed " + element + ".");
|
|
2657
|
-
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
2658
|
-
if (config != null) {
|
|
2659
|
-
var JSCompiler_inline_result;
|
|
2660
|
-
a: {
|
|
2661
|
-
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(config, "ref").get) && JSCompiler_inline_result.isReactWarning) {
|
|
2662
|
-
JSCompiler_inline_result = false;
|
|
2663
|
-
break a;
|
|
2664
|
-
}
|
|
2665
|
-
JSCompiler_inline_result = config.ref !== undefined;
|
|
2666
|
-
}
|
|
2667
|
-
JSCompiler_inline_result && (owner = getOwner());
|
|
2668
|
-
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
2669
|
-
for (propName in config)
|
|
2670
|
-
!hasOwnProperty.call(config, propName) || propName === "key" || propName === "__self" || propName === "__source" || propName === "ref" && config.ref === undefined || (props[propName] = config[propName]);
|
|
2671
|
-
}
|
|
2672
|
-
var propName = arguments.length - 2;
|
|
2673
|
-
if (propName === 1)
|
|
2674
|
-
props.children = children;
|
|
2675
|
-
else if (1 < propName) {
|
|
2676
|
-
JSCompiler_inline_result = Array(propName);
|
|
2677
|
-
for (var i = 0;i < propName; i++)
|
|
2678
|
-
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
2679
|
-
props.children = JSCompiler_inline_result;
|
|
2680
|
-
}
|
|
2681
|
-
props = ReactElement(element.type, key, props, owner, element._debugStack, element._debugTask);
|
|
2682
|
-
for (key = 2;key < arguments.length; key++)
|
|
2683
|
-
validateChildKeys(arguments[key]);
|
|
2684
|
-
return props;
|
|
2685
|
-
};
|
|
2686
|
-
exports.createContext = function(defaultValue) {
|
|
2687
|
-
defaultValue = {
|
|
2688
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
2689
|
-
_currentValue: defaultValue,
|
|
2690
|
-
_currentValue2: defaultValue,
|
|
2691
|
-
_threadCount: 0,
|
|
2692
|
-
Provider: null,
|
|
2693
|
-
Consumer: null
|
|
2694
|
-
};
|
|
2695
|
-
defaultValue.Provider = defaultValue;
|
|
2696
|
-
defaultValue.Consumer = {
|
|
2697
|
-
$$typeof: REACT_CONSUMER_TYPE,
|
|
2698
|
-
_context: defaultValue
|
|
2699
|
-
};
|
|
2700
|
-
defaultValue._currentRenderer = null;
|
|
2701
|
-
defaultValue._currentRenderer2 = null;
|
|
2702
|
-
return defaultValue;
|
|
2703
|
-
};
|
|
2704
|
-
exports.createElement = function(type, config, children) {
|
|
2705
|
-
for (var i = 2;i < arguments.length; i++)
|
|
2706
|
-
validateChildKeys(arguments[i]);
|
|
2707
|
-
i = {};
|
|
2708
|
-
var key = null;
|
|
2709
|
-
if (config != null)
|
|
2710
|
-
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
2711
|
-
hasOwnProperty.call(config, propName) && propName !== "key" && propName !== "__self" && propName !== "__source" && (i[propName] = config[propName]);
|
|
2712
|
-
var childrenLength = arguments.length - 2;
|
|
2713
|
-
if (childrenLength === 1)
|
|
2714
|
-
i.children = children;
|
|
2715
|
-
else if (1 < childrenLength) {
|
|
2716
|
-
for (var childArray = Array(childrenLength), _i = 0;_i < childrenLength; _i++)
|
|
2717
|
-
childArray[_i] = arguments[_i + 2];
|
|
2718
|
-
Object.freeze && Object.freeze(childArray);
|
|
2719
|
-
i.children = childArray;
|
|
2720
|
-
}
|
|
2721
|
-
if (type && type.defaultProps)
|
|
2722
|
-
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
2723
|
-
i[propName] === undefined && (i[propName] = childrenLength[propName]);
|
|
2724
|
-
key && defineKeyPropWarningGetter(i, typeof type === "function" ? type.displayName || type.name || "Unknown" : type);
|
|
2725
|
-
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
2726
|
-
return ReactElement(type, key, i, getOwner(), propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
|
2727
|
-
};
|
|
2728
|
-
exports.createRef = function() {
|
|
2729
|
-
var refObject = { current: null };
|
|
2730
|
-
Object.seal(refObject);
|
|
2731
|
-
return refObject;
|
|
2732
|
-
};
|
|
2733
|
-
exports.forwardRef = function(render) {
|
|
2734
|
-
render != null && render.$$typeof === REACT_MEMO_TYPE ? console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof render !== "function" ? console.error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render) : render.length !== 0 && render.length !== 2 && console.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.");
|
|
2735
|
-
render != null && render.defaultProps != null && console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");
|
|
2736
|
-
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
2737
|
-
Object.defineProperty(elementType, "displayName", {
|
|
2738
|
-
enumerable: false,
|
|
2739
|
-
configurable: true,
|
|
2740
|
-
get: function() {
|
|
2741
|
-
return ownName;
|
|
2742
|
-
},
|
|
2743
|
-
set: function(name) {
|
|
2744
|
-
ownName = name;
|
|
2745
|
-
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
2746
|
-
}
|
|
2747
|
-
});
|
|
2748
|
-
return elementType;
|
|
2749
|
-
};
|
|
2750
|
-
exports.isValidElement = isValidElement;
|
|
2751
|
-
exports.lazy = function(ctor) {
|
|
2752
|
-
ctor = { _status: -1, _result: ctor };
|
|
2753
|
-
var lazyType = {
|
|
2754
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
2755
|
-
_payload: ctor,
|
|
2756
|
-
_init: lazyInitializer
|
|
2757
|
-
}, ioInfo = {
|
|
2758
|
-
name: "lazy",
|
|
2759
|
-
start: -1,
|
|
2760
|
-
end: -1,
|
|
2761
|
-
value: null,
|
|
2762
|
-
owner: null,
|
|
2763
|
-
debugStack: Error("react-stack-top-frame"),
|
|
2764
|
-
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
2765
|
-
};
|
|
2766
|
-
ctor._ioInfo = ioInfo;
|
|
2767
|
-
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
2768
|
-
return lazyType;
|
|
2769
|
-
};
|
|
2770
|
-
exports.memo = function(type, compare) {
|
|
2771
|
-
type == null && console.error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
2772
|
-
compare = {
|
|
2773
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
2774
|
-
type,
|
|
2775
|
-
compare: compare === undefined ? null : compare
|
|
2776
|
-
};
|
|
2777
|
-
var ownName;
|
|
2778
|
-
Object.defineProperty(compare, "displayName", {
|
|
2779
|
-
enumerable: false,
|
|
2780
|
-
configurable: true,
|
|
2781
|
-
get: function() {
|
|
2782
|
-
return ownName;
|
|
2783
|
-
},
|
|
2784
|
-
set: function(name) {
|
|
2785
|
-
ownName = name;
|
|
2786
|
-
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
2787
|
-
}
|
|
2788
|
-
});
|
|
2789
|
-
return compare;
|
|
2790
|
-
};
|
|
2791
|
-
exports.startTransition = function(scope) {
|
|
2792
|
-
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
2793
|
-
currentTransition._updatedFibers = new Set;
|
|
2794
|
-
ReactSharedInternals.T = currentTransition;
|
|
2795
|
-
try {
|
|
2796
|
-
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
2797
|
-
onStartTransitionFinish !== null && onStartTransitionFinish(currentTransition, returnValue);
|
|
2798
|
-
typeof returnValue === "object" && returnValue !== null && typeof returnValue.then === "function" && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
|
2799
|
-
} catch (error) {
|
|
2800
|
-
reportGlobalError(error);
|
|
2801
|
-
} finally {
|
|
2802
|
-
prevTransition === null && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")), prevTransition !== null && currentTransition.types !== null && (prevTransition.types !== null && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
2803
|
-
}
|
|
2804
|
-
};
|
|
2805
|
-
exports.unstable_useCacheRefresh = function() {
|
|
2806
|
-
return resolveDispatcher().useCacheRefresh();
|
|
2807
|
-
};
|
|
2808
|
-
exports.use = function(usable) {
|
|
2809
|
-
return resolveDispatcher().use(usable);
|
|
2810
|
-
};
|
|
2811
|
-
exports.useActionState = function(action, initialState, permalink) {
|
|
2812
|
-
return resolveDispatcher().useActionState(action, initialState, permalink);
|
|
2813
|
-
};
|
|
2814
|
-
exports.useCallback = function(callback, deps) {
|
|
2815
|
-
return resolveDispatcher().useCallback(callback, deps);
|
|
2816
|
-
};
|
|
2817
|
-
exports.useContext = function(Context) {
|
|
2818
|
-
var dispatcher = resolveDispatcher();
|
|
2819
|
-
Context.$$typeof === REACT_CONSUMER_TYPE && console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?");
|
|
2820
|
-
return dispatcher.useContext(Context);
|
|
2821
|
-
};
|
|
2822
|
-
exports.useDebugValue = function(value, formatterFn) {
|
|
2823
|
-
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
2824
|
-
};
|
|
2825
|
-
exports.useDeferredValue = function(value, initialValue) {
|
|
2826
|
-
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
2827
|
-
};
|
|
2828
|
-
exports.useEffect = function(create, deps) {
|
|
2829
|
-
create == null && console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
|
2830
|
-
return resolveDispatcher().useEffect(create, deps);
|
|
2831
|
-
};
|
|
2832
|
-
exports.useEffectEvent = function(callback) {
|
|
2833
|
-
return resolveDispatcher().useEffectEvent(callback);
|
|
2834
|
-
};
|
|
2835
|
-
exports.useId = function() {
|
|
2836
|
-
return resolveDispatcher().useId();
|
|
2837
|
-
};
|
|
2838
|
-
exports.useImperativeHandle = function(ref, create, deps) {
|
|
2839
|
-
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
2840
|
-
};
|
|
2841
|
-
exports.useInsertionEffect = function(create, deps) {
|
|
2842
|
-
create == null && console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
|
2843
|
-
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
2844
|
-
};
|
|
2845
|
-
exports.useLayoutEffect = function(create, deps) {
|
|
2846
|
-
create == null && console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
|
2847
|
-
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
2848
|
-
};
|
|
2849
|
-
exports.useMemo = function(create, deps) {
|
|
2850
|
-
return resolveDispatcher().useMemo(create, deps);
|
|
2851
|
-
};
|
|
2852
|
-
exports.useOptimistic = function(passthrough, reducer) {
|
|
2853
|
-
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
2854
|
-
};
|
|
2855
|
-
exports.useReducer = function(reducer, initialArg, init) {
|
|
2856
|
-
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
2857
|
-
};
|
|
2858
|
-
exports.useRef = function(initialValue) {
|
|
2859
|
-
return resolveDispatcher().useRef(initialValue);
|
|
2860
|
-
};
|
|
2861
|
-
exports.useState = function(initialState) {
|
|
2862
|
-
return resolveDispatcher().useState(initialState);
|
|
2863
|
-
};
|
|
2864
|
-
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
2865
|
-
return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
2866
|
-
};
|
|
2867
|
-
exports.useTransition = function() {
|
|
2868
|
-
return resolveDispatcher().useTransition();
|
|
2869
|
-
};
|
|
2870
|
-
exports.version = "19.2.4";
|
|
2871
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
2872
|
-
})();
|
|
2873
|
-
});
|
|
2874
|
-
|
|
2875
|
-
// node_modules/react/index.js
|
|
2876
|
-
var require_react = __commonJS((exports, module) => {
|
|
2877
|
-
var react_development = __toESM(require_react_development());
|
|
2878
|
-
if (false) {} else {
|
|
2879
|
-
module.exports = react_development;
|
|
2880
|
-
}
|
|
2881
|
-
});
|
|
2882
|
-
|
|
2883
2036
|
// src/tui/context/AppContext.tsx
|
|
2037
|
+
import { createContext, useContext, useReducer, useEffect } from "react";
|
|
2884
2038
|
import { jsxDEV } from "@opentui/react/jsx-dev-runtime";
|
|
2885
2039
|
function appReducer(state, action) {
|
|
2886
2040
|
switch (action.type) {
|
|
@@ -2920,8 +2074,8 @@ function appReducer(state, action) {
|
|
|
2920
2074
|
}
|
|
2921
2075
|
}
|
|
2922
2076
|
function AppProvider({ children }) {
|
|
2923
|
-
const [state, dispatch] =
|
|
2924
|
-
|
|
2077
|
+
const [state, dispatch] = useReducer(appReducer, initialState);
|
|
2078
|
+
useEffect(() => {
|
|
2925
2079
|
let cancelled = false;
|
|
2926
2080
|
async function loadConfig2() {
|
|
2927
2081
|
try {
|
|
@@ -2947,7 +2101,7 @@ function AppProvider({ children }) {
|
|
|
2947
2101
|
}, undefined, false, undefined, this);
|
|
2948
2102
|
}
|
|
2949
2103
|
function useAppContext() {
|
|
2950
|
-
const ctx =
|
|
2104
|
+
const ctx = useContext(AppContext);
|
|
2951
2105
|
if (!ctx)
|
|
2952
2106
|
throw new Error("useAppContext must be used within AppProvider");
|
|
2953
2107
|
return ctx;
|
|
@@ -2956,9 +2110,8 @@ function useNavigate() {
|
|
|
2956
2110
|
const { dispatch } = useAppContext();
|
|
2957
2111
|
return (screen) => dispatch({ type: "NAVIGATE", screen });
|
|
2958
2112
|
}
|
|
2959
|
-
var
|
|
2113
|
+
var initialState, AppContext;
|
|
2960
2114
|
var init_AppContext = __esm(() => {
|
|
2961
|
-
import_react = __toESM(require_react(), 1);
|
|
2962
2115
|
initialState = {
|
|
2963
2116
|
screen: "main-menu",
|
|
2964
2117
|
config: null,
|
|
@@ -2966,7 +2119,7 @@ var init_AppContext = __esm(() => {
|
|
|
2966
2119
|
benchResults: [],
|
|
2967
2120
|
isLoadingConfig: true
|
|
2968
2121
|
};
|
|
2969
|
-
AppContext =
|
|
2122
|
+
AppContext = createContext(null);
|
|
2970
2123
|
});
|
|
2971
2124
|
|
|
2972
2125
|
// package.json
|
|
@@ -2974,7 +2127,7 @@ var package_default;
|
|
|
2974
2127
|
var init_package = __esm(() => {
|
|
2975
2128
|
package_default = {
|
|
2976
2129
|
name: "ai-speedometer",
|
|
2977
|
-
version: "2.0.
|
|
2130
|
+
version: "2.0.4",
|
|
2978
2131
|
description: "A comprehensive CLI tool for benchmarking AI models across multiple providers with parallel execution and professional metrics",
|
|
2979
2132
|
bin: {
|
|
2980
2133
|
"ai-speedometer": "dist/ai-speedometer",
|
|
@@ -2990,7 +2143,7 @@ var init_package = __esm(() => {
|
|
|
2990
2143
|
"test:watch": "bun test --watch",
|
|
2991
2144
|
"test:update": "bun test --update-snapshots",
|
|
2992
2145
|
typecheck: "bun tsc --noEmit",
|
|
2993
|
-
build: "bun build src/index.ts --outdir dist --target bun --external '@opentui/core' --external '@opentui/react' && printf '#!/usr/bin/env bun\\n' | cat - dist/index.js > dist/ai-speedometer && chmod +x dist/ai-speedometer && rm dist/index.js",
|
|
2146
|
+
build: "bun build src/index.ts --outdir dist --target bun --external '@opentui/core' --external '@opentui/react' --external 'react' --external 'react-reconciler' && printf '#!/usr/bin/env bun\\n' | cat - dist/index.js > dist/ai-speedometer && chmod +x dist/ai-speedometer && rm dist/index.js",
|
|
2994
2147
|
prepublishOnly: "bun run build"
|
|
2995
2148
|
},
|
|
2996
2149
|
keywords: [
|
|
@@ -3026,7 +2179,9 @@ var init_package = __esm(() => {
|
|
|
3026
2179
|
],
|
|
3027
2180
|
dependencies: {
|
|
3028
2181
|
"@opentui/core": "0.1.79",
|
|
3029
|
-
"@opentui/react": "0.1.79"
|
|
2182
|
+
"@opentui/react": "0.1.79",
|
|
2183
|
+
react: "^19.0.0",
|
|
2184
|
+
"react-reconciler": "^0.32.0"
|
|
3030
2185
|
},
|
|
3031
2186
|
devDependencies: {
|
|
3032
2187
|
"jsonc-parser": "^3.3.1"
|
|
@@ -3088,13 +2243,14 @@ function Footer({ hints }) {
|
|
|
3088
2243
|
var init_Footer = () => {};
|
|
3089
2244
|
|
|
3090
2245
|
// src/tui/screens/MainMenuScreen.tsx
|
|
2246
|
+
import { useState } from "react";
|
|
3091
2247
|
import { useRenderer } from "@opentui/react";
|
|
3092
2248
|
import { useKeyboard } from "@opentui/react";
|
|
3093
2249
|
import { jsxDEV as jsxDEV4 } from "@opentui/react/jsx-dev-runtime";
|
|
3094
2250
|
function MainMenuScreen() {
|
|
3095
2251
|
const navigate = useNavigate();
|
|
3096
2252
|
const renderer = useRenderer();
|
|
3097
|
-
const [cursor, setCursor] =
|
|
2253
|
+
const [cursor, setCursor] = useState(0);
|
|
3098
2254
|
useKeyboard((key) => {
|
|
3099
2255
|
if (key.name === "up") {
|
|
3100
2256
|
setCursor((i) => (i - 1 + ITEMS.length) % ITEMS.length);
|
|
@@ -3177,11 +2333,10 @@ function MainMenuScreen() {
|
|
|
3177
2333
|
]
|
|
3178
2334
|
}, undefined, true, undefined, this);
|
|
3179
2335
|
}
|
|
3180
|
-
var
|
|
2336
|
+
var ITEMS;
|
|
3181
2337
|
var init_MainMenuScreen = __esm(() => {
|
|
3182
2338
|
init_AppContext();
|
|
3183
2339
|
init_package();
|
|
3184
|
-
import_react2 = __toESM(require_react(), 1);
|
|
3185
2340
|
ITEMS = [
|
|
3186
2341
|
{ label: "\u26A1 Run Benchmark", desc: "test model speed & throughput", color: "#7dcfff" },
|
|
3187
2342
|
{ label: "\u2699 Manage Models", desc: "add providers and configure", color: "#bb9af7" },
|
|
@@ -3190,10 +2345,11 @@ var init_MainMenuScreen = __esm(() => {
|
|
|
3190
2345
|
});
|
|
3191
2346
|
|
|
3192
2347
|
// src/tui/components/MenuList.tsx
|
|
2348
|
+
import { useState as useState2 } from "react";
|
|
3193
2349
|
import { useKeyboard as useKeyboard2 } from "@opentui/react";
|
|
3194
2350
|
import { jsxDEV as jsxDEV5 } from "@opentui/react/jsx-dev-runtime";
|
|
3195
2351
|
function MenuList({ items, selectedIndex: initialIndex = 0, onSelect, onNavigate }) {
|
|
3196
|
-
const [cursor, setCursor] =
|
|
2352
|
+
const [cursor, setCursor] = useState2(initialIndex);
|
|
3197
2353
|
useKeyboard2((key) => {
|
|
3198
2354
|
if (key.name === "up") {
|
|
3199
2355
|
const next = (cursor - 1 + items.length) % items.length;
|
|
@@ -3241,10 +2397,7 @@ function MenuList({ items, selectedIndex: initialIndex = 0, onSelect, onNavigate
|
|
|
3241
2397
|
})
|
|
3242
2398
|
}, undefined, false, undefined, this);
|
|
3243
2399
|
}
|
|
3244
|
-
var
|
|
3245
|
-
var init_MenuList = __esm(() => {
|
|
3246
|
-
import_react5 = __toESM(require_react(), 1);
|
|
3247
|
-
});
|
|
2400
|
+
var init_MenuList = () => {};
|
|
3248
2401
|
|
|
3249
2402
|
// src/tui/screens/ModelMenuScreen.tsx
|
|
3250
2403
|
import { useKeyboard as useKeyboard3 } from "@opentui/react";
|
|
@@ -3301,12 +2454,13 @@ var init_ModelMenuScreen = __esm(() => {
|
|
|
3301
2454
|
});
|
|
3302
2455
|
|
|
3303
2456
|
// src/tui/hooks/usePaste.ts
|
|
2457
|
+
import { useEffect as useEffect2, useRef } from "react";
|
|
3304
2458
|
import { useRenderer as useRenderer2 } from "@opentui/react";
|
|
3305
2459
|
function usePaste(onPaste) {
|
|
3306
2460
|
const renderer = useRenderer2();
|
|
3307
|
-
const callbackRef =
|
|
2461
|
+
const callbackRef = useRef(onPaste);
|
|
3308
2462
|
callbackRef.current = onPaste;
|
|
3309
|
-
|
|
2463
|
+
useEffect2(() => {
|
|
3310
2464
|
const handler = (event) => callbackRef.current(event.text);
|
|
3311
2465
|
renderer.keyInput.on("paste", handler);
|
|
3312
2466
|
return () => {
|
|
@@ -3314,28 +2468,26 @@ function usePaste(onPaste) {
|
|
|
3314
2468
|
};
|
|
3315
2469
|
}, [renderer]);
|
|
3316
2470
|
}
|
|
3317
|
-
var
|
|
3318
|
-
var init_usePaste = __esm(() => {
|
|
3319
|
-
import_react8 = __toESM(require_react(), 1);
|
|
3320
|
-
});
|
|
2471
|
+
var init_usePaste = () => {};
|
|
3321
2472
|
|
|
3322
2473
|
// src/tui/screens/ModelSelectScreen.tsx
|
|
2474
|
+
import { useState as useState3, useEffect as useEffect3, useCallback, useRef as useRef2 } from "react";
|
|
3323
2475
|
import { useKeyboard as useKeyboard4, useTerminalDimensions } from "@opentui/react";
|
|
3324
2476
|
import { jsxDEV as jsxDEV7 } from "@opentui/react/jsx-dev-runtime";
|
|
3325
2477
|
function ModelSelectScreen() {
|
|
3326
2478
|
const { state, dispatch } = useAppContext();
|
|
3327
2479
|
const navigate = useNavigate();
|
|
3328
2480
|
const { height, width } = useTerminalDimensions();
|
|
3329
|
-
const [searchQuery, setSearchQuery] =
|
|
3330
|
-
const [cursor, setCursor] =
|
|
3331
|
-
const [selected, setSelected] =
|
|
3332
|
-
const [allModels, setAllModels] =
|
|
3333
|
-
const [recentKeys, setRecentKeys] =
|
|
3334
|
-
const [debouncedQuery, setDebouncedQuery] =
|
|
3335
|
-
const scrollboxRef =
|
|
2481
|
+
const [searchQuery, setSearchQuery] = useState3("");
|
|
2482
|
+
const [cursor, setCursor] = useState3(0);
|
|
2483
|
+
const [selected, setSelected] = useState3(new Set);
|
|
2484
|
+
const [allModels, setAllModels] = useState3([]);
|
|
2485
|
+
const [recentKeys, setRecentKeys] = useState3(new Set);
|
|
2486
|
+
const [debouncedQuery, setDebouncedQuery] = useState3("");
|
|
2487
|
+
const scrollboxRef = useRef2(null);
|
|
3336
2488
|
const PAGE_SIZE = Math.max(3, height - 14);
|
|
3337
2489
|
const CARD_W = Math.min(60, width - 4);
|
|
3338
|
-
|
|
2490
|
+
useEffect3(() => {
|
|
3339
2491
|
const providers = state.config?.providers ?? [];
|
|
3340
2492
|
const models = [];
|
|
3341
2493
|
for (const provider of providers) {
|
|
@@ -3370,11 +2522,11 @@ function ModelSelectScreen() {
|
|
|
3370
2522
|
}
|
|
3371
2523
|
loadRecents();
|
|
3372
2524
|
}, [state.config]);
|
|
3373
|
-
|
|
2525
|
+
useEffect3(() => {
|
|
3374
2526
|
const t = setTimeout(() => setDebouncedQuery(searchQuery), DEBOUNCE_MS);
|
|
3375
2527
|
return () => clearTimeout(t);
|
|
3376
2528
|
}, [searchQuery]);
|
|
3377
|
-
|
|
2529
|
+
useEffect3(() => {
|
|
3378
2530
|
setCursor(0);
|
|
3379
2531
|
}, [debouncedQuery]);
|
|
3380
2532
|
function isRecent(m) {
|
|
@@ -3413,7 +2565,7 @@ function ModelSelectScreen() {
|
|
|
3413
2565
|
})();
|
|
3414
2566
|
const allModelRows = allRows.filter((r) => r.kind === "model");
|
|
3415
2567
|
const cursorModel = allModelRows[cursor]?.model;
|
|
3416
|
-
|
|
2568
|
+
useEffect3(() => {
|
|
3417
2569
|
const sb = scrollboxRef.current;
|
|
3418
2570
|
if (!sb)
|
|
3419
2571
|
return;
|
|
@@ -3425,7 +2577,7 @@ function ModelSelectScreen() {
|
|
|
3425
2577
|
sb.scrollTo(cursor - visible + 1);
|
|
3426
2578
|
}
|
|
3427
2579
|
}, [cursor, PAGE_SIZE]);
|
|
3428
|
-
const launchBench =
|
|
2580
|
+
const launchBench = useCallback((models) => {
|
|
3429
2581
|
dispatch({ type: "BENCH_START", models });
|
|
3430
2582
|
navigate("benchmark");
|
|
3431
2583
|
}, [dispatch, navigate]);
|
|
@@ -3656,11 +2808,10 @@ function ModelSelectScreen() {
|
|
|
3656
2808
|
}, undefined, true, undefined, this)
|
|
3657
2809
|
}, undefined, false, undefined, this);
|
|
3658
2810
|
}
|
|
3659
|
-
var
|
|
2811
|
+
var DEBOUNCE_MS = 50;
|
|
3660
2812
|
var init_ModelSelectScreen = __esm(() => {
|
|
3661
2813
|
init_AppContext();
|
|
3662
2814
|
init_usePaste();
|
|
3663
|
-
import_react10 = __toESM(require_react(), 1);
|
|
3664
2815
|
});
|
|
3665
2816
|
|
|
3666
2817
|
// src/tui/components/BarChart.tsx
|
|
@@ -3766,6 +2917,7 @@ function ResultsTable({ results, pendingCount }) {
|
|
|
3766
2917
|
var init_ResultsTable = () => {};
|
|
3767
2918
|
|
|
3768
2919
|
// src/tui/screens/BenchmarkScreen.tsx
|
|
2920
|
+
import { useState as useState4, useEffect as useEffect4, useRef as useRef3, useMemo } from "react";
|
|
3769
2921
|
import { useKeyboard as useKeyboard5 } from "@opentui/react";
|
|
3770
2922
|
import { jsxDEV as jsxDEV10 } from "@opentui/react/jsx-dev-runtime";
|
|
3771
2923
|
function rankBadge(rank) {
|
|
@@ -3786,12 +2938,12 @@ function Divider() {
|
|
|
3786
2938
|
function BenchmarkScreen() {
|
|
3787
2939
|
const { state, dispatch } = useAppContext();
|
|
3788
2940
|
const navigate = useNavigate();
|
|
3789
|
-
const [modelStates, setModelStates] =
|
|
3790
|
-
const [spinnerFrame, setSpinnerFrame] =
|
|
3791
|
-
const [allDone, setAllDone] =
|
|
3792
|
-
const spinnerRef =
|
|
3793
|
-
const startedRef =
|
|
3794
|
-
|
|
2941
|
+
const [modelStates, setModelStates] = useState4([]);
|
|
2942
|
+
const [spinnerFrame, setSpinnerFrame] = useState4(0);
|
|
2943
|
+
const [allDone, setAllDone] = useState4(false);
|
|
2944
|
+
const spinnerRef = useRef3(null);
|
|
2945
|
+
const startedRef = useRef3(false);
|
|
2946
|
+
useEffect4(() => {
|
|
3795
2947
|
if (startedRef.current)
|
|
3796
2948
|
return;
|
|
3797
2949
|
startedRef.current = true;
|
|
@@ -3850,7 +3002,7 @@ function BenchmarkScreen() {
|
|
|
3850
3002
|
const maxTtftForBar = Math.max(...done.map((m) => (m.result?.timeToFirstToken ?? 0) / 1000), 1);
|
|
3851
3003
|
const doneResults = tpsRanked.map((m) => m.result);
|
|
3852
3004
|
const pendingCount = running.length + pending.length;
|
|
3853
|
-
const allRows =
|
|
3005
|
+
const allRows = useMemo(() => {
|
|
3854
3006
|
const rows = [];
|
|
3855
3007
|
if (!allDone) {
|
|
3856
3008
|
const total = modelStates.length || 1;
|
|
@@ -4247,15 +3399,15 @@ function BenchmarkScreen() {
|
|
|
4247
3399
|
]
|
|
4248
3400
|
}, undefined, true, undefined, this);
|
|
4249
3401
|
}
|
|
4250
|
-
var
|
|
3402
|
+
var BAR_W = 25;
|
|
4251
3403
|
var init_BenchmarkScreen = __esm(() => {
|
|
4252
3404
|
init_AppContext();
|
|
4253
3405
|
init_BarChart();
|
|
4254
3406
|
init_ResultsTable();
|
|
4255
|
-
import_react12 = __toESM(require_react(), 1);
|
|
4256
3407
|
});
|
|
4257
3408
|
|
|
4258
3409
|
// src/tui/screens/AddVerifiedScreen.tsx
|
|
3410
|
+
import { useState as useState5, useEffect as useEffect5, useRef as useRef4 } from "react";
|
|
4259
3411
|
import { useKeyboard as useKeyboard6, useTerminalDimensions as useTerminalDimensions2 } from "@opentui/react";
|
|
4260
3412
|
import { jsxDEV as jsxDEV11 } from "@opentui/react/jsx-dev-runtime";
|
|
4261
3413
|
function AddVerifiedScreen() {
|
|
@@ -4264,19 +3416,19 @@ function AddVerifiedScreen() {
|
|
|
4264
3416
|
const { height, width } = useTerminalDimensions2();
|
|
4265
3417
|
const PAGE_SIZE = Math.max(3, height - 16);
|
|
4266
3418
|
const CARD_W = Math.min(62, width - 4);
|
|
4267
|
-
const [step, setStep] =
|
|
4268
|
-
const [allProviders, setAllProviders] =
|
|
4269
|
-
const [filtered, setFiltered] =
|
|
4270
|
-
const [cursor, setCursor] =
|
|
4271
|
-
const [searchQuery, setSearchQuery] =
|
|
4272
|
-
const scrollboxRef =
|
|
4273
|
-
const [selectedProvider, setSelectedProvider] =
|
|
4274
|
-
const [apiKey, setApiKey] =
|
|
4275
|
-
const [saving, setSaving] =
|
|
4276
|
-
const [saveError, setSaveError] =
|
|
4277
|
-
const [saveSuccess, setSaveSuccess] =
|
|
4278
|
-
const [loadError, setLoadError] =
|
|
4279
|
-
|
|
3419
|
+
const [step, setStep] = useState5("browse");
|
|
3420
|
+
const [allProviders, setAllProviders] = useState5([]);
|
|
3421
|
+
const [filtered, setFiltered] = useState5([]);
|
|
3422
|
+
const [cursor, setCursor] = useState5(0);
|
|
3423
|
+
const [searchQuery, setSearchQuery] = useState5("");
|
|
3424
|
+
const scrollboxRef = useRef4(null);
|
|
3425
|
+
const [selectedProvider, setSelectedProvider] = useState5(null);
|
|
3426
|
+
const [apiKey, setApiKey] = useState5("");
|
|
3427
|
+
const [saving, setSaving] = useState5(false);
|
|
3428
|
+
const [saveError, setSaveError] = useState5("");
|
|
3429
|
+
const [saveSuccess, setSaveSuccess] = useState5(false);
|
|
3430
|
+
const [loadError, setLoadError] = useState5("");
|
|
3431
|
+
useEffect5(() => {
|
|
4280
3432
|
async function load() {
|
|
4281
3433
|
try {
|
|
4282
3434
|
const { getAllProviders: getAllProviders2 } = await Promise.resolve().then(() => (init_models_dev(), exports_models_dev));
|
|
@@ -4289,7 +3441,7 @@ function AddVerifiedScreen() {
|
|
|
4289
3441
|
}
|
|
4290
3442
|
load();
|
|
4291
3443
|
}, []);
|
|
4292
|
-
|
|
3444
|
+
useEffect5(() => {
|
|
4293
3445
|
if (!searchQuery) {
|
|
4294
3446
|
setFiltered(allProviders);
|
|
4295
3447
|
} else {
|
|
@@ -4298,7 +3450,7 @@ function AddVerifiedScreen() {
|
|
|
4298
3450
|
}
|
|
4299
3451
|
setCursor(0);
|
|
4300
3452
|
}, [searchQuery, allProviders]);
|
|
4301
|
-
|
|
3453
|
+
useEffect5(() => {
|
|
4302
3454
|
const sb = scrollboxRef.current;
|
|
4303
3455
|
if (!sb)
|
|
4304
3456
|
return;
|
|
@@ -4704,14 +3856,13 @@ function AddVerifiedScreen() {
|
|
|
4704
3856
|
}, undefined, true, undefined, this)
|
|
4705
3857
|
}, undefined, false, undefined, this);
|
|
4706
3858
|
}
|
|
4707
|
-
var import_react14;
|
|
4708
3859
|
var init_AddVerifiedScreen = __esm(() => {
|
|
4709
3860
|
init_AppContext();
|
|
4710
3861
|
init_usePaste();
|
|
4711
|
-
import_react14 = __toESM(require_react(), 1);
|
|
4712
3862
|
});
|
|
4713
3863
|
|
|
4714
3864
|
// src/tui/screens/AddCustomScreen.tsx
|
|
3865
|
+
import { useState as useState6 } from "react";
|
|
4715
3866
|
import { useKeyboard as useKeyboard7, useTerminalDimensions as useTerminalDimensions3 } from "@opentui/react";
|
|
4716
3867
|
import { jsxDEV as jsxDEV12 } from "@opentui/react/jsx-dev-runtime";
|
|
4717
3868
|
function stepIndex(s) {
|
|
@@ -4722,18 +3873,18 @@ function AddCustomScreen() {
|
|
|
4722
3873
|
const navigate = useNavigate();
|
|
4723
3874
|
const { width } = useTerminalDimensions3();
|
|
4724
3875
|
const CARD_W = Math.min(60, width - 4);
|
|
4725
|
-
const [step, setStep] =
|
|
4726
|
-
const [providerType, setProviderType] =
|
|
4727
|
-
const [typeCursor, setTypeCursor] =
|
|
4728
|
-
const [providerId, setProviderId] =
|
|
4729
|
-
const [providerName, setProviderName] =
|
|
4730
|
-
const [baseUrl, setBaseUrl] =
|
|
4731
|
-
const [apiKey, setApiKey] =
|
|
4732
|
-
const [modelInput, setModelInput] =
|
|
4733
|
-
const [models, setModels] =
|
|
4734
|
-
const [saveError, setSaveError] =
|
|
4735
|
-
const [savedModelCount, setSavedModelCount] =
|
|
4736
|
-
const [inputError, setInputError] =
|
|
3876
|
+
const [step, setStep] = useState6("type");
|
|
3877
|
+
const [providerType, setProviderType] = useState6("openai-compatible");
|
|
3878
|
+
const [typeCursor, setTypeCursor] = useState6(0);
|
|
3879
|
+
const [providerId, setProviderId] = useState6("");
|
|
3880
|
+
const [providerName, setProviderName] = useState6("");
|
|
3881
|
+
const [baseUrl, setBaseUrl] = useState6("");
|
|
3882
|
+
const [apiKey, setApiKey] = useState6("");
|
|
3883
|
+
const [modelInput, setModelInput] = useState6("");
|
|
3884
|
+
const [models, setModels] = useState6([]);
|
|
3885
|
+
const [saveError, setSaveError] = useState6("");
|
|
3886
|
+
const [savedModelCount, setSavedModelCount] = useState6(0);
|
|
3887
|
+
const [inputError, setInputError] = useState6("");
|
|
4737
3888
|
const typeItems = ["OpenAI Compatible", "Anthropic", "Back"];
|
|
4738
3889
|
async function doSave() {
|
|
4739
3890
|
setStep("saving");
|
|
@@ -5261,17 +4412,17 @@ function AddCustomScreen() {
|
|
|
5261
4412
|
}, undefined, true, undefined, this)
|
|
5262
4413
|
}, undefined, false, undefined, this);
|
|
5263
4414
|
}
|
|
5264
|
-
var
|
|
4415
|
+
var STEPS, STEP_LABELS, STEP_NUM;
|
|
5265
4416
|
var init_AddCustomScreen = __esm(() => {
|
|
5266
4417
|
init_AppContext();
|
|
5267
4418
|
init_usePaste();
|
|
5268
|
-
import_react16 = __toESM(require_react(), 1);
|
|
5269
4419
|
STEPS = ["type", "id", "name", "url", "key", "models"];
|
|
5270
4420
|
STEP_LABELS = ["Type", "ID", "Name", "URL", "Key", "Models"];
|
|
5271
4421
|
STEP_NUM = ["\u2460", "\u2461", "\u2462", "\u2463", "\u2464", "\u2465"];
|
|
5272
4422
|
});
|
|
5273
4423
|
|
|
5274
4424
|
// src/tui/screens/AddModelsScreen.tsx
|
|
4425
|
+
import { useState as useState7, useEffect as useEffect6 } from "react";
|
|
5275
4426
|
import { useKeyboard as useKeyboard8, useTerminalDimensions as useTerminalDimensions4 } from "@opentui/react";
|
|
5276
4427
|
import { jsxDEV as jsxDEV13 } from "@opentui/react/jsx-dev-runtime";
|
|
5277
4428
|
function AddModelsScreen() {
|
|
@@ -5279,17 +4430,17 @@ function AddModelsScreen() {
|
|
|
5279
4430
|
const navigate = useNavigate();
|
|
5280
4431
|
const { width } = useTerminalDimensions4();
|
|
5281
4432
|
const CARD_W = Math.min(60, width - 4);
|
|
5282
|
-
const [step, setStep] =
|
|
5283
|
-
const [providers, setProviders] =
|
|
5284
|
-
const [cursor, setCursor] =
|
|
5285
|
-
const [selectedProvider, setSelectedProvider] =
|
|
5286
|
-
const [modelInput, setModelInput] =
|
|
5287
|
-
const [addedModels, setAddedModels] =
|
|
5288
|
-
const [loadError, setLoadError] =
|
|
5289
|
-
const [saveError, setSaveError] =
|
|
5290
|
-
const [inputError, setInputError] =
|
|
5291
|
-
const [done, setDone] =
|
|
5292
|
-
|
|
4433
|
+
const [step, setStep] = useState7("pick");
|
|
4434
|
+
const [providers, setProviders] = useState7([]);
|
|
4435
|
+
const [cursor, setCursor] = useState7(0);
|
|
4436
|
+
const [selectedProvider, setSelectedProvider] = useState7(null);
|
|
4437
|
+
const [modelInput, setModelInput] = useState7("");
|
|
4438
|
+
const [addedModels, setAddedModels] = useState7([]);
|
|
4439
|
+
const [loadError, setLoadError] = useState7("");
|
|
4440
|
+
const [saveError, setSaveError] = useState7("");
|
|
4441
|
+
const [inputError, setInputError] = useState7("");
|
|
4442
|
+
const [done, setDone] = useState7(false);
|
|
4443
|
+
useEffect6(() => {
|
|
5293
4444
|
async function load() {
|
|
5294
4445
|
try {
|
|
5295
4446
|
const { getCustomProvidersFromConfig: getCustomProvidersFromConfig2 } = await Promise.resolve().then(() => (init_ai_config(), exports_ai_config));
|
|
@@ -5651,11 +4802,9 @@ function AddModelsScreen() {
|
|
|
5651
4802
|
}, undefined, true, undefined, this)
|
|
5652
4803
|
}, undefined, false, undefined, this);
|
|
5653
4804
|
}
|
|
5654
|
-
var import_react18;
|
|
5655
4805
|
var init_AddModelsScreen = __esm(() => {
|
|
5656
4806
|
init_AppContext();
|
|
5657
4807
|
init_usePaste();
|
|
5658
|
-
import_react18 = __toESM(require_react(), 1);
|
|
5659
4808
|
});
|
|
5660
4809
|
|
|
5661
4810
|
// src/tui/screens/ListProvidersScreen.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-speedometer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "A comprehensive CLI tool for benchmarking AI models across multiple providers with parallel execution and professional metrics",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ai-speedometer": "dist/ai-speedometer",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"test:watch": "bun test --watch",
|
|
17
17
|
"test:update": "bun test --update-snapshots",
|
|
18
18
|
"typecheck": "bun tsc --noEmit",
|
|
19
|
-
"build": "bun build src/index.ts --outdir dist --target bun --external '@opentui/core' --external '@opentui/react' && printf '#!/usr/bin/env bun\\n' | cat - dist/index.js > dist/ai-speedometer && chmod +x dist/ai-speedometer && rm dist/index.js",
|
|
19
|
+
"build": "bun build src/index.ts --outdir dist --target bun --external '@opentui/core' --external '@opentui/react' --external 'react' --external 'react-reconciler' && printf '#!/usr/bin/env bun\\n' | cat - dist/index.js > dist/ai-speedometer && chmod +x dist/ai-speedometer && rm dist/index.js",
|
|
20
20
|
"prepublishOnly": "bun run build"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@opentui/core": "0.1.79",
|
|
55
|
-
"@opentui/react": "0.1.79"
|
|
55
|
+
"@opentui/react": "0.1.79",
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-reconciler": "^0.32.0"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"jsonc-parser": "^3.3.1"
|