Merge branch 'lab4' into lab5
This commit is contained in:
44
db.json
44
db.json
@@ -71,44 +71,12 @@
|
|||||||
"intakeId": "2"
|
"intakeId": "2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "60fa",
|
"id": "1ce3",
|
||||||
"last_name": "Иванов",
|
"last_name": "1",
|
||||||
"first_name": "Иван",
|
"first_name": "2",
|
||||||
"email": "ivaov@example.com",
|
"email": "1@1",
|
||||||
"phone": "+7 (990) 001-12-22",
|
"phone": "9999333333",
|
||||||
"birth_date": "2005-09-08",
|
"birth_date": "0003-03-03",
|
||||||
"programId": "1",
|
|
||||||
"intakeId": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "5c43",
|
|
||||||
"last_name": "Иванов",
|
|
||||||
"first_name": "Иван",
|
|
||||||
"email": "ianov@example.com",
|
|
||||||
"phone": "+7 (990) 533-43-54",
|
|
||||||
"birth_date": "2005-07-09",
|
|
||||||
"programId": "1",
|
|
||||||
"intakeId": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "7628",
|
|
||||||
"last_name": "Иванов",
|
|
||||||
"first_name": "Иван",
|
|
||||||
"email": "ianov@example.com",
|
|
||||||
"phone": "+7 (990) 533-43-54",
|
|
||||||
"birth_date": "2005-07-09",
|
|
||||||
"programId": "1",
|
|
||||||
"intakeId": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "7e84",
|
|
||||||
"last_name": "Киреев",
|
|
||||||
"first_name": "Дмитрий",
|
|
||||||
"email": "kireev@ya.ru",
|
|
||||||
"phone": "+7 (955) 537-85-55",
|
|
||||||
"birth_date": "2006-09-09",
|
|
||||||
"program": "1",
|
|
||||||
"intake": "2",
|
|
||||||
"programId": "1",
|
"programId": "1",
|
||||||
"intakeId": "2"
|
"intakeId": "2"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
img/ULSTU.jpg
BIN
img/ULSTU.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 526 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB |
BIN
img/tg.png
BIN
img/tg.png
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
BIN
img/vk.png
BIN
img/vk.png
Binary file not shown.
|
Before Width: | Height: | Size: 143 KiB |
BIN
img/yt.png
BIN
img/yt.png
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB |
16
node_modules/.bin/json-server
generated
vendored
16
node_modules/.bin/json-server
generated
vendored
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*)
|
|
||||||
if command -v cygpath > /dev/null 2>&1; then
|
|
||||||
basedir=`cygpath -w "$basedir"`
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
exec "$basedir/node" "$basedir/../json-server/lib/bin.js" "$@"
|
|
||||||
else
|
|
||||||
exec node "$basedir/../json-server/lib/bin.js" "$@"
|
|
||||||
fi
|
|
||||||
17
node_modules/.bin/json-server.cmd
generated
vendored
17
node_modules/.bin/json-server.cmd
generated
vendored
@@ -1,17 +0,0 @@
|
|||||||
@ECHO off
|
|
||||||
GOTO start
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
||||||
:start
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json-server\lib\bin.js" %*
|
|
||||||
28
node_modules/.bin/json-server.ps1
generated
vendored
28
node_modules/.bin/json-server.ps1
generated
vendored
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
# Support pipeline input
|
|
||||||
if ($MyInvocation.ExpectingInput) {
|
|
||||||
$input | & "$basedir/node$exe" "$basedir/../json-server/lib/bin.js" $args
|
|
||||||
} else {
|
|
||||||
& "$basedir/node$exe" "$basedir/../json-server/lib/bin.js" $args
|
|
||||||
}
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
# Support pipeline input
|
|
||||||
if ($MyInvocation.ExpectingInput) {
|
|
||||||
$input | & "node$exe" "$basedir/../json-server/lib/bin.js" $args
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../json-server/lib/bin.js" $args
|
|
||||||
}
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
4330
node_modules/.package-lock.json
generated
vendored
4330
node_modules/.package-lock.json
generated
vendored
File diff suppressed because it is too large
Load Diff
8
node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
8
node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"hash": "1d2bb4d0",
|
||||||
|
"configHash": "9a03b25e",
|
||||||
|
"lockfileHash": "0219a5db",
|
||||||
|
"browserHash": "7bf22424",
|
||||||
|
"optimized": {},
|
||||||
|
"chunks": {}
|
||||||
|
}
|
||||||
2520
node_modules/.vite/deps/axios.js
generated
vendored
Normal file
2520
node_modules/.vite/deps/axios.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/.vite/deps/axios.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/axios.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2012
node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min__js.js
generated
vendored
Normal file
2012
node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min__js.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min__js.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min__js.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
35
node_modules/.vite/deps/chunk-G3PMV62Z.js
generated
vendored
Normal file
35
node_modules/.vite/deps/chunk-G3PMV62Z.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
var __create = Object.create;
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __getProtoOf = Object.getPrototypeOf;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __commonJS = (cb, mod) => function __require() {
|
||||||
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||||
|
};
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||||
|
// If the importer is in node compatibility mode or this is not an ESM
|
||||||
|
// file that has been converted to a CommonJS file using a Babel-
|
||||||
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||||
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||||
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||||
|
mod
|
||||||
|
));
|
||||||
|
|
||||||
|
export {
|
||||||
|
__commonJS,
|
||||||
|
__export,
|
||||||
|
__toESM
|
||||||
|
};
|
||||||
7
node_modules/.vite/deps/chunk-G3PMV62Z.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/chunk-G3PMV62Z.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
280
node_modules/.vite/deps/chunk-HE4GKDYE.js
generated
vendored
Normal file
280
node_modules/.vite/deps/chunk-HE4GKDYE.js
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-UGC3UZ7L.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-G3PMV62Z.js";
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
(function() {
|
||||||
|
function noop() {
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function createPortal$1(children, containerInfo, implementation) {
|
||||||
|
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
||||||
|
try {
|
||||||
|
testStringCoercion(key);
|
||||||
|
var JSCompiler_inline_result = false;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = true;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result && (console.error(
|
||||||
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||||
|
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
||||||
|
), testStringCoercion(key));
|
||||||
|
return {
|
||||||
|
$$typeof: REACT_PORTAL_TYPE,
|
||||||
|
key: null == key ? null : "" + key,
|
||||||
|
children,
|
||||||
|
containerInfo,
|
||||||
|
implementation
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function getCrossOriginStringAs(as, input) {
|
||||||
|
if ("font" === as) return "";
|
||||||
|
if ("string" === typeof input)
|
||||||
|
return "use-credentials" === input ? input : "";
|
||||||
|
}
|
||||||
|
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||||
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
||||||
|
}
|
||||||
|
function getValueDescriptorExpectingEnumForWarning(thing) {
|
||||||
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
||||||
|
}
|
||||||
|
function resolveDispatcher() {
|
||||||
|
var dispatcher = ReactSharedInternals.H;
|
||||||
|
null === dispatcher && console.error(
|
||||||
|
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
||||||
|
);
|
||||||
|
return dispatcher;
|
||||||
|
}
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||||
|
var React = require_react(), Internals = {
|
||||||
|
d: {
|
||||||
|
f: noop,
|
||||||
|
r: function() {
|
||||||
|
throw Error(
|
||||||
|
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
||||||
|
);
|
||||||
|
},
|
||||||
|
D: noop,
|
||||||
|
C: noop,
|
||||||
|
L: noop,
|
||||||
|
m: noop,
|
||||||
|
X: noop,
|
||||||
|
S: noop,
|
||||||
|
M: noop
|
||||||
|
},
|
||||||
|
p: 0,
|
||||||
|
findDOMNode: null
|
||||||
|
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
||||||
|
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
||||||
|
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
||||||
|
);
|
||||||
|
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
||||||
|
exports.createPortal = function(children, container) {
|
||||||
|
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
||||||
|
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
||||||
|
throw Error("Target container is not a DOM element.");
|
||||||
|
return createPortal$1(children, container, null, key);
|
||||||
|
};
|
||||||
|
exports.flushSync = function(fn) {
|
||||||
|
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
||||||
|
try {
|
||||||
|
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
||||||
|
return fn();
|
||||||
|
} finally {
|
||||||
|
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
||||||
|
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preconnect = function(href, options) {
|
||||||
|
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
||||||
|
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
||||||
|
getValueDescriptorExpectingEnumForWarning(options)
|
||||||
|
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
||||||
|
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
||||||
|
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
||||||
|
) : console.error(
|
||||||
|
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||||
|
getValueDescriptorExpectingObjectForWarning(href)
|
||||||
|
);
|
||||||
|
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
||||||
|
};
|
||||||
|
exports.prefetchDNS = function(href) {
|
||||||
|
if ("string" !== typeof href || !href)
|
||||||
|
console.error(
|
||||||
|
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||||
|
getValueDescriptorExpectingObjectForWarning(href)
|
||||||
|
);
|
||||||
|
else if (1 < arguments.length) {
|
||||||
|
var options = arguments[1];
|
||||||
|
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
||||||
|
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||||
|
getValueDescriptorExpectingEnumForWarning(options)
|
||||||
|
) : console.error(
|
||||||
|
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||||
|
getValueDescriptorExpectingEnumForWarning(options)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
"string" === typeof href && Internals.d.D(href);
|
||||||
|
};
|
||||||
|
exports.preinit = function(href, options) {
|
||||||
|
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
||||||
|
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
||||||
|
getValueDescriptorExpectingEnumForWarning(options)
|
||||||
|
) : "style" !== options.as && "script" !== options.as && console.error(
|
||||||
|
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
||||||
|
getValueDescriptorExpectingEnumForWarning(options.as)
|
||||||
|
) : console.error(
|
||||||
|
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||||
|
getValueDescriptorExpectingObjectForWarning(href)
|
||||||
|
);
|
||||||
|
if ("string" === typeof href && options && "string" === typeof options.as) {
|
||||||
|
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
||||||
|
"style" === as ? Internals.d.S(
|
||||||
|
href,
|
||||||
|
"string" === typeof options.precedence ? options.precedence : void 0,
|
||||||
|
{
|
||||||
|
crossOrigin,
|
||||||
|
integrity,
|
||||||
|
fetchPriority
|
||||||
|
}
|
||||||
|
) : "script" === as && Internals.d.X(href, {
|
||||||
|
crossOrigin,
|
||||||
|
integrity,
|
||||||
|
fetchPriority,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preinitModule = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
||||||
|
if (encountered)
|
||||||
|
console.error(
|
||||||
|
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
||||||
|
encountered
|
||||||
|
);
|
||||||
|
else
|
||||||
|
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
||||||
|
case "script":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
||||||
|
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
||||||
|
encountered,
|
||||||
|
href
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ("string" === typeof href)
|
||||||
|
if ("object" === typeof options && null !== options) {
|
||||||
|
if (null == options.as || "script" === options.as)
|
||||||
|
encountered = getCrossOriginStringAs(
|
||||||
|
options.as,
|
||||||
|
options.crossOrigin
|
||||||
|
), Internals.d.M(href, {
|
||||||
|
crossOrigin: encountered,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||||
|
});
|
||||||
|
} else null == options && Internals.d.M(href);
|
||||||
|
};
|
||||||
|
exports.preload = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||||
|
encountered && console.error(
|
||||||
|
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
||||||
|
encountered
|
||||||
|
);
|
||||||
|
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
||||||
|
encountered = options.as;
|
||||||
|
var crossOrigin = getCrossOriginStringAs(
|
||||||
|
encountered,
|
||||||
|
options.crossOrigin
|
||||||
|
);
|
||||||
|
Internals.d.L(href, encountered, {
|
||||||
|
crossOrigin,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||||
|
type: "string" === typeof options.type ? options.type : void 0,
|
||||||
|
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
||||||
|
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
||||||
|
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
||||||
|
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
||||||
|
media: "string" === typeof options.media ? options.media : void 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preloadModule = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||||
|
encountered && console.error(
|
||||||
|
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
||||||
|
encountered
|
||||||
|
);
|
||||||
|
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
||||||
|
options.as,
|
||||||
|
options.crossOrigin
|
||||||
|
), Internals.d.m(href, {
|
||||||
|
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
||||||
|
crossOrigin: encountered,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
||||||
|
})) : Internals.d.m(href));
|
||||||
|
};
|
||||||
|
exports.requestFormReset = function(form) {
|
||||||
|
Internals.d.r(form);
|
||||||
|
};
|
||||||
|
exports.unstable_batchedUpdates = function(fn, a) {
|
||||||
|
return fn(a);
|
||||||
|
};
|
||||||
|
exports.useFormState = function(action, initialState, permalink) {
|
||||||
|
return resolveDispatcher().useFormState(action, initialState, permalink);
|
||||||
|
};
|
||||||
|
exports.useFormStatus = function() {
|
||||||
|
return resolveDispatcher().useHostTransitionStatus();
|
||||||
|
};
|
||||||
|
exports.version = "19.1.0";
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react-dom/index.js
|
||||||
|
var require_react_dom = __commonJS({
|
||||||
|
"node_modules/react-dom/index.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
checkDCE();
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_dom_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export {
|
||||||
|
require_react_dom
|
||||||
|
};
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react-dom/cjs/react-dom.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react-dom.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=chunk-HE4GKDYE.js.map
|
||||||
7
node_modules/.vite/deps/chunk-HE4GKDYE.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/chunk-HE4GKDYE.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
972
node_modules/.vite/deps/chunk-UGC3UZ7L.js
generated
vendored
Normal file
972
node_modules/.vite/deps/chunk-UGC3UZ7L.js
generated
vendored
Normal file
@@ -0,0 +1,972 @@
|
|||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-G3PMV62Z.js";
|
||||||
|
|
||||||
|
// node_modules/react/cjs/react.development.js
|
||||||
|
var require_react_development = __commonJS({
|
||||||
|
"node_modules/react/cjs/react.development.js"(exports, module) {
|
||||||
|
"use strict";
|
||||||
|
(function() {
|
||||||
|
function defineDeprecationWarning(methodName, info) {
|
||||||
|
Object.defineProperty(Component.prototype, methodName, {
|
||||||
|
get: function() {
|
||||||
|
console.warn(
|
||||||
|
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
||||||
|
info[0],
|
||||||
|
info[1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function getIteratorFn(maybeIterable) {
|
||||||
|
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
||||||
|
return null;
|
||||||
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
||||||
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
||||||
|
}
|
||||||
|
function warnNoop(publicInstance, callerName) {
|
||||||
|
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
||||||
|
var warningKey = publicInstance + "." + callerName;
|
||||||
|
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
||||||
|
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
||||||
|
callerName,
|
||||||
|
publicInstance
|
||||||
|
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
||||||
|
}
|
||||||
|
function Component(props, context, updater) {
|
||||||
|
this.props = props;
|
||||||
|
this.context = context;
|
||||||
|
this.refs = emptyObject;
|
||||||
|
this.updater = updater || ReactNoopUpdateQueue;
|
||||||
|
}
|
||||||
|
function ComponentDummy() {
|
||||||
|
}
|
||||||
|
function PureComponent(props, context, updater) {
|
||||||
|
this.props = props;
|
||||||
|
this.context = context;
|
||||||
|
this.refs = emptyObject;
|
||||||
|
this.updater = updater || ReactNoopUpdateQueue;
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = false;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = true;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(
|
||||||
|
JSCompiler_inline_result,
|
||||||
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||||
|
JSCompiler_inline_result$jscomp$0
|
||||||
|
);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type)
|
||||||
|
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE:
|
||||||
|
return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE:
|
||||||
|
return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE:
|
||||||
|
return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type)
|
||||||
|
switch ("number" === typeof type.tag && console.error(
|
||||||
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||||
|
), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE:
|
||||||
|
return (type.displayName || "Context") + ".Provider";
|
||||||
|
case REACT_CONSUMER_TYPE:
|
||||||
|
return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||||
|
return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return false;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
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
|
||||||
|
));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
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."
|
||||||
|
));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||||
|
self = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: false,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function cloneAndReplaceKey(oldElement, newKey) {
|
||||||
|
newKey = ReactElement(
|
||||||
|
oldElement.type,
|
||||||
|
newKey,
|
||||||
|
void 0,
|
||||||
|
void 0,
|
||||||
|
oldElement._owner,
|
||||||
|
oldElement.props,
|
||||||
|
oldElement._debugStack,
|
||||||
|
oldElement._debugTask
|
||||||
|
);
|
||||||
|
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
||||||
|
return newKey;
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
function escape(key) {
|
||||||
|
var escaperLookup = { "=": "=0", ":": "=2" };
|
||||||
|
return "$" + key.replace(/[=:]/g, function(match) {
|
||||||
|
return escaperLookup[match];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function getElementKey(element, index) {
|
||||||
|
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
||||||
|
}
|
||||||
|
function noop$1() {
|
||||||
|
}
|
||||||
|
function resolveThenable(thenable) {
|
||||||
|
switch (thenable.status) {
|
||||||
|
case "fulfilled":
|
||||||
|
return thenable.value;
|
||||||
|
case "rejected":
|
||||||
|
throw thenable.reason;
|
||||||
|
default:
|
||||||
|
switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
|
||||||
|
function(fulfilledValue) {
|
||||||
|
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||||
|
}
|
||||||
|
)), thenable.status) {
|
||||||
|
case "fulfilled":
|
||||||
|
return thenable.value;
|
||||||
|
case "rejected":
|
||||||
|
throw thenable.reason;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw thenable;
|
||||||
|
}
|
||||||
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
||||||
|
var type = typeof children;
|
||||||
|
if ("undefined" === type || "boolean" === type) children = null;
|
||||||
|
var invokeCallback = false;
|
||||||
|
if (null === children) invokeCallback = true;
|
||||||
|
else
|
||||||
|
switch (type) {
|
||||||
|
case "bigint":
|
||||||
|
case "string":
|
||||||
|
case "number":
|
||||||
|
invokeCallback = true;
|
||||||
|
break;
|
||||||
|
case "object":
|
||||||
|
switch (children.$$typeof) {
|
||||||
|
case REACT_ELEMENT_TYPE:
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
invokeCallback = true;
|
||||||
|
break;
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
return invokeCallback = children._init, mapIntoArray(
|
||||||
|
invokeCallback(children._payload),
|
||||||
|
array,
|
||||||
|
escapedPrefix,
|
||||||
|
nameSoFar,
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (invokeCallback) {
|
||||||
|
invokeCallback = children;
|
||||||
|
callback = callback(invokeCallback);
|
||||||
|
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
||||||
|
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
||||||
|
return c;
|
||||||
|
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
||||||
|
callback,
|
||||||
|
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
||||||
|
userProvidedKeyEscapeRegex,
|
||||||
|
"$&/"
|
||||||
|
) + "/") + childKey
|
||||||
|
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
invokeCallback = 0;
|
||||||
|
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
||||||
|
if (isArrayImpl(children))
|
||||||
|
for (var i = 0; i < children.length; i++)
|
||||||
|
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
||||||
|
nameSoFar,
|
||||||
|
array,
|
||||||
|
escapedPrefix,
|
||||||
|
type,
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
else if (i = getIteratorFn(children), "function" === typeof i)
|
||||||
|
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
||||||
|
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
||||||
|
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
||||||
|
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
||||||
|
nameSoFar,
|
||||||
|
array,
|
||||||
|
escapedPrefix,
|
||||||
|
type,
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
else if ("object" === type) {
|
||||||
|
if ("function" === typeof children.then)
|
||||||
|
return mapIntoArray(
|
||||||
|
resolveThenable(children),
|
||||||
|
array,
|
||||||
|
escapedPrefix,
|
||||||
|
nameSoFar,
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
array = String(children);
|
||||||
|
throw Error(
|
||||||
|
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return invokeCallback;
|
||||||
|
}
|
||||||
|
function mapChildren(children, func, context) {
|
||||||
|
if (null == children) return children;
|
||||||
|
var result = [], count = 0;
|
||||||
|
mapIntoArray(children, result, "", "", function(child) {
|
||||||
|
return func.call(context, child, count++);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function lazyInitializer(payload) {
|
||||||
|
if (-1 === payload._status) {
|
||||||
|
var ctor = payload._result;
|
||||||
|
ctor = ctor();
|
||||||
|
ctor.then(
|
||||||
|
function(moduleObject) {
|
||||||
|
if (0 === payload._status || -1 === payload._status)
|
||||||
|
payload._status = 1, payload._result = moduleObject;
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
if (0 === payload._status || -1 === payload._status)
|
||||||
|
payload._status = 2, payload._result = error;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
||||||
|
}
|
||||||
|
if (1 === payload._status)
|
||||||
|
return ctor = payload._result, void 0 === ctor && console.error(
|
||||||
|
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
||||||
|
ctor
|
||||||
|
), "default" in ctor || console.error(
|
||||||
|
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
||||||
|
ctor
|
||||||
|
), ctor.default;
|
||||||
|
throw payload._result;
|
||||||
|
}
|
||||||
|
function resolveDispatcher() {
|
||||||
|
var dispatcher = ReactSharedInternals.H;
|
||||||
|
null === dispatcher && console.error(
|
||||||
|
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
||||||
|
);
|
||||||
|
return dispatcher;
|
||||||
|
}
|
||||||
|
function noop() {
|
||||||
|
}
|
||||||
|
function enqueueTask(task) {
|
||||||
|
if (null === enqueueTaskImpl)
|
||||||
|
try {
|
||||||
|
var requireString = ("require" + Math.random()).slice(0, 7);
|
||||||
|
enqueueTaskImpl = (module && module[requireString]).call(
|
||||||
|
module,
|
||||||
|
"timers"
|
||||||
|
).setImmediate;
|
||||||
|
} catch (_err) {
|
||||||
|
enqueueTaskImpl = function(callback) {
|
||||||
|
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
||||||
|
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
||||||
|
));
|
||||||
|
var channel = new MessageChannel();
|
||||||
|
channel.port1.onmessage = callback;
|
||||||
|
channel.port2.postMessage(void 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return enqueueTaskImpl(task);
|
||||||
|
}
|
||||||
|
function aggregateErrors(errors) {
|
||||||
|
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
||||||
|
}
|
||||||
|
function popActScope(prevActQueue, prevActScopeDepth) {
|
||||||
|
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
||||||
|
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
||||||
|
);
|
||||||
|
actScopeDepth = prevActScopeDepth;
|
||||||
|
}
|
||||||
|
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
||||||
|
var queue = ReactSharedInternals.actQueue;
|
||||||
|
if (null !== queue)
|
||||||
|
if (0 !== queue.length)
|
||||||
|
try {
|
||||||
|
flushActQueue(queue);
|
||||||
|
enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} catch (error) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
}
|
||||||
|
else ReactSharedInternals.actQueue = null;
|
||||||
|
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
||||||
|
}
|
||||||
|
function flushActQueue(queue) {
|
||||||
|
if (!isFlushing) {
|
||||||
|
isFlushing = true;
|
||||||
|
var i = 0;
|
||||||
|
try {
|
||||||
|
for (; i < queue.length; i++) {
|
||||||
|
var callback = queue[i];
|
||||||
|
do {
|
||||||
|
ReactSharedInternals.didUsePromise = false;
|
||||||
|
var continuation = callback(false);
|
||||||
|
if (null !== continuation) {
|
||||||
|
if (ReactSharedInternals.didUsePromise) {
|
||||||
|
queue[i] = callback;
|
||||||
|
queue.splice(0, i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback = continuation;
|
||||||
|
} else break;
|
||||||
|
} while (1);
|
||||||
|
}
|
||||||
|
queue.length = 0;
|
||||||
|
} catch (error) {
|
||||||
|
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
} finally {
|
||||||
|
isFlushing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||||
|
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||||
|
Symbol.for("react.provider");
|
||||||
|
var 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 = {
|
||||||
|
isMounted: function() {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
enqueueForceUpdate: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "forceUpdate");
|
||||||
|
},
|
||||||
|
enqueueReplaceState: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "replaceState");
|
||||||
|
},
|
||||||
|
enqueueSetState: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "setState");
|
||||||
|
}
|
||||||
|
}, assign = Object.assign, emptyObject = {};
|
||||||
|
Object.freeze(emptyObject);
|
||||||
|
Component.prototype.isReactComponent = {};
|
||||||
|
Component.prototype.setState = function(partialState, callback) {
|
||||||
|
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
||||||
|
throw Error(
|
||||||
|
"takes an object of state variables to update or a function which returns an object of state variables."
|
||||||
|
);
|
||||||
|
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
||||||
|
};
|
||||||
|
Component.prototype.forceUpdate = function(callback) {
|
||||||
|
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
||||||
|
};
|
||||||
|
var deprecatedAPIs = {
|
||||||
|
isMounted: [
|
||||||
|
"isMounted",
|
||||||
|
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
||||||
|
],
|
||||||
|
replaceState: [
|
||||||
|
"replaceState",
|
||||||
|
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
||||||
|
]
|
||||||
|
}, fnName;
|
||||||
|
for (fnName in deprecatedAPIs)
|
||||||
|
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
||||||
|
ComponentDummy.prototype = Component.prototype;
|
||||||
|
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
||||||
|
deprecatedAPIs.constructor = PureComponent;
|
||||||
|
assign(deprecatedAPIs, Component.prototype);
|
||||||
|
deprecatedAPIs.isPureReactComponent = true;
|
||||||
|
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
||||||
|
H: null,
|
||||||
|
A: null,
|
||||||
|
T: null,
|
||||||
|
S: null,
|
||||||
|
V: null,
|
||||||
|
actQueue: null,
|
||||||
|
isBatchingLegacy: false,
|
||||||
|
didScheduleLegacyUpdate: false,
|
||||||
|
didUsePromise: false,
|
||||||
|
thrownErrors: [],
|
||||||
|
getCurrentStack: null,
|
||||||
|
recentlyCreatedOwnerStacks: 0
|
||||||
|
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
deprecatedAPIs = {
|
||||||
|
"react-stack-bottom-frame": function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = deprecatedAPIs["react-stack-bottom-frame"].bind(deprecatedAPIs, UnknownOwner)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
||||||
|
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
||||||
|
var event = new window.ErrorEvent("error", {
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: true,
|
||||||
|
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
||||||
|
error
|
||||||
|
});
|
||||||
|
if (!window.dispatchEvent(event)) return;
|
||||||
|
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
||||||
|
process.emit("uncaughtException", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.error(error);
|
||||||
|
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
||||||
|
queueMicrotask(function() {
|
||||||
|
return queueMicrotask(callback);
|
||||||
|
});
|
||||||
|
} : enqueueTask;
|
||||||
|
deprecatedAPIs = Object.freeze({
|
||||||
|
__proto__: null,
|
||||||
|
c: function(size) {
|
||||||
|
return resolveDispatcher().useMemoCache(size);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exports.Children = {
|
||||||
|
map: mapChildren,
|
||||||
|
forEach: function(children, forEachFunc, forEachContext) {
|
||||||
|
mapChildren(
|
||||||
|
children,
|
||||||
|
function() {
|
||||||
|
forEachFunc.apply(this, arguments);
|
||||||
|
},
|
||||||
|
forEachContext
|
||||||
|
);
|
||||||
|
},
|
||||||
|
count: function(children) {
|
||||||
|
var n = 0;
|
||||||
|
mapChildren(children, function() {
|
||||||
|
n++;
|
||||||
|
});
|
||||||
|
return n;
|
||||||
|
},
|
||||||
|
toArray: function(children) {
|
||||||
|
return mapChildren(children, function(child) {
|
||||||
|
return child;
|
||||||
|
}) || [];
|
||||||
|
},
|
||||||
|
only: function(children) {
|
||||||
|
if (!isValidElement(children))
|
||||||
|
throw Error(
|
||||||
|
"React.Children.only expected to receive a single React element child."
|
||||||
|
);
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.Component = Component;
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.Profiler = REACT_PROFILER_TYPE;
|
||||||
|
exports.PureComponent = PureComponent;
|
||||||
|
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
||||||
|
exports.Suspense = REACT_SUSPENSE_TYPE;
|
||||||
|
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
||||||
|
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
||||||
|
exports.act = function(callback) {
|
||||||
|
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
||||||
|
actScopeDepth++;
|
||||||
|
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
||||||
|
try {
|
||||||
|
var result = callback();
|
||||||
|
} catch (error) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
}
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length)
|
||||||
|
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||||
|
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
||||||
|
var thenable = result;
|
||||||
|
queueSeveralMicrotasks(function() {
|
||||||
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = 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 () => ...);"
|
||||||
|
));
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
then: function(resolve, reject) {
|
||||||
|
didAwaitActCall = true;
|
||||||
|
thenable.then(
|
||||||
|
function(returnValue) {
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
if (0 === prevActScopeDepth) {
|
||||||
|
try {
|
||||||
|
flushActQueue(queue), enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(
|
||||||
|
returnValue,
|
||||||
|
resolve,
|
||||||
|
reject
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} catch (error$0) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error$0);
|
||||||
|
}
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length) {
|
||||||
|
var _thrownError = aggregateErrors(
|
||||||
|
ReactSharedInternals.thrownErrors
|
||||||
|
);
|
||||||
|
ReactSharedInternals.thrownErrors.length = 0;
|
||||||
|
reject(_thrownError);
|
||||||
|
}
|
||||||
|
} else resolve(returnValue);
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
||||||
|
ReactSharedInternals.thrownErrors
|
||||||
|
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var returnValue$jscomp$0 = result;
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
||||||
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = 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(() => ...)"
|
||||||
|
));
|
||||||
|
}), ReactSharedInternals.actQueue = null);
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length)
|
||||||
|
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||||
|
return {
|
||||||
|
then: function(resolve, reject) {
|
||||||
|
didAwaitActCall = true;
|
||||||
|
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(
|
||||||
|
returnValue$jscomp$0,
|
||||||
|
resolve,
|
||||||
|
reject
|
||||||
|
);
|
||||||
|
})) : resolve(returnValue$jscomp$0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
exports.cache = function(fn) {
|
||||||
|
return function() {
|
||||||
|
return fn.apply(null, arguments);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
exports.captureOwnerStack = function() {
|
||||||
|
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
||||||
|
return null === getCurrentStack ? null : getCurrentStack();
|
||||||
|
};
|
||||||
|
exports.cloneElement = function(element, config, children) {
|
||||||
|
if (null === element || void 0 === element)
|
||||||
|
throw Error(
|
||||||
|
"The argument must be a React element, but you passed " + element + "."
|
||||||
|
);
|
||||||
|
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
||||||
|
if (null != config) {
|
||||||
|
var JSCompiler_inline_result;
|
||||||
|
a: {
|
||||||
|
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
||||||
|
config,
|
||||||
|
"ref"
|
||||||
|
).get) && JSCompiler_inline_result.isReactWarning) {
|
||||||
|
JSCompiler_inline_result = false;
|
||||||
|
break a;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result = void 0 !== config.ref;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result && (owner = getOwner());
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
||||||
|
for (propName in config)
|
||||||
|
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
||||||
|
}
|
||||||
|
var propName = arguments.length - 2;
|
||||||
|
if (1 === propName) props.children = children;
|
||||||
|
else if (1 < propName) {
|
||||||
|
JSCompiler_inline_result = Array(propName);
|
||||||
|
for (var i = 0; i < propName; i++)
|
||||||
|
JSCompiler_inline_result[i] = arguments[i + 2];
|
||||||
|
props.children = JSCompiler_inline_result;
|
||||||
|
}
|
||||||
|
props = ReactElement(
|
||||||
|
element.type,
|
||||||
|
key,
|
||||||
|
void 0,
|
||||||
|
void 0,
|
||||||
|
owner,
|
||||||
|
props,
|
||||||
|
element._debugStack,
|
||||||
|
element._debugTask
|
||||||
|
);
|
||||||
|
for (key = 2; key < arguments.length; key++)
|
||||||
|
owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
exports.createContext = function(defaultValue) {
|
||||||
|
defaultValue = {
|
||||||
|
$$typeof: REACT_CONTEXT_TYPE,
|
||||||
|
_currentValue: defaultValue,
|
||||||
|
_currentValue2: defaultValue,
|
||||||
|
_threadCount: 0,
|
||||||
|
Provider: null,
|
||||||
|
Consumer: null
|
||||||
|
};
|
||||||
|
defaultValue.Provider = defaultValue;
|
||||||
|
defaultValue.Consumer = {
|
||||||
|
$$typeof: REACT_CONSUMER_TYPE,
|
||||||
|
_context: defaultValue
|
||||||
|
};
|
||||||
|
defaultValue._currentRenderer = null;
|
||||||
|
defaultValue._currentRenderer2 = null;
|
||||||
|
return defaultValue;
|
||||||
|
};
|
||||||
|
exports.createElement = function(type, config, children) {
|
||||||
|
for (var i = 2; i < arguments.length; i++) {
|
||||||
|
var node = arguments[i];
|
||||||
|
isValidElement(node) && node._store && (node._store.validated = 1);
|
||||||
|
}
|
||||||
|
i = {};
|
||||||
|
node = null;
|
||||||
|
if (null != config)
|
||||||
|
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), node = "" + config.key), config)
|
||||||
|
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
||||||
|
var childrenLength = arguments.length - 2;
|
||||||
|
if (1 === childrenLength) i.children = children;
|
||||||
|
else if (1 < childrenLength) {
|
||||||
|
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
||||||
|
childArray[_i] = arguments[_i + 2];
|
||||||
|
Object.freeze && Object.freeze(childArray);
|
||||||
|
i.children = childArray;
|
||||||
|
}
|
||||||
|
if (type && type.defaultProps)
|
||||||
|
for (propName in childrenLength = type.defaultProps, childrenLength)
|
||||||
|
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
||||||
|
node && defineKeyPropWarningGetter(
|
||||||
|
i,
|
||||||
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||||
|
);
|
||||||
|
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return ReactElement(
|
||||||
|
type,
|
||||||
|
node,
|
||||||
|
void 0,
|
||||||
|
void 0,
|
||||||
|
getOwner(),
|
||||||
|
i,
|
||||||
|
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||||
|
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||||
|
);
|
||||||
|
};
|
||||||
|
exports.createRef = function() {
|
||||||
|
var refObject = { current: null };
|
||||||
|
Object.seal(refObject);
|
||||||
|
return refObject;
|
||||||
|
};
|
||||||
|
exports.forwardRef = function(render) {
|
||||||
|
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
||||||
|
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
||||||
|
) : "function" !== typeof render ? console.error(
|
||||||
|
"forwardRef requires a render function but was given %s.",
|
||||||
|
null === render ? "null" : typeof render
|
||||||
|
) : 0 !== render.length && 2 !== render.length && console.error(
|
||||||
|
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
||||||
|
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
||||||
|
);
|
||||||
|
null != render && null != render.defaultProps && console.error(
|
||||||
|
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
||||||
|
);
|
||||||
|
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
||||||
|
Object.defineProperty(elementType, "displayName", {
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true,
|
||||||
|
get: function() {
|
||||||
|
return ownName;
|
||||||
|
},
|
||||||
|
set: function(name) {
|
||||||
|
ownName = name;
|
||||||
|
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return elementType;
|
||||||
|
};
|
||||||
|
exports.isValidElement = isValidElement;
|
||||||
|
exports.lazy = function(ctor) {
|
||||||
|
return {
|
||||||
|
$$typeof: REACT_LAZY_TYPE,
|
||||||
|
_payload: { _status: -1, _result: ctor },
|
||||||
|
_init: lazyInitializer
|
||||||
|
};
|
||||||
|
};
|
||||||
|
exports.memo = function(type, compare) {
|
||||||
|
null == type && console.error(
|
||||||
|
"memo: The first argument must be a component. Instead received: %s",
|
||||||
|
null === type ? "null" : typeof type
|
||||||
|
);
|
||||||
|
compare = {
|
||||||
|
$$typeof: REACT_MEMO_TYPE,
|
||||||
|
type,
|
||||||
|
compare: void 0 === compare ? null : compare
|
||||||
|
};
|
||||||
|
var ownName;
|
||||||
|
Object.defineProperty(compare, "displayName", {
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true,
|
||||||
|
get: function() {
|
||||||
|
return ownName;
|
||||||
|
},
|
||||||
|
set: function(name) {
|
||||||
|
ownName = name;
|
||||||
|
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return compare;
|
||||||
|
};
|
||||||
|
exports.startTransition = function(scope) {
|
||||||
|
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
||||||
|
ReactSharedInternals.T = currentTransition;
|
||||||
|
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
||||||
|
try {
|
||||||
|
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
||||||
|
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
||||||
|
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
||||||
|
} catch (error) {
|
||||||
|
reportGlobalError(error);
|
||||||
|
} finally {
|
||||||
|
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
||||||
|
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
||||||
|
)), ReactSharedInternals.T = prevTransition;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.unstable_useCacheRefresh = function() {
|
||||||
|
return resolveDispatcher().useCacheRefresh();
|
||||||
|
};
|
||||||
|
exports.use = function(usable) {
|
||||||
|
return resolveDispatcher().use(usable);
|
||||||
|
};
|
||||||
|
exports.useActionState = function(action, initialState, permalink) {
|
||||||
|
return resolveDispatcher().useActionState(
|
||||||
|
action,
|
||||||
|
initialState,
|
||||||
|
permalink
|
||||||
|
);
|
||||||
|
};
|
||||||
|
exports.useCallback = function(callback, deps) {
|
||||||
|
return resolveDispatcher().useCallback(callback, deps);
|
||||||
|
};
|
||||||
|
exports.useContext = function(Context) {
|
||||||
|
var dispatcher = resolveDispatcher();
|
||||||
|
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
||||||
|
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
||||||
|
);
|
||||||
|
return dispatcher.useContext(Context);
|
||||||
|
};
|
||||||
|
exports.useDebugValue = function(value, formatterFn) {
|
||||||
|
return resolveDispatcher().useDebugValue(value, formatterFn);
|
||||||
|
};
|
||||||
|
exports.useDeferredValue = function(value, initialValue) {
|
||||||
|
return resolveDispatcher().useDeferredValue(value, initialValue);
|
||||||
|
};
|
||||||
|
exports.useEffect = function(create, createDeps, update) {
|
||||||
|
null == create && console.warn(
|
||||||
|
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||||
|
);
|
||||||
|
var dispatcher = resolveDispatcher();
|
||||||
|
if ("function" === typeof update)
|
||||||
|
throw Error(
|
||||||
|
"useEffect CRUD overload is not enabled in this build of React."
|
||||||
|
);
|
||||||
|
return dispatcher.useEffect(create, createDeps);
|
||||||
|
};
|
||||||
|
exports.useId = function() {
|
||||||
|
return resolveDispatcher().useId();
|
||||||
|
};
|
||||||
|
exports.useImperativeHandle = function(ref, create, deps) {
|
||||||
|
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
||||||
|
};
|
||||||
|
exports.useInsertionEffect = function(create, deps) {
|
||||||
|
null == create && console.warn(
|
||||||
|
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||||
|
);
|
||||||
|
return resolveDispatcher().useInsertionEffect(create, deps);
|
||||||
|
};
|
||||||
|
exports.useLayoutEffect = function(create, deps) {
|
||||||
|
null == create && console.warn(
|
||||||
|
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||||
|
);
|
||||||
|
return resolveDispatcher().useLayoutEffect(create, deps);
|
||||||
|
};
|
||||||
|
exports.useMemo = function(create, deps) {
|
||||||
|
return resolveDispatcher().useMemo(create, deps);
|
||||||
|
};
|
||||||
|
exports.useOptimistic = function(passthrough, reducer) {
|
||||||
|
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
||||||
|
};
|
||||||
|
exports.useReducer = function(reducer, initialArg, init) {
|
||||||
|
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
||||||
|
};
|
||||||
|
exports.useRef = function(initialValue) {
|
||||||
|
return resolveDispatcher().useRef(initialValue);
|
||||||
|
};
|
||||||
|
exports.useState = function(initialState) {
|
||||||
|
return resolveDispatcher().useState(initialState);
|
||||||
|
};
|
||||||
|
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
||||||
|
return resolveDispatcher().useSyncExternalStore(
|
||||||
|
subscribe,
|
||||||
|
getSnapshot,
|
||||||
|
getServerSnapshot
|
||||||
|
);
|
||||||
|
};
|
||||||
|
exports.useTransition = function() {
|
||||||
|
return resolveDispatcher().useTransition();
|
||||||
|
};
|
||||||
|
exports.version = "19.1.0";
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react/index.js
|
||||||
|
var require_react = __commonJS({
|
||||||
|
"node_modules/react/index.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export {
|
||||||
|
require_react
|
||||||
|
};
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react/cjs/react.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=chunk-UGC3UZ7L.js.map
|
||||||
7
node_modules/.vite/deps/chunk-UGC3UZ7L.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/chunk-UGC3UZ7L.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
6
node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import {
|
||||||
|
require_react_dom
|
||||||
|
} from "./chunk-HE4GKDYE.js";
|
||||||
|
import "./chunk-UGC3UZ7L.js";
|
||||||
|
import "./chunk-G3PMV62Z.js";
|
||||||
|
export default require_react_dom();
|
||||||
7
node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
18100
node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
18100
node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12095
node_modules/.vite/deps/react-router-dom.js
generated
vendored
Normal file
12095
node_modules/.vite/deps/react-router-dom.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/.vite/deps/react-router-dom.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react-router-dom.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/.vite/deps/react.js
generated
vendored
Normal file
5
node_modules/.vite/deps/react.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-UGC3UZ7L.js";
|
||||||
|
import "./chunk-G3PMV62Z.js";
|
||||||
|
export default require_react();
|
||||||
7
node_modules/.vite/deps/react.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"sources": [],
|
||||||
|
"sourcesContent": [],
|
||||||
|
"mappings": "",
|
||||||
|
"names": []
|
||||||
|
}
|
||||||
281
node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
281
node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-UGC3UZ7L.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-G3PMV62Z.js";
|
||||||
|
|
||||||
|
// node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||||
|
var require_react_jsx_dev_runtime_development = __commonJS({
|
||||||
|
"node_modules/react/cjs/react-jsx-dev-runtime.development.js"(exports) {
|
||||||
|
"use strict";
|
||||||
|
(function() {
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type)
|
||||||
|
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE:
|
||||||
|
return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE:
|
||||||
|
return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE:
|
||||||
|
return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type)
|
||||||
|
switch ("number" === typeof type.tag && console.error(
|
||||||
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||||
|
), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE:
|
||||||
|
return (type.displayName || "Context") + ".Provider";
|
||||||
|
case REACT_CONSUMER_TYPE:
|
||||||
|
return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = false;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = true;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(
|
||||||
|
JSCompiler_inline_result,
|
||||||
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||||
|
JSCompiler_inline_result$jscomp$0
|
||||||
|
);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||||
|
return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return false;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
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
|
||||||
|
));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
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."
|
||||||
|
));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||||
|
self = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: false,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
||||||
|
var children = config.children;
|
||||||
|
if (void 0 !== children)
|
||||||
|
if (isStaticChildren)
|
||||||
|
if (isArrayImpl(children)) {
|
||||||
|
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||||
|
validateChildKeys(children[isStaticChildren]);
|
||||||
|
Object.freeze && Object.freeze(children);
|
||||||
|
} else
|
||||||
|
console.error(
|
||||||
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||||
|
);
|
||||||
|
else validateChildKeys(children);
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
children = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(config).filter(function(k) {
|
||||||
|
return "key" !== k;
|
||||||
|
});
|
||||||
|
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||||
|
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||||
|
isStaticChildren,
|
||||||
|
children,
|
||||||
|
keys,
|
||||||
|
children
|
||||||
|
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||||
|
}
|
||||||
|
children = null;
|
||||||
|
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||||
|
if ("key" in config) {
|
||||||
|
maybeKey = {};
|
||||||
|
for (var propName in config)
|
||||||
|
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||||
|
} else maybeKey = config;
|
||||||
|
children && defineKeyPropWarningGetter(
|
||||||
|
maybeKey,
|
||||||
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||||
|
);
|
||||||
|
return ReactElement(
|
||||||
|
type,
|
||||||
|
children,
|
||||||
|
self,
|
||||||
|
source,
|
||||||
|
getOwner(),
|
||||||
|
maybeKey,
|
||||||
|
debugStack,
|
||||||
|
debugTask
|
||||||
|
);
|
||||||
|
}
|
||||||
|
function validateChildKeys(node) {
|
||||||
|
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
||||||
|
}
|
||||||
|
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||||
|
Symbol.for("react.provider");
|
||||||
|
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
React = {
|
||||||
|
"react-stack-bottom-frame": function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
||||||
|
React,
|
||||||
|
UnknownOwner
|
||||||
|
)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsxDEV = function(type, config, maybeKey, isStaticChildren, source, self) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(
|
||||||
|
type,
|
||||||
|
config,
|
||||||
|
maybeKey,
|
||||||
|
isStaticChildren,
|
||||||
|
source,
|
||||||
|
self,
|
||||||
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||||
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||||
|
);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react/jsx-dev-runtime.js
|
||||||
|
var require_jsx_dev_runtime = __commonJS({
|
||||||
|
"node_modules/react/jsx-dev-runtime.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_jsx_dev_runtime_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_jsx_dev_runtime();
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react/cjs/react-jsx-dev-runtime.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-dev-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=react_jsx-dev-runtime.js.map
|
||||||
7
node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
294
node_modules/.vite/deps/react_jsx-runtime.js
generated
vendored
Normal file
294
node_modules/.vite/deps/react_jsx-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
import {
|
||||||
|
require_react
|
||||||
|
} from "./chunk-UGC3UZ7L.js";
|
||||||
|
import {
|
||||||
|
__commonJS
|
||||||
|
} from "./chunk-G3PMV62Z.js";
|
||||||
|
|
||||||
|
// 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";
|
||||||
|
(function() {
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type)
|
||||||
|
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE:
|
||||||
|
return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE:
|
||||||
|
return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE:
|
||||||
|
return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE:
|
||||||
|
return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE:
|
||||||
|
return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type)
|
||||||
|
switch ("number" === typeof type.tag && console.error(
|
||||||
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||||
|
), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE:
|
||||||
|
return (type.displayName || "Context") + ".Provider";
|
||||||
|
case REACT_CONSUMER_TYPE:
|
||||||
|
return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE:
|
||||||
|
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = false;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = true;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(
|
||||||
|
JSCompiler_inline_result,
|
||||||
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||||
|
JSCompiler_inline_result$jscomp$0
|
||||||
|
);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||||
|
return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return false;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
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
|
||||||
|
));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = true;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
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."
|
||||||
|
));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||||
|
self = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: false,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: false,
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
||||||
|
var children = config.children;
|
||||||
|
if (void 0 !== children)
|
||||||
|
if (isStaticChildren)
|
||||||
|
if (isArrayImpl(children)) {
|
||||||
|
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||||
|
validateChildKeys(children[isStaticChildren]);
|
||||||
|
Object.freeze && Object.freeze(children);
|
||||||
|
} else
|
||||||
|
console.error(
|
||||||
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||||
|
);
|
||||||
|
else validateChildKeys(children);
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
children = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(config).filter(function(k) {
|
||||||
|
return "key" !== k;
|
||||||
|
});
|
||||||
|
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||||
|
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||||
|
isStaticChildren,
|
||||||
|
children,
|
||||||
|
keys,
|
||||||
|
children
|
||||||
|
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||||
|
}
|
||||||
|
children = null;
|
||||||
|
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||||
|
if ("key" in config) {
|
||||||
|
maybeKey = {};
|
||||||
|
for (var propName in config)
|
||||||
|
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||||
|
} else maybeKey = config;
|
||||||
|
children && defineKeyPropWarningGetter(
|
||||||
|
maybeKey,
|
||||||
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||||
|
);
|
||||||
|
return ReactElement(
|
||||||
|
type,
|
||||||
|
children,
|
||||||
|
self,
|
||||||
|
source,
|
||||||
|
getOwner(),
|
||||||
|
maybeKey,
|
||||||
|
debugStack,
|
||||||
|
debugTask
|
||||||
|
);
|
||||||
|
}
|
||||||
|
function validateChildKeys(node) {
|
||||||
|
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
||||||
|
}
|
||||||
|
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||||
|
Symbol.for("react.provider");
|
||||||
|
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
React = {
|
||||||
|
"react-stack-bottom-frame": function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
||||||
|
React,
|
||||||
|
UnknownOwner
|
||||||
|
)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsx = function(type, config, maybeKey, source, self) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(
|
||||||
|
type,
|
||||||
|
config,
|
||||||
|
maybeKey,
|
||||||
|
false,
|
||||||
|
source,
|
||||||
|
self,
|
||||||
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||||
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||||
|
);
|
||||||
|
};
|
||||||
|
exports.jsxs = function(type, config, maybeKey, source, self) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(
|
||||||
|
type,
|
||||||
|
config,
|
||||||
|
maybeKey,
|
||||||
|
true,
|
||||||
|
source,
|
||||||
|
self,
|
||||||
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||||
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||||
|
);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// node_modules/react/jsx-runtime.js
|
||||||
|
var require_jsx_runtime = __commonJS({
|
||||||
|
"node_modules/react/jsx-runtime.js"(exports, module) {
|
||||||
|
if (false) {
|
||||||
|
module.exports = null;
|
||||||
|
} else {
|
||||||
|
module.exports = require_react_jsx_runtime_development();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_jsx_runtime();
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
react/cjs/react-jsx-runtime.development.js:
|
||||||
|
(**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=react_jsx-runtime.js.map
|
||||||
7
node_modules/.vite/deps/react_jsx-runtime.js.map
generated
vendored
Normal file
7
node_modules/.vite/deps/react_jsx-runtime.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
49
node_modules/@polka/url/build.js
generated
vendored
49
node_modules/@polka/url/build.js
generated
vendored
@@ -1,49 +0,0 @@
|
|||||||
const qs = require('querystring');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef ParsedURL
|
|
||||||
* @type {import('.').ParsedURL}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef Request
|
|
||||||
* @property {string} url
|
|
||||||
* @property {ParsedURL} _parsedUrl
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Request} req
|
|
||||||
* @returns {ParsedURL|void}
|
|
||||||
*/
|
|
||||||
function parse(req) {
|
|
||||||
let raw = req.url;
|
|
||||||
if (raw == null) return;
|
|
||||||
|
|
||||||
let prev = req._parsedUrl;
|
|
||||||
if (prev && prev.raw === raw) return prev;
|
|
||||||
|
|
||||||
let pathname=raw, search='', query, hash;
|
|
||||||
|
|
||||||
if (raw.length > 1) {
|
|
||||||
let idx = raw.indexOf('#', 1);
|
|
||||||
|
|
||||||
if (idx !== -1) {
|
|
||||||
hash = raw.substring(idx);
|
|
||||||
pathname = raw.substring(0, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
idx = pathname.indexOf('?', 1);
|
|
||||||
|
|
||||||
if (idx !== -1) {
|
|
||||||
search = pathname.substring(idx);
|
|
||||||
pathname = pathname.substring(0, idx);
|
|
||||||
if (search.length > 1) {
|
|
||||||
query = qs.parse(search.substring(1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return req._parsedUrl = { pathname, search, query, hash, raw };
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.parse = parse;
|
|
||||||
47
node_modules/@polka/url/build.mjs
generated
vendored
47
node_modules/@polka/url/build.mjs
generated
vendored
@@ -1,47 +0,0 @@
|
|||||||
import * as qs from 'node:querystring';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef ParsedURL
|
|
||||||
* @type {import('.').ParsedURL}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef Request
|
|
||||||
* @property {string} url
|
|
||||||
* @property {ParsedURL} _parsedUrl
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Request} req
|
|
||||||
* @returns {ParsedURL|void}
|
|
||||||
*/
|
|
||||||
export function parse(req) {
|
|
||||||
let raw = req.url;
|
|
||||||
if (raw == null) return;
|
|
||||||
|
|
||||||
let prev = req._parsedUrl;
|
|
||||||
if (prev && prev.raw === raw) return prev;
|
|
||||||
|
|
||||||
let pathname=raw, search='', query, hash;
|
|
||||||
|
|
||||||
if (raw.length > 1) {
|
|
||||||
let idx = raw.indexOf('#', 1);
|
|
||||||
|
|
||||||
if (idx !== -1) {
|
|
||||||
hash = raw.substring(idx);
|
|
||||||
pathname = raw.substring(0, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
idx = pathname.indexOf('?', 1);
|
|
||||||
|
|
||||||
if (idx !== -1) {
|
|
||||||
search = pathname.substring(idx);
|
|
||||||
pathname = pathname.substring(0, idx);
|
|
||||||
if (search.length > 1) {
|
|
||||||
query = qs.parse(search.substring(1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return req._parsedUrl = { pathname, search, query, hash, raw };
|
|
||||||
}
|
|
||||||
11
node_modules/@polka/url/index.d.ts
generated
vendored
11
node_modules/@polka/url/index.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
|||||||
import type { IncomingMessage } from 'http';
|
|
||||||
|
|
||||||
export interface ParsedURL {
|
|
||||||
pathname: string;
|
|
||||||
search: string;
|
|
||||||
query: Record<string, string | string[]> | undefined;
|
|
||||||
hash: string | undefined;
|
|
||||||
raw: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parse(req: IncomingMessage): ParsedURL;
|
|
||||||
30
node_modules/@polka/url/package.json
generated
vendored
30
node_modules/@polka/url/package.json
generated
vendored
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0.0-next.29",
|
|
||||||
"name": "@polka/url",
|
|
||||||
"repository": "lukeed/polka",
|
|
||||||
"description": "Super fast, memoized `req.url` parser",
|
|
||||||
"module": "build.mjs",
|
|
||||||
"types": "index.d.ts",
|
|
||||||
"main": "build.js",
|
|
||||||
"license": "MIT",
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"types": "./index.d.ts",
|
|
||||||
"import": "./build.mjs",
|
|
||||||
"require": "./build.js"
|
|
||||||
},
|
|
||||||
"./package.json": "./package.json"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"build.*",
|
|
||||||
"index.d.*"
|
|
||||||
],
|
|
||||||
"author": {
|
|
||||||
"name": "Luke Edwards",
|
|
||||||
"email": "luke@lukeed.com",
|
|
||||||
"url": "https://lukeed.com"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
68
node_modules/@polka/url/readme.md
generated
vendored
68
node_modules/@polka/url/readme.md
generated
vendored
@@ -1,68 +0,0 @@
|
|||||||
# @polka/url [](https://npmjs.org/package/@polka/url) [](https://licenses.dev/npm/%40polka%2Furl)
|
|
||||||
|
|
||||||
> Super fast, memoized `req.url` parser; _not_ limited to [Polka][polka]!
|
|
||||||
|
|
||||||
Parses the `url` from a [`IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) request. The returned object will always only contain the following keys: `search`, `query`, `pathname`, and `raw`.
|
|
||||||
|
|
||||||
> **Note:** This library does not process `protocol`, `hostname`, `port`, etc.<br>This is because the incoming `req.url` value only begins with the path information.
|
|
||||||
|
|
||||||
Parsed requests will be mutated with a `_parsedUrl` key, containing the returned output. This is used for future memoization, avoiding the need to fully parse the same `url` value multiple times.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
```
|
|
||||||
$ npm install --save @polka/url
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```js
|
|
||||||
const parse = require('@polka/url');
|
|
||||||
|
|
||||||
let req = {
|
|
||||||
url: '/foo/bar?fizz=buzz'
|
|
||||||
};
|
|
||||||
let output = parse(req);
|
|
||||||
//=> {
|
|
||||||
//=> pathname: '/foo/bar',
|
|
||||||
//=> raw: '/foo/bar?fizz=buzz',
|
|
||||||
//=> search: '?fizz=buzz',
|
|
||||||
//=> query: {
|
|
||||||
//=> fizz: 'buzz'
|
|
||||||
//=> },
|
|
||||||
//=> }
|
|
||||||
|
|
||||||
// Attaches result for future memoization
|
|
||||||
assert.deepEqual(output, req._parsedUrl); //=> true
|
|
||||||
```
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
### url(req)
|
|
||||||
Returns: `Object` or `undefined`
|
|
||||||
|
|
||||||
> **Important:** The `req` must have a `url` key, otherwise `undefined` will be returned.<br>If no input is provided at all, a `TypeError` will be thrown.
|
|
||||||
|
|
||||||
#### req
|
|
||||||
Type: `IncomingMessage` or `{ url: string }`
|
|
||||||
|
|
||||||
The incoming HTTP request (`req`) or a plain `Object` with a `url` key.
|
|
||||||
|
|
||||||
> **Note:** In Node.js servers, the [`req.url`](https://nodejs.org/api/http.html#http_message_url) begins with a pathname & does not include a `hash`.
|
|
||||||
|
|
||||||
|
|
||||||
## Benchmarks
|
|
||||||
|
|
||||||
Check out the [`bench`](/bench) directory for in-depth benchmark results and comparisons.
|
|
||||||
|
|
||||||
|
|
||||||
## Support
|
|
||||||
|
|
||||||
Any issues or questions can be sent to the [Polka][polka] repository.<br>However, please specify that your inquiry is about `@polka/url` specifically.
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT © [Luke Edwards](https://lukeed.com)
|
|
||||||
|
|
||||||
[polka]: https://github.com/lukeed/polka
|
|
||||||
21
node_modules/@tinyhttp/accepts/LICENSE
generated
vendored
21
node_modules/@tinyhttp/accepts/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020 v 1 r t l
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
117
node_modules/@tinyhttp/accepts/README.md
generated
vendored
117
node_modules/@tinyhttp/accepts/README.md
generated
vendored
@@ -1,117 +0,0 @@
|
|||||||
# @tinyhttp/accepts
|
|
||||||
|
|
||||||
> [`accepts`](https://github.com/jshttp/accepts) rewrite in TypeScript.
|
|
||||||
|
|
||||||
Higher level content negotiation based on
|
|
||||||
[negotiator](https://www.npmjs.com/package/negotiator). Extracted from
|
|
||||||
[koa](https://www.npmjs.com/package/koa) for general use.
|
|
||||||
|
|
||||||
In addition to negotiator, it allows:
|
|
||||||
|
|
||||||
- Allows types as an array or arguments list, ie
|
|
||||||
`(['text/html', 'application/json'])` as well as
|
|
||||||
`('text/html', 'application/json')`.
|
|
||||||
- Allows type shorthands such as `json`.
|
|
||||||
- Returns `false` when no types match
|
|
||||||
- Treats non-existent headers as `*`
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm i @tinyhttp/accepts
|
|
||||||
```
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { Accepts } from '@tinyhttp/accepts'
|
|
||||||
```
|
|
||||||
|
|
||||||
### accepts(req)
|
|
||||||
|
|
||||||
Create a new `Accepts` object for the given `req`.
|
|
||||||
|
|
||||||
#### `.charset(charsets)`
|
|
||||||
|
|
||||||
Return the first accepted charset. If nothing in `charsets` is accepted, then
|
|
||||||
`false` is returned.
|
|
||||||
|
|
||||||
#### `.charsets()`
|
|
||||||
|
|
||||||
Return the charsets that the request accepts, in the order of the client's
|
|
||||||
preference (most preferred first).
|
|
||||||
|
|
||||||
#### `.encoding(encodings)`
|
|
||||||
|
|
||||||
Return the first accepted encoding. If nothing in `encodings` is accepted, then
|
|
||||||
`false` is returned.
|
|
||||||
|
|
||||||
#### `.encodings()`
|
|
||||||
|
|
||||||
Return the encodings that the request accepts, in the order of the client's
|
|
||||||
preference (most preferred first).
|
|
||||||
|
|
||||||
#### `.language(languages)`
|
|
||||||
|
|
||||||
Return the first accepted language. If nothing in `languages` is accepted, then
|
|
||||||
`false` is returned.
|
|
||||||
|
|
||||||
#### `.languages()`
|
|
||||||
|
|
||||||
Return the languages that the request accepts, in the order of the client's
|
|
||||||
preference (most preferred first).
|
|
||||||
|
|
||||||
#### `.type(types)`
|
|
||||||
|
|
||||||
Return the first accepted type (and it is returned as the same text as what
|
|
||||||
appears in the `types` array). If nothing in `types` is accepted, then `false`
|
|
||||||
is returned.
|
|
||||||
|
|
||||||
The `types` array can contain full MIME types or file extensions. Any value that
|
|
||||||
is not a full MIME types is passed to `require('mime-types').lookup`.
|
|
||||||
|
|
||||||
#### `.types()`
|
|
||||||
|
|
||||||
Return the types that the request accepts, in the order of the client's
|
|
||||||
preference (most preferred first).
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
This simple example shows how to use `accepts` to return a different typed
|
|
||||||
respond body based on what the client wants to accept. The server lists it's
|
|
||||||
preferences in order and will get back the best match between the client and
|
|
||||||
server.
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import Accepts from '@tinyhttp/accepts'
|
|
||||||
import { createServer } from 'node:http'
|
|
||||||
|
|
||||||
createServer((req, res) => {
|
|
||||||
const accept = new Accepts(req)
|
|
||||||
|
|
||||||
// the order of this list is significant; should be server preferred order
|
|
||||||
switch (accept.type(['json', 'html'])) {
|
|
||||||
case 'json':
|
|
||||||
res.setHeader('Content-Type', 'application/json')
|
|
||||||
res.write('{"hello":"world!"}')
|
|
||||||
break
|
|
||||||
case 'html':
|
|
||||||
res.setHeader('Content-Type', 'text/html')
|
|
||||||
res.write('<b>hello, world!</b>')
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
// the fallback is text/plain, so no need to specify it above
|
|
||||||
res.setHeader('Content-Type', 'text/plain')
|
|
||||||
res.write('hello, world!')
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
res.end()
|
|
||||||
}).listen(3000)
|
|
||||||
```
|
|
||||||
|
|
||||||
You can test this out with the cURL program:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -I -H 'Accept: text/html' http://localhost:3000/
|
|
||||||
```
|
|
||||||
48
node_modules/@tinyhttp/accepts/dist/index.d.ts
generated
vendored
48
node_modules/@tinyhttp/accepts/dist/index.d.ts
generated
vendored
@@ -1,48 +0,0 @@
|
|||||||
import type { IncomingMessage as I, IncomingHttpHeaders } from 'node:http';
|
|
||||||
import Negotiator from 'negotiator';
|
|
||||||
export declare class Accepts {
|
|
||||||
headers: IncomingHttpHeaders;
|
|
||||||
negotiator: Negotiator;
|
|
||||||
constructor(req: Pick<I, 'headers'>);
|
|
||||||
/**
|
|
||||||
* Check if the given `type(s)` is acceptable, returning the best match when true, otherwise `false`, in which case you should respond with 406 "Not Acceptable".
|
|
||||||
*
|
|
||||||
* The `type` value may be a single mime type string such as "application/json", the extension name such as "json" or an array `["json", "html", "text/plain"]`. When a list or array is given the _best_ match, if any is returned. When no types are given as arguments, returns all types accepted by the client in the preference order.
|
|
||||||
*/
|
|
||||||
types(types: string | string[], ...args: string[]): string[] | string | false;
|
|
||||||
get type(): (types: string | string[], ...args: string[]) => string[] | string | false;
|
|
||||||
/**
|
|
||||||
* Return accepted encodings or best fit based on `encodings`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Encoding: gzip, deflate`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['gzip', 'deflate']
|
|
||||||
*/
|
|
||||||
encodings(encodings: string | string[], ...args: string[]): string | string[] | boolean;
|
|
||||||
get encoding(): (encodings: string | string[], ...args: string[]) => string | string[] | boolean;
|
|
||||||
/**
|
|
||||||
* Return accepted charsets or best fit based on `charsets`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['utf-8', 'utf-7', 'iso-8859-1']
|
|
||||||
*/
|
|
||||||
charsets(charsets?: string | string[], ...args: string[]): string | string[] | boolean;
|
|
||||||
get charset(): (charsets: string | string[], ...args: string[]) => string | string[] | boolean;
|
|
||||||
/**
|
|
||||||
* Return accepted languages or best fit based on `langs`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Language: en;q=0.8, es, pt`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['es', 'pt', 'en']
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
languages(languages: string | string[], ...args: string[]): string | string[] | boolean;
|
|
||||||
get lang(): (languages: string | string[], ...args: string[]) => string | string[] | boolean;
|
|
||||||
get langs(): (languages: string | string[], ...args: string[]) => string | string[] | boolean;
|
|
||||||
get language(): (languages: string | string[], ...args: string[]) => string | string[] | boolean;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=index.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/dist/index.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/accepts/dist/index.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,IAAI,CAAC,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAE1E,OAAO,UAAU,MAAM,YAAY,CAAA;AAMnC,qBAAa,OAAO;IAClB,OAAO,EAAE,mBAAmB,CAAA;IAC5B,UAAU,EAAE,UAAU,CAAA;gBACV,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC;IAInC;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK;IA0B7E,IAAI,IAAI,IAA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AE,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAE/F;CACF"}
|
|
||||||
117
node_modules/@tinyhttp/accepts/dist/index.js
generated
vendored
117
node_modules/@tinyhttp/accepts/dist/index.js
generated
vendored
@@ -1,117 +0,0 @@
|
|||||||
import mime from 'mime';
|
|
||||||
import Negotiator from 'negotiator';
|
|
||||||
const extToMime = (type) => (type.indexOf('/') === -1 ? mime.getType(type) : type);
|
|
||||||
const validMime = (type) => typeof type === 'string';
|
|
||||||
export class Accepts {
|
|
||||||
constructor(req) {
|
|
||||||
this.headers = req.headers;
|
|
||||||
this.negotiator = new Negotiator(req);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Check if the given `type(s)` is acceptable, returning the best match when true, otherwise `false`, in which case you should respond with 406 "Not Acceptable".
|
|
||||||
*
|
|
||||||
* The `type` value may be a single mime type string such as "application/json", the extension name such as "json" or an array `["json", "html", "text/plain"]`. When a list or array is given the _best_ match, if any is returned. When no types are given as arguments, returns all types accepted by the client in the preference order.
|
|
||||||
*/
|
|
||||||
types(types, ...args) {
|
|
||||||
let mimeTypes = [];
|
|
||||||
// support flattened arguments
|
|
||||||
if (types && !Array.isArray(types)) {
|
|
||||||
mimeTypes = [types, ...args];
|
|
||||||
}
|
|
||||||
else if (types) {
|
|
||||||
mimeTypes = [...types, ...args];
|
|
||||||
}
|
|
||||||
// no types, return all requested types
|
|
||||||
if (!mimeTypes || mimeTypes.length === 0) {
|
|
||||||
return this.negotiator.mediaTypes();
|
|
||||||
}
|
|
||||||
// no accept header, return first given type
|
|
||||||
if (!this.headers.accept) {
|
|
||||||
return mimeTypes[0];
|
|
||||||
}
|
|
||||||
const mimes = mimeTypes.map(extToMime);
|
|
||||||
const accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
|
|
||||||
const [first] = accepts;
|
|
||||||
return first ? mimeTypes[mimes.indexOf(first)] : false;
|
|
||||||
}
|
|
||||||
get type() {
|
|
||||||
return this.types;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return accepted encodings or best fit based on `encodings`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Encoding: gzip, deflate`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['gzip', 'deflate']
|
|
||||||
*/
|
|
||||||
encodings(encodings, ...args) {
|
|
||||||
let _encodings = encodings;
|
|
||||||
// support flattened arguments
|
|
||||||
if (_encodings && !Array.isArray(_encodings)) {
|
|
||||||
_encodings = [_encodings, ...args];
|
|
||||||
}
|
|
||||||
// no encodings, return all requested encodings
|
|
||||||
if (!_encodings || _encodings.length === 0) {
|
|
||||||
return this.negotiator.encodings();
|
|
||||||
}
|
|
||||||
return this.negotiator.encodings(_encodings)[0] || false;
|
|
||||||
}
|
|
||||||
get encoding() {
|
|
||||||
return this.encodings;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return accepted charsets or best fit based on `charsets`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['utf-8', 'utf-7', 'iso-8859-1']
|
|
||||||
*/
|
|
||||||
charsets(charsets, ...args) {
|
|
||||||
let _charsets = charsets;
|
|
||||||
// support flattened arguments
|
|
||||||
if (_charsets && !Array.isArray(_charsets)) {
|
|
||||||
_charsets = [_charsets, ...args];
|
|
||||||
}
|
|
||||||
// no charsets, return all requested charsets
|
|
||||||
if (!_charsets || _charsets.length === 0) {
|
|
||||||
return this.negotiator.charsets();
|
|
||||||
}
|
|
||||||
return this.negotiator.charsets(_charsets)[0] || false;
|
|
||||||
}
|
|
||||||
get charset() {
|
|
||||||
return this.charsets;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return accepted languages or best fit based on `langs`.
|
|
||||||
*
|
|
||||||
* Given `Accept-Language: en;q=0.8, es, pt`
|
|
||||||
* an array sorted by quality is returned:
|
|
||||||
*
|
|
||||||
* ['es', 'pt', 'en']
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
languages(languages, ...args) {
|
|
||||||
let _languages = languages;
|
|
||||||
// support flattened arguments
|
|
||||||
if (_languages && !Array.isArray(_languages)) {
|
|
||||||
_languages = [_languages, ...args];
|
|
||||||
}
|
|
||||||
// no languages, return all requested languages
|
|
||||||
if (!_languages || _languages.length === 0) {
|
|
||||||
return this.negotiator.languages();
|
|
||||||
}
|
|
||||||
return this.negotiator.languages(_languages)[0] || false;
|
|
||||||
}
|
|
||||||
get lang() {
|
|
||||||
return this.languages;
|
|
||||||
}
|
|
||||||
get langs() {
|
|
||||||
return this.languages;
|
|
||||||
}
|
|
||||||
get language() {
|
|
||||||
return this.languages;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/dist/index.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/dist/index.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAE1F,MAAM,SAAS,GAAG,CAAC,IAAa,EAAW,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAA;AAEtE,MAAM,OAAO,OAAO;IAGlB,YAAY,GAAuB;QACjC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,UAA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C,UAAU,CAAC,EAAE,CAAC;YAC7C,UAAU,GAAG,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAA;QACpC,CAAC;QAED,+CAA+C;QAC/C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA;QACpC,CAAC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAA;IAC1D,CAAC;IACD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IACD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;CACF"}
|
|
||||||
16
node_modules/@tinyhttp/accepts/node_modules/.bin/mime
generated
vendored
16
node_modules/@tinyhttp/accepts/node_modules/.bin/mime
generated
vendored
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*)
|
|
||||||
if command -v cygpath > /dev/null 2>&1; then
|
|
||||||
basedir=`cygpath -w "$basedir"`
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
exec "$basedir/node" "$basedir/../mime/bin/cli.js" "$@"
|
|
||||||
else
|
|
||||||
exec node "$basedir/../mime/bin/cli.js" "$@"
|
|
||||||
fi
|
|
||||||
17
node_modules/@tinyhttp/accepts/node_modules/.bin/mime.cmd
generated
vendored
17
node_modules/@tinyhttp/accepts/node_modules/.bin/mime.cmd
generated
vendored
@@ -1,17 +0,0 @@
|
|||||||
@ECHO off
|
|
||||||
GOTO start
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
||||||
:start
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\bin\cli.js" %*
|
|
||||||
28
node_modules/@tinyhttp/accepts/node_modules/.bin/mime.ps1
generated
vendored
28
node_modules/@tinyhttp/accepts/node_modules/.bin/mime.ps1
generated
vendored
@@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
# Support pipeline input
|
|
||||||
if ($MyInvocation.ExpectingInput) {
|
|
||||||
$input | & "$basedir/node$exe" "$basedir/../mime/bin/cli.js" $args
|
|
||||||
} else {
|
|
||||||
& "$basedir/node$exe" "$basedir/../mime/bin/cli.js" $args
|
|
||||||
}
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
# Support pipeline input
|
|
||||||
if ($MyInvocation.ExpectingInput) {
|
|
||||||
$input | & "node$exe" "$basedir/../mime/bin/cli.js" $args
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../mime/bin/cli.js" $args
|
|
||||||
}
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
21
node_modules/@tinyhttp/accepts/node_modules/mime/LICENSE
generated
vendored
21
node_modules/@tinyhttp/accepts/node_modules/mime/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2023 Robert Kieffer
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
143
node_modules/@tinyhttp/accepts/node_modules/mime/README.md
generated
vendored
143
node_modules/@tinyhttp/accepts/node_modules/mime/README.md
generated
vendored
@@ -1,143 +0,0 @@
|
|||||||
<!--
|
|
||||||
-- This file is auto-generated from src/README_js.md. Changes should be made there.
|
|
||||||
-->
|
|
||||||
# Mime
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/mime)
|
|
||||||
[](https://github.com/broofa/mime/actions/workflows/ci.yml?query=branch%3Amain)
|
|
||||||
|
|
||||||
An API for MIME type information.
|
|
||||||
|
|
||||||
- All `mime-db` types
|
|
||||||
- Compact and dependency-free [](https://bundlejs.com/?q=mime)
|
|
||||||
- Full TS support
|
|
||||||
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> `mime@4` is now `latest`. If you're upgrading from `mime@3`, note the following:
|
|
||||||
> * `mime@4` is API-compatible with `mime@3`, with ~~one~~ two exceptions:
|
|
||||||
> * Direct imports of `mime` properties [no longer supported](https://github.com/broofa/mime/issues/295)
|
|
||||||
> * `mime.define()` cannot be called on the default `mime` object
|
|
||||||
> * ESM module support is required. [ESM Module FAQ](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
|
|
||||||
> * Requires an [ES2020](https://caniuse.com/?search=es2020) or newer runtime
|
|
||||||
> * Built-in Typescript types (`@types/mime` no longer needed)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install mime
|
|
||||||
```
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
For the full version (800+ MIME types, 1,000+ extensions):
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import mime from 'mime';
|
|
||||||
|
|
||||||
mime.getType('txt'); // ⇨ 'text/plain'
|
|
||||||
mime.getExtension('text/plain'); // ⇨ 'txt'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Lite Version [](https://bundlejs.com/?q=mime/lite)
|
|
||||||
|
|
||||||
`mime/lite` is a drop-in `mime` replacement, stripped of unofficial ("`prs.*`", "`x-*`", "`vnd.*`") types:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import mime from 'mime/lite';
|
|
||||||
```
|
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
### `mime.getType(pathOrExtension)`
|
|
||||||
|
|
||||||
Get mime type for the given file path or extension. E.g.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
mime.getType('js'); // ⇨ 'text/javascript'
|
|
||||||
mime.getType('json'); // ⇨ 'application/json'
|
|
||||||
|
|
||||||
mime.getType('txt'); // ⇨ 'text/plain'
|
|
||||||
mime.getType('dir/text.txt'); // ⇨ 'text/plain'
|
|
||||||
mime.getType('dir\\text.txt'); // ⇨ 'text/plain'
|
|
||||||
mime.getType('.text.txt'); // ⇨ 'text/plain'
|
|
||||||
mime.getType('.txt'); // ⇨ 'text/plain'
|
|
||||||
```
|
|
||||||
|
|
||||||
`null` is returned in cases where an extension is not detected or recognized
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
mime.getType('foo/txt'); // ⇨ null
|
|
||||||
mime.getType('bogus_type'); // ⇨ null
|
|
||||||
```
|
|
||||||
|
|
||||||
### `mime.getExtension(type)`
|
|
||||||
|
|
||||||
Get file extension for the given mime type. Charset options (often included in Content-Type headers) are ignored.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
mime.getExtension('text/plain'); // ⇨ 'txt'
|
|
||||||
mime.getExtension('application/json'); // ⇨ 'json'
|
|
||||||
mime.getExtension('text/html; charset=utf8'); // ⇨ 'html'
|
|
||||||
```
|
|
||||||
|
|
||||||
### `mime.getAllExtensions(type)`
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> New in `mime@4`
|
|
||||||
|
|
||||||
Get all file extensions for the given mime type.
|
|
||||||
|
|
||||||
```javascript --run default
|
|
||||||
mime.getAllExtensions('image/jpeg'); // ⇨ Set(3) { 'jpeg', 'jpg', 'jpe' }
|
|
||||||
```
|
|
||||||
|
|
||||||
## Custom `Mime` instances
|
|
||||||
|
|
||||||
The default `mime` objects are immutable. Custom, mutable versions can be created as follows...
|
|
||||||
### new Mime(type map [, type map, ...])
|
|
||||||
|
|
||||||
Create a new, custom mime instance. For example, to create a mutable version of the default `mime` instance:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { Mime } from 'mime/lite';
|
|
||||||
|
|
||||||
import standardTypes from 'mime/types/standard.js';
|
|
||||||
import otherTypes from 'mime/types/other.js';
|
|
||||||
|
|
||||||
const mime = new Mime(standardTypes, otherTypes);
|
|
||||||
```
|
|
||||||
|
|
||||||
Each argument is passed to the `define()` method, below. For example `new Mime(standardTypes, otherTypes)` is synonomous with `new Mime().define(standardTypes).define(otherTypes)`
|
|
||||||
|
|
||||||
### `mime.define(type map [, force = false])`
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> Only available on custom `Mime` instances
|
|
||||||
|
|
||||||
Define MIME type -> extensions.
|
|
||||||
|
|
||||||
Attempting to map a type to an already-defined extension will `throw` unless the `force` argument is set to `true`.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
mime.define({'text/x-abc': ['abc', 'abcd']});
|
|
||||||
|
|
||||||
mime.getType('abcd'); // ⇨ 'text/x-abc'
|
|
||||||
mime.getExtension('text/x-abc') // ⇨ 'abc'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Command Line
|
|
||||||
|
|
||||||
### Extension -> type
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ mime scripts/jquery.js
|
|
||||||
text/javascript
|
|
||||||
```
|
|
||||||
|
|
||||||
### Type -> extension
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ mime -r image/jpeg
|
|
||||||
jpeg
|
|
||||||
```
|
|
||||||
6
node_modules/@tinyhttp/accepts/node_modules/mime/bin/cli.js
generated
vendored
6
node_modules/@tinyhttp/accepts/node_modules/mime/bin/cli.js
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
// Thin wrapper around mime
|
|
||||||
import mime_cli from '../dist/src/mime_cli.js';
|
|
||||||
|
|
||||||
await mime_cli();
|
|
||||||
17
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.d.ts
generated
vendored
17
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.d.ts
generated
vendored
@@ -1,17 +0,0 @@
|
|||||||
type TypeMap = {
|
|
||||||
[key: string]: string[];
|
|
||||||
};
|
|
||||||
export default class Mime {
|
|
||||||
#private;
|
|
||||||
constructor(...args: TypeMap[]);
|
|
||||||
define(typeMap: TypeMap, force?: boolean): this;
|
|
||||||
getType(path: string): string | null;
|
|
||||||
getExtension(type: string): string | null;
|
|
||||||
getAllExtensions(type: string): Set<string> | null;
|
|
||||||
_freeze(): this;
|
|
||||||
_getTestState(): {
|
|
||||||
types: Map<string, string>;
|
|
||||||
extensions: Map<string, string>;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export {};
|
|
||||||
85
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.js
generated
vendored
85
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.js
generated
vendored
@@ -1,85 +0,0 @@
|
|||||||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
||||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
||||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
||||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
||||||
};
|
|
||||||
var _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;
|
|
||||||
class Mime {
|
|
||||||
constructor(...args) {
|
|
||||||
_Mime_extensionToType.set(this, new Map());
|
|
||||||
_Mime_typeToExtension.set(this, new Map());
|
|
||||||
_Mime_typeToExtensions.set(this, new Map());
|
|
||||||
for (const arg of args) {
|
|
||||||
this.define(arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
define(typeMap, force = false) {
|
|
||||||
for (let [type, extensions] of Object.entries(typeMap)) {
|
|
||||||
type = type.toLowerCase();
|
|
||||||
extensions = extensions.map((ext) => ext.toLowerCase());
|
|
||||||
if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
|
|
||||||
__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, new Set());
|
|
||||||
}
|
|
||||||
const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
|
|
||||||
let first = true;
|
|
||||||
for (let extension of extensions) {
|
|
||||||
const starred = extension.startsWith('*');
|
|
||||||
extension = starred ? extension.slice(1) : extension;
|
|
||||||
allExtensions?.add(extension);
|
|
||||||
if (first) {
|
|
||||||
__classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
if (starred)
|
|
||||||
continue;
|
|
||||||
const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
|
|
||||||
if (currentType && currentType != type && !force) {
|
|
||||||
throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
|
|
||||||
}
|
|
||||||
__classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
getType(path) {
|
|
||||||
if (typeof path !== 'string')
|
|
||||||
return null;
|
|
||||||
const last = path.replace(/^.*[/\\]/, '').toLowerCase();
|
|
||||||
const ext = last.replace(/^.*\./, '').toLowerCase();
|
|
||||||
const hasPath = last.length < path.length;
|
|
||||||
const hasDot = ext.length < last.length - 1;
|
|
||||||
if (!hasDot && hasPath)
|
|
||||||
return null;
|
|
||||||
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
||||||
}
|
|
||||||
getExtension(type) {
|
|
||||||
if (typeof type !== 'string')
|
|
||||||
return null;
|
|
||||||
type = type?.split?.(';')[0];
|
|
||||||
return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null);
|
|
||||||
}
|
|
||||||
getAllExtensions(type) {
|
|
||||||
if (typeof type !== 'string')
|
|
||||||
return null;
|
|
||||||
return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
|
|
||||||
}
|
|
||||||
_freeze() {
|
|
||||||
this.define = () => {
|
|
||||||
throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');
|
|
||||||
};
|
|
||||||
Object.freeze(this);
|
|
||||||
for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
|
|
||||||
Object.freeze(extensions);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
_getTestState() {
|
|
||||||
return {
|
|
||||||
types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
|
|
||||||
extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f"),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();
|
|
||||||
export default Mime;
|
|
||||||
//# sourceMappingURL=Mime.js.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/Mime.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"Mime.js","sourceRoot":"","sources":["../../src/Mime.ts"],"names":[],"mappings":";;;;;;AAEA,MAAqB,IAAI;IAKvB,YAAY,GAAG,IAAe;QAJ9B,gCAAmB,IAAI,GAAG,EAAkB,EAAC;QAC7C,gCAAmB,IAAI,GAAG,EAAkB,EAAC;QAC7C,iCAAoB,IAAI,GAAG,EAAuB,EAAC;QAGjD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAcD,MAAM,CAAC,OAAgB,EAAE,KAAK,GAAG,KAAK;QACpC,KAAK,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,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CAAC;IAMD,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,8HAA8H,CAAC,CAAC;QAClJ,CAAC,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEpB,KAAK,MAAM,UAAU,IAAI,uBAAA,IAAI,8BAAkB,CAAC,MAAM,EAAE,EAAE,CAAC;YACzD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa;QACX,OAAO;YACL,KAAK,EAAE,uBAAA,IAAI,6BAAiB;YAC5B,UAAU,EAAE,uBAAA,IAAI,6BAAiB;SAClC,CAAC;IACJ,CAAC;CACF;;eAtIoB,IAAI"}
|
|
||||||
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.d.ts
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
|||||||
import Mime from './Mime.js';
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
declare const _default: Mime;
|
|
||||||
export default _default;
|
|
||||||
6
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.js
generated
vendored
6
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.js
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
import otherTypes from '../types/other.js';
|
|
||||||
import standardTypes from '../types/standard.js';
|
|
||||||
import Mime from './Mime.js';
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
export default new Mime(standardTypes, otherTypes)._freeze();
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAe,IAAI,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC"}
|
|
||||||
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.d.ts
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
|||||||
import Mime from './Mime.js';
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
declare const _default: Mime;
|
|
||||||
export default _default;
|
|
||||||
5
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.js
generated
vendored
5
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.js
generated
vendored
@@ -1,5 +0,0 @@
|
|||||||
import standardTypes from '../types/standard.js';
|
|
||||||
import Mime from './Mime.js';
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
export default new Mime(standardTypes)._freeze();
|
|
||||||
//# sourceMappingURL=index_lite.js.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/index_lite.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index_lite.js","sourceRoot":"","sources":["../../src/index_lite.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAe,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,CAAC"}
|
|
||||||
2
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.d.ts
generated
vendored
2
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.d.ts
generated
vendored
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
export default function (): Promise<void>;
|
|
||||||
67
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.js
generated
vendored
67
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.js
generated
vendored
@@ -1,67 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
import fs from 'node:fs/promises';
|
|
||||||
import path from 'node:path';
|
|
||||||
import { fileURLToPath } from 'node:url';
|
|
||||||
import mime from './index.js';
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
export default async function () {
|
|
||||||
process.title = 'mime';
|
|
||||||
const json = await fs.readFile(path.join(__dirname, '../../package.json'), 'utf-8');
|
|
||||||
const pkg = JSON.parse(json);
|
|
||||||
const args = process.argv.splice(2);
|
|
||||||
if (args.includes('--version') ||
|
|
||||||
args.includes('-v') ||
|
|
||||||
args.includes('--v')) {
|
|
||||||
console.log(pkg.version);
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
else if (args.includes('--name') ||
|
|
||||||
args.includes('-n') ||
|
|
||||||
args.includes('--n')) {
|
|
||||||
console.log(pkg.name);
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
else if (args.includes('--help') ||
|
|
||||||
args.includes('-h') ||
|
|
||||||
args.includes('--h')) {
|
|
||||||
console.log(pkg.name + ' - ' + pkg.description + '\n');
|
|
||||||
console.log(`Usage:
|
|
||||||
|
|
||||||
mime [flags] [path_or_extension]
|
|
||||||
|
|
||||||
Flags:
|
|
||||||
--help, -h Show this message
|
|
||||||
--version, -v Display the version
|
|
||||||
--name, -n Print the name of the program
|
|
||||||
--reverse, -r Print the extension of the mime type
|
|
||||||
|
|
||||||
Note: the command will exit after it executes if a command is specified
|
|
||||||
The path_or_extension is the path to the file or the extension of the file.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
mime --help
|
|
||||||
mime --version
|
|
||||||
mime --name
|
|
||||||
mime -v
|
|
||||||
mime --reverse application/text
|
|
||||||
mime src/log.js
|
|
||||||
mime new.py
|
|
||||||
mime foo.sh
|
|
||||||
`);
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
else if (args.includes('--reverse') || args.includes('-r')) {
|
|
||||||
const mimeType = args[args.length - 1];
|
|
||||||
const extension = mime.getExtension(mimeType);
|
|
||||||
if (!extension)
|
|
||||||
process.exit(1);
|
|
||||||
process.stdout.write(extension + '\n');
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
const file = args[0];
|
|
||||||
const type = mime.getType(file);
|
|
||||||
if (!type)
|
|
||||||
process.exit(1);
|
|
||||||
process.stdout.write(type + '\n');
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=mime_cli.js.map
|
|
||||||
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/src/mime_cli.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"mime_cli.js","sourceRoot":"","sources":["../../src/mime_cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,MAAM,CAAC,OAAO,CAAC,KAAK;IAClB,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;IAMvB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAC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,CAAC,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE9C,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEhC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
|
||||||
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.d.ts
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
|||||||
declare const types: {
|
|
||||||
[key: string]: string[];
|
|
||||||
};
|
|
||||||
export default types;
|
|
||||||
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.js
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.js
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/other.js.map
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.d.ts
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.d.ts
generated
vendored
@@ -1,4 +0,0 @@
|
|||||||
declare const types: {
|
|
||||||
[key: string]: string[];
|
|
||||||
};
|
|
||||||
export default types;
|
|
||||||
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.js
generated
vendored
4
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.js
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.js.map
generated
vendored
1
node_modules/@tinyhttp/accepts/node_modules/mime/dist/types/standard.js.map
generated
vendored
File diff suppressed because one or more lines are too long
76
node_modules/@tinyhttp/accepts/node_modules/mime/package.json
generated
vendored
76
node_modules/@tinyhttp/accepts/node_modules/mime/package.json
generated
vendored
@@ -1,76 +0,0 @@
|
|||||||
{
|
|
||||||
"author": {
|
|
||||||
"name": "Robert Kieffer",
|
|
||||||
"url": "http://github.com/broofa",
|
|
||||||
"email": "robert@broofa.com"
|
|
||||||
},
|
|
||||||
"type": "module",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16"
|
|
||||||
},
|
|
||||||
"main": "./dist/src/index.js",
|
|
||||||
"exports": {
|
|
||||||
".": "./dist/src/index.js",
|
|
||||||
"./lite": "./dist/src/index_lite.js",
|
|
||||||
"./types/standard.js": "./dist/types/standard.js",
|
|
||||||
"./types/other.js": "./dist/types/other.js",
|
|
||||||
"./package.json": "./package.json"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"bin",
|
|
||||||
"dist/src",
|
|
||||||
"dist/types",
|
|
||||||
"src",
|
|
||||||
"types"
|
|
||||||
],
|
|
||||||
"bin": {
|
|
||||||
"mime": "bin/cli.js"
|
|
||||||
},
|
|
||||||
"contributors": [],
|
|
||||||
"description": "A comprehensive library for mime-type mapping",
|
|
||||||
"license": "MIT",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/mime-db": "1.*",
|
|
||||||
"@types/mime-types": "2.1.4",
|
|
||||||
"@types/node": "20.14.10",
|
|
||||||
"@typescript-eslint/eslint-plugin": "7.15.0",
|
|
||||||
"@typescript-eslint/parser": "7.15.0",
|
|
||||||
"chalk": "5.3.0",
|
|
||||||
"mime-score": "2.0.4",
|
|
||||||
"mime-types": "2.1.35",
|
|
||||||
"prettier": "3.3.2",
|
|
||||||
"runmd": "1.3.9",
|
|
||||||
"standard-version": "9.5.0",
|
|
||||||
"typescript": "5.5.3"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "npm run build:clean && tsc",
|
|
||||||
"build:clean": "rm -fr dist",
|
|
||||||
"build:types": "node dist/scripts/build.js",
|
|
||||||
"build:watch": "npm run build:clean && tsc --watch",
|
|
||||||
"lint": "prettier -c .",
|
|
||||||
"lint:fix": "prettier -w .",
|
|
||||||
"prepublishOnly": "npm run build && npm run build:types && npm test",
|
|
||||||
"release": "# `standard-version --dry-run` is the command you're after",
|
|
||||||
"test": "npm run build && node --test && ./test/exports_test.sh",
|
|
||||||
"test:watch": "clear && node --enable-source-maps --test --watch test"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"extension",
|
|
||||||
"file",
|
|
||||||
"mime",
|
|
||||||
"mime-db",
|
|
||||||
"mimetypes",
|
|
||||||
"util"
|
|
||||||
],
|
|
||||||
"name": "mime",
|
|
||||||
"repository": {
|
|
||||||
"url": "https://github.com/broofa/mime",
|
|
||||||
"type": "git"
|
|
||||||
},
|
|
||||||
"version": "4.0.4",
|
|
||||||
"funding": [
|
|
||||||
"https://github.com/sponsors/broofa"
|
|
||||||
],
|
|
||||||
"packageManager": "npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483"
|
|
||||||
}
|
|
||||||
137
node_modules/@tinyhttp/accepts/node_modules/mime/src/Mime.ts
generated
vendored
137
node_modules/@tinyhttp/accepts/node_modules/mime/src/Mime.ts
generated
vendored
@@ -1,137 +0,0 @@
|
|||||||
type TypeMap = { [key: string]: string[] };
|
|
||||||
|
|
||||||
export default class Mime {
|
|
||||||
#extensionToType = new Map<string, string>();
|
|
||||||
#typeToExtension = new Map<string, string>();
|
|
||||||
#typeToExtensions = new Map<string, Set<string>>();
|
|
||||||
|
|
||||||
constructor(...args: TypeMap[]) {
|
|
||||||
for (const arg of args) {
|
|
||||||
this.define(arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define mimetype -> extension mappings. Each key is a mime-type that maps
|
|
||||||
* to an array of extensions associated with the type. The first extension is
|
|
||||||
* used as the default extension for the type.
|
|
||||||
*
|
|
||||||
* e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
|
|
||||||
*
|
|
||||||
* If a mapping for an extension has already been defined an error will be
|
|
||||||
* thrown unless the `force` argument is set to `true`.
|
|
||||||
*
|
|
||||||
* e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});
|
|
||||||
*/
|
|
||||||
define(typeMap: TypeMap, force = false) {
|
|
||||||
for (let [type, extensions] of Object.entries(typeMap)) {
|
|
||||||
// Lowercase thingz
|
|
||||||
type = type.toLowerCase();
|
|
||||||
extensions = extensions.map((ext) => ext.toLowerCase());
|
|
||||||
|
|
||||||
if (!this.#typeToExtensions.has(type)) {
|
|
||||||
this.#typeToExtensions.set(type, new Set<string>());
|
|
||||||
}
|
|
||||||
const allExtensions = this.#typeToExtensions.get(type);
|
|
||||||
|
|
||||||
let first = true;
|
|
||||||
for (let extension of extensions) {
|
|
||||||
const starred = extension.startsWith('*');
|
|
||||||
|
|
||||||
extension = starred ? extension.slice(1) : extension;
|
|
||||||
|
|
||||||
// Add to list of extensions for the type
|
|
||||||
allExtensions?.add(extension);
|
|
||||||
|
|
||||||
if (first) {
|
|
||||||
// Map type to default extension (first in list)
|
|
||||||
this.#typeToExtension.set(type, extension);
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
|
|
||||||
// Starred types are not eligible to be the default extension
|
|
||||||
if (starred) continue;
|
|
||||||
|
|
||||||
// Map extension to type
|
|
||||||
const currentType = this.#extensionToType.get(extension);
|
|
||||||
if (currentType && currentType != type && !force) {
|
|
||||||
throw new Error(
|
|
||||||
`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
this.#extensionToType.set(extension, type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get mime type associated with an extension
|
|
||||||
*/
|
|
||||||
getType(path: string) {
|
|
||||||
if (typeof path !== 'string') return null;
|
|
||||||
|
|
||||||
// Remove chars preceeding `/` or `\`
|
|
||||||
const last = path.replace(/^.*[/\\]/, '').toLowerCase();
|
|
||||||
|
|
||||||
// Remove chars preceeding '.'
|
|
||||||
const ext = last.replace(/^.*\./, '').toLowerCase();
|
|
||||||
|
|
||||||
const hasPath = last.length < path.length;
|
|
||||||
const hasDot = ext.length < last.length - 1;
|
|
||||||
|
|
||||||
// Extension-less file?
|
|
||||||
if (!hasDot && hasPath) return null;
|
|
||||||
|
|
||||||
return this.#extensionToType.get(ext) ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get default file extension associated with a mime type
|
|
||||||
*/
|
|
||||||
getExtension(type: string) {
|
|
||||||
if (typeof type !== 'string') return null;
|
|
||||||
|
|
||||||
// Remove http header parameter(s) (specifically, charset)
|
|
||||||
type = type?.split?.(';')[0];
|
|
||||||
|
|
||||||
return (
|
|
||||||
(type && this.#typeToExtension.get(type.trim().toLowerCase())) ?? null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all file extensions associated with a mime type
|
|
||||||
*/
|
|
||||||
getAllExtensions(type: string) {
|
|
||||||
if (typeof type !== 'string') return null;
|
|
||||||
|
|
||||||
return this.#typeToExtensions.get(type.toLowerCase()) ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Private API, for internal use only. These APIs may change at any time
|
|
||||||
//
|
|
||||||
|
|
||||||
_freeze() {
|
|
||||||
this.define = () => {
|
|
||||||
throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.freeze(this);
|
|
||||||
|
|
||||||
for (const extensions of this.#typeToExtensions.values()) {
|
|
||||||
Object.freeze(extensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
_getTestState() {
|
|
||||||
return {
|
|
||||||
types: this.#extensionToType,
|
|
||||||
extensions: this.#typeToExtension,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
7
node_modules/@tinyhttp/accepts/node_modules/mime/src/index.ts
generated
vendored
7
node_modules/@tinyhttp/accepts/node_modules/mime/src/index.ts
generated
vendored
@@ -1,7 +0,0 @@
|
|||||||
import otherTypes from '../types/other.js';
|
|
||||||
import standardTypes from '../types/standard.js';
|
|
||||||
import Mime from './Mime.js';
|
|
||||||
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
|
|
||||||
export default new Mime(standardTypes, otherTypes)._freeze();
|
|
||||||
6
node_modules/@tinyhttp/accepts/node_modules/mime/src/index_lite.ts
generated
vendored
6
node_modules/@tinyhttp/accepts/node_modules/mime/src/index_lite.ts
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
import standardTypes from '../types/standard.js';
|
|
||||||
import Mime from './Mime.js';
|
|
||||||
|
|
||||||
export { default as Mime } from './Mime.js';
|
|
||||||
|
|
||||||
export default new Mime(standardTypes)._freeze();
|
|
||||||
85
node_modules/@tinyhttp/accepts/node_modules/mime/src/mime_cli.ts
generated
vendored
85
node_modules/@tinyhttp/accepts/node_modules/mime/src/mime_cli.ts
generated
vendored
@@ -1,85 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
import fs from 'node:fs/promises';
|
|
||||||
import path from 'node:path';
|
|
||||||
import { fileURLToPath } from 'node:url';
|
|
||||||
import mime from './index.js';
|
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
export default async function () {
|
|
||||||
process.title = 'mime';
|
|
||||||
|
|
||||||
// TODO: Use json imports to access package.json once "import attributes" are
|
|
||||||
// a real, stable thing.
|
|
||||||
//
|
|
||||||
// See https://github.com/tc39/proposal-import-attributes
|
|
||||||
const json = await fs.readFile(
|
|
||||||
path.join(__dirname, '../../package.json'),
|
|
||||||
'utf-8',
|
|
||||||
);
|
|
||||||
const pkg = JSON.parse(json);
|
|
||||||
|
|
||||||
const args = process.argv.splice(2);
|
|
||||||
|
|
||||||
if (
|
|
||||||
args.includes('--version') ||
|
|
||||||
args.includes('-v') ||
|
|
||||||
args.includes('--v')
|
|
||||||
) {
|
|
||||||
console.log(pkg.version);
|
|
||||||
process.exit(0);
|
|
||||||
} else if (
|
|
||||||
args.includes('--name') ||
|
|
||||||
args.includes('-n') ||
|
|
||||||
args.includes('--n')
|
|
||||||
) {
|
|
||||||
console.log(pkg.name);
|
|
||||||
process.exit(0);
|
|
||||||
} else if (
|
|
||||||
args.includes('--help') ||
|
|
||||||
args.includes('-h') ||
|
|
||||||
args.includes('--h')
|
|
||||||
) {
|
|
||||||
console.log(pkg.name + ' - ' + pkg.description + '\n');
|
|
||||||
console.log(`Usage:
|
|
||||||
|
|
||||||
mime [flags] [path_or_extension]
|
|
||||||
|
|
||||||
Flags:
|
|
||||||
--help, -h Show this message
|
|
||||||
--version, -v Display the version
|
|
||||||
--name, -n Print the name of the program
|
|
||||||
--reverse, -r Print the extension of the mime type
|
|
||||||
|
|
||||||
Note: the command will exit after it executes if a command is specified
|
|
||||||
The path_or_extension is the path to the file or the extension of the file.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
mime --help
|
|
||||||
mime --version
|
|
||||||
mime --name
|
|
||||||
mime -v
|
|
||||||
mime --reverse application/text
|
|
||||||
mime src/log.js
|
|
||||||
mime new.py
|
|
||||||
mime foo.sh
|
|
||||||
`);
|
|
||||||
process.exit(0);
|
|
||||||
} else if (args.includes('--reverse') || args.includes('-r')) {
|
|
||||||
const mimeType = args[args.length - 1];
|
|
||||||
const extension = mime.getExtension(mimeType);
|
|
||||||
|
|
||||||
if (!extension) process.exit(1);
|
|
||||||
|
|
||||||
process.stdout.write(extension + '\n');
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const file = args[0];
|
|
||||||
const type = mime.getType(file);
|
|
||||||
|
|
||||||
if (!type) process.exit(1);
|
|
||||||
|
|
||||||
process.stdout.write(type + '\n');
|
|
||||||
}
|
|
||||||
3
node_modules/@tinyhttp/accepts/node_modules/mime/types/other.ts
generated
vendored
3
node_modules/@tinyhttp/accepts/node_modules/mime/types/other.ts
generated
vendored
File diff suppressed because one or more lines are too long
3
node_modules/@tinyhttp/accepts/node_modules/mime/types/standard.ts
generated
vendored
3
node_modules/@tinyhttp/accepts/node_modules/mime/types/standard.ts
generated
vendored
File diff suppressed because one or more lines are too long
35
node_modules/@tinyhttp/accepts/package.json
generated
vendored
35
node_modules/@tinyhttp/accepts/package.json
generated
vendored
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@tinyhttp/accepts",
|
|
||||||
"description": "accepts rewrite in TypeScript",
|
|
||||||
"version": "2.2.3",
|
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "https://tinyhttp.v1rtl.site",
|
|
||||||
"funding": {
|
|
||||||
"type": "individual",
|
|
||||||
"url": "https://github.com/tinyhttp/tinyhttp?sponsor=1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/tinyhttp/tinyhttp.git",
|
|
||||||
"directory": "packages/cookie-signature"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.20.0"
|
|
||||||
},
|
|
||||||
"type": "module",
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"exports": "./dist/index.js",
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/negotiator": "^0.6.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"mime": "4.0.4",
|
|
||||||
"negotiator": "^0.6.3"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "tsc"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
21
node_modules/@tinyhttp/app/LICENSE
generated
vendored
21
node_modules/@tinyhttp/app/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020 v 1 r t l
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
25
node_modules/@tinyhttp/app/README.md
generated
vendored
25
node_modules/@tinyhttp/app/README.md
generated
vendored
@@ -1,25 +0,0 @@
|
|||||||
# @tinyhttp/app
|
|
||||||
|
|
||||||
The core of tinyhttp. Contains the `App`, `Request` and `Response`. Additionally, it provides special tinyhttp-specific types.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm i @tinyhttp/app
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { App } from '@tinyhttp/app'
|
|
||||||
import type { Request, Response, NextFunction } from '@tinyhttp/app'
|
|
||||||
|
|
||||||
new App()
|
|
||||||
.use((req: Request, res: Response, next: NextFunction) => {
|
|
||||||
console.log('Did a request')
|
|
||||||
next()
|
|
||||||
})
|
|
||||||
.get('/', (_, res) => res.send('<h1>Hello World</h1>'))
|
|
||||||
.get('/page/:page', (req, res) => res.send(`You opened ${req.params.page}`))
|
|
||||||
.listen(3000)
|
|
||||||
```
|
|
||||||
55
node_modules/@tinyhttp/app/dist/app.d.ts
generated
vendored
55
node_modules/@tinyhttp/app/dist/app.d.ts
generated
vendored
@@ -1,55 +0,0 @@
|
|||||||
import { type Server } from 'node:http';
|
|
||||||
import type { Handler, Middleware, NextFunction, UseMethodParams } from '@tinyhttp/router';
|
|
||||||
import { Router } from '@tinyhttp/router';
|
|
||||||
import type { TemplateEngineOptions } from './index.js';
|
|
||||||
import type { ErrorHandler } from './onError.js';
|
|
||||||
import type { Request } from './request.js';
|
|
||||||
import type { Response } from './response.js';
|
|
||||||
import type { AppConstructor, AppInterface, AppRenderOptions, AppSettings, TemplateEngine } from './types.js';
|
|
||||||
/**
|
|
||||||
* `App` class - the starting point of tinyhttp app.
|
|
||||||
*
|
|
||||||
* With the `App` you can:
|
|
||||||
* * use routing methods and `.use(...)`
|
|
||||||
* * set no match (404) and error (500) handlers
|
|
||||||
* * configure template engines
|
|
||||||
* * store data in locals
|
|
||||||
* * listen the http server on a specified port
|
|
||||||
*
|
|
||||||
* In case you use TypeScript, you can pass custom types to this class because it is also a generic class.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ```ts
|
|
||||||
* interface CoolReq extends Request {
|
|
||||||
* genericsAreDope: boolean
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* const app = App<any, CoolReq, Response>()
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
export declare class App<Req extends Request = Request, Res extends Response = Response> extends Router<App, Req, Res> implements AppInterface<Req, Res> {
|
|
||||||
#private;
|
|
||||||
middleware: Middleware<Req, Res>[];
|
|
||||||
locals: Record<string, unknown>;
|
|
||||||
noMatchHandler: Handler;
|
|
||||||
onError: ErrorHandler;
|
|
||||||
settings: AppSettings;
|
|
||||||
engines: Record<string, TemplateEngine>;
|
|
||||||
applyExtensions?: Handler;
|
|
||||||
attach: (req: Req, res: Res, next?: NextFunction) => void;
|
|
||||||
cache: Record<string, unknown>;
|
|
||||||
constructor(options?: AppConstructor<Req, Res>);
|
|
||||||
set<K extends keyof AppSettings>(setting: K, value: AppSettings[K]): this;
|
|
||||||
enable<K extends keyof AppSettings>(setting: K): this;
|
|
||||||
enabled<K extends keyof AppSettings>(setting: K): boolean;
|
|
||||||
disable<K extends keyof AppSettings>(setting: K): this;
|
|
||||||
path(): any;
|
|
||||||
engine<RenderOptions extends TemplateEngineOptions = TemplateEngineOptions>(ext: string, fn: TemplateEngine<RenderOptions>): this;
|
|
||||||
render<RenderOptions extends TemplateEngineOptions = TemplateEngineOptions>(name: string, data?: Record<string, unknown>, options?: AppRenderOptions<RenderOptions>, cb?: (err: unknown, html?: unknown) => void): void;
|
|
||||||
use(...args: UseMethodParams<Req, Res, AppInterface<any, any>>): this;
|
|
||||||
route(path: string): App<any, any>;
|
|
||||||
handler<RenderOptions extends TemplateEngineOptions = TemplateEngineOptions>(req: Req, res: Res, next?: NextFunction): void;
|
|
||||||
listen(port?: number, cb?: () => void, host?: string): Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=app.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/app.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/app.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,WAAW,CAAA;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAkB,MAAM,kBAAkB,CAAA;AAGzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAyB7G;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,qBAAa,GAAG,CAAC,GAAG,SAAS,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,QAAQ,GAAG,QAAQ,CAC7E,SAAQ,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAC5B,YAAW,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC;;IAEjC,UAAU,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAK;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAK;IACpC,cAAc,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,YAAY,CAAA;IACrB,QAAQ,EAAE,WAAW,CAAA;IACrB,OAAO,EAAE,MAAM,CAAC,MA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,GAAG,EAAE,GAAG,CAAC;IAsBlC,OAAO,CAAC,aAAa,SAAS,qBAAqB,GAAG,qBAAqB,EACzE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,CAAC,EAAE,YAAY;IAmHrB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM;CAGrD"}
|
|
||||||
323
node_modules/@tinyhttp/app/dist/app.js
generated
vendored
323
node_modules/@tinyhttp/app/dist/app.js
generated
vendored
@@ -1,323 +0,0 @@
|
|||||||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
||||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
||||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
||||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
||||||
};
|
|
||||||
var _App_instances, _App_find;
|
|
||||||
import { createServer } from 'node:http';
|
|
||||||
import { getPathname } from '@tinyhttp/req';
|
|
||||||
import { Router, pushMiddleware } from '@tinyhttp/router';
|
|
||||||
import { parse as rg } from 'regexparam';
|
|
||||||
import { extendMiddleware } from './extend.js';
|
|
||||||
import { onErrorHandler } from './onError.js';
|
|
||||||
import { getURLParams } from './request.js';
|
|
||||||
import { View } from './view.js';
|
|
||||||
/**
|
|
||||||
* Add leading slash if not present (e.g. path -> /path, /path -> /path)
|
|
||||||
* @param x
|
|
||||||
*/
|
|
||||||
const lead = (x) => (x.charCodeAt(0) === 47 ? x : `/${x}`);
|
|
||||||
const trail = (x) => (x.charCodeAt(x.length - 1) === 47 ? x.substring(0, x.length - 1) : x);
|
|
||||||
const mount = (fn) => (fn instanceof App ? fn.attach : fn);
|
|
||||||
const applyHandler = (h) => async (req, res, next) => {
|
|
||||||
try {
|
|
||||||
if (h[Symbol.toStringTag] === 'AsyncFunction') {
|
|
||||||
await h(req, res, next);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
h(req, res, next);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
next === null || next === void 0 ? void 0 : next(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* `App` class - the starting point of tinyhttp app.
|
|
||||||
*
|
|
||||||
* With the `App` you can:
|
|
||||||
* * use routing methods and `.use(...)`
|
|
||||||
* * set no match (404) and error (500) handlers
|
|
||||||
* * configure template engines
|
|
||||||
* * store data in locals
|
|
||||||
* * listen the http server on a specified port
|
|
||||||
*
|
|
||||||
* In case you use TypeScript, you can pass custom types to this class because it is also a generic class.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* ```ts
|
|
||||||
* interface CoolReq extends Request {
|
|
||||||
* genericsAreDope: boolean
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* const app = App<any, CoolReq, Response>()
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
export class App extends Router {
|
|
||||||
constructor(options = {}) {
|
|
||||||
super();
|
|
||||||
_App_instances.add(this);
|
|
||||||
this.middleware = [];
|
|
||||||
this.locals = {};
|
|
||||||
this.engines = {};
|
|
||||||
this.onError = (options === null || options === void 0 ? void 0 : options.onError) || onErrorHandler;
|
|
||||||
// @ts-expect-error typescript is not smart enough to understand "this" ts(2345)
|
|
||||||
this.noMatchHandler = (options === null || options === void 0 ? void 0 : options.noMatchHandler) || this.onError.bind(this, { code: 404 });
|
|
||||||
this.settings = {
|
|
||||||
view: View,
|
|
||||||
xPoweredBy: true,
|
|
||||||
views: `${process.cwd()}/views`,
|
|
||||||
'view cache': process.env.NODE_ENV === 'production',
|
|
||||||
'trust proxy': 0,
|
|
||||||
...options.settings
|
|
||||||
};
|
|
||||||
if (options.applyExtensions)
|
|
||||||
this.applyExtensions = options === null || options === void 0 ? void 0 : options.applyExtensions;
|
|
||||||
const boundHandler = this.handler.bind(this);
|
|
||||||
this.attach = (req, res, next) => setImmediate(boundHandler, req, res, next);
|
|
||||||
this.cache = {};
|
|
||||||
}
|
|
||||||
set(setting, value) {
|
|
||||||
this.settings[setting] = value;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
enable(setting) {
|
|
||||||
this.settings[setting] = true;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
enabled(setting) {
|
|
||||||
return Boolean(this.settings[setting]);
|
|
||||||
}
|
|
||||||
disable(setting) {
|
|
||||||
this.settings[setting] = false;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
path() {
|
|
||||||
return this.parent ? this.parent.path() + this.mountpath : '';
|
|
||||||
}
|
|
||||||
engine(ext, fn) {
|
|
||||||
this.engines[ext[0] === '.' ? ext : `.${ext}`] = fn;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
render(name, data = {}, options = {}, cb = () => { }) {
|
|
||||||
let view;
|
|
||||||
const { _locals, ...opts } = options;
|
|
||||||
let locals = this.locals;
|
|
||||||
if (_locals)
|
|
||||||
locals = { ...locals, ..._locals };
|
|
||||||
locals = { ...locals, ...data };
|
|
||||||
if (opts.cache == null)
|
|
||||||
opts.cache = this.enabled('view cache');
|
|
||||||
if (opts.cache) {
|
|
||||||
view = this.cache[name];
|
|
||||||
}
|
|
||||||
if (!view) {
|
|
||||||
const ViewClass = this.settings.view || View;
|
|
||||||
try {
|
|
||||||
view = new ViewClass(name, {
|
|
||||||
defaultEngine: this.settings['view engine'],
|
|
||||||
root: this.settings.views,
|
|
||||||
engines: this.engines
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
return cb(err);
|
|
||||||
}
|
|
||||||
if (opts.cache) {
|
|
||||||
this.cache[name] = view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
view.render(opts, locals, cb);
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
cb(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
use(...args) {
|
|
||||||
var _a;
|
|
||||||
const base = args[0];
|
|
||||||
const fns = args.slice(1).flat();
|
|
||||||
let pathArray = [];
|
|
||||||
if (typeof base === 'function' || base instanceof App) {
|
|
||||||
fns.unshift(base);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// if base is not an array of paths, then convert it to an array.
|
|
||||||
let basePaths = [];
|
|
||||||
if (Array.isArray(base))
|
|
||||||
basePaths = base;
|
|
||||||
else if (typeof base === 'string')
|
|
||||||
basePaths = [base];
|
|
||||||
basePaths = basePaths.filter((element) => {
|
|
||||||
if (typeof element === 'string') {
|
|
||||||
pathArray.push(element);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
fns.unshift(...basePaths);
|
|
||||||
}
|
|
||||||
pathArray = pathArray.length ? pathArray.map((path) => lead(path)) : ['/'];
|
|
||||||
const mountpath = pathArray.join(', ');
|
|
||||||
let regex;
|
|
||||||
for (const fn of fns) {
|
|
||||||
if (fn instanceof App) {
|
|
||||||
for (const path of pathArray) {
|
|
||||||
regex = rg(path, true);
|
|
||||||
fn.mountpath = mountpath;
|
|
||||||
this.apps[path] = fn;
|
|
||||||
// @ts-expect-error typescript is not smart enough to understand "this" ts(2345)
|
|
||||||
fn.parent = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const path of pathArray) {
|
|
||||||
const handlerPaths = [];
|
|
||||||
const handlerFunctions = [];
|
|
||||||
const handlerPathBase = path === '/' ? '' : lead(path);
|
|
||||||
for (const fn of fns) {
|
|
||||||
if (fn instanceof App && ((_a = fn.middleware) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
||||||
for (const mw of fn.middleware) {
|
|
||||||
handlerPaths.push(handlerPathBase + lead(mw.path));
|
|
||||||
handlerFunctions.push(fn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
handlerPaths.push('');
|
|
||||||
handlerFunctions.push(fn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pushMiddleware(this.middleware)({
|
|
||||||
path,
|
|
||||||
regex,
|
|
||||||
type: 'mw',
|
|
||||||
handler: mount(handlerFunctions[0]),
|
|
||||||
handlers: handlerFunctions.slice(1).map(mount),
|
|
||||||
fullPaths: handlerPaths
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
route(path) {
|
|
||||||
const app = new App({ settings: this.settings });
|
|
||||||
this.use(path, app);
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
handler(req, res, next) {
|
|
||||||
/* Set X-Powered-By header */
|
|
||||||
const { xPoweredBy } = this.settings;
|
|
||||||
if (xPoweredBy)
|
|
||||||
res.setHeader('X-Powered-By', typeof xPoweredBy === 'string' ? xPoweredBy : 'tinyhttp');
|
|
||||||
// @ts-expect-error typescript is not smart enough to understand "this" ts(2345)
|
|
||||||
const exts = this.applyExtensions || extendMiddleware(this);
|
|
||||||
let mw = [
|
|
||||||
{
|
|
||||||
handler: exts,
|
|
||||||
type: 'mw',
|
|
||||||
path: '/'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
req.baseUrl = '';
|
|
||||||
const handle = (mw, pathname) => async (req, res, next) => {
|
|
||||||
var _a;
|
|
||||||
const { path, handler, regex } = mw;
|
|
||||||
let params;
|
|
||||||
try {
|
|
||||||
params = regex ? getURLParams(regex, pathname) : {};
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
if (e instanceof URIError)
|
|
||||||
return res.sendStatus(400);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
let prefix = path;
|
|
||||||
if (regex) {
|
|
||||||
for (const key of regex.keys) {
|
|
||||||
if (key === 'wild') {
|
|
||||||
prefix = prefix.replace('*', params.wild);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
prefix = prefix.replace(`:${key}`, params[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req.params = { ...req.params, ...params };
|
|
||||||
if (mw.type === 'mw') {
|
|
||||||
req.url = lead(req.originalUrl.substring(prefix.length));
|
|
||||||
req.baseUrl = trail(req.originalUrl.substring(0, prefix.length));
|
|
||||||
}
|
|
||||||
if (!req.path)
|
|
||||||
req.path = pathname;
|
|
||||||
if ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.enableReqRoute)
|
|
||||||
req.route = mw;
|
|
||||||
await applyHandler(handler)(req, res, next);
|
|
||||||
};
|
|
||||||
let idx = 0;
|
|
||||||
const loop = () => {
|
|
||||||
req.originalUrl = req.baseUrl + req.url;
|
|
||||||
const pathname = getPathname(req.url);
|
|
||||||
const matched = __classPrivateFieldGet(this, _App_instances, "m", _App_find).call(this, pathname).filter((x) => (req.method === 'HEAD' || (x.method ? x.method === req.method : true)) && !mw.includes(x));
|
|
||||||
if (matched.length && matched[0] !== null) {
|
|
||||||
if (idx !== 0) {
|
|
||||||
idx = mw.length;
|
|
||||||
req.params = {};
|
|
||||||
}
|
|
||||||
mw = [
|
|
||||||
...mw,
|
|
||||||
...matched,
|
|
||||||
{
|
|
||||||
type: 'mw',
|
|
||||||
handler: (req, res, next) => {
|
|
||||||
if (req.method === 'HEAD') {
|
|
||||||
res.statusCode = 204;
|
|
||||||
return res.end('');
|
|
||||||
}
|
|
||||||
next === null || next === void 0 ? void 0 : next();
|
|
||||||
},
|
|
||||||
path: '/'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
else if (this.parent == null) {
|
|
||||||
mw.push({
|
|
||||||
handler: this.noMatchHandler,
|
|
||||||
type: 'route',
|
|
||||||
path: '/'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
void handle(mw[idx++], pathname)(req, res, next);
|
|
||||||
};
|
|
||||||
const parentNext = next;
|
|
||||||
next = (err) => {
|
|
||||||
if (err != null) {
|
|
||||||
// @ts-expect-error The 'this' context of type 'this' is not assignable to method's 'this' of type 'App<Request, Response<unknown>>' ts(2345)
|
|
||||||
return this.onError(err, req, res);
|
|
||||||
}
|
|
||||||
if (res.writableEnded)
|
|
||||||
return;
|
|
||||||
if (idx >= mw.length) {
|
|
||||||
if (parentNext != null)
|
|
||||||
parentNext();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loop();
|
|
||||||
};
|
|
||||||
loop();
|
|
||||||
}
|
|
||||||
listen(port, cb, host) {
|
|
||||||
return createServer().on('request', this.attach).listen(port, host, cb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_App_instances = new WeakSet(), _App_find = function _App_find(url) {
|
|
||||||
return this.middleware.filter((m) => {
|
|
||||||
m.regex = m.regex || rg(m.path, m.type === 'mw');
|
|
||||||
let fullPathRegex;
|
|
||||||
m.fullPath && typeof m.fullPath === 'string'
|
|
||||||
? (fullPathRegex = rg(m.fullPath, m.type === 'mw'))
|
|
||||||
: (fullPathRegex = null);
|
|
||||||
return m.regex.pattern.test(url) && (m.type === 'mw' && fullPathRegex ? fullPathRegex.pattern.test(url) : true);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=app.js.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/app.js.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/app.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
node_modules/@tinyhttp/app/dist/extend.d.ts
generated
vendored
8
node_modules/@tinyhttp/app/dist/extend.d.ts
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
import type { App } from './app.js';
|
|
||||||
import type { Handler } from './index.js';
|
|
||||||
import type { TemplateEngineOptions } from './types.js';
|
|
||||||
/**
|
|
||||||
* Extends Request and Response objects with custom properties and methods
|
|
||||||
*/
|
|
||||||
export declare const extendMiddleware: <EngineOptions extends TemplateEngineOptions = TemplateEngineOptions>(app: App) => Handler;
|
|
||||||
//# sourceMappingURL=extend.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/extend.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/extend.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../src/extend.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAKzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,SAAS,qBAAqB,+BAA+B,GAAG,KA+DtG,OAAO,CAAA"}
|
|
||||||
64
node_modules/@tinyhttp/app/dist/extend.js
generated
vendored
64
node_modules/@tinyhttp/app/dist/extend.js
generated
vendored
@@ -1,64 +0,0 @@
|
|||||||
import { compile } from '@tinyhttp/proxy-addr';
|
|
||||||
import { checkIfXMLHttpRequest, getAccepts, getAcceptsCharsets, getAcceptsEncodings, getAcceptsLanguages, getFreshOrStale, getQueryParams, getRangeFromHeader, getRequestHeader, reqIs } from '@tinyhttp/req';
|
|
||||||
import { append, attachment, clearCookie, download, formatResponse, getResponseHeader, json, redirect, send, sendFile, sendStatus, setContentType, setCookie, setHeader, setLinksHeader, setLocationHeader, setVaryHeader, status } from '@tinyhttp/res';
|
|
||||||
import { getSubdomains } from './request.js';
|
|
||||||
import { getHost, getIP, getIPs, getProtocol } from './request.js';
|
|
||||||
import { renderTemplate } from './response.js';
|
|
||||||
/**
|
|
||||||
* Extends Request and Response objects with custom properties and methods
|
|
||||||
*/
|
|
||||||
export const extendMiddleware = (app) => ((req, res, next) => {
|
|
||||||
const { settings } = app;
|
|
||||||
res.get = getResponseHeader(res);
|
|
||||||
req.get = getRequestHeader(req);
|
|
||||||
if (settings === null || settings === void 0 ? void 0 : settings.bindAppToReqRes) {
|
|
||||||
req.app = app;
|
|
||||||
res.app = app;
|
|
||||||
}
|
|
||||||
if (settings === null || settings === void 0 ? void 0 : settings.networkExtensions) {
|
|
||||||
let trust = (settings === null || settings === void 0 ? void 0 : settings['trust proxy']) || 0;
|
|
||||||
if (trust && typeof trust !== 'function') {
|
|
||||||
trust = compile(trust);
|
|
||||||
settings['trust proxy'] = trust;
|
|
||||||
}
|
|
||||||
req.protocol = getProtocol(req, trust);
|
|
||||||
req.secure = req.protocol === 'https';
|
|
||||||
const host = getHost(req, trust);
|
|
||||||
req.hostname = host === null || host === void 0 ? void 0 : host.hostname;
|
|
||||||
req.port = host === null || host === void 0 ? void 0 : host.port;
|
|
||||||
req.subdomains = getSubdomains(req, trust, settings.subdomainOffset);
|
|
||||||
req.ip = getIP(req, trust);
|
|
||||||
req.ips = getIPs(req, trust);
|
|
||||||
}
|
|
||||||
req.query = getQueryParams(req.url);
|
|
||||||
req.is = reqIs(req);
|
|
||||||
req.range = getRangeFromHeader(req);
|
|
||||||
req.accepts = getAccepts(req);
|
|
||||||
req.acceptsCharsets = getAcceptsCharsets(req);
|
|
||||||
req.acceptsEncodings = getAcceptsEncodings(req);
|
|
||||||
req.acceptsLanguages = getAcceptsLanguages(req);
|
|
||||||
req.xhr = checkIfXMLHttpRequest(req);
|
|
||||||
res.header = res.set = setHeader(res);
|
|
||||||
res.send = send(req, res);
|
|
||||||
res.json = json(res);
|
|
||||||
res.status = status(res);
|
|
||||||
res.sendStatus = sendStatus(req, res);
|
|
||||||
res.sendFile = sendFile(req, res);
|
|
||||||
res.type = setContentType(res);
|
|
||||||
res.location = setLocationHeader(req, res);
|
|
||||||
res.links = setLinksHeader(res);
|
|
||||||
res.vary = setVaryHeader(res);
|
|
||||||
res.cookie = setCookie(req, res);
|
|
||||||
res.clearCookie = clearCookie(req, res);
|
|
||||||
res.render = renderTemplate(req, res, app);
|
|
||||||
res.format = formatResponse(req, res, next);
|
|
||||||
res.redirect = redirect(req, res, next);
|
|
||||||
res.attachment = attachment(res);
|
|
||||||
res.download = download(req, res);
|
|
||||||
res.append = append(res);
|
|
||||||
res.locals = res.locals || Object.create(null);
|
|
||||||
Object.defineProperty(req, 'fresh', { get: getFreshOrStale.bind(null, req, res), configurable: true });
|
|
||||||
req.stale = !req.fresh;
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=extend.js.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/extend.js.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/extend.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"extend.js","sourceRoot":"","sources":["../src/extend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACN,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,MAAM,EACP,MAAM,eAAe,CAAA;AAItB,OAAO,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAsE,GAAQ,EAAE,EAAE,CAChH,CAAC,CAAC,GAAY,EAAE,GAA4B,EAAE,IAAkB,EAAE,EAAE;IAClE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IAExB,GAAG,CAAC,GAAG,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;IAChC,GAAG,CAAC,GAAG,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;IAE/B,IAAI,QAAQ,a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,CAAA;IAC1D,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC1C,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAC3C,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IACvC,GAAG,CAAC,UAAU,GAAG,UAAU,CAAW,GAAG,CAAC,CAAA;IAC1C,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAoB,GAAG,EAAE,GAAG,CAAC,CAAA;IACpD,GAAG,CAAC,MAAM,GAAG,MAAM,CAAW,GAAG,CAAC,CAAA;IAClC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAE9C,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;IACtG,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAA;IAEtB,IAAI,EAAE,CAAA;AACR,CAAC,CAAY,CAAA"}
|
|
||||||
15
node_modules/@tinyhttp/app/dist/index.d.ts
generated
vendored
15
node_modules/@tinyhttp/app/dist/index.d.ts
generated
vendored
@@ -1,15 +0,0 @@
|
|||||||
export { App } from './app.js';
|
|
||||||
export * from './request.js';
|
|
||||||
export * from './response.js';
|
|
||||||
export { extendMiddleware } from './extend.js';
|
|
||||||
export { onErrorHandler, type ErrorHandler } from './onError.js';
|
|
||||||
export { View } from './view.js';
|
|
||||||
export type { AppSettings, TemplateEngineOptions, TemplateEngine, AppConstructor } from './types.js';
|
|
||||||
import type { Middleware, NextFunction, AsyncHandler as RAsyncHandler, Handler as RHandler, SyncHandler as RSyncHandler } from '@tinyhttp/router';
|
|
||||||
import type { Request } from './request.js';
|
|
||||||
import type { Response } from './response.js';
|
|
||||||
export type Handler = RHandler<Request, Response>;
|
|
||||||
export type AsyncHandler = RAsyncHandler<Request, Response>;
|
|
||||||
export type SyncHandler = RSyncHandler<Request, Response>;
|
|
||||||
export type { NextFunction, Middleware, Request, Response };
|
|
||||||
//# sourceMappingURL=index.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/index.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/index.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEpG,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,YAAY,IAAI,aAAa,EAC7B,OAAO,IAAI,QAAQ,EACnB,WAAW,IAAI,YAAY,EAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACjD,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AAC3D,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACzD,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
||||||
7
node_modules/@tinyhttp/app/dist/index.js
generated
vendored
7
node_modules/@tinyhttp/app/dist/index.js
generated
vendored
@@ -1,7 +0,0 @@
|
|||||||
export { App } from './app.js';
|
|
||||||
export * from './request.js';
|
|
||||||
export * from './response.js';
|
|
||||||
export { extendMiddleware } from './extend.js';
|
|
||||||
export { onErrorHandler } from './onError.js';
|
|
||||||
export { View } from './view.js';
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/index.js.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/index.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
|
|
||||||
7
node_modules/@tinyhttp/app/dist/onError.d.ts
generated
vendored
7
node_modules/@tinyhttp/app/dist/onError.d.ts
generated
vendored
@@ -1,7 +0,0 @@
|
|||||||
import type { NextFunction } from '@tinyhttp/router';
|
|
||||||
import type { App } from './app.js';
|
|
||||||
import type { Request } from './request.js';
|
|
||||||
import type { Response } from './response.js';
|
|
||||||
export type ErrorHandler = (this: App, err: any, req: Request, res: Response, next?: NextFunction) => void;
|
|
||||||
export declare const onErrorHandler: ErrorHandler;
|
|
||||||
//# sourceMappingURL=onError.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/onError.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/onError.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"onError.d.ts","sourceRoot":"","sources":["../src/onError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,IAAI,CAAA;AAE1G,eAAO,MAAM,cAAc,EAAE,YAU5B,CAAA"}
|
|
||||||
15
node_modules/@tinyhttp/app/dist/onError.js
generated
vendored
15
node_modules/@tinyhttp/app/dist/onError.js
generated
vendored
@@ -1,15 +0,0 @@
|
|||||||
import { STATUS_CODES } from 'node:http';
|
|
||||||
export const onErrorHandler = function (err, _req, res) {
|
|
||||||
if (this.onError === onErrorHandler && this.parent)
|
|
||||||
return this.parent.onError(err, _req, res);
|
|
||||||
if (err instanceof Error)
|
|
||||||
console.error(err);
|
|
||||||
const code = err.code in STATUS_CODES ? err.code : err.status;
|
|
||||||
if (typeof err === 'string' || Buffer.isBuffer(err))
|
|
||||||
res.writeHead(500).end(err);
|
|
||||||
else if (code in STATUS_CODES)
|
|
||||||
res.writeHead(code).end(STATUS_CODES[code]);
|
|
||||||
else
|
|
||||||
res.writeHead(500).end(err.message);
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=onError.js.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/onError.js.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/onError.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"onError.js","sourceRoot":"","sources":["../src/onError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAQxC,MAAM,CAAC,MAAM,cAAc,GAAiB,UAAqB,GAAQ,EAAE,IAAa,EAAE,GAAa;IACrG,IAAI,IAAI,CAAC,OAAO,KAAK,cAAc,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAE9F,IAAI,GAAG,YAAY,KAAK;QAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAE5C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAA;IAE7D,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;SAC3E,IAAI,IAAI,IAAI,YAAY;QAAE,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;;QACrE,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC1C,CAAC,CAAA"}
|
|
||||||
59
node_modules/@tinyhttp/app/dist/request.d.ts
generated
vendored
59
node_modules/@tinyhttp/app/dist/request.d.ts
generated
vendored
@@ -1,59 +0,0 @@
|
|||||||
import type { IncomingHttpHeaders, IncomingMessage } from 'node:http';
|
|
||||||
import type { ParsedUrlQuery } from 'node:querystring';
|
|
||||||
import { type Trust } from '@tinyhttp/proxy-addr';
|
|
||||||
import type { Options, Ranges } from 'header-range-parser';
|
|
||||||
import type { Middleware } from '@tinyhttp/router';
|
|
||||||
import type { App } from './app.js';
|
|
||||||
import type { Socket } from 'node:net';
|
|
||||||
import type { TLSSocket } from 'node:tls';
|
|
||||||
import type { URLParams } from '@tinyhttp/req';
|
|
||||||
export { getURLParams } from '@tinyhttp/req';
|
|
||||||
export type Host = {
|
|
||||||
hostname: string;
|
|
||||||
port?: number;
|
|
||||||
};
|
|
||||||
export declare const getProtocol: (req: Request, trust: Trust) => Protocol;
|
|
||||||
export declare const getHost: (req: Request, trust: Trust) => Host | undefined;
|
|
||||||
export declare const getIP: (req: Pick<Request, "headers" | "connection" | "socket">, trust: Trust) => string | undefined;
|
|
||||||
export declare const getIPs: (req: Pick<Request, "headers" | "connection" | "socket">, trust: Trust) => string[] | undefined;
|
|
||||||
export declare const getSubdomains: (req: Request, trust: Trust, subdomainOffset?: number) => string[];
|
|
||||||
export type Connection = IncomingMessage['socket'] & {
|
|
||||||
encrypted: boolean;
|
|
||||||
};
|
|
||||||
export type Protocol = 'http' | 'https' | string;
|
|
||||||
export type { URLParams };
|
|
||||||
type AcceptsReturns = string | boolean | string[];
|
|
||||||
export interface Request extends IncomingMessage {
|
|
||||||
originalUrl: string;
|
|
||||||
path: string;
|
|
||||||
url: string;
|
|
||||||
baseUrl: string;
|
|
||||||
query: ParsedUrlQuery;
|
|
||||||
params: URLParams;
|
|
||||||
connection: Connection;
|
|
||||||
socket: TLSSocket | Socket;
|
|
||||||
route?: Middleware;
|
|
||||||
protocol: Protocol;
|
|
||||||
secure: boolean;
|
|
||||||
xhr: boolean;
|
|
||||||
hostname?: string;
|
|
||||||
port?: number;
|
|
||||||
ip?: string;
|
|
||||||
ips?: string[];
|
|
||||||
subdomains?: string[];
|
|
||||||
get: <HeaderName extends string>(header: HeaderName) => IncomingHttpHeaders[HeaderName];
|
|
||||||
range: (size: number, options?: Options) => -1 | -2 | -3 | Ranges | undefined;
|
|
||||||
accepts: (...types: string[]) => AcceptsReturns;
|
|
||||||
acceptsEncodings: (...encodings: string[]) => AcceptsReturns;
|
|
||||||
acceptsCharsets: (...charsets: string[]) => AcceptsReturns;
|
|
||||||
acceptsLanguages: (...languages: string[]) => AcceptsReturns;
|
|
||||||
is: (...types: string[]) => string | boolean;
|
|
||||||
cookies?: any;
|
|
||||||
signedCookies?: any;
|
|
||||||
secret?: string | string[];
|
|
||||||
fresh?: boolean;
|
|
||||||
stale?: boolean;
|
|
||||||
body?: any;
|
|
||||||
app?: App;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=request.d.ts.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/request.d.ts.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/request.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,KAAK,KAAK,EAAwC,MAAM,sBAAsB,CAAA;AACvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAQD,eAAO,MAAM,WAAW,QAAS,OA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;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,GAAG,EAAE,CAAC,UAAU,SAAS,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,mBAAmB,CAAC,UAAU,CAAC,CAAA;IACvF,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;IAC7E,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,cAAc,CAAA;IAC/C,gBAAgB,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,KAAK,cAAc,CAAA;IAC5D,eAAe,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,cAAc,CAAA;IAC1D,gBAAgB,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,KAAK,cAAc,CAAA;IAC5D,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,OAAO,CAAA;IAC5C,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,aAAa,CAAC,EAAE,GAAG,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,GAAG,CAAC,EAAE,GAAG,CAAA;CACV"}
|
|
||||||
85
node_modules/@tinyhttp/app/dist/request.js
generated
vendored
85
node_modules/@tinyhttp/app/dist/request.js
generated
vendored
@@ -1,85 +0,0 @@
|
|||||||
import { all, compile, proxyaddr as proxyAddr } from '@tinyhttp/proxy-addr';
|
|
||||||
import { isIP } from 'node:net';
|
|
||||||
export { getURLParams } from '@tinyhttp/req';
|
|
||||||
const trustRemoteAddress = ({ socket }, trust) => {
|
|
||||||
const val = socket.remoteAddress;
|
|
||||||
if (typeof trust !== 'function')
|
|
||||||
trust = compile(trust);
|
|
||||||
return trust(val, 0);
|
|
||||||
};
|
|
||||||
export const getProtocol = (req, trust) => {
|
|
||||||
const proto = `http${req.secure ? 's' : ''}`;
|
|
||||||
if (!trustRemoteAddress(req, trust))
|
|
||||||
return proto;
|
|
||||||
const header = req.headers['X-Forwarded-Proto'] || proto;
|
|
||||||
const index = header.indexOf(',');
|
|
||||||
return index !== -1 ? header.substring(0, index).trim() : header.trim();
|
|
||||||
};
|
|
||||||
const normalizeHostString = (host) => decodeURIComponent(host).toLowerCase().normalize();
|
|
||||||
const getAuthorityHeaderHostString = (req) => {
|
|
||||||
const authority = req.get(':authority');
|
|
||||||
if (Array.isArray(authority))
|
|
||||||
return undefined;
|
|
||||||
if (Array.isArray(authority) || !authority)
|
|
||||||
return undefined;
|
|
||||||
const index = authority.indexOf('@');
|
|
||||||
if (index === -1)
|
|
||||||
return normalizeHostString(authority);
|
|
||||||
return normalizeHostString(authority.substring(index + 1));
|
|
||||||
};
|
|
||||||
const getForwardedHeaderHostString = (req) => {
|
|
||||||
const forwardedHost = req.get('x-forwarded-host');
|
|
||||||
if (Array.isArray(forwardedHost))
|
|
||||||
return undefined;
|
|
||||||
if (!forwardedHost)
|
|
||||||
return undefined;
|
|
||||||
return normalizeHostString(forwardedHost);
|
|
||||||
};
|
|
||||||
const getDefaultHeaderHostString = (req) => {
|
|
||||||
const host = req.get('host');
|
|
||||||
if (!host || host.indexOf(',') !== -1)
|
|
||||||
return undefined;
|
|
||||||
if (host.indexOf(',') !== -1)
|
|
||||||
return undefined;
|
|
||||||
return normalizeHostString(host);
|
|
||||||
};
|
|
||||||
const getHostString = (req, trust) => {
|
|
||||||
var _a;
|
|
||||||
if (trustRemoteAddress(req, trust)) {
|
|
||||||
const forwardedHost = getForwardedHeaderHostString(req);
|
|
||||||
if (forwardedHost)
|
|
||||||
return forwardedHost;
|
|
||||||
}
|
|
||||||
const authorityHost = getAuthorityHeaderHostString(req);
|
|
||||||
const defaultHost = getDefaultHeaderHostString(req);
|
|
||||||
if (authorityHost && defaultHost) {
|
|
||||||
if (authorityHost !== defaultHost)
|
|
||||||
throw new Error('Request `:authority` pseudo-header does not agree with `Host` header');
|
|
||||||
return authorityHost;
|
|
||||||
}
|
|
||||||
return (_a = authorityHost !== null && authorityHost !== void 0 ? authorityHost : defaultHost) !== null && _a !== void 0 ? _a : undefined;
|
|
||||||
};
|
|
||||||
export const getHost = (req, trust) => {
|
|
||||||
const host = getHostString(req, trust);
|
|
||||||
if (!host)
|
|
||||||
return undefined;
|
|
||||||
// IPv6 literal support
|
|
||||||
const index = host.indexOf(':', host[0] === '[' ? host.indexOf(']') + 1 : 0);
|
|
||||||
if (index === -1)
|
|
||||||
return { hostname: host };
|
|
||||||
const hostname = host.substring(0, index);
|
|
||||||
const port = Number(host.substring(index + 1));
|
|
||||||
if (Number.isNaN(port))
|
|
||||||
throw new TypeError('Port number is NaN, therefore Host is malformed');
|
|
||||||
return { hostname, port };
|
|
||||||
};
|
|
||||||
export const getIP = (req, trust) => proxyAddr(req, trust).replace(/^.*:/, ''); // striping the redundant prefix addeded by OS to IPv4 address
|
|
||||||
export const getIPs = (req, trust) => all(req, trust);
|
|
||||||
export const getSubdomains = (req, trust, subdomainOffset = 2) => {
|
|
||||||
const host = getHost(req, trust);
|
|
||||||
if (!(host === null || host === void 0 ? void 0 : host.hostname))
|
|
||||||
return [];
|
|
||||||
const subdomains = isIP(host.hostname) ? [host.hostname] : host.hostname.split('.').reverse();
|
|
||||||
return subdomains.slice(subdomainOffset);
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=request.js.map
|
|
||||||
1
node_modules/@tinyhttp/app/dist/request.js.map
generated
vendored
1
node_modules/@tinyhttp/app/dist/request.js.map
generated
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"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,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAA;IAC9F,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAuD,EAAE,KAAY,EAAsB,EAAE,CACjH,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA,CAAC,8DAA8D;AAE1G,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAuD,EAAE,KAAY,EAAwB,EAAE,CACpH,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAEjB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAY,EAAE,KAAY,EAAE,eAAe,GAAG,CAAC,EAAY,EAAE;IACzF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAChC,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA;QAAE,OAAO,EAAE,CAAA;IAE9B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAA;IAE7F,OAAO,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;AAC1C,CAAC,CAAA"}
|
|
||||||
44
node_modules/@tinyhttp/app/dist/response.d.ts
generated
vendored
44
node_modules/@tinyhttp/app/dist/response.d.ts
generated
vendored
@@ -1,44 +0,0 @@
|
|||||||
import type { OutgoingHttpHeaders, ServerResponse } from 'node:http';
|
|
||||||
import type { SerializeOptions } from '@tinyhttp/cookie';
|
|
||||||
import type { DownloadOptions, FormatProps, SendFileOptions } from '@tinyhttp/res';
|
|
||||||
import type { App } from './app.js';
|
|
||||||
import type { Request } from './request.js';
|
|
||||||
import type { AppRenderOptions, TemplateEngineOptions } from './types.js';
|
|
||||||
export declare const renderTemplate: <O extends TemplateEngineOptions = TemplateEngineOptions>(_req: Request, res: Response, app: App) => (file: string, data?: Record<string, unknown>, options?: AppRenderOptions<O>) => Response;
|
|
||||||
export interface Response<B = unknown> extends ServerResponse {
|
|
||||||
header(field: string | Record<string, unknown>, val?: string | any[]): Response<B>;
|
|
||||||
set(field: string | Record<string, unknown>, val?: string | any[]): Response<B>;
|
|
||||||
get<HeaderName extends string>(field: HeaderName): OutgoingHttpHeaders[HeaderName];
|
|
||||||
send(body: B): Response<B>;
|
|
||||||
sendFile(path: string, options?: SendFileOptions, cb?: (err?: unknown) => void): Response<B>;
|
|
||||||
json(body: B): Response<B>;
|
|
||||||
status(status: number): Response<B>;
|
|
||||||
sendStatus(statusCode: number): Response<B>;
|
|
||||||
cookie(name: string, value: string | Record<string, unknown>, options?: SerializeOptions & Partial<{
|
|
||||||
signed: boolean;
|
|
||||||
}>): Response<B>;
|
|
||||||
clearCookie(name: string, options?: SerializeOptions): Response<B>;
|
|
||||||
location(url: string): Response<B>;
|
|
||||||
links(links: {
|
|
||||||
[key: string]: string;
|
|
||||||
}): Response<B>;
|
|
||||||
render<O extends TemplateEngineOptions = TemplateEngineOptions>(file: string, data?: Record<string, any>, options?: AppRenderOptions<O>): Response<B>;
|
|
||||||
vary(field: string): Response<B>;
|
|
||||||
format(obj: FormatProps): Response<B>;
|
|
||||||
redirect(url: string, status?: number): Response<B>;
|
|
||||||
type(type: string): Response<B>;
|
|
||||||
download(path: string, filename: string, options?: DownloadOptions, cb?: (err?: unknown) => void): Response<B>;
|
|
||||||
attachment(filename?: string): Response<B>;
|
|
||||||
app?: App;
|
|
||||||
locals: Record<string, any>;
|
|
||||||
/**
|
|
||||||
* Send JSON response with JSONP callback support.
|
|
||||||
*
|
|
||||||
* To enable this method, install the `@tinyhttp/jsonp` package and attach the method to `res.jsonp` property.
|
|
||||||
*
|
|
||||||
* @param obj Response object
|
|
||||||
*/
|
|
||||||
jsonp(obj: any): Response<B>;
|
|
||||||
append(field: string, value: any): Response<B>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=response.d.ts.map
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user