docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,31 @@
import { ToString } from './262';
/**
* https://tc39.es/ecma402/#sec-getoption
* @param opts
* @param prop
* @param type
* @param values
* @param fallback
*/
export function GetOption(opts, prop, type, values, fallback) {
if (typeof opts !== 'object') {
throw new TypeError('Options must be an object');
}
var value = opts[prop];
if (value !== undefined) {
if (type !== 'boolean' && type !== 'string') {
throw new TypeError('invalid type');
}
if (type === 'boolean') {
value = Boolean(value);
}
if (type === 'string') {
value = ToString(value);
}
if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {
throw new RangeError("".concat(value, " is not within ").concat(values.join(', ')));
}
return value;
}
return fallback;
}
@@ -0,0 +1,2 @@
let resolveConfig = require('./lib/public/resolve-config')
module.exports = (resolveConfig.__esModule ? resolveConfig : { default: resolveConfig }).default
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var marqueeRole = {
abstract: false,
accessibleNameRequired: true,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section']]
};
var _default = exports.default = marqueeRole;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 0C 1C"},D:{"1":"0 1 2 3 4 5 HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC"},E:{"1":"B C L M G aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C"},F:{"1":"0 1 2 3 4 5 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B FD GD HD ID NC uC JD OC"},G:{"1":"SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB tD uD vD wD xD QC RC SC yD","2":"J oD pD qD rD sD aC"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2":"1D"}},B:5,C:"prefers-reduced-motion media query",D:true};
@@ -0,0 +1,154 @@
// Generated by LiveScript 1.6.0
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
values = function(object){
var i$, x, results$ = [];
for (i$ in object) {
x = object[i$];
results$.push(x);
}
return results$;
};
keys = function(object){
var x, results$ = [];
for (x in object) {
results$.push(x);
}
return results$;
};
pairsToObj = function(object){
var i$, len$, x, resultObj$ = {};
for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
x = object[i$];
resultObj$[x[0]] = x[1];
}
return resultObj$;
};
objToPairs = function(object){
var key, value, results$ = [];
for (key in object) {
value = object[key];
results$.push([key, value]);
}
return results$;
};
listsToObj = curry$(function(keys, values){
var i$, len$, i, key, resultObj$ = {};
for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
i = i$;
key = keys[i$];
resultObj$[key] = values[i];
}
return resultObj$;
});
objToLists = function(object){
var keys, values, key, value;
keys = [];
values = [];
for (key in object) {
value = object[key];
keys.push(key);
values.push(value);
}
return [keys, values];
};
empty = function(object){
var x;
for (x in object) {
return false;
}
return true;
};
each = curry$(function(f, object){
var i$, x;
for (i$ in object) {
x = object[i$];
f(x);
}
return object;
});
map = curry$(function(f, object){
var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
resultObj$[k] = f(x);
}
return resultObj$;
});
compact = function(object){
var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
if (x) {
resultObj$[k] = x;
}
}
return resultObj$;
};
filter = curry$(function(f, object){
var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
if (f(x)) {
resultObj$[k] = x;
}
}
return resultObj$;
});
reject = curry$(function(f, object){
var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
if (!f(x)) {
resultObj$[k] = x;
}
}
return resultObj$;
});
partition = curry$(function(f, object){
var passed, failed, k, x;
passed = {};
failed = {};
for (k in object) {
x = object[k];
(f(x) ? passed : failed)[k] = x;
}
return [passed, failed];
});
find = curry$(function(f, object){
var i$, x;
for (i$ in object) {
x = object[i$];
if (f(x)) {
return x;
}
}
});
module.exports = {
values: values,
keys: keys,
pairsToObj: pairsToObj,
objToPairs: objToPairs,
listsToObj: listsToObj,
objToLists: objToLists,
empty: empty,
each: each,
map: map,
filter: filter,
compact: compact,
reject: reject,
partition: partition,
find: find
};
function curry$(f, bound){
var context,
_curry = function(args) {
return f.length > 1 ? function(){
var params = args ? args.concat() : [];
context = bound ? context || this : this;
return params.push.apply(params, arguments) <
f.length && arguments.length ?
_curry.call(context, params) : f.apply(context, params);
} : f;
};
return _curry();
}
@@ -0,0 +1,76 @@
"use strict";
exports.__esModule = true;
exports["default"] = unesc;
// Many thanks for this post which made this migration much easier.
// https://mathiasbynens.be/notes/css-escapes
/**
*
* @param {string} str
* @returns {[string, number]|undefined}
*/
function gobbleHex(str) {
var lower = str.toLowerCase();
var hex = '';
var spaceTerminated = false;
for (var i = 0; i < 6 && lower[i] !== undefined; i++) {
var code = lower.charCodeAt(i);
// check to see if we are dealing with a valid hex char [a-f|0-9]
var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;
// https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
spaceTerminated = code === 32;
if (!valid) {
break;
}
hex += lower[i];
}
if (hex.length === 0) {
return undefined;
}
var codePoint = parseInt(hex, 16);
var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF;
// Add special case for
// "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
// https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) {
return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
}
return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
}
var CONTAINS_ESCAPE = /\\/;
function unesc(str) {
var needToProcess = CONTAINS_ESCAPE.test(str);
if (!needToProcess) {
return str;
}
var ret = "";
for (var i = 0; i < str.length; i++) {
if (str[i] === "\\") {
var gobbled = gobbleHex(str.slice(i + 1, i + 7));
if (gobbled !== undefined) {
ret += gobbled[0];
i += gobbled[1];
continue;
}
// Retain a pair of \\ if double escaped `\\\\`
// https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
if (str[i + 1] === "\\") {
ret += "\\";
i++;
continue;
}
// if \\ is at the end of the string retain it
// https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
if (str.length === i + 1) {
ret += str[i];
}
continue;
}
ret += str[i];
}
return ret;
}
module.exports = exports.default;
@@ -0,0 +1,80 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/eye-slash-filled.tsx
var eye_slash_filled_exports = {};
__export(eye_slash_filled_exports, {
EyeSlashFilledIcon: () => EyeSlashFilledIcon
});
module.exports = __toCommonJS(eye_slash_filled_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var EyeSlashFilledIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
role: "presentation",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M21.2714 9.17834C20.9814 8.71834 20.6714 8.28834 20.3514 7.88834C19.9814 7.41834 19.2814 7.37834 18.8614 7.79834L15.8614 10.7983C16.0814 11.4583 16.1214 12.2183 15.9214 13.0083C15.5714 14.4183 14.4314 15.5583 13.0214 15.9083C12.2314 16.1083 11.4714 16.0683 10.8114 15.8483C10.8114 15.8483 9.38141 17.2783 8.35141 18.3083C7.85141 18.8083 8.01141 19.6883 8.68141 19.9483C9.75141 20.3583 10.8614 20.5683 12.0014 20.5683C13.7814 20.5683 15.5114 20.0483 17.0914 19.0783C18.7014 18.0783 20.1514 16.6083 21.3214 14.7383C22.2714 13.2283 22.2214 10.6883 21.2714 9.17834Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M14.0206 9.98062L9.98062 14.0206C9.47062 13.5006 9.14062 12.7806 9.14062 12.0006C9.14062 10.4306 10.4206 9.14062 12.0006 9.14062C12.7806 9.14062 13.5006 9.47062 14.0206 9.98062Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M18.25 5.74969L14.86 9.13969C14.13 8.39969 13.12 7.95969 12 7.95969C9.76 7.95969 7.96 9.76969 7.96 11.9997C7.96 13.1197 8.41 14.1297 9.14 14.8597L5.76 18.2497H5.75C4.64 17.3497 3.62 16.1997 2.75 14.8397C1.75 13.2697 1.75 10.7197 2.75 9.14969C3.91 7.32969 5.33 5.89969 6.91 4.91969C8.49 3.95969 10.22 3.42969 12 3.42969C14.23 3.42969 16.39 4.24969 18.25 5.74969Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M14.8581 11.9981C14.8581 13.5681 13.5781 14.8581 11.9981 14.8581C11.9381 14.8581 11.8881 14.8581 11.8281 14.8381L14.8381 11.8281C14.8581 11.8881 14.8581 11.9381 14.8581 11.9981Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M21.7689 2.22891C21.4689 1.92891 20.9789 1.92891 20.6789 2.22891L2.22891 20.6889C1.92891 20.9889 1.92891 21.4789 2.22891 21.7789C2.37891 21.9189 2.56891 21.9989 2.76891 21.9989C2.96891 21.9989 3.15891 21.9189 3.30891 21.7689L21.7689 3.30891C22.0789 3.00891 22.0789 2.52891 21.7689 2.22891Z",
fill: "currentColor"
}
)
]
}
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
EyeSlashFilledIcon
});
@@ -0,0 +1,88 @@
[![npm version](https://img.shields.io/npm/v/react-textarea-autosize.svg)](https://www.npmjs.com/package/react-textarea-autosize)
[![npm](https://img.shields.io/npm/dm/react-textarea-autosize.svg)](https://www.npmjs.com/package/react-textarea-autosize)
# react-textarea-autosize
Drop-in replacement for the textarea component which automatically resizes
textarea as content changes. A native React version of the popular
[jQuery Autosize](http://www.jacklmoore.com/autosize/)! Weighs
around <span class="weight">1.3KB</span> (minified & gzipped).
This module supports IE9 and above.
```javascript
import TextareaAutosize from 'react-textarea-autosize';
// If you use CommonJS syntax:
// var TextareaAutosize = require('react-textarea-autosize').default;
React.renderComponent(
<div>
<TextareaAutosize />
</div>,
document.getElementById('element'),
);
```
## Install
`npm install react-textarea-autosize`
## Demo
https://andarist.github.io/react-textarea-autosize/
## Props
### Special props:
| prop | type | description |
| ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `maxRows` | `number` | Maximum number of rows up to which the textarea can grow |
| `minRows` | `number` | Minimum number of rows to show for textarea |
| `onHeightChange` | `func` | Function invoked on textarea height change, with height as first argument. The second function argument is an object containing additional information that might be useful for custom behaviors. Current options include `{ rowHeight: number }`. |
| `cacheMeasurements` | `boolean` | Reuse previously computed measurements when computing height of textarea. Default: `false` |
Apart from these, the component accepts all props that are accepted by `<textarea/>`, like `style`, `onChange`, `value`, etc.
## FAQ
### How to focus
Get a ref to inner textarea:
```js
<TextareaAutosize ref={(tag) => (this.textarea = tag)} />
```
And then call a focus on that ref:
```js
this.textarea.focus();
```
To autofocus:
```js
<TextareaAutosize autoFocus />
```
(all HTML attributes are passed to inner textarea)
### How to test it with jest and react-test-renderer if you need ref
Because [jest](https://github.com/facebook/jest) provides polyfills for DOM
objects by requiring [jsdom](https://github.com/tmpvar/jsdom) and
[react-test-renderer](https://www.npmjs.com/package/react-test-renderer) doesn't
provide refs for rendered components out of the box (calling ref callbacks with
`null`), you need to supply a mocked ref in your tests in you need it for your tests.
You can do it like this (more can be read
[here](https://github.com/facebook/react/issues/7740#issuecomment-247335106)):
```js
const tree = renderer
.create(<TextareaAutosize />, {
createNodeMock: () => document.createElement('textarea'),
})
.toJSON();
```
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('defer', require('../defer'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,61 @@
/**
* @file 主函数
* @author mengke01(kekee000@gmail.com)
*/
import {Font, createFont} from './ttf/font';
import TTF from './ttf/ttf';
import TTFReader from './ttf/ttfreader';
import TTFWriter from './ttf/ttfwriter';
import ttf2eot from './ttf/ttf2eot';
import eot2ttf from './ttf/eot2ttf';
import ttf2woff from './ttf/ttf2woff';
import woff2ttf from './ttf/woff2ttf';
import ttf2svg from './ttf/ttf2svg';
import svg2ttfobject from './ttf/svg2ttfobject';
import Reader from './ttf/reader';
import Writer from './ttf/writer';
import OTFReader from './ttf/otfreader';
import otf2ttfobject from './ttf/otf2ttfobject';
import ttf2base64 from './ttf/ttf2base64';
import ttf2icon from './ttf/ttf2icon';
import ttftowoff2 from './ttf/ttftowoff2';
import woff2tottf from './ttf/woff2tottf';
import woff2 from '../woff2/index';
import bufferUtil from './nodejs/buffer';
const modules = {
createFont,
Font,
TTF,
TTFReader,
TTFWriter,
ttf2eot,
eot2ttf,
ttf2woff,
woff2ttf,
ttf2svg,
svg2ttfobject,
Reader,
Writer,
OTFReader,
otf2ttfobject,
ttf2base64,
ttf2icon,
ttftowoff2,
woff2tottf,
woff2,
toArrayBuffer: bufferUtil.toArrayBuffer,
toBuffer: bufferUtil.toBuffer,
};
// Export named exports for ESM
export { Font, woff2, createFont };
// Export default object
export default modules;
if (typeof exports !== 'undefined') {
// eslint-disable-next-line import/no-commonjs
module.exports = modules;
}
@@ -0,0 +1,152 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToRawPrecision = ToRawPrecision;
var tslib_1 = require("tslib");
var decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
var constants_1 = require("../constants");
var utils_1 = require("../utils");
var ApplyUnsignedRoundingMode_1 = require("./ApplyUnsignedRoundingMode");
//IMPL: Helper function to find n1, e1, and r1
function findN1E1R1(x, p) {
var maxN1 = decimal_js_1.default.pow(10, p);
var minN1 = decimal_js_1.default.pow(10, p - 1);
var maxE1 = x.div(minN1).log(10).plus(p).minus(1).ceil();
var currentE1 = maxE1;
while (true) {
var currentN1 = x.div(decimal_js_1.default.pow(10, currentE1.minus(p).plus(1))).floor();
if (currentN1.lessThan(maxN1) && currentN1.greaterThanOrEqualTo(minN1)) {
var currentR1 = currentN1.times(decimal_js_1.default.pow(10, currentE1.minus(p).plus(1)));
if (currentR1.lessThanOrEqualTo(x)) {
return {
n1: currentN1,
e1: currentE1,
r1: currentR1,
};
}
}
currentE1 = currentE1.minus(1);
}
}
//IMPL: Helper function to find n2, e2, and r2
function findN2E2R2(x, p) {
var maxN2 = decimal_js_1.default.pow(10, p);
var minN2 = decimal_js_1.default.pow(10, p - 1);
var minE2 = x.div(maxN2).log(10).plus(p).minus(1).floor();
var currentE2 = minE2;
while (true) {
var currentN2 = x.div(decimal_js_1.default.pow(10, currentE2.minus(p).plus(1))).ceil();
if (currentN2.lessThan(maxN2) && currentN2.greaterThanOrEqualTo(minN2)) {
var currentR2 = currentN2.times(decimal_js_1.default.pow(10, currentE2.minus(p).plus(1)));
if (currentR2.greaterThanOrEqualTo(x)) {
return {
n2: currentN2,
e2: currentE2,
r2: currentR2,
};
}
}
currentE2 = currentE2.plus(1);
}
}
/**
* https://tc39.es/ecma402/#sec-torawprecision
* @param x a finite non-negative Number or BigInt
* @param minPrecision an integer between 1 and 21
* @param maxPrecision an integer between 1 and 21
*/
function ToRawPrecision(x, minPrecision, maxPrecision, unsignedRoundingMode) {
// 1. Let p be maxPrecision.
var p = maxPrecision;
var m;
var e;
var xFinal;
// 2. If x = 0, then
if (x.isZero()) {
// a. Let m be the String value consisting of p occurrences of the character "0".
m = (0, utils_1.repeat)('0', p);
// b. Let e be 0.
e = 0;
// c. Let xFinal be 0.
xFinal = constants_1.ZERO;
}
else {
// 3. Else,
// a. Let {n1, e1, r1} be the result of findN1E1R1(x, p).
var _a = findN1E1R1(x, p), n1 = _a.n1, e1 = _a.e1, r1 = _a.r1;
// b. Let {n2, e2, r2} be the result of findN2E2R2(x, p).
var _b = findN2E2R2(x, p), n2 = _b.n2, e2 = _b.e2, r2 = _b.r2;
// c. Let r be ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode).
var r = (0, ApplyUnsignedRoundingMode_1.ApplyUnsignedRoundingMode)(x, r1, r2, unsignedRoundingMode);
var n
// d. If r = r1, then
= void 0;
// d. If r = r1, then
if (r.eq(r1)) {
// i. Let n be n1.
n = n1;
// ii. Let e be e1.
e = e1.toNumber();
// iii. Let xFinal be r1.
xFinal = r1;
}
else {
// e. Else,
// i. Let n be n2.
n = n2;
// ii. Let e be e2.
e = e2.toNumber();
// iii. Let xFinal be r2.
xFinal = r2;
}
// f. Let m be the String representation of n.
m = n.toString();
}
var int;
// 4. If e ≥ p - 1, then
if (e >= p - 1) {
// a. Let m be the string-concatenation of m and p - 1 - e occurrences of the character "0".
m = m + (0, utils_1.repeat)('0', e - p + 1);
// b. Let int be e + 1.
int = e + 1;
}
else if (e >= 0) {
// 5. Else if e ≥ 0, then
// a. Let m be the string-concatenation of the first e + 1 characters of m, ".", and the remaining p - (e + 1) characters of m.
m = m.slice(0, e + 1) + '.' + m.slice(m.length - (p - (e + 1)));
// b. Let int be e + 1.
int = e + 1;
}
else {
// 6. Else,
// a. Assert: e < 0.
(0, utils_1.invariant)(e < 0, 'e should be less than 0');
// b. Let m be the string-concatenation of "0.", -e - 1 occurrences of the character "0", and m.
m = '0.' + (0, utils_1.repeat)('0', -e - 1) + m;
// c. Let int be 1.
int = 1;
}
// 7. If m contains ".", and maxPrecision > minPrecision, then
if (m.includes('.') && maxPrecision > minPrecision) {
// a. Let cut be maxPrecision - minPrecision.
var cut = maxPrecision - minPrecision;
// b. Repeat, while cut > 0 and the last character of m is "0",
while (cut > 0 && m[m.length - 1] === '0') {
// i. Remove the last character from m.
m = m.slice(0, m.length - 1);
// ii. Decrease cut by 1.
cut--;
}
// c. If the last character of m is ".", then
if (m[m.length - 1] === '.') {
// i. Remove the last character from m.
m = m.slice(0, m.length - 1);
}
}
// 8. Return the Record { [[FormattedString]]: m, [[RoundedNumber]]: xFinal, [[IntegerDigitsCount]]: int, [[RoundingMagnitude]]: e }.
return {
formattedString: m,
roundedNumber: xFinal,
integerDigitsCount: int,
roundingMagnitude: e,
};
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/selection/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useSelectableCollection} from './useSelectableCollection';\nexport {useSelectableItem} from './useSelectableItem';\nexport {useSelectableList} from './useSelectableList';\nexport {ListKeyboardDelegate} from './ListKeyboardDelegate';\nexport {DOMLayoutDelegate} from './DOMLayoutDelegate';\nexport {useTypeSelect} from './useTypeSelect';\n\nexport type {AriaSelectableCollectionOptions, SelectableCollectionAria} from './useSelectableCollection';\nexport type {AriaSelectableListOptions, SelectableListAria} from './useSelectableList';\nexport type {SelectableItemOptions, SelectableItemStates, SelectableItemAria} from './useSelectableItem';\nexport type {AriaTypeSelectOptions, TypeSelectAria} from './useTypeSelect';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,25 @@
import { AriaLinkProps } from "@react-types/link";
import { DOMAttributes, FocusableElement, RefObject } from "@react-types/shared";
export interface AriaLinkOptions extends AriaLinkProps {
/** Whether the link is disabled. */
isDisabled?: boolean;
/**
* The HTML element used to render the link, e.g. 'a', or 'span'.
* @default 'a'
*/
elementType?: string;
}
export interface LinkAria {
/** Props for the link element. */
linkProps: DOMAttributes;
/** Whether the link is currently pressed. */
isPressed: boolean;
}
/**
* Provides the behavior and accessibility implementation for a link component.
* A link allows a user to navigate to another page or resource within a web page
* or application.
*/
export function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,211 @@
'use strict';
const util = require('util');
const Writable = require('readable-stream/lib/_stream_writable.js');
const { LEVEL } = require('triple-beam');
/**
* Constructor function for the TransportStream. This is the base prototype
* that all `winston >= 3` transports should inherit from.
* @param {Object} options - Options for this TransportStream instance
* @param {String} options.level - Highest level according to RFC5424.
* @param {Boolean} options.handleExceptions - If true, info with
* { exception: true } will be written.
* @param {Function} options.log - Custom log function for simple Transport
* creation
* @param {Function} options.close - Called on "unpipe" from parent.
*/
const TransportStream = module.exports = function TransportStream(options = {}) {
Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
this.format = options.format;
this.level = options.level;
this.handleExceptions = options.handleExceptions;
this.handleRejections = options.handleRejections;
this.silent = options.silent;
if (options.log) this.log = options.log;
if (options.logv) this.logv = options.logv;
if (options.close) this.close = options.close;
// Get the levels from the source we are piped from.
this.once('pipe', logger => {
// Remark (indexzero): this bookkeeping can only support multiple
// Logger parents with the same `levels`. This comes into play in
// the `winston.Container` code in which `container.add` takes
// a fully realized set of options with pre-constructed TransportStreams.
this.levels = logger.levels;
this.parent = logger;
});
// If and/or when the transport is removed from this instance
this.once('unpipe', src => {
// Remark (indexzero): this bookkeeping can only support multiple
// Logger parents with the same `levels`. This comes into play in
// the `winston.Container` code in which `container.add` takes
// a fully realized set of options with pre-constructed TransportStreams.
if (src === this.parent) {
this.parent = null;
if (this.close) {
this.close();
}
}
});
};
/*
* Inherit from Writeable using Node.js built-ins
*/
util.inherits(TransportStream, Writable);
/**
* Writes the info object to our transport instance.
* @param {mixed} info - TODO: add param description.
* @param {mixed} enc - TODO: add param description.
* @param {function} callback - TODO: add param description.
* @returns {undefined}
* @private
*/
TransportStream.prototype._write = function _write(info, enc, callback) {
if (this.silent || (info.exception === true && !this.handleExceptions)) {
return callback(null);
}
// Remark: This has to be handled in the base transport now because we
// cannot conditionally write to our pipe targets as stream. We always
// prefer any explicit level set on the Transport itself falling back to
// any level set on the parent.
const level = this.level || (this.parent && this.parent.level);
if (!level || this.levels[level] >= this.levels[info[LEVEL]]) {
if (info && !this.format) {
return this.log(info, callback);
}
let errState;
let transformed;
// We trap(and re-throw) any errors generated by the user-provided format, but also
// guarantee that the streams callback is invoked so that we can continue flowing.
try {
transformed = this.format.transform(Object.assign({}, info), this.format.options);
} catch (err) {
errState = err;
}
if (errState || !transformed) {
// eslint-disable-next-line callback-return
callback();
if (errState) throw errState;
return;
}
return this.log(transformed, callback);
}
this._writableState.sync = false;
return callback(null);
};
/**
* Writes the batch of info objects (i.e. "object chunks") to our transport
* instance after performing any necessary filtering.
* @param {mixed} chunks - TODO: add params description.
* @param {function} callback - TODO: add params description.
* @returns {mixed} - TODO: add returns description.
* @private
*/
TransportStream.prototype._writev = function _writev(chunks, callback) {
if (this.logv) {
const infos = chunks.filter(this._accept, this);
if (!infos.length) {
return callback(null);
}
// Remark (indexzero): from a performance perspective if Transport
// implementers do choose to implement logv should we make it their
// responsibility to invoke their format?
return this.logv(infos, callback);
}
for (let i = 0; i < chunks.length; i++) {
if (!this._accept(chunks[i])) continue;
if (chunks[i].chunk && !this.format) {
this.log(chunks[i].chunk, chunks[i].callback);
continue;
}
let errState;
let transformed;
// We trap(and re-throw) any errors generated by the user-provided format, but also
// guarantee that the streams callback is invoked so that we can continue flowing.
try {
transformed = this.format.transform(
Object.assign({}, chunks[i].chunk),
this.format.options
);
} catch (err) {
errState = err;
}
if (errState || !transformed) {
// eslint-disable-next-line callback-return
chunks[i].callback();
if (errState) {
// eslint-disable-next-line callback-return
callback(null);
throw errState;
}
} else {
this.log(transformed, chunks[i].callback);
}
}
return callback(null);
};
/**
* Predicate function that returns true if the specfied `info` on the
* WriteReq, `write`, should be passed down into the derived
* TransportStream's I/O via `.log(info, callback)`.
* @param {WriteReq} write - winston@3 Node.js WriteReq for the `info` object
* representing the log message.
* @returns {Boolean} - Value indicating if the `write` should be accepted &
* logged.
*/
TransportStream.prototype._accept = function _accept(write) {
const info = write.chunk;
if (this.silent) {
return false;
}
// We always prefer any explicit level set on the Transport itself
// falling back to any level set on the parent.
const level = this.level || (this.parent && this.parent.level);
// Immediately check the average case: log level filtering.
if (
info.exception === true ||
!level ||
this.levels[level] >= this.levels[info[LEVEL]]
) {
// Ensure the info object is valid based on `{ exception }`:
// 1. { handleExceptions: true }: all `info` objects are valid
// 2. { exception: false }: accepted by all transports.
if (this.handleExceptions || info.exception !== true) {
return true;
}
}
return false;
};
/**
* _nop is short for "No operation"
* @returns {Boolean} Intentionally false.
*/
TransportStream.prototype._nop = function _nop() {
// eslint-disable-next-line no-undefined
return void undefined;
};
@@ -0,0 +1,2 @@
'use strict';
require('../register')('promise', {Promise: require('promise')})
@@ -0,0 +1,26 @@
import { useMemo, useRef } from 'react';
import { isFunction } from '../utils';
import isDev from '../utils/isDev';
var useMemoizedFn = function (fn) {
if (isDev) {
if (!isFunction(fn)) {
console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof fn));
}
}
var fnRef = useRef(fn);
// why not write `fnRef.current = fn`?
// https://github.com/alibaba/hooks/issues/728
fnRef.current = useMemo(function () { return fn; }, [fn]);
var memoizedFn = useRef(undefined);
if (!memoizedFn.current) {
memoizedFn.current = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return fnRef.current.apply(this, args);
};
}
return memoizedFn.current;
};
export default useMemoizedFn;
@@ -0,0 +1,70 @@
# fs-minipass
Filesystem streams based on [minipass](http://npm.im/minipass).
4 classes are exported:
- ReadStream
- ReadStreamSync
- WriteStream
- WriteStreamSync
When using `ReadStreamSync`, all of the data is made available
immediately upon consuming the stream. Nothing is buffered in memory
when the stream is constructed. If the stream is piped to a writer,
then it will synchronously `read()` and emit data into the writer as
fast as the writer can consume it. (That is, it will respect
backpressure.) If you call `stream.read()` then it will read the
entire file and return the contents.
When using `WriteStreamSync`, every write is flushed to the file
synchronously. If your writes all come in a single tick, then it'll
write it all out in a single tick. It's as synchronous as you are.
The async versions work much like their node builtin counterparts,
with the exception of introducing significantly less Stream machinery
overhead.
## USAGE
It's just streams, you pipe them or read() them or write() to them.
```js
const fsm = require('fs-minipass')
const readStream = new fsm.ReadStream('file.txt')
const writeStream = new fsm.WriteStream('output.txt')
writeStream.write('some file header or whatever\n')
readStream.pipe(writeStream)
```
## ReadStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `readSize` The size of reads to do, defaults to 16MB
- `size` The size of the file, if known. Prevents zero-byte read()
call at the end.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the file is done being read.
## WriteStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `mode` The mode to create the file with. Defaults to `0o666`.
- `start` The position in the file to start reading. If not
specified, then the file will start writing at position zero, and be
truncated by default.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the stream is ended.
- `flags` Flags to use when opening the file. Irrelevant if `fd` is
passed in, since file won't be opened in that case. Defaults to
`'a'` if a `pos` is specified, or `'w'` otherwise.
@@ -0,0 +1,134 @@
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
"use strict"
const path = require("path")
const { getSourceCode } = require("../util/eslint-compat")
const getConvertPath = require("../util/get-convert-path")
const { getPackageJson } = require("../util/get-package-json")
const { isBinFile } = require("../util/is-bin-file")
const getNpmignore = require("../util/get-npmignore")
const HASHBANG_ENV = "#!/usr/bin/env"
/**
* @typedef {[
* {
* ignoreBin?:boolean
* convertPath?: import('../util/get-convert-path').ConvertPath;
* }?
* ]} RuleOptions
*/
/**
* Checks whether the code has a hashbang comment or not.
* @param {import('./rule-module').PluginRuleContext<{RuleOptions: RuleOptions}>} context
*/
function hasHashbang(context) {
const sourceCode = getSourceCode(context)
return Boolean(sourceCode.text.startsWith(HASHBANG_ENV))
}
/** @param {import('./rule-module').PluginRuleContext<{RuleOptions: RuleOptions}>} context */
function ignore(context) {
const options = context.options[0] || {}
const ignoreBin = options.ignoreBin ?? false
if (ignoreBin && hasHashbang(context)) {
// If the code has a hashbang comment, it is considered an executable file.
return true
}
const filePath = context.filename ?? context.getFilename()
if (filePath === "<input>") {
// The file path is "<input>" (not specified), so it will be ignored.
return true
}
const originalAbsolutePath = path.resolve(filePath)
// Find package.json
const packageJson = getPackageJson(originalAbsolutePath)
if (typeof packageJson?.filePath !== "string") {
// The file is not in a package, so it will be ignored.
return true
}
// Convert by convertPath option
const packageDirectory = path.dirname(packageJson.filePath)
const convertedRelativePath = getConvertPath(context)(
path
.relative(packageDirectory, originalAbsolutePath)
.replace(/\\/gu, "/")
)
const convertedAbsolutePath = path.resolve(
packageDirectory,
convertedRelativePath
)
if (
ignoreBin &&
isBinFile(convertedAbsolutePath, packageJson.bin, packageDirectory)
) {
// The file is defined in the `bin` field of `package.json`
return true
}
// Check ignored or not
const npmignore = getNpmignore(convertedAbsolutePath)
if (npmignore.match(convertedRelativePath)) {
// The file is unpublished file, so it will be ignored.
return true
}
return false
}
/** @type {import('./rule-module').RuleModule<{RuleOptions: RuleOptions}>} */
module.exports = {
meta: {
docs: {
description: "disallow top-level `await` in published modules",
recommended: false,
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-top-level-await.md",
},
fixable: null,
messages: {
forbidden: "Top-level `await` is forbidden in published modules.",
},
schema: [
{
type: "object",
properties: {
ignoreBin: { type: "boolean" },
convertPath: getConvertPath.schema,
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
if (ignore(context)) {
return {}
}
let functionDepth = 0
return {
":function"() {
functionDepth++
},
":function:exit"() {
functionDepth--
},
"AwaitExpression, ForOfStatement[await=true], VariableDeclaration[kind='await using']"(
node
) {
if (functionDepth > 0) {
// not top-level
return
}
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1,68 @@
var baseRest = require('./_baseRest'),
createWrap = require('./_createWrap'),
getHolder = require('./_getHolder'),
replaceHolders = require('./_replaceHolders');
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_PARTIAL_FLAG = 32;
/**
* Creates a function that invokes the method at `object[key]` with `partials`
* prepended to the arguments it receives.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist. See
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @since 0.10.0
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // Bound with placeholders.
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = baseRest(function(object, key, partials) {
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bindKey));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(key, bitmask, object, partials, holders);
});
// Assign default placeholders.
bindKey.placeholder = {};
module.exports = bindKey;
@@ -0,0 +1,26 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var _react = require("react");
var _utils = require("../utils");
var _useMemoizedFn = _interopRequireDefault(require("../useMemoizedFn"));
var _useCreation = _interopRequireDefault(require("../useCreation"));
var useResetState = function useResetState(initialState) {
var initialStateRef = (0, _react.useRef)(initialState);
var initialStateMemo = (0, _useCreation["default"])(function () {
return (0, _utils.isFunction)(initialStateRef.current) ? initialStateRef.current() : initialStateRef.current;
}, []);
var _a = (0, _tslib.__read)((0, _react.useState)(initialStateMemo), 2),
state = _a[0],
setState = _a[1];
var resetState = (0, _useMemoizedFn["default"])(function () {
setState(initialStateMemo);
});
return [state, setState, resetState];
};
var _default = exports["default"] = useResetState;
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,WAAW,CAAC;IAC5C,iBAAiB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,6BAA6B,CAAC;IACjG,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,MAAM,CAAC;IAC7C,cAAc,CAAC,UAAU,CAAC;IAC1B,kBAAkB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,4BAA4B,CAAC;IACjG,sBAAsB,CAAC,+DAAmD,CAAC;IAC3E,UAAU,CAAC,YAAS,CAAC;IACrB,aAAa,CAAC,kBAAe,CAAC;IAC9B,YAAY,CAAC,kBAAkB,CAAC;AAClC","sources":["packages/@react-aria/table/intl/de-DE.json"],"sourcesContent":["{\n \"ascending\": \"aufsteigend\",\n \"ascendingSort\": \"sortiert nach Spalte {columnName} in aufsteigender Reihenfolge\",\n \"columnSize\": \"{value} Pixel\",\n \"descending\": \"absteigend\",\n \"descendingSort\": \"sortiert nach Spalte {columnName} in absteigender Reihenfolge\",\n \"resizerDescription\": \"Eingabetaste zum Starten der Größenänderung drücken\",\n \"select\": \"Auswählen\",\n \"selectAll\": \"Alles auswählen\",\n \"sortable\": \"sortierbare Spalte\"\n}\n"],"names":[],"version":3,"file":"de-DE.module.js.map"}
@@ -0,0 +1,32 @@
var hashClear = require('./_hashClear'),
hashDelete = require('./_hashDelete'),
hashGet = require('./_hashGet'),
hashHas = require('./_hashHas'),
hashSet = require('./_hashSet');
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
@@ -0,0 +1,825 @@
export default `flf2a$ 8 7 20 -1 7
TILES by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
[..@
[..@
[..@
[. @
[. @
@
[..@
@@
[. [.@
[. [.@
@
@
@
@
@
@@
@
[.. [.. @
[...... [....@
[.. [.. @
[.. [.. @
[...... [....@
[.. [.. @
@@
[.. @
[. [.. @
[.. @
[.. @
[..@
[.. [.. @
[.. @
@@
@
[.. [.. @
[.. @
[.. @
[.. @
[.. @
[.. [.. @
@@
[. @
[.. [..@
[.. @
[... @
[.. @
[.. [..@
[. @
@@
[..@
[.@
@
@
@
@
@
@@
[..@
[.. @
[.. @
[.. @
[.. @
[.. @
[..@
@@
[.. @
[.. @
[..@
[..@
[..@
[.. @
[.. @
@@
[.. @
[.. [.. [..@
[. [. [.. @
[.... [.......@
[. [. [.. @
[.. [.. [..@
[.. @
@@
@
[.. @
[.. @
[... [.....@
[.. @
[.. @
@
@@
@
@
@
@
@
@
[..@
[.@@
@
@
@
[.....@
@
@
@
@@
@
@
@
@
@
@
[..@
@@
[..@
[.. @
[.. @
[.. @
[.. @
[.. @
[.. @
@@
@
[.. @
[.. [.. @
[.. [.. @
[.. [..@
[.. [.. @
[... @
@@
@
[.. @
[.. @
[.. @
[.. @
[.. @
[....@
@@
@
[. [.. @
[. [..@
[.. @
[.. @
[.. @
[........ @
@@
@
[.. [.. @
[.. @
[.. @
[.. @
[..@
[..... @
@@
@
[.. @
[ [.. @
[. [.. @
[.. [.. @
[.... [. [..@
[.. @
@@
@
[.. [... @
[.. @
[... @
[.. @
[..@
[... [.. @
@@
@
[.. @
[.. @
[.. @
[. [.. @
[.. [..@
[.. [.. @
@@
@
[..... [..@
[.. @
[.. @
[.. @
[.. @
[.. @
@@
@
[. @
[.. [.. @
[.. [. @
[.. [. @
[.. [..@
[.... @
@@
@
[. [.. @
[.. [..@
[. [.. @
[. [.. @
[.. @
[.. @
@@
@
@
@
@
[..@
@
[..@
@@
@
@
@
@
[..@
@
[..@
[.@@
[..@
[.. @
[.. @
[.. @
[.. @
[.. @
[..@
@@
@
@
[......@
@
[......@
@
@
@@
[.. @
[.. @
[.. @
[..@
[.. @
[.. @
[.. @
@@
[... @
[.. @
[..@
[.. @
[.. @
@
[.. @
@@
@
[... @
[. [.. @
[. [.. [..@
[.. [..[ [..@
[.. \`\`\` @
[.. @
@@
[. @
[. .. @
[. [.. @
[.. [.. @
[...... [.. @
[.. [.. @
[.. [..@
@@
[.. [.. @
[. [.. @
[. [..@
[... [. @
[. [..@
[. [.@
[.... [.. @
@@
[.. @
[.. [..@
[.. @
[.. @
[.. @
[.. [..@
[.... @
@@
[..... @
[.. [.. @
[.. [..@
[.. [..@
[.. [..@
[.. [.. @
[..... @
@@
[........@
[.. @
[.. @
[...... @
[.. @
[.. @
[........@
@@
[........@
[.. @
[.. @
[...... @
[.. @
[.. @
[.. @
@@
[.... @
[. [.. @
[.. @
[.. @
[.. [....@
[.. [. @
[..... @
@@
[.. [..@
[.. [..@
[.. [..@
[...... [..@
[.. [..@
[.. [..@
[.. [..@
@@
[..@
[..@
[..@
[..@
[..@
[..@
[..@
@@
[..@
[..@
[..@
[..@
[..@
[. [..@
[.... @
@@
[.. [.. @
[.. [.. @
[.. [.. @
[. [. @
[.. [.. @
[.. [.. @
[.. [..@
@@
[.. @
[.. @
[.. @
[.. @
[.. @
[.. @
[........@
@@
[.. [..@
[. [.. [...@
[.. [.. [ [..@
[.. [.. [..@
[.. [. [..@
[.. [..@
[.. [..@
@@
[... [..@
[. [.. [..@
[.. [.. [..@
[.. [.. [..@
[.. [. [..@
[.. [. ..@
[.. [..@
@@
[.... @
[.. [.. @
[.. [..@
[.. [..@
[.. [..@
[.. [.. @
[.... @
@@
[....... @
[.. [..@
[.. [..@
[....... @
[.. @
[.. @
[.. @
@@
[.... @
[.. [.. @
[.. [..@
[.. [..@
[.. [..@
[.. [. [.. @
[.. .. @
[. @@
[....... @
[.. [.. @
[.. [.. @
[. [.. @
[.. [.. @
[.. [.. @
[.. [..@
@@
[.. .. @
[.. [..@
[.. @
[.. @
[.. @
[.. [..@
[.. .. @
@@
[... [......@
[.. @
[.. @
[.. @
[.. @
[.. @
[.. @
@@
[.. [..@
[.. [..@
[.. [..@
[.. [..@
[.. [..@
[.. [..@
[..... @
@@
[.. [..@
[.. [.. @
[.. [.. @
[.. [.. @
[.. [.. @
[.... @
[.. @
@@
[.. [..@
[.. [..@
[.. [. [..@
[.. [.. [..@
[.. [. [.. [..@
[. [. [....@
[.. [..@
@@
[.. [..@
[.. [.. @
[.. [.. @
[.. @
[.. [.. @
[.. [.. @
[.. [..@
@@
[.. [..@
[.. [.. @
[.. [.. @
[.. @
[.. @
[.. @
[.. @
@@
[....... [..@
[.. @
[.. @
[.. @
[.. @
[.. @
[...........@
@@
[....@
[.. @
[.. @
[.. @
[.. @
[.. @
[....@
@@
[.. @
[.. @
[.. @
[.. @
[.. @
[.. @
[..@
@@
[....@
[..@
[..@
[..@
[..@
[..@
[....@
@@
[.. @
[.. [.. @
[.. [..@
@
@
@
@
@@
@
@
@
@
@
@
@
[.....@@
[..@
[. @
@
@
@
@
@
@@
@
@
[.. @
[.. [.. @
[.. [.. @
[.. [.. @
[.. [...@
@@
[.. @
[.. @
[.. @
[.. [.. @
[.. [..@
[.. [..@
[.. [.. @
@@
@
@
[...@
[.. @
[.. @
[.. @
[...@
@@
[..@
[..@
[..@
[.. [..@
[. [..@
[. [..@
[.. [..@
@@
@
@
[.. @
[. [.. @
[..... [..@
[. @
[.... @
@@
[..@
[. @
[.[. [.@
[.. @
[.. @
[.. @
[.. @
@@
@
@
[.. @
[.. [..@
[.. [..@
[.. [..@
[.. @
[.. @@
@
[.. @
[.. @
[. [. @
[.. [..@
[. [..@
[.. [..@
@@
@
[.@
@
[..@
[..@
[..@
[..@
@@
@
[..@
@
[..@
[..@
[..@
[..@
[... @@
[.. @
[.. @
[.. [..@
[.. [.. @
[.[.. @
[.. [.. @
[.. [..@
@@
[..@
[..@
[..@
[..@
[..@
[..@
[...@
@@
@
@
[... [.. [.. @
[.. [. [..@
[.. [. [..@
[.. [. [..@
[... [. [..@
@@
@
@
[.. [.. @
[.. [..@
[.. [..@
[.. [..@
[... [..@
@@
@
@
[.. @
[.. [.. @
[.. [..@
[.. [.. @
[.. @
@@
@
@
[. [.. @
[. [.. @
[. [..@
[.. [.. @
[.. @
[.. @@
@
@
[.. @
[. [.. @
[. [.. @
[..[.. @
[.. @
[...@@
@
@
[. [...@
[.. @
[.. @
[.. @
[... @
@@
@
@
[.... @
[.. @
[... @
[..@
[.. [..@
@@
[.. @
[.. @
[.[. [.@
[.. @
[.. @
[.. @
[.. @
@@
@
@
[.. [..@
[.. [..@
[.. [..@
[.. [..@
[..[..@
@@
@
@
[.. [..@
[.. [.. @
[.. [.. @
[.[.. @
[.. @
@@
@
@
[.. [...@
[.. . [..@
[.. [. [..@
[. [. [.[..@
[... [...@
@@
@
@
[.. [..@
[. [.. @
[. @
[. [.. @
[.. [..@
@@
@
@
[.. [..@
[.. [.. @
[... @
[.. @
[.. @
[.. @@
@
@
[.... [..@
[.. @
[.. @
[.. @
[........@
@@
[..@
[.. @
[.. @
[.. @
[.. @
[.. @
[..@
@@
[.@
[.@
[.@
@
[.@
[.@
[.@
@@
[.. @
[.. @
[.. @
[..@
[.. @
[.. @
[.. @
@@
[.. [. @
[. [..@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Nathan Friedly <nathan@nfriedly.com> (http://nfriedly.com/)
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.
@@ -0,0 +1,29 @@
import {TokenType as tt} from "../parser/tokenizer/types";
export default function elideImportEquals(tokens) {
// import
tokens.removeInitialToken();
// name
tokens.removeToken();
// =
tokens.removeToken();
// name or require
tokens.removeToken();
// Handle either `import A = require('A')` or `import A = B.C.D`.
if (tokens.matches1(tt.parenL)) {
// (
tokens.removeToken();
// path string
tokens.removeToken();
// )
tokens.removeToken();
} else {
while (tokens.matches1(tt.dot)) {
// .
tokens.removeToken();
// name
tokens.removeToken();
}
}
}
@@ -0,0 +1,17 @@
import { MockedModuleType } from '@vitest/mocker';
type Promisable<T> = T | Promise<T>;
type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Promisable<Partial<M>>;
type MockFactory = () => any;
interface MockOptions {
spy?: boolean;
}
interface PendingSuiteMock {
id: string;
importer: string;
action: "mock" | "unmock";
type?: MockedModuleType;
factory?: MockFactory;
}
export type { MockFactoryWithHelper as M, PendingSuiteMock as P, MockOptions as a, MockFactory as b };
@@ -0,0 +1,6 @@
var set = require("./set.js");
var getPrototypeOf = require("./getPrototypeOf.js");
function _superPropSet(t, e, o, r, p, f) {
return set(getPrototypeOf(f ? t.prototype : t), e, o, r, p);
}
module.exports = _superPropSet, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,39 @@
// Northern Sami [se]
import dayjs from '../index';
var locale = {
name: 'se',
weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
weekStart: 1,
weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'MMMM D. [b.] YYYY',
LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
},
relativeTime: {
future: '%s geažes',
past: 'maŋit %s',
s: 'moadde sekunddat',
m: 'okta minuhta',
mm: '%d minuhtat',
h: 'okta diimmu',
hh: '%d diimmut',
d: 'okta beaivi',
dd: '%d beaivvit',
M: 'okta mánnu',
MM: '%d mánut',
y: 'okta jahki',
yy: '%d jagit'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,15 @@
root = true
[*]
indent_style = tab;
insert_final_newline = true;
quote_type = auto;
space_after_anonymous_functions = true;
space_after_control_statements = true;
spaces_around_operators = true;
trim_trailing_whitespace = true;
spaces_in_brackets = false;
end_of_line = lf;
[CHANGELOG.md]
indent_style = space
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = matchesPattern;
var _index = require("./generated/index.js");
function isMemberExpressionLike(node) {
return (0, _index.isMemberExpression)(node) || (0, _index.isMetaProperty)(node);
}
function matchesPattern(member, match, allowPartial) {
if (!isMemberExpressionLike(member)) return false;
const parts = Array.isArray(match) ? match : match.split(".");
const nodes = [];
let node;
for (node = member; isMemberExpressionLike(node); node = (_object = node.object) != null ? _object : node.meta) {
var _object;
nodes.push(node.property);
}
nodes.push(node);
if (nodes.length < parts.length) return false;
if (!allowPartial && nodes.length > parts.length) return false;
for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
const node = nodes[j];
let value;
if ((0, _index.isIdentifier)(node)) {
value = node.name;
} else if ((0, _index.isStringLiteral)(node)) {
value = node.value;
} else if ((0, _index.isThisExpression)(node)) {
value = "this";
} else if ((0, _index.isSuper)(node)) {
value = "super";
} else if ((0, _index.isPrivateName)(node)) {
value = "#" + node.id.name;
} else {
return false;
}
if (parts[i] !== value) return false;
}
return true;
}
//# sourceMappingURL=matchesPattern.js.map
@@ -0,0 +1,10 @@
export var isObject = function (value) {
return value !== null && typeof value === 'object';
};
export var isFunction = function (value) {
return typeof value === 'function';
};
export var isString = function (value) { return typeof value === 'string'; };
export var isBoolean = function (value) { return typeof value === 'boolean'; };
export var isNumber = function (value) { return typeof value === 'number'; };
export var isUndef = function (value) { return typeof value === 'undefined'; };
@@ -0,0 +1,9 @@
"use client";
import {
PopoverProvider,
usePopoverContext
} from "./chunk-CGIRYUEE.mjs";
export {
PopoverProvider,
usePopoverContext
};
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
from io import StringIO
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.stderr = StringIO()
def test_GetLibraries(self):
self.assertEqual(msvs._GetLibraries({}), [])
self.assertEqual(msvs._GetLibraries({"libraries": []}), [])
self.assertEqual(
msvs._GetLibraries({"other": "foo", "libraries": ["a.lib"]}), ["a.lib"]
)
self.assertEqual(msvs._GetLibraries({"libraries": ["-la"]}), ["a.lib"])
self.assertEqual(
msvs._GetLibraries(
{
"libraries": [
"a.lib",
"b.lib",
"c.lib",
"-lb.lib",
"-lb.lib",
"d.lib",
"a.lib",
]
}
),
["c.lib", "b.lib", "d.lib", "a.lib"],
)
if __name__ == "__main__":
unittest.main()
@@ -0,0 +1 @@
{"version":3,"file":"postConstruct.spec.d.ts","sourceRoot":"","sources":["../../../../src/metadata/decorators/postConstruct.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,80 @@
{
"name": "es-object-atoms",
"version": "1.1.1",
"description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible",
"main": "index.js",
"exports": {
".": "./index.js",
"./RequireObjectCoercible": "./RequireObjectCoercible.js",
"./isObject": "./isObject.js",
"./ToObject": "./ToObject.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'",
"posttest": "npx npm@\">= 10.2\" audit --production",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/es-object-atoms.git"
},
"keywords": [
"javascript",
"ecmascript",
"object",
"toobject",
"coercible"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/es-object-atoms/issues"
},
"homepage": "https://github.com/ljharb/es-object-atoms#readme",
"dependencies": {
"es-errors": "^1.3.0"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.3",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"encoding": "^0.1.13",
"eslint": "^8.8.0",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,152 @@
'use strict';
var identity = require('../nodes/identity.js');
var Scalar = require('../nodes/Scalar.js');
var stringify = require('./stringify.js');
var stringifyComment = require('./stringifyComment.js');
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
let keyComment = (identity.isNode(key) && key.comment) || null;
if (simpleKeys) {
if (keyComment) {
throw new Error('With simple keys, key nodes cannot have comments');
}
if (identity.isCollection(key) || (!identity.isNode(key) && typeof key === 'object')) {
const msg = 'With simple keys, collection cannot be used as a key value';
throw new Error(msg);
}
}
let explicitKey = !simpleKeys &&
(!key ||
(keyComment && value == null && !ctx.inFlow) ||
identity.isCollection(key) ||
(identity.isScalar(key)
? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL
: typeof key === 'object'));
ctx = Object.assign({}, ctx, {
allNullValues: false,
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
indent: indent + indentStep
});
let keyCommentDone = false;
let chompKeep = false;
let str = stringify.stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
if (simpleKeys)
throw new Error('With simple keys, single line scalar must not span more than 1024 characters');
explicitKey = true;
}
if (ctx.inFlow) {
if (allNullValues || value == null) {
if (keyCommentDone && onComment)
onComment();
return str === '' ? '?' : explicitKey ? `? ${str}` : str;
}
}
else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {
str = `? ${str}`;
if (keyComment && !keyCommentDone) {
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
}
else if (chompKeep && onChompKeep)
onChompKeep();
return str;
}
if (keyCommentDone)
keyComment = null;
if (explicitKey) {
if (keyComment)
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
str = `? ${str}\n${indent}:`;
}
else {
str = `${str}:`;
if (keyComment)
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
}
let vsb, vcb, valueComment;
if (identity.isNode(value)) {
vsb = !!value.spaceBefore;
vcb = value.commentBefore;
valueComment = value.comment;
}
else {
vsb = false;
vcb = null;
valueComment = null;
if (value && typeof value === 'object')
value = doc.createNode(value);
}
ctx.implicitKey = false;
if (!explicitKey && !keyComment && identity.isScalar(value))
ctx.indentAtStart = str.length + 1;
chompKeep = false;
if (!indentSeq &&
indentStep.length >= 2 &&
!ctx.inFlow &&
!explicitKey &&
identity.isSeq(value) &&
!value.flow &&
!value.tag &&
!value.anchor) {
// If indentSeq === false, consider '- ' as part of indentation where possible
ctx.indent = ctx.indent.substring(2);
}
let valueCommentDone = false;
const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
let ws = ' ';
if (keyComment || vsb || vcb) {
ws = vsb ? '\n' : '';
if (vcb) {
const cs = commentString(vcb);
ws += `\n${stringifyComment.indentComment(cs, ctx.indent)}`;
}
if (valueStr === '' && !ctx.inFlow) {
if (ws === '\n' && valueComment)
ws = '\n\n';
}
else {
ws += `\n${ctx.indent}`;
}
}
else if (!explicitKey && identity.isCollection(value)) {
const vs0 = valueStr[0];
const nl0 = valueStr.indexOf('\n');
const hasNewline = nl0 !== -1;
const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
if (hasNewline || !flow) {
let hasPropsLine = false;
if (hasNewline && (vs0 === '&' || vs0 === '!')) {
let sp0 = valueStr.indexOf(' ');
if (vs0 === '&' &&
sp0 !== -1 &&
sp0 < nl0 &&
valueStr[sp0 + 1] === '!') {
sp0 = valueStr.indexOf(' ', sp0 + 1);
}
if (sp0 === -1 || nl0 < sp0)
hasPropsLine = true;
}
if (!hasPropsLine)
ws = `\n${ctx.indent}`;
}
}
else if (valueStr === '' || valueStr[0] === '\n') {
ws = '';
}
str += ws + valueStr;
if (ctx.inFlow) {
if (valueCommentDone && onComment)
onComment();
}
else if (valueComment && !valueCommentDone) {
str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
}
else if (chompKeep && onChompKeep) {
onChompKeep();
}
return str;
}
exports.stringifyPair = stringifyPair;
@@ -0,0 +1,494 @@
'use strict';
var CombinedStream = require('combined-stream');
var util = require('util');
var path = require('path');
var http = require('http');
var https = require('https');
var parseUrl = require('url').parse;
var fs = require('fs');
var Stream = require('stream').Stream;
var crypto = require('crypto');
var mime = require('mime-types');
var asynckit = require('asynckit');
var setToStringTag = require('es-set-tostringtag');
var hasOwn = require('hasown');
var populate = require('./populate.js');
/**
* Create readable "multipart/form-data" streams.
* Can be used to submit forms
* and file uploads to other web applications.
*
* @constructor
* @param {object} options - Properties to be added/overriden for FormData and CombinedStream
*/
function FormData(options) {
if (!(this instanceof FormData)) {
return new FormData(options);
}
this._overheadLength = 0;
this._valueLength = 0;
this._valuesToMeasure = [];
CombinedStream.call(this);
options = options || {}; // eslint-disable-line no-param-reassign
for (var option in options) { // eslint-disable-line no-restricted-syntax
this[option] = options[option];
}
}
// make it a Stream
util.inherits(FormData, CombinedStream);
FormData.LINE_BREAK = '\r\n';
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
FormData.prototype.append = function (field, value, options) {
options = options || {}; // eslint-disable-line no-param-reassign
// allow filename as single option
if (typeof options === 'string') {
options = { filename: options }; // eslint-disable-line no-param-reassign
}
var append = CombinedStream.prototype.append.bind(this);
// all that streamy business can't handle numbers
if (typeof value === 'number' || value == null) {
value = String(value); // eslint-disable-line no-param-reassign
}
// https://github.com/felixge/node-form-data/issues/38
if (Array.isArray(value)) {
/*
* Please convert your array into string
* the way web server expects it
*/
this._error(new Error('Arrays are not supported.'));
return;
}
var header = this._multiPartHeader(field, value, options);
var footer = this._multiPartFooter();
append(header);
append(value);
append(footer);
// pass along options.knownLength
this._trackLength(header, value, options);
};
FormData.prototype._trackLength = function (header, value, options) {
var valueLength = 0;
/*
* used w/ getLengthSync(), when length is known.
* e.g. for streaming directly from a remote server,
* w/ a known file a size, and not wanting to wait for
* incoming file to finish to get its size.
*/
if (options.knownLength != null) {
valueLength += Number(options.knownLength);
} else if (Buffer.isBuffer(value)) {
valueLength = value.length;
} else if (typeof value === 'string') {
valueLength = Buffer.byteLength(value);
}
this._valueLength += valueLength;
// @check why add CRLF? does this account for custom/multiple CRLFs?
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
// empty or either doesn't have path or not an http response or not a stream
if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
return;
}
// no need to bother with the length
if (!options.knownLength) {
this._valuesToMeasure.push(value);
}
};
FormData.prototype._lengthRetriever = function (value, callback) {
if (hasOwn(value, 'fd')) {
// take read range into a account
// `end` = Infinity –> read file till the end
//
// TODO: Looks like there is bug in Node fs.createReadStream
// it doesn't respect `end` options without `start` options
// Fix it when node fixes it.
// https://github.com/joyent/node/issues/7819
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
// when end specified
// no need to calculate range
// inclusive, starts with 0
callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
// not that fast snoopy
} else {
// still need to fetch file size from fs
fs.stat(value.path, function (err, stat) {
if (err) {
callback(err);
return;
}
// update final size based on the range options
var fileSize = stat.size - (value.start ? value.start : 0);
callback(null, fileSize);
});
}
// or http response
} else if (hasOwn(value, 'httpVersion')) {
callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
// or request stream http://github.com/mikeal/request
} else if (hasOwn(value, 'httpModule')) {
// wait till response come back
value.on('response', function (response) {
value.pause();
callback(null, Number(response.headers['content-length']));
});
value.resume();
// something else
} else {
callback('Unknown stream'); // eslint-disable-line callback-return
}
};
FormData.prototype._multiPartHeader = function (field, value, options) {
/*
* custom header specified (as string)?
* it becomes responsible for boundary
* (e.g. to handle extra CRLFs on .NET servers)
*/
if (typeof options.header === 'string') {
return options.header;
}
var contentDisposition = this._getContentDisposition(value, options);
var contentType = this._getContentType(value, options);
var contents = '';
var headers = {
// add custom disposition as third element or keep it two elements if not
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
// if no content type. allow it to be empty array
'Content-Type': [].concat(contentType || [])
};
// allow custom headers.
if (typeof options.header === 'object') {
populate(headers, options.header);
}
var header;
for (var prop in headers) { // eslint-disable-line no-restricted-syntax
if (hasOwn(headers, prop)) {
header = headers[prop];
// skip nullish headers.
if (header == null) {
continue; // eslint-disable-line no-restricted-syntax, no-continue
}
// convert all headers to arrays.
if (!Array.isArray(header)) {
header = [header];
}
// add non-empty headers.
if (header.length) {
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
}
}
}
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
};
FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
var filename;
if (typeof options.filepath === 'string') {
// custom filepath for relative paths
filename = path.normalize(options.filepath).replace(/\\/g, '/');
} else if (options.filename || (value && (value.name || value.path))) {
/*
* custom filename take precedence
* formidable and the browser add a name property
* fs- and request- streams have path property
*/
filename = path.basename(options.filename || (value && (value.name || value.path)));
} else if (value && value.readable && hasOwn(value, 'httpVersion')) {
// or try http response
filename = path.basename(value.client._httpMessage.path || '');
}
if (filename) {
return 'filename="' + filename + '"';
}
};
FormData.prototype._getContentType = function (value, options) {
// use custom content-type above all
var contentType = options.contentType;
// or try `name` from formidable, browser
if (!contentType && value && value.name) {
contentType = mime.lookup(value.name);
}
// or try `path` from fs-, request- streams
if (!contentType && value && value.path) {
contentType = mime.lookup(value.path);
}
// or if it's http-reponse
if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
contentType = value.headers['content-type'];
}
// or guess it from the filepath or filename
if (!contentType && (options.filepath || options.filename)) {
contentType = mime.lookup(options.filepath || options.filename);
}
// fallback to the default content type if `value` is not simple value
if (!contentType && value && typeof value === 'object') {
contentType = FormData.DEFAULT_CONTENT_TYPE;
}
return contentType;
};
FormData.prototype._multiPartFooter = function () {
return function (next) {
var footer = FormData.LINE_BREAK;
var lastPart = this._streams.length === 0;
if (lastPart) {
footer += this._lastBoundary();
}
next(footer);
}.bind(this);
};
FormData.prototype._lastBoundary = function () {
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
};
FormData.prototype.getHeaders = function (userHeaders) {
var header;
var formHeaders = {
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
};
for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
if (hasOwn(userHeaders, header)) {
formHeaders[header.toLowerCase()] = userHeaders[header];
}
}
return formHeaders;
};
FormData.prototype.setBoundary = function (boundary) {
if (typeof boundary !== 'string') {
throw new TypeError('FormData boundary must be a string');
}
this._boundary = boundary;
};
FormData.prototype.getBoundary = function () {
if (!this._boundary) {
this._generateBoundary();
}
return this._boundary;
};
FormData.prototype.getBuffer = function () {
var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
var boundary = this.getBoundary();
// Create the form content. Add Line breaks to the end of data.
for (var i = 0, len = this._streams.length; i < len; i++) {
if (typeof this._streams[i] !== 'function') {
// Add content to the buffer.
if (Buffer.isBuffer(this._streams[i])) {
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
} else {
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
}
// Add break after content.
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
}
}
}
// Add the footer and return the Buffer object.
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
};
FormData.prototype._generateBoundary = function () {
// This generates a 50 character boundary similar to those used by Firefox.
// They are optimized for boyer-moore parsing.
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
};
// Note: getLengthSync DOESN'T calculate streams length
// As workaround one can calculate file size manually and add it as knownLength option
FormData.prototype.getLengthSync = function () {
var knownLength = this._overheadLength + this._valueLength;
// Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
if (this._streams.length) {
knownLength += this._lastBoundary().length;
}
// https://github.com/form-data/form-data/issues/40
if (!this.hasKnownLength()) {
/*
* Some async length retrievers are present
* therefore synchronous length calculation is false.
* Please use getLength(callback) to get proper length
*/
this._error(new Error('Cannot calculate proper length in synchronous way.'));
}
return knownLength;
};
// Public API to check if length of added values is known
// https://github.com/form-data/form-data/issues/196
// https://github.com/form-data/form-data/issues/262
FormData.prototype.hasKnownLength = function () {
var hasKnownLength = true;
if (this._valuesToMeasure.length) {
hasKnownLength = false;
}
return hasKnownLength;
};
FormData.prototype.getLength = function (cb) {
var knownLength = this._overheadLength + this._valueLength;
if (this._streams.length) {
knownLength += this._lastBoundary().length;
}
if (!this._valuesToMeasure.length) {
process.nextTick(cb.bind(this, null, knownLength));
return;
}
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
if (err) {
cb(err);
return;
}
values.forEach(function (length) {
knownLength += length;
});
cb(null, knownLength);
});
};
FormData.prototype.submit = function (params, cb) {
var request;
var options;
var defaults = { method: 'post' };
// parse provided url if it's string or treat it as options object
if (typeof params === 'string') {
params = parseUrl(params); // eslint-disable-line no-param-reassign
/* eslint sort-keys: 0 */
options = populate({
port: params.port,
path: params.pathname,
host: params.hostname,
protocol: params.protocol
}, defaults);
} else { // use custom params
options = populate(params, defaults);
// if no port provided use default one
if (!options.port) {
options.port = options.protocol === 'https:' ? 443 : 80;
}
}
// put that good code in getHeaders to some use
options.headers = this.getHeaders(params.headers);
// https if specified, fallback to http in any other case
if (options.protocol === 'https:') {
request = https.request(options);
} else {
request = http.request(options);
}
// get content length and fire away
this.getLength(function (err, length) {
if (err && err !== 'Unknown stream') {
this._error(err);
return;
}
// add content length
if (length) {
request.setHeader('Content-Length', length);
}
this.pipe(request);
if (cb) {
var onResponse;
var callback = function (error, responce) {
request.removeListener('error', callback);
request.removeListener('response', onResponse);
return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
};
onResponse = callback.bind(this, null);
request.on('error', callback);
request.on('response', onResponse);
}
}.bind(this));
return request;
};
FormData.prototype._error = function (err) {
if (!this.error) {
this.error = err;
this.pause();
this.emit('error', err);
}
};
FormData.prototype.toString = function () {
return '[object FormData]';
};
setToStringTag(FormData, 'FormData');
// Public API
module.exports = FormData;
@@ -0,0 +1,198 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let formatterCache = new Map<string, Intl.DateTimeFormat>();
interface DateRangeFormatPart extends Intl.DateTimeFormatPart {
source: 'startRange' | 'endRange' | 'shared'
}
/** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */
export class DateFormatter implements Intl.DateTimeFormat {
private formatter: Intl.DateTimeFormat;
private options: Intl.DateTimeFormatOptions;
private resolvedHourCycle: Intl.DateTimeFormatOptions['hourCycle'];
constructor(locale: string, options: Intl.DateTimeFormatOptions = {}) {
this.formatter = getCachedDateFormatter(locale, options);
this.options = options;
}
/** Formats a date as a string according to the locale and format options passed to the constructor. */
format(value: Date): string {
return this.formatter.format(value);
}
/** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */
formatToParts(value: Date): Intl.DateTimeFormatPart[] {
return this.formatter.formatToParts(value);
}
/** Formats a date range as a string. */
formatRange(start: Date, end: Date): string {
// @ts-ignore
if (typeof this.formatter.formatRange === 'function') {
// @ts-ignore
return this.formatter.formatRange(start, end);
}
if (end < start) {
throw new RangeError('End date must be >= start date');
}
// Very basic fallback for old browsers.
return `${this.formatter.format(start)} – ${this.formatter.format(end)}`;
}
/** Formats a date range as an array of parts. */
formatRangeToParts(start: Date, end: Date): DateRangeFormatPart[] {
// @ts-ignore
if (typeof this.formatter.formatRangeToParts === 'function') {
// @ts-ignore
return this.formatter.formatRangeToParts(start, end);
}
if (end < start) {
throw new RangeError('End date must be >= start date');
}
let startParts = this.formatter.formatToParts(start);
let endParts = this.formatter.formatToParts(end);
return [
...startParts.map(p => ({...p, source: 'startRange'} as DateRangeFormatPart)),
{type: 'literal', value: ' – ', source: 'shared'},
...endParts.map(p => ({...p, source: 'endRange'} as DateRangeFormatPart))
];
}
/** Returns the resolved formatting options based on the values passed to the constructor. */
resolvedOptions(): Intl.ResolvedDateTimeFormatOptions {
let resolvedOptions = this.formatter.resolvedOptions();
if (hasBuggyResolvedHourCycle()) {
if (!this.resolvedHourCycle) {
this.resolvedHourCycle = getResolvedHourCycle(resolvedOptions.locale, this.options);
}
resolvedOptions.hourCycle = this.resolvedHourCycle;
resolvedOptions.hour12 = this.resolvedHourCycle === 'h11' || this.resolvedHourCycle === 'h12';
}
// Safari uses a different name for the Ethiopic (Amete Alem) calendar.
// https://bugs.webkit.org/show_bug.cgi?id=241564
if (resolvedOptions.calendar === 'ethiopic-amete-alem') {
resolvedOptions.calendar = 'ethioaa';
}
return resolvedOptions;
}
}
// There are multiple bugs involving the hour12 and hourCycle options in various browser engines.
// - Chrome [1] (and the ECMA 402 spec [2]) resolve hour12: false in English and other locales to h24 (24:00 - 23:59)
// rather than h23 (00:00 - 23:59). Same can happen with hour12: true in French, which Chrome resolves to h11 (00:00 - 11:59)
// rather than h12 (12:00 - 11:59).
// - WebKit returns an incorrect hourCycle resolved option in the French locale due to incorrect parsing of 'h' literal
// in the resolved pattern. It also formats incorrectly when specifying the hourCycle option for the same reason. [3]
// [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1045791
// [2] https://github.com/tc39/ecma402/issues/402
// [3] https://bugs.webkit.org/show_bug.cgi?id=229313
// https://github.com/unicode-org/cldr/blob/018b55eff7ceb389c7e3fc44e2f657eae3b10b38/common/supplemental/supplementalData.xml#L4774-L4802
const hour12Preferences = {
true: {
// Only Japanese uses the h11 style for 12 hour time. All others use h12.
ja: 'h11'
},
false: {
// All locales use h23 for 24 hour time. None use h24.
}
};
function getCachedDateFormatter(locale: string, options: Intl.DateTimeFormatOptions = {}): Intl.DateTimeFormat {
// Work around buggy hour12 behavior in Chrome / ECMA 402 spec by using hourCycle instead.
// Only apply the workaround if the issue is detected, because the hourCycle option is buggy in Safari.
if (typeof options.hour12 === 'boolean' && hasBuggyHour12Behavior()) {
options = {...options};
let pref = hour12Preferences[String(options.hour12)][locale.split('-')[0]];
let defaultHourCycle = options.hour12 ? 'h12' : 'h23';
options.hourCycle = pref ?? defaultHourCycle;
delete options.hour12;
}
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');
if (formatterCache.has(cacheKey)) {
return formatterCache.get(cacheKey)!;
}
let numberFormatter = new Intl.DateTimeFormat(locale, options);
formatterCache.set(cacheKey, numberFormatter);
return numberFormatter;
}
let _hasBuggyHour12Behavior: boolean | null = null;
function hasBuggyHour12Behavior() {
if (_hasBuggyHour12Behavior == null) {
_hasBuggyHour12Behavior = new Intl.DateTimeFormat('en-US', {
hour: 'numeric',
hour12: false
}).format(new Date(2020, 2, 3, 0)) === '24';
}
return _hasBuggyHour12Behavior;
}
let _hasBuggyResolvedHourCycle: boolean | null = null;
function hasBuggyResolvedHourCycle() {
if (_hasBuggyResolvedHourCycle == null) {
_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat('fr', {
hour: 'numeric',
hour12: false
}).resolvedOptions().hourCycle === 'h12';
}
return _hasBuggyResolvedHourCycle;
}
function getResolvedHourCycle(locale: string, options: Intl.DateTimeFormatOptions) {
if (!options.timeStyle && !options.hour) {
return undefined;
}
// Work around buggy results in resolved hourCycle and hour12 options in WebKit.
// Format the minimum possible hour and maximum possible hour in a day and parse the results.
locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, '');
locale += (locale.includes('-u-') ? '' : '-u') + '-nu-latn';
let formatter = getCachedDateFormatter(locale, {
...options,
timeZone: undefined // use local timezone
});
let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find(p => p.type === 'hour')!.value, 10);
let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find(p => p.type === 'hour')!.value, 10);
if (min === 0 && max === 23) {
return 'h23';
}
if (min === 24 && max === 23) {
return 'h24';
}
if (min === 0 && max === 11) {
return 'h11';
}
if (min === 12 && max === 11) {
return 'h12';
}
throw new Error('Unexpected hour cycle result');
}
@@ -0,0 +1,71 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const ReturnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
categoryId: import("@sinclair/typebox").TNumber;
categoryName: import("@sinclair/typebox").TString;
categoryMbCount: import("@sinclair/typebox").TNumber;
buddyList: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
birthday_year: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_month: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_day: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
phone_num: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
category_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
user_id: import("@sinclair/typebox").TNumber;
nickname: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
sex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
level: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
age: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
qid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
login_days: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
categoryName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
categoryId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>>;
}>>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GetFriendWithCategory extends OneBotAction<void, ReturnType> {
actionName: "get_friends_with_category";
payloadSchema: import("@sinclair/typebox").TObject<{}>;
returnSchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
categoryId: import("@sinclair/typebox").TNumber;
categoryName: import("@sinclair/typebox").TString;
categoryMbCount: import("@sinclair/typebox").TNumber;
buddyList: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
birthday_year: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_month: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
birthday_day: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
phone_num: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
category_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
user_id: import("@sinclair/typebox").TNumber;
nickname: import("@sinclair/typebox").TString;
remark: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
sex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
level: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
age: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
qid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
login_days: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
categoryName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
categoryId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>>;
}>>;
actionSummary: string;
actionTags: string[];
payloadExample: {};
returnExample: {
categoryId: number;
categoryName: string;
categoryMbCount: number;
buddyList: never[];
}[];
_handle(): Promise<{
buddyList: import("index").OB11User[];
categoryId: number;
categorySortId: number;
categoryName: string;
categoryMbCount: number;
onlineCount: number;
}[]>;
}
export {};
@@ -0,0 +1,201 @@
import { Action } from './types/actions'
import {
ActionFromReducersMapObject,
PreloadedStateShapeFromReducersMapObject,
Reducer,
StateFromReducersMapObject
} from './types/reducers'
import ActionTypes from './utils/actionTypes'
import isPlainObject from './utils/isPlainObject'
import warning from './utils/warning'
import { kindOf } from './utils/kindOf'
function getUnexpectedStateShapeWarningMessage(
inputState: object,
reducers: { [key: string]: Reducer<any, any, any> },
action: Action,
unexpectedKeyCache: { [key: string]: true }
) {
const reducerKeys = Object.keys(reducers)
const argumentName =
action && action.type === ActionTypes.INIT
? 'preloadedState argument passed to createStore'
: 'previous state received by the reducer'
if (reducerKeys.length === 0) {
return (
'Store does not have a valid reducer. Make sure the argument passed ' +
'to combineReducers is an object whose values are reducers.'
)
}
if (!isPlainObject(inputState)) {
return (
`The ${argumentName} has unexpected type of "${kindOf(
inputState
)}". Expected argument to be an object with the following ` +
`keys: "${reducerKeys.join('", "')}"`
)
}
const unexpectedKeys = Object.keys(inputState).filter(
key => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]
)
unexpectedKeys.forEach(key => {
unexpectedKeyCache[key] = true
})
if (action && action.type === ActionTypes.REPLACE) return
if (unexpectedKeys.length > 0) {
return (
`Unexpected ${unexpectedKeys.length > 1 ? 'keys' : 'key'} ` +
`"${unexpectedKeys.join('", "')}" found in ${argumentName}. ` +
`Expected to find one of the known reducer keys instead: ` +
`"${reducerKeys.join('", "')}". Unexpected keys will be ignored.`
)
}
}
function assertReducerShape(reducers: {
[key: string]: Reducer<any, any, any>
}) {
Object.keys(reducers).forEach(key => {
const reducer = reducers[key]
const initialState = reducer(undefined, { type: ActionTypes.INIT })
if (typeof initialState === 'undefined') {
throw new Error(
`The slice reducer for key "${key}" returned undefined during initialization. ` +
`If the state passed to the reducer is undefined, you must ` +
`explicitly return the initial state. The initial state may ` +
`not be undefined. If you don't want to set a value for this reducer, ` +
`you can use null instead of undefined.`
)
}
if (
typeof reducer(undefined, {
type: ActionTypes.PROBE_UNKNOWN_ACTION()
}) === 'undefined'
) {
throw new Error(
`The slice reducer for key "${key}" returned undefined when probed with a random type. ` +
`Don't try to handle '${ActionTypes.INIT}' or other actions in "redux/*" ` +
`namespace. They are considered private. Instead, you must return the ` +
`current state for any unknown actions, unless it is undefined, ` +
`in which case you must return the initial state, regardless of the ` +
`action type. The initial state may not be undefined, but can be null.`
)
}
})
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @template S Combined state object type.
*
* @param reducers An object whose values correspond to different reducer
* functions that need to be combined into one. One handy way to obtain it
* is to use `import * as reducers` syntax. The reducers may never
* return undefined for any action. Instead, they should return their
* initial state if the state passed to them was undefined, and the current
* state for any unrecognized action.
*
* @returns A reducer function that invokes every reducer inside the passed
* object, and builds a state object with the same shape.
*/
export default function combineReducers<M>(
reducers: M
): M[keyof M] extends Reducer<any, any, any> | undefined
? Reducer<
StateFromReducersMapObject<M>,
ActionFromReducersMapObject<M>,
Partial<PreloadedStateShapeFromReducersMapObject<M>>
>
: never
export default function combineReducers(reducers: {
[key: string]: Reducer<any, any, any>
}) {
const reducerKeys = Object.keys(reducers)
const finalReducers: { [key: string]: Reducer<any, any, any> } = {}
for (let i = 0; i < reducerKeys.length; i++) {
const key = reducerKeys[i]
if (process.env.NODE_ENV !== 'production') {
if (typeof reducers[key] === 'undefined') {
warning(`No reducer provided for key "${key}"`)
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key]
}
}
const finalReducerKeys = Object.keys(finalReducers)
// This is used to make sure we don't warn about the same
// keys multiple times.
let unexpectedKeyCache: { [key: string]: true }
if (process.env.NODE_ENV !== 'production') {
unexpectedKeyCache = {}
}
let shapeAssertionError: unknown
try {
assertReducerShape(finalReducers)
} catch (e) {
shapeAssertionError = e
}
return function combination(
state: StateFromReducersMapObject<typeof reducers> = {},
action: Action
) {
if (shapeAssertionError) {
throw shapeAssertionError
}
if (process.env.NODE_ENV !== 'production') {
const warningMessage = getUnexpectedStateShapeWarningMessage(
state,
finalReducers,
action,
unexpectedKeyCache
)
if (warningMessage) {
warning(warningMessage)
}
}
let hasChanged = false
const nextState: StateFromReducersMapObject<typeof reducers> = {}
for (let i = 0; i < finalReducerKeys.length; i++) {
const key = finalReducerKeys[i]
const reducer = finalReducers[key]
const previousStateForKey = state[key]
const nextStateForKey = reducer(previousStateForKey, action)
if (typeof nextStateForKey === 'undefined') {
const actionType = action && action.type
throw new Error(
`When called with an action of type ${
actionType ? `"${String(actionType)}"` : '(unknown type)'
}, the slice reducer for key "${key}" returned undefined. ` +
`To ignore an action, you must explicitly return the previous state. ` +
`If you want this reducer to hold no value, you can return null instead of undefined.`
)
}
nextState[key] = nextStateForKey
hasChanged = hasChanged || nextStateForKey !== previousStateForKey
}
hasChanged =
hasChanged || finalReducerKeys.length !== Object.keys(state).length
return hasChanged ? nextState : state
}
}
@@ -0,0 +1,35 @@
"use strict";
const basicLogPrefix = require("./basicLogPrefix.js");
class ConsoleAppender {
/**
* Constructor (构造函数)
* @param layout Layout (布局)
*/
constructor(layout) {
this.layout = layout;
this.name = "console";
this.dateFormat = "HH:mm:ss.SSS";
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
setup(logger) {
}
/**
* Write log (写入日志)
* @param event Log event (日志事件)
*/
write(event) {
const { layout } = this;
if (layout) {
console.log(layout.format(event));
} else {
console.log(basicLogPrefix(event, this.dateFormat), ...event.message);
}
}
/**
* Close appender (关闭输出)
*/
close() {
return Promise.resolve();
}
}
module.exports = ConsoleAppender;
@@ -0,0 +1,58 @@
{
"name": "socks",
"private": false,
"version": "2.8.7",
"description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.",
"main": "build/index.js",
"typings": "typings/index.d.ts",
"homepage": "https://github.com/JoshGlazebrook/socks/",
"repository": {
"type": "git",
"url": "https://github.com/JoshGlazebrook/socks.git"
},
"bugs": {
"url": "https://github.com/JoshGlazebrook/socks/issues"
},
"keywords": [
"socks",
"proxy",
"tor",
"socks 4",
"socks 5",
"socks4",
"socks5"
],
"engines": {
"node": ">= 10.0.0",
"npm": ">= 3.0.0"
},
"author": "Josh Glazebrook",
"contributors": [
"castorw"
],
"license": "MIT",
"readmeFilename": "README.md",
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.20.0",
"mocha": "^10.0.0",
"prettier": "^3.2.5",
"ts-node": "^10.9.1",
"typescript": "^5.3.3"
},
"dependencies": {
"ip-address": "^10.0.1",
"smart-buffer": "^4.2.0"
},
"scripts": {
"prepublish": "npm install -g typescript && npm run build",
"test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts",
"prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml",
"lint": "eslint 'src/**/*.ts'",
"build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p .",
"build-raw": "rm -rf build typings && tsc -p ."
}
}
@@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = optimizettf;
var _reduceGlyf = _interopRequireDefault(require("./reduceGlyf"));
var _pathCeil = _interopRequireDefault(require("../../graphics/pathCeil"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file 对ttf对象进行优化,查找错误,去除冗余点
* @author mengke01(kekee000@gmail.com)
*/
/**
* 对ttf对象进行优化
*
* @param {Object} ttf ttf对象
* @return {true|Object} 错误信息
*/
function optimizettf(ttf) {
var checkUnicodeRepeat = {}; // 检查是否有重复代码点
var repeatList = [];
ttf.glyf.forEach(function (glyf, index) {
if (glyf.unicode) {
glyf.unicode = glyf.unicode.sort();
// 将glyf的代码点按小到大排序
glyf.unicode.sort(function (a, b) {
return a - b;
}).forEach(function (u) {
if (checkUnicodeRepeat[u]) {
repeatList.push(index);
} else {
checkUnicodeRepeat[u] = true;
}
});
}
if (!glyf.compound && glyf.contours) {
// 整数化
glyf.contours.forEach(function (contour) {
(0, _pathCeil.default)(contour);
});
// 缩减glyf
(0, _reduceGlyf.default)(glyf);
}
// 整数化
glyf.xMin = Math.round(glyf.xMin || 0);
glyf.xMax = Math.round(glyf.xMax || 0);
glyf.yMin = Math.round(glyf.yMin || 0);
glyf.yMax = Math.round(glyf.yMax || 0);
glyf.leftSideBearing = Math.round(glyf.leftSideBearing || 0);
glyf.advanceWidth = Math.round(glyf.advanceWidth || 0);
});
// 过滤无轮廓字体,如果存在复合字形不进行过滤
if (!ttf.glyf.some(function (a) {
return a.compound;
})) {
ttf.glyf = ttf.glyf.filter(function (glyf, index) {
return index === 0 || glyf.contours && glyf.contours.length;
});
}
if (!repeatList.length) {
return true;
}
return {
repeat: repeatList
};
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,37 @@
'use strict';
var $TypeError = require('es-errors/type');
var GetValueFromBuffer = require('./GetValueFromBuffer');
var IsValidIntegerIndex = require('./IsValidIntegerIndex');
var TypedArrayElementSize = require('./TypedArrayElementSize');
var TypedArrayElementType = require('./TypedArrayElementType');
var isTypedArray = require('is-typed-array');
var typedArrayBuffer = require('typed-array-buffer');
var typedArrayByteOffset = require('typed-array-byte-offset');
// https://262.ecma-international.org/15.0/#sec-typedarraygetelement
module.exports = function TypedArrayGetElement(O, index) {
if (!isTypedArray(O)) {
throw new $TypeError('Assertion failed: `O` must be a TypedArray instance');
}
if (typeof index !== 'number') {
throw new $TypeError('Assertion failed: `index` must be a Number');
}
if (!IsValidIntegerIndex(O, index)) {
return undefined; // step 1
}
var offset = typedArrayByteOffset(O); // step 2
var elementSize = TypedArrayElementSize(O); // step 3
var byteIndexInBuffer = (index * elementSize) + offset; // step 4
var elementType = TypedArrayElementType(O); // step 5
return GetValueFromBuffer(typedArrayBuffer(O), byteIndexInBuffer, elementType, true, 'UNORDERED'); // step 6
};
@@ -0,0 +1,9 @@
/**
* 获取移动或缩放之后的中心点
*/
export default function getPositionOnMoveOrScale(x: number, y: number, width: number, height: number, scale: number, toScale: number, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number): {
x: number;
y: number;
lastCX: number;
lastCY: number;
};
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAKD,MAAM,8BAAQ,IAAI;AAEX,SAAS,0CAAgB,UAA+B;IAC7D,IAAI,QAAQ,4BAAM,GAAG,CAAC;IACtB,IAAI,SAAS,MACX,OAAO;IAGT,uFAAuF;IACvF,IAAI,UAAU;IACd,IAAI,aAAa,CAAC;QAChB,KAAK,IAAI,QAAQ,MAAO;YACtB,IAAI,KAAK,IAAI,KAAK,WAChB,WAAW,CAAA,GAAA,uCAAY,EAAE,MAAM;iBAC1B,IAAI,KAAK,IAAI,KAAK,QACvB;QAEJ;IACF;IAEA,WAAW;IACX,4BAAM,GAAG,CAAC,YAAY;IACtB,OAAO;AACT","sources":["packages/@react-stately/collections/src/getItemCount.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, Node} from '@react-types/shared';\nimport {getChildNodes} from './getChildNodes';\n\nconst cache = new WeakMap<Iterable<unknown>, number>();\n\nexport function getItemCount<T>(collection: Collection<Node<T>>): number {\n let count = cache.get(collection);\n if (count != null) {\n return count;\n }\n\n // TS isn't smart enough to know we've ensured count is a number, so use a new variable\n let counter = 0;\n let countItems = (items: Iterable<Node<T>>) => {\n for (let item of items) {\n if (item.type === 'section') {\n countItems(getChildNodes(item, collection));\n } else if (item.type === 'item') {\n counter++;\n }\n }\n };\n\n countItems(collection);\n cache.set(collection, counter);\n return counter;\n}\n"],"names":[],"version":3,"file":"getItemCount.main.js.map"}
@@ -0,0 +1,48 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReferenceTracker = void 0;
/* eslint-disable @typescript-eslint/no-namespace */
const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
/**
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
*/
exports.ReferenceTracker = eslintUtils.ReferenceTracker;
@@ -0,0 +1,47 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMPropsResponderContext} from './DOMPropsContext';
import {HoverProps} from './useHover';
import React, {ForwardedRef, ReactNode, useEffect, useRef} from 'react';
import {useObjectRef} from '@react-aria/utils';
interface DOMPropsResponderProps extends HoverProps {
children: ReactNode
}
export const DOMPropsResponder = React.forwardRef(({children, ...props}: DOMPropsResponderProps, ref: ForwardedRef<Element>) => {
let isRegistered = useRef(false);
let objRef = useObjectRef(ref);
let context = {
...props,
ref: objRef,
register() {
isRegistered.current = true;
}
};
// TODO: Think of a more generic message when this replaces the PressResponder as well
useEffect(() => {
if (!isRegistered.current) {
console.warn(
'A DOMPropsResponder was ultilized without a hoverable DOM node.'
);
}
}, []);
return (
<DOMPropsResponderContext.Provider value={context}>
{children}
</DOMPropsResponderContext.Provider>
);
});
@@ -0,0 +1,12 @@
import * as _heroui_system from '@heroui/system';
import { UseSwitchProps } from './use-switch.js';
import 'react';
import 'tailwind-variants';
import '@heroui/theme';
import '@react-aria/switch';
interface SwitchProps extends UseSwitchProps {
}
declare const Switch: _heroui_system.InternalForwardRefRenderFunction<"input", SwitchProps, never>;
export { SwitchProps, Switch as default };
@@ -0,0 +1,12 @@
const generateLinearEasing = (easing, duration, // as milliseconds
resolution = 10 // as milliseconds
) => {
let points = "";
const numPoints = Math.max(Math.round(duration / resolution), 2);
for (let i = 0; i < numPoints; i++) {
points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", ";
}
return `linear(${points.substring(0, points.length - 2)})`;
};
export { generateLinearEasing };
@@ -0,0 +1,44 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
file_count: import("@sinclair/typebox").TNumber;
limit_count: import("@sinclair/typebox").TNumber;
used_space: import("@sinclair/typebox").TNumber;
total_space: import("@sinclair/typebox").TNumber;
}>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GetGroupFileSystemInfo extends OneBotAction<PayloadType, ReturnType> {
actionName: "get_group_file_system_info";
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
file_count: import("@sinclair/typebox").TNumber;
limit_count: import("@sinclair/typebox").TNumber;
used_space: import("@sinclair/typebox").TNumber;
total_space: import("@sinclair/typebox").TNumber;
}>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
};
returnExample: {
file_count: number;
limit_count: number;
used_space: number;
total_space: number;
};
_handle(payload: PayloadType): Promise<{
file_count: number;
limit_count: number;
used_space: number;
total_space: number;
}>;
}
export {};
@@ -0,0 +1,12 @@
"use strict";
/**
* Detect Electron renderer / nwjs process, which is node, but we should
* treat as a browser.
*/
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
module.exports = require('./browser.js');
} else {
module.exports = require('./node.js');
}
@@ -0,0 +1,35 @@
'use strict';
require('../auto');
var test = require('tape');
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var functionsHaveNames = require('functions-have-names')();
var isEnumerable = Object.prototype.propertyIsEnumerable;
var runTests = require('./tests');
var name = 'groupBy';
var fullName = 'Object.' + name;
test('shimmed', function (t) {
var fn = Object[name];
t.equal(fn.length, 2, fullName + ' has a length of 2');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(fn.name, name, fullName + ' has name "' + name + '"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, name), fullName + ' is not enumerable');
et.end();
});
runTests(callBind(fn, Object), t);
t.end();
});
@@ -0,0 +1,270 @@
'use strict';
module.exports = function generate_required(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
var $vSchema = 'schema' + $lvl;
if (!$isData) {
if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
var $required = [];
var arr1 = $schema;
if (arr1) {
var $property, i1 = -1,
l1 = arr1.length - 1;
while (i1 < l1) {
$property = arr1[i1 += 1];
var $propertySch = it.schema.properties[$property];
if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
$required[$required.length] = $property;
}
}
}
} else {
var $required = $schema;
}
}
if ($isData || $required.length) {
var $currentErrorPath = it.errorPath,
$loopRequired = $isData || $required.length >= it.opts.loopRequired,
$ownProperties = it.opts.ownProperties;
if ($breakOnError) {
out += ' var missing' + ($lvl) + '; ';
if ($loopRequired) {
if (!$isData) {
out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
}
var $i = 'i' + $lvl,
$propertyPath = 'schema' + $lvl + '[' + $i + ']',
$missingProperty = '\' + ' + $propertyPath + ' + \'';
if (it.opts._errorDataPathProperty) {
it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
}
out += ' var ' + ($valid) + ' = true; ';
if ($isData) {
out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
}
out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
if ($ownProperties) {
out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
}
out += '; if (!' + ($valid) + ') break; } ';
if ($isData) {
out += ' } ';
}
out += ' if (!' + ($valid) + ') { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += ' } else { ';
} else {
out += ' if ( ';
var arr2 = $required;
if (arr2) {
var $propertyKey, $i = -1,
l2 = arr2.length - 1;
while ($i < l2) {
$propertyKey = arr2[$i += 1];
if ($i) {
out += ' || ';
}
var $prop = it.util.getProperty($propertyKey),
$useData = $data + $prop;
out += ' ( ( ' + ($useData) + ' === undefined ';
if ($ownProperties) {
out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
}
out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
}
}
out += ') { ';
var $propertyPath = 'missing' + $lvl,
$missingProperty = '\' + ' + $propertyPath + ' + \'';
if (it.opts._errorDataPathProperty) {
it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
}
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += ' } else { ';
}
} else {
if ($loopRequired) {
if (!$isData) {
out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
}
var $i = 'i' + $lvl,
$propertyPath = 'schema' + $lvl + '[' + $i + ']',
$missingProperty = '\' + ' + $propertyPath + ' + \'';
if (it.opts._errorDataPathProperty) {
it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
}
if ($isData) {
out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
}
out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
if ($ownProperties) {
out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
}
out += ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
if ($isData) {
out += ' } ';
}
} else {
var arr3 = $required;
if (arr3) {
var $propertyKey, i3 = -1,
l3 = arr3.length - 1;
while (i3 < l3) {
$propertyKey = arr3[i3 += 1];
var $prop = it.util.getProperty($propertyKey),
$missingProperty = it.util.escapeQuotes($propertyKey),
$useData = $data + $prop;
if (it.opts._errorDataPathProperty) {
it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
}
out += ' if ( ' + ($useData) + ' === undefined ';
if ($ownProperties) {
out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
}
out += ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'';
if (it.opts._errorDataPathProperty) {
out += 'is a required property';
} else {
out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
}
out += '\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
}
}
}
}
it.errorPath = $currentErrorPath;
} else if ($breakOnError) {
out += ' if (true) {';
}
return out;
}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isLet;
var _index = require("./generated/index.js");
{
var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
}
function isLet(node) {
{
return (0, _index.isVariableDeclaration)(node) && (node.kind !== "var" || node[BLOCK_SCOPED_SYMBOL]);
}
}
//# sourceMappingURL=isLet.js.map
@@ -0,0 +1,4 @@
// This is a generated file. Do not edit.
module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/
module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60Line truncated
module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE7Line truncated
@@ -0,0 +1,30 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import type { Assert } from '../helpers/index.mjs';
import type { TUnion } from '../union/index.mjs';
import type { TLiteral } from '../literal/index.mjs';
import type { TInteger } from '../integer/index.mjs';
import type { TNumber } from '../number/index.mjs';
import type { TBigInt } from '../bigint/index.mjs';
import type { TString } from '../string/index.mjs';
import type { TBoolean } from '../boolean/index.mjs';
import type { TNever } from '../never/index.mjs';
import type { Static } from '../static/index.mjs';
import { type TTemplateLiteralSyntax } from './syntax.mjs';
import { EmptyString } from '../helpers/index.mjs';
import { Kind } from '../symbols/index.mjs';
type TemplateLiteralStaticKind<T, Acc extends string> = T extends TUnion<infer U> ? {
[K in keyof U]: TemplateLiteralStatic<Assert<[U[K]], TTemplateLiteralKind[]>, Acc>;
}[number] : T extends TTemplateLiteral ? `${Static<T>}` : T extends TLiteral<infer U> ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never;
type TemplateLiteralStatic<T extends TTemplateLiteralKind[], Acc extends string> = T extends [infer L, ...infer R] ? `${TemplateLiteralStaticKind<L, Acc>}${TemplateLiteralStatic<Assert<R, TTemplateLiteralKind[]>, Acc>}` : Acc;
export type TTemplateLiteralKind = TTemplateLiteral | TUnion | TLiteral | TInteger | TNumber | TBigInt | TString | TBoolean | TNever;
export interface TTemplateLiteral<T extends TTemplateLiteralKind[] = TTemplateLiteralKind[]> extends TSchema {
[Kind]: 'TemplateLiteral';
static: TemplateLiteralStatic<T, EmptyString>;
type: 'string';
pattern: string;
}
/** `[Json]` Creates a TemplateLiteral type from template dsl string */
export declare function TemplateLiteral<T extends string>(syntax: T, options?: SchemaOptions): TTemplateLiteralSyntax<T>;
/** `[Json]` Creates a TemplateLiteral type */
export declare function TemplateLiteral<T extends TTemplateLiteralKind[]>(kinds: [...T], options?: SchemaOptions): TTemplateLiteral<T>;
export {};
@@ -0,0 +1,288 @@
import platform from "../platform/index.js";
import utils from "../utils.js";
import AxiosError from "../core/AxiosError.js";
import composeSignals from "../helpers/composeSignals.js";
import {trackStream} from "../helpers/trackStream.js";
import AxiosHeaders from "../core/AxiosHeaders.js";
import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js";
import resolveConfig from "../helpers/resolveConfig.js";
import settle from "../core/settle.js";
const DEFAULT_CHUNK_SIZE = 64 * 1024;
const {isFunction} = utils;
const globalFetchAPI = (({Request, Response}) => ({
Request, Response
}))(utils.global);
const {
ReadableStream, TextEncoder
} = utils.global;
const test = (fn, ...args) => {
try {
return !!fn(...args);
} catch (e) {
return false
}
}
const factory = (env) => {
env = utils.merge.call({
skipUndefined: true
}, globalFetchAPI, env);
const {fetch: envFetch, Request, Response} = env;
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
const isRequestSupported = isFunction(Request);
const isResponseSupported = isFunction(Response);
if (!isFetchSupported) {
return false;
}
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
);
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
let duplexAccessed = false;
const hasContentType = new Request(platform.origin, {
body: new ReadableStream(),
method: 'POST',
get duplex() {
duplexAccessed = true;
return 'half';
},
}).headers.has('Content-Type');
return duplexAccessed && !hasContentType;
});
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
test(() => utils.isReadableStream(new Response('').body));
const resolvers = {
stream: supportsResponseStream && ((res) => res.body)
};
isFetchSupported && ((() => {
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
!resolvers[type] && (resolvers[type] = (res, config) => {
let method = res && res[type];
if (method) {
return method.call(res);
}
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
})
});
})());
const getBodyLength = async (body) => {
if (body == null) {
return 0;
}
if (utils.isBlob(body)) {
return body.size;
}
if (utils.isSpecCompliantForm(body)) {
const _request = new Request(platform.origin, {
method: 'POST',
body,
});
return (await _request.arrayBuffer()).byteLength;
}
if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
return body.byteLength;
}
if (utils.isURLSearchParams(body)) {
body = body + '';
}
if (utils.isString(body)) {
return (await encodeText(body)).byteLength;
}
}
const resolveBodyLength = async (headers, body) => {
const length = utils.toFiniteNumber(headers.getContentLength());
return length == null ? getBodyLength(body) : length;
}
return async (config) => {
let {
url,
method,
data,
signal,
cancelToken,
timeout,
onDownloadProgress,
onUploadProgress,
responseType,
headers,
withCredentials = 'same-origin',
fetchOptions
} = resolveConfig(config);
let _fetch = envFetch || fetch;
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
let request = null;
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
composedSignal.unsubscribe();
});
let requestContentLength;
try {
if (
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
) {
let _request = new Request(url, {
method: 'POST',
body: data,
duplex: "half"
});
let contentTypeHeader;
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
headers.setContentType(contentTypeHeader)
}
if (_request.body) {
const [onProgress, flush] = progressEventDecorator(
requestContentLength,
progressEventReducer(asyncDecorator(onUploadProgress))
);
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
}
}
if (!utils.isString(withCredentials)) {
withCredentials = withCredentials ? 'include' : 'omit';
}
// Cloudflare Workers throws when credentials are defined
// see https://github.com/cloudflare/workerd/issues/902
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
const resolvedOptions = {
...fetchOptions,
signal: composedSignal,
method: method.toUpperCase(),
headers: headers.normalize().toJSON(),
body: data,
duplex: "half",
credentials: isCredentialsSupported ? withCredentials : undefined
};
request = isRequestSupported && new Request(url, resolvedOptions);
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
const options = {};
['status', 'statusText', 'headers'].forEach(prop => {
options[prop] = response[prop];
});
const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
responseContentLength,
progressEventReducer(asyncDecorator(onDownloadProgress), true)
) || [];
response = new Response(
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
flush && flush();
unsubscribe && unsubscribe();
}),
options
);
}
responseType = responseType || 'text';
let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);
!isStreamResponse && unsubscribe && unsubscribe();
return await new Promise((resolve, reject) => {
settle(resolve, reject, {
data: responseData,
headers: AxiosHeaders.from(response.headers),
status: response.status,
statusText: response.statusText,
config,
request
})
})
} catch (err) {
unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign(
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
{
cause: err.cause || err
}
)
}
throw AxiosError.from(err, err && err.code, config, request);
}
}
}
const seedCache = new Map();
export const getFetch = (config) => {
let env = (config && config.env) || {};
const {fetch, Request, Response} = env;
const seeds = [
Request, Response, fetch
];
let len = seeds.length, i = len,
seed, target, map = seedCache;
while (i--) {
seed = seeds[i];
target = map.get(seed);
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))
map = target;
}
return target;
};
const adapter = getFetch();
export default adapter;
@@ -0,0 +1,14 @@
/**
* This code comes from @react-aria/overlays
*/
/**
* Hides all elements in the DOM outside the given targets from screen readers using aria-hidden,
* and returns a function to revert these changes. In addition, changes to the DOM are watched
* and new elements outside the targets are automatically hidden.
* @param targets - The elements that should remain visible.
* @param root - Nothing will be hidden above this element.
* @returns - A function to restore all hidden elements.
*/
declare function ariaHideOutside(targets: Element[], root?: HTMLElement): () => void;
export { ariaHideOutside };
@@ -0,0 +1,341 @@
'use strict';
const scan = require('./scan');
const parse = require('./parse');
const utils = require('./utils');
const constants = require('./constants');
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
/**
* Creates a matcher function from one or more glob patterns. The
* returned function takes a string to match as its first argument,
* and returns true if the string is a match. The returned matcher
* function also takes a boolean as the second argument that, when true,
* returns an object with additional information.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch(glob[, options]);
*
* const isMatch = picomatch('*.!(*a)');
* console.log(isMatch('a.a')); //=> false
* console.log(isMatch('a.b')); //=> true
* ```
* @name picomatch
* @param {String|Array} `globs` One or more glob patterns.
* @param {Object=} `options`
* @return {Function=} Returns a matcher function.
* @api public
*/
const picomatch = (glob, options, returnState = false) => {
if (Array.isArray(glob)) {
const fns = glob.map(input => picomatch(input, options, returnState));
const arrayMatcher = str => {
for (const isMatch of fns) {
const state = isMatch(str);
if (state) return state;
}
return false;
};
return arrayMatcher;
}
const isState = isObject(glob) && glob.tokens && glob.input;
if (glob === '' || (typeof glob !== 'string' && !isState)) {
throw new TypeError('Expected pattern to be a non-empty string');
}
const opts = options || {};
const posix = opts.windows;
const regex = isState
? picomatch.compileRe(glob, options)
: picomatch.makeRe(glob, options, false, true);
const state = regex.state;
delete regex.state;
let isIgnored = () => false;
if (opts.ignore) {
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
}
const matcher = (input, returnObject = false) => {
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
const result = { glob, state, regex, posix, input, output, match, isMatch };
if (typeof opts.onResult === 'function') {
opts.onResult(result);
}
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === 'function') {
opts.onIgnore(result);
}
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === 'function') {
opts.onMatch(result);
}
return returnObject ? result : true;
};
if (returnState) {
matcher.state = state;
}
return matcher;
};
/**
* Test `input` with the given `regex`. This is used by the main
* `picomatch()` function to test the input string.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.test(input, regex[, options]);
*
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
* ```
* @param {String} `input` String to test.
* @param {RegExp} `regex`
* @return {Object} Returns an object with matching info.
* @api public
*/
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
if (typeof input !== 'string') {
throw new TypeError('Expected input to be a string');
}
if (input === '') {
return { isMatch: false, output: '' };
}
const opts = options || {};
const format = opts.format || (posix ? utils.toPosixSlashes : null);
let match = input === glob;
let output = (match && format) ? format(input) : input;
if (match === false) {
output = format ? format(input) : input;
match = output === glob;
}
if (match === false || opts.capture === true) {
if (opts.matchBase === true || opts.basename === true) {
match = picomatch.matchBase(input, regex, options, posix);
} else {
match = regex.exec(output);
}
}
return { isMatch: Boolean(match), match, output };
};
/**
* Match the basename of a filepath.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.matchBase(input, glob[, options]);
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
* ```
* @param {String} `input` String to test.
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
* @return {Boolean}
* @api public
*/
picomatch.matchBase = (input, glob, options) => {
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
return regex.test(utils.basename(input));
};
/**
* Returns true if **any** of the given glob `patterns` match the specified `string`.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.isMatch(string, patterns[, options]);
*
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
* ```
* @param {String|Array} str The string to test.
* @param {String|Array} patterns One or more glob patterns to use for matching.
* @param {Object} [options] See available [options](#options).
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
/**
* Parse a glob pattern to create the source string for a regular
* expression.
*
* ```js
* const picomatch = require('picomatch');
* const result = picomatch.parse(pattern[, options]);
* ```
* @param {String} `pattern`
* @param {Object} `options`
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
* @api public
*/
picomatch.parse = (pattern, options) => {
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
return parse(pattern, { ...options, fastpaths: false });
};
/**
* Scan a glob pattern to separate the pattern into segments.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.scan(input[, options]);
*
* const result = picomatch.scan('!./foo/*.js');
* console.log(result);
* { prefix: '!./',
* input: '!./foo/*.js',
* start: 3,
* base: 'foo',
* glob: '*.js',
* isBrace: false,
* isBracket: false,
* isGlob: true,
* isExtglob: false,
* isGlobstar: false,
* negated: true }
* ```
* @param {String} `input` Glob pattern to scan.
* @param {Object} `options`
* @return {Object} Returns an object with
* @api public
*/
picomatch.scan = (input, options) => scan(input, options);
/**
* Compile a regular expression from the `state` object returned by the
* [parse()](#parse) method.
*
* @param {Object} `state`
* @param {Object} `options`
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
* @return {RegExp}
* @api public
*/
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
if (returnOutput === true) {
return state.output;
}
const opts = options || {};
const prepend = opts.contains ? '' : '^';
const append = opts.contains ? '' : '$';
let source = `${prepend}(?:${state.output})${append}`;
if (state && state.negated === true) {
source = `^(?!${source}).*$`;
}
const regex = picomatch.toRegex(source, options);
if (returnState === true) {
regex.state = state;
}
return regex;
};
/**
* Create a regular expression from a parsed glob pattern.
*
* ```js
* const picomatch = require('picomatch');
* const state = picomatch.parse('*.js');
* // picomatch.compileRe(state[, options]);
*
* console.log(picomatch.compileRe(state));
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
* ```
* @param {String} `state` The object returned from the `.parse` method.
* @param {Object} `options`
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
* @return {RegExp} Returns a regex created from the given pattern.
* @api public
*/
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
if (!input || typeof input !== 'string') {
throw new TypeError('Expected a non-empty string');
}
let parsed = { negated: false, fastpaths: true };
if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
parsed.output = parse.fastpaths(input, options);
}
if (!parsed.output) {
parsed = parse(input, options);
}
return picomatch.compileRe(parsed, options, returnOutput, returnState);
};
/**
* Create a regular expression from the given regex source string.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.toRegex(source[, options]);
*
* const { output } = picomatch.parse('*.js');
* console.log(picomatch.toRegex(output));
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
* ```
* @param {String} `source` Regular expression source string.
* @param {Object} `options`
* @return {RegExp}
* @api public
*/
picomatch.toRegex = (source, options) => {
try {
const opts = options || {};
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
} catch (err) {
if (options && options.debug === true) throw err;
return /$^/;
}
};
/**
* Picomatch constants.
* @return {Object}
*/
picomatch.constants = constants;
/**
* Expose "picomatch"
*/
module.exports = picomatch;
@@ -0,0 +1,6 @@
import {
SearchLinearIcon
} from "../chunk-O65ECHHD.mjs";
export {
SearchLinearIcon
};
@@ -0,0 +1,298 @@
export interface DefaultColors {
inherit: 'inherit'
current: 'currentColor'
transparent: 'transparent'
black: '#000'
white: '#fff'
slate: {
'50': '#f8fafc'
'100': '#f1f5f9'
'200': '#e2e8f0'
'300': '#cbd5e1'
'400': '#94a3b8'
'500': '#64748b'
'600': '#475569'
'700': '#334155'
'800': '#1e293b'
'900': '#0f172a'
'950': '#020617'
}
gray: {
'50': '#f9fafb'
'100': '#f3f4f6'
'200': '#e5e7eb'
'300': '#d1d5db'
'400': '#9ca3af'
'500': '#6b7280'
'600': '#4b5563'
'700': '#374151'
'800': '#1f2937'
'900': '#111827'
'950': '#030712'
}
zinc: {
'50': '#fafafa'
'100': '#f4f4f5'
'200': '#e4e4e7'
'300': '#d4d4d8'
'400': '#a1a1aa'
'500': '#71717a'
'600': '#52525b'
'700': '#3f3f46'
'800': '#27272a'
'900': '#18181b'
'950': '#09090b'
}
neutral: {
'50': '#fafafa'
'100': '#f5f5f5'
'200': '#e5e5e5'
'300': '#d4d4d4'
'400': '#a3a3a3'
'500': '#737373'
'600': '#525252'
'700': '#404040'
'800': '#262626'
'900': '#171717'
'950': '#0a0a0a'
}
stone: {
'50': '#fafaf9'
'100': '#f5f5f4'
'200': '#e7e5e4'
'300': '#d6d3d1'
'400': '#a8a29e'
'500': '#78716c'
'600': '#57534e'
'700': '#44403c'
'800': '#292524'
'900': '#1c1917'
'950': '#0c0a09'
}
red: {
'50': '#fef2f2'
'100': '#fee2e2'
'200': '#fecaca'
'300': '#fca5a5'
'400': '#f87171'
'500': '#ef4444'
'600': '#dc2626'
'700': '#b91c1c'
'800': '#991b1b'
'900': '#7f1d1d'
'950': '#450a0a'
}
orange: {
'50': '#fff7ed'
'100': '#ffedd5'
'200': '#fed7aa'
'300': '#fdba74'
'400': '#fb923c'
'500': '#f97316'
'600': '#ea580c'
'700': '#c2410c'
'800': '#9a3412'
'900': '#7c2d12'
'950': '#431407'
}
amber: {
'50': '#fffbeb'
'100': '#fef3c7'
'200': '#fde68a'
'300': '#fcd34d'
'400': '#fbbf24'
'500': '#f59e0b'
'600': '#d97706'
'700': '#b45309'
'800': '#92400e'
'900': '#78350f'
'950': '#451a03'
}
yellow: {
'50': '#fefce8'
'100': '#fef9c3'
'200': '#fef08a'
'300': '#fde047'
'400': '#facc15'
'500': '#eab308'
'600': '#ca8a04'
'700': '#a16207'
'800': '#854d0e'
'900': '#713f12'
'950': '#422006'
}
lime: {
'50': '#f7fee7'
'100': '#ecfccb'
'200': '#d9f99d'
'300': '#bef264'
'400': '#a3e635'
'500': '#84cc16'
'600': '#65a30d'
'700': '#4d7c0f'
'800': '#3f6212'
'900': '#365314'
'950': '#1a2e05'
}
green: {
'50': '#f0fdf4'
'100': '#dcfce7'
'200': '#bbf7d0'
'300': '#86efac'
'400': '#4ade80'
'500': '#22c55e'
'600': '#16a34a'
'700': '#15803d'
'800': '#166534'
'900': '#14532d'
'950': '#052e16'
}
emerald: {
'50': '#ecfdf5'
'100': '#d1fae5'
'200': '#a7f3d0'
'300': '#6ee7b7'
'400': '#34d399'
'500': '#10b981'
'600': '#059669'
'700': '#047857'
'800': '#065f46'
'900': '#064e3b'
'950': '#022c22'
}
teal: {
'50': '#f0fdfa'
'100': '#ccfbf1'
'200': '#99f6e4'
'300': '#5eead4'
'400': '#2dd4bf'
'500': '#14b8a6'
'600': '#0d9488'
'700': '#0f766e'
'800': '#115e59'
'900': '#134e4a'
'950': '#042f2e'
}
cyan: {
'50': '#ecfeff'
'100': '#cffafe'
'200': '#a5f3fc'
'300': '#67e8f9'
'400': '#22d3ee'
'500': '#06b6d4'
'600': '#0891b2'
'700': '#0e7490'
'800': '#155e75'
'900': '#164e63'
'950': '#083344'
}
sky: {
'50': '#f0f9ff'
'100': '#e0f2fe'
'200': '#bae6fd'
'300': '#7dd3fc'
'400': '#38bdf8'
'500': '#0ea5e9'
'600': '#0284c7'
'700': '#0369a1'
'800': '#075985'
'900': '#0c4a6e'
'950': '#082f49'
}
blue: {
'50': '#eff6ff'
'100': '#dbeafe'
'200': '#bfdbfe'
'300': '#93c5fd'
'400': '#60a5fa'
'500': '#3b82f6'
'600': '#2563eb'
'700': '#1d4ed8'
'800': '#1e40af'
'900': '#1e3a8a'
'950': '#172554'
}
indigo: {
'50': '#eef2ff'
'100': '#e0e7ff'
'200': '#c7d2fe'
'300': '#a5b4fc'
'400': '#818cf8'
'500': '#6366f1'
'600': '#4f46e5'
'700': '#4338ca'
'800': '#3730a3'
'900': '#312e81'
'950': '#1e1b4b'
}
violet: {
'50': '#f5f3ff'
'100': '#ede9fe'
'200': '#ddd6fe'
'300': '#c4b5fd'
'400': '#a78bfa'
'500': '#8b5cf6'
'600': '#7c3aed'
'700': '#6d28d9'
'800': '#5b21b6'
'900': '#4c1d95'
'950': '#2e1065'
}
purple: {
'50': '#faf5ff'
'100': '#f3e8ff'
'200': '#e9d5ff'
'300': '#d8b4fe'
'400': '#c084fc'
'500': '#a855f7'
'600': '#9333ea'
'700': '#7e22ce'
'800': '#6b21a8'
'900': '#581c87'
'950': '#3b0764'
}
fuchsia: {
'50': '#fdf4ff'
'100': '#fae8ff'
'200': '#f5d0fe'
'300': '#f0abfc'
'400': '#e879f9'
'500': '#d946ef'
'600': '#c026d3'
'700': '#a21caf'
'800': '#86198f'
'900': '#701a75'
'950': '#4a044e'
}
pink: {
'50': '#fdf2f8'
'100': '#fce7f3'
'200': '#fbcfe8'
'300': '#f9a8d4'
'400': '#f472b6'
'500': '#ec4899'
'600': '#db2777'
'700': '#be185d'
'800': '#9d174d'
'900': '#831843'
'950': '#500724'
}
rose: {
'50': '#fff1f2'
'100': '#ffe4e6'
'200': '#fecdd3'
'300': '#fda4af'
'400': '#fb7185'
'500': '#f43f5e'
'600': '#e11d48'
'700': '#be123c'
'800': '#9f1239'
'900': '#881337'
'950': '#4c0519'
}
/** @deprecated As of Tailwind CSS v2.2, `lightBlue` has been renamed to `sky`. Update your configuration file to silence this warning. */ lightBlue: DefaultColors['sky']
/** @deprecated As of Tailwind CSS v3.0, `warmGray` has been renamed to `stone`. Update your configuration file to silence this warning. */ warmGray: DefaultColors['stone']
/** @deprecated As of Tailwind CSS v3.0, `trueGray` has been renamed to `neutral`. Update your configuration file to silence this warning. */ trueGray: DefaultColors['neutral']
/** @deprecated As of Tailwind CSS v3.0, `coolGray` has been renamed to `gray`. Update your configuration file to silence this warning. */ coolGray: DefaultColors['gray']
/** @deprecated As of Tailwind CSS v3.0, `blueGray` has been renamed to `slate`. Update your configuration file to silence this warning. */ blueGray: DefaultColors['slate']
}
@@ -0,0 +1,142 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "caracteres", verb: "ter" },
file: { unit: "bytes", verb: "ter" },
array: { unit: "itens", verb: "ter" },
set: { unit: "itens", verb: "ter" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "número";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "nulo";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "padrão",
email: "endereço de e-mail",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data e hora ISO",
date: "data ISO",
time: "hora ISO",
duration: "duração ISO",
ipv4: "endereço IPv4",
ipv6: "endereço IPv6",
cidrv4: "faixa de IPv4",
cidrv6: "faixa de IPv6",
base64: "texto codificado em base64",
base64url: "URL codificada em base64",
json_string: "texto JSON",
e164: "número E.164",
jwt: "JWT",
template_literal: "entrada",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Tipo inválido: esperado ${issue.expected}, recebido ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Entrada inválida: esperado ${util.stringifyPrimitive(issue.values[0])}`;
return `Opção inválida: esperada uma das ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Texto inválido: deve começar com "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Texto inválido: deve terminar com "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Texto inválido: deve incluir "${_issue.includes}"`;
if (_issue.format === "regex")
return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} inválido`;
}
case "not_multiple_of":
return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
case "unrecognized_keys":
return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Chave inválida em ${issue.origin}`;
case "invalid_union":
return "Entrada inválida";
case "invalid_element":
return `Valor inválido em ${issue.origin}`;
default:
return `Campo inválido`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,9 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="10" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="10" x2="15" y1="9" y2="9"></line>
<line class="ql-stroke" x1="10" x2="15" y1="14" y2="14"></line>
<polygon class="ql-fill ql-stroke" points="3 5 5 3 7 5 3 5"></polygon>
<line class="ql-stroke" x1="5" x2="5" y1="7" y2="5"></line>
<polygon class="ql-fill ql-stroke" points="3 13 5 15 7 13 3 13"></polygon>
<line class="ql-stroke" x1="5" x2="5" y1="11" y2="13"></line>
</svg>

After

Width:  |  Height:  |  Size: 502 B

@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/react.ts","../src/utils/react-is.ts","../src/utils/warning.ts","../src/connect/verifySubselectors.ts","../src/connect/selectorFactory.ts","../src/utils/bindActionCreators.ts","../src/utils/isPlainObject.ts","../src/utils/verifyPlainObject.ts","../src/connect/wrapMapToProps.ts","../src/connect/invalidArgFactory.ts","../src/connect/mapDispatchToProps.ts","../src/connect/mapStateToProps.ts","../src/connect/mergeProps.ts","../src/utils/batch.ts","../src/utils/Subscription.ts","../src/utils/useIsomorphicLayoutEffect.ts","../src/utils/shallowEqual.ts","../src/utils/hoistStatics.ts","../src/components/Context.ts","../src/components/connect.tsx","../src/components/Provider.tsx","../src/hooks/useReduxContext.ts","../src/hooks/useStore.ts","../src/hooks/useDispatch.ts","../src/hooks/useSelector.ts","../src/exports.ts"],"sourcesContent":["import * as React from 'react'\n\nexport { React }\n","import type { ElementType, MemoExoticComponent, ReactElement } from 'react'\nimport { React } from './react'\n\n// Directly ported from:\n// https://unpkg.com/browse/react-is@19.0.0/cjs/react-is.production.js\n// It's very possible this could change in the future, but given that\n// we only use these in `connect`, this is a low priority.\n\nexport const IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19')\n\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(\n IS_REACT_19 ? 'react.transitional.element' : 'react.element',\n)\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal')\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment')\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode')\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler')\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer')\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context')\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref')\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense')\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\n 'react.suspense_list',\n)\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo')\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy')\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen')\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\n 'react.client.reference',\n)\n\nexport const ForwardRef = REACT_FORWARD_REF_TYPE\nexport const Memo = REACT_MEMO_TYPE\n\nexport function isValidElementType(type: any): type is ElementType {\n return typeof type === 'string' ||\n typeof type === 'function' ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (typeof type === 'object' &&\n type !== null &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n type.getModuleId !== undefined))\n ? !0\n : !1\n}\n\nfunction typeOf(object: any): symbol | undefined {\n if (typeof object === 'object' && object !== null) {\n const { $$typeof } = object\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (((object = object.type), object)) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return object\n default:\n switch (((object = object && object.$$typeof), object)) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object\n case REACT_CONSUMER_TYPE:\n return object\n default:\n return $$typeof\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof\n }\n }\n}\n\nexport function isContextConsumer(object: any): object is ReactElement {\n return IS_REACT_19\n ? typeOf(object) === REACT_CONSUMER_TYPE\n : typeOf(object) === REACT_CONTEXT_TYPE\n}\n\nexport function isMemo(object: any): object is MemoExoticComponent<any> {\n return typeOf(object) === REACT_MEMO_TYPE\n}\n","/**\r\n * Prints a warning in the console if it exists.\r\n *\r\n * @param {String} message The warning message.\r\n * @returns {void}\r\n */\r\nexport default function warning(message: string) {\r\n /* eslint-disable no-console */\r\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\r\n console.error(message)\r\nLine truncated
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,MAAM,CAAC;AACvC","sources":["packages/@react-aria/overlays/intl/hr-HR.json"],"sourcesContent":["{\n \"dismiss\": \"Odbaci\"\n}\n"],"names":[],"version":3,"file":"hr-HR.main.js.map"}
@@ -0,0 +1,678 @@
import {createSyntheticEvent as $8a9cb279dc87e130$export$525bc4921d56d4a, preventFocus as $8a9cb279dc87e130$export$cabe61c495ee3649, setEventTarget as $8a9cb279dc87e130$export$c2b7abe5d61ec696} from "./utils.module.js";
import {disableTextSelection as $14c0b72509d70225$export$16a4697467175487, restoreTextSelection as $14c0b72509d70225$export$b0d6fa1ab32e3295} from "./textSelection.module.js";
import {PressResponderContext as $ae1eeba8b9eafd08$export$5165eccb35aaadb5} from "./context.module.js";
import {_ as $7mdmh$_} from "@swc/helpers/_/_class_private_field_get";
import {_ as $7mdmh$_1} from "@swc/helpers/_/_class_private_field_init";
import {_ as $7mdmh$_2} from "@swc/helpers/_/_class_private_field_set";
import {mergeProps as $7mdmh$mergeProps, useSyncRef as $7mdmh$useSyncRef, useGlobalListeners as $7mdmh$useGlobalListeners, useEffectEvent as $7mdmh$useEffectEvent, nodeContains as $7mdmh$nodeContains, getEventTarget as $7mdmh$getEventTarget, getOwnerDocument as $7mdmh$getOwnerDocument, chain as $7mdmh$chain, isMac as $7mdmh$isMac, openLink as $7mdmh$openLink, isVirtualClick as $7mdmh$isVirtualClick, isVirtualPointerEvent as $7mdmh$isVirtualPointerEvent, focusWithoutScrolling as $7mdmh$focusWithoutScrolling, getOwnerWindow as $7mdmh$getOwnerWindow} from "@react-aria/utils";
import {flushSync as $7mdmh$flushSync} from "react-dom";
import {useContext as $7mdmh$useContext, useState as $7mdmh$useState, useRef as $7mdmh$useRef, useMemo as $7mdmh$useMemo, useEffect as $7mdmh$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
function $f6c31cce2adf654f$var$usePressResponderContext(props) {
// Consume context from <PressResponder> and merge with props.
let context = (0, $7mdmh$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
if (context) {
let { register: register, ...contextProps } = context;
props = (0, $7mdmh$mergeProps)(contextProps, props);
register();
}
(0, $7mdmh$useSyncRef)(context, props.ref);
return props;
}
var $f6c31cce2adf654f$var$_shouldStopPropagation = /*#__PURE__*/ new WeakMap();
class $f6c31cce2adf654f$var$PressEvent {
continuePropagation() {
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, false);
}
get shouldStopPropagation() {
return (0, $7mdmh$_)(this, $f6c31cce2adf654f$var$_shouldStopPropagation);
}
constructor(type, pointerType, originalEvent, state){
(0, $7mdmh$_1)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
writable: true,
value: void 0
});
(0, $7mdmh$_2)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, true);
var _state_target;
let currentTarget = (_state_target = state === null || state === void 0 ? void 0 : state.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget;
const rect = currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.getBoundingClientRect();
let x, y = 0;
let clientX, clientY = null;
if (originalEvent.clientX != null && originalEvent.clientY != null) {
clientX = originalEvent.clientX;
clientY = originalEvent.clientY;
}
if (rect) {
if (clientX != null && clientY != null) {
x = clientX - rect.left;
y = clientY - rect.top;
} else {
x = rect.width / 2;
y = rect.height / 2;
}
}
this.type = type;
this.pointerType = pointerType;
this.target = originalEvent.currentTarget;
this.shiftKey = originalEvent.shiftKey;
this.metaKey = originalEvent.metaKey;
this.ctrlKey = originalEvent.ctrlKey;
this.altKey = originalEvent.altKey;
this.x = x;
this.y = y;
}
}
const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
const $f6c31cce2adf654f$var$STYLE_ID = 'react-aria-pressable-style';
const $f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE = 'data-react-aria-pressable';
function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
let { onPress: onPress, onPressChange: onPressChange, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onClick: onClick, isDisabled: isDisabled, isPressed: isPressedProp, preventFocusOnPress: preventFocusOnPress, shouldCancelOnPointerExit: shouldCancelOnPointerExit, allowTextSelectionOnPress: allowTextSelectionOnPress, ref: domRef, ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
let [isPressed, setPressed] = (0, $7mdmh$useState)(false);
let ref = (0, $7mdmh$useRef)({
isPressed: false,
ignoreEmulatedMouseEvents: false,
didFirePressStart: false,
isTriggeringEvent: false,
activePointerId: null,
target: null,
isOverTarget: false,
pointerType: null,
disposables: []
});
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $7mdmh$useGlobalListeners)();
let triggerPressStart = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled || state.didFirePressStart) return false;
let shouldStopPropagation = true;
state.isTriggeringEvent = true;
if (onPressStart) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressstart', pointerType, originalEvent);
onPressStart(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(true);
state.isTriggeringEvent = false;
state.didFirePressStart = true;
setPressed(true);
return shouldStopPropagation;
});
let triggerPressEnd = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType, wasPressed = true)=>{
let state = ref.current;
if (!state.didFirePressStart) return false;
state.didFirePressStart = false;
state.isTriggeringEvent = true;
let shouldStopPropagation = true;
if (onPressEnd) {
let event = new $f6c31cce2adf654f$var$PressEvent('pressend', pointerType, originalEvent);
onPressEnd(event);
shouldStopPropagation = event.shouldStopPropagation;
}
if (onPressChange) onPressChange(false);
setPressed(false);
if (onPress && wasPressed && !isDisabled) {
let event = new $f6c31cce2adf654f$var$PressEvent('press', pointerType, originalEvent);
onPress(event);
shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
}
state.isTriggeringEvent = false;
return shouldStopPropagation;
});
let triggerPressUp = (0, $7mdmh$useEffectEvent)((originalEvent, pointerType)=>{
let state = ref.current;
if (isDisabled) return false;
if (onPressUp) {
state.isTriggeringEvent = true;
let event = new $f6c31cce2adf654f$var$PressEvent('pressup', pointerType, originalEvent);
onPressUp(event);
state.isTriggeringEvent = false;
return event.shouldStopPropagation;
}
return true;
});
let cancel = (0, $7mdmh$useEffectEvent)((e)=>{
let state = ref.current;
if (state.isPressed && state.target) {
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
state.isPressed = false;
state.isOverTarget = false;
state.activePointerId = null;
state.pointerType = null;
removeAllGlobalListeners();
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
for (let dispose of state.disposables)dispose();
state.disposables = [];
}
});
let cancelOnPointerExit = (0, $7mdmh$useEffectEvent)((e)=>{
if (shouldCancelOnPointerExit) cancel(e);
});
let triggerClick = (0, $7mdmh$useEffectEvent)((e)=>{
if (isDisabled) return;
onClick === null || onClick === void 0 ? void 0 : onClick(e);
});
let triggerSyntheticClick = (0, $7mdmh$useEffectEvent)((e, target)=>{
if (isDisabled) return;
// Some third-party libraries pass in onClick instead of onPress.
// Create a fake mouse event and trigger onClick as well.
// This matches the browser's native activation behavior for certain elements (e.g. button).
// https://html.spec.whatwg.org/#activation
// https://html.spec.whatwg.org/#fire-a-synthetic-pointer-event
if (onClick) {
let event = new MouseEvent('click', e);
(0, $8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
onClick((0, $8a9cb279dc87e130$export$525bc4921d56d4a)(event));
}
});
let pressProps = (0, $7mdmh$useMemo)(()=>{
let state = ref.current;
let pressProps = {
onKeyDown (e) {
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && (0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) {
var _state_metaKeyEvents;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((0, $7mdmh$getEventTarget)(e.nativeEvent), e.key)) e.preventDefault();
// If the event is repeating, it may have started on a different element
// after which focus moved to the current element. Ignore these events and
// only handle the first key down event.
let shouldStopPropagation = true;
if (!state.isPressed && !e.repeat) {
state.target = e.currentTarget;
state.isPressed = true;
state.pointerType = 'keyboard';
shouldStopPropagation = triggerPressStart(e, 'keyboard');
// Focus may move before the key up event, so register the event on the document
// instead of the same element where the key down event occurred. Make it capturing so that it will trigger
// before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
let originalTarget = e.currentTarget;
let pressUp = (e)=>{
if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && (0, $7mdmh$nodeContains)(originalTarget, (0, $7mdmh$getEventTarget)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
};
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'keyup', (0, $7mdmh$chain)(pressUp, onKeyUp), true);
}
if (shouldStopPropagation) e.stopPropagation();
// Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
// macOS has a bug where keyup events are not fired while the Meta key is down.
// When the Meta key itself is released we will get an event for that, and we'll act as if
// all of these other keys were released as well.
// https://bugs.chromium.org/p/chromium/issues/detail?id=1393524
// https://bugs.webkit.org/show_bug.cgi?id=55291
// https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
if (e.metaKey && (0, $7mdmh$isMac)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
} else if (e.key === 'Meta') state.metaKeyEvents = new Map();
},
onClick (e) {
if (e && !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (e && e.button === 0 && !state.isTriggeringEvent && !(0, $7mdmh$openLink).isOpening) {
let shouldStopPropagation = true;
if (isDisabled) e.preventDefault();
// If triggered from a screen reader or by using element.click(),
// trigger as if it were a keyboard click.
if (!state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === 'virtual' || (0, $7mdmh$isVirtualClick)(e.nativeEvent))) {
let stopPressStart = triggerPressStart(e, 'virtual');
let stopPressUp = triggerPressUp(e, 'virtual');
let stopPressEnd = triggerPressEnd(e, 'virtual');
triggerClick(e);
shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
} else if (state.isPressed && state.pointerType !== 'keyboard') {
let pointerType = state.pointerType || e.nativeEvent.pointerType || 'virtual';
let stopPressUp = triggerPressUp($f6c31cce2adf654f$var$createEvent(e.currentTarget, e), pointerType);
let stopPressEnd = triggerPressEnd($f6c31cce2adf654f$var$createEvent(e.currentTarget, e), pointerType, true);
shouldStopPropagation = stopPressUp && stopPressEnd;
state.isOverTarget = false;
triggerClick(e);
cancel(e);
}
state.ignoreEmulatedMouseEvents = false;
if (shouldStopPropagation) e.stopPropagation();
}
}
};
let onKeyUp = (e)=>{
var _state_metaKeyEvents;
if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
var _state_metaKeyEvents1;
if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard((0, $7mdmh$getEventTarget)(e), e.key)) e.preventDefault();
let target = (0, $7mdmh$getEventTarget)(e);
let wasPressed = (0, $7mdmh$nodeContains)(state.target, (0, $7mdmh$getEventTarget)(e));
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
if (wasPressed) triggerSyntheticClick(e, state.target);
removeAllGlobalListeners();
// If a link was triggered with a key other than Enter, open the URL ourselves.
// This means the link has a role override, and the default browser behavior
// only applies when using the Enter key.
if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && (0, $7mdmh$nodeContains)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
// Store a hidden property on the event so we only trigger link click once,
// even if there are multiple usePress instances attached to the element.
e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
(0, $7mdmh$openLink)(state.target, e, false);
}
state.isPressed = false;
(_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
} else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
var _state_target;
// If we recorded keydown events that occurred while the Meta key was pressed,
// and those haven't received keyup events already, fire keyup events ourselves.
// See comment above for more info about the macOS bug causing this.
let events = state.metaKeyEvents;
state.metaKeyEvents = undefined;
for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
}
};
if (typeof PointerEvent !== 'undefined') {
pressProps.onPointerDown = (e)=>{
// Only handle left clicks, and ignore events that bubbled through portals.
if (e.button !== 0 || !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
// iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
// Ignore and let the onClick handler take care of it instead.
// https://bugs.webkit.org/show_bug.cgi?id=222627
// https://bugs.webkit.org/show_bug.cgi?id=223202
if ((0, $7mdmh$isVirtualPointerEvent)(e.nativeEvent)) {
state.pointerType = 'virtual';
return;
}
state.pointerType = e.pointerType;
let shouldStopPropagation = true;
if (!state.isPressed) {
state.isPressed = true;
state.isOverTarget = true;
state.activePointerId = e.pointerId;
state.target = e.currentTarget;
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
shouldStopPropagation = triggerPressStart(e, state.pointerType);
// Release pointer capture so that touch interactions can leave the original target.
// This enables onPointerLeave and onPointerEnter to fire.
let target = (0, $7mdmh$getEventTarget)(e.nativeEvent);
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointerup', onPointerUp, false);
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointercancel', onPointerCancel, false);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseDown = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (e.button === 0) {
if (preventFocusOnPress) {
let dispose = (0, $8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
if (dispose) state.disposables.push(dispose);
}
e.stopPropagation();
}
};
pressProps.onPointerUp = (e)=>{
// iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent)) || state.pointerType === 'virtual') return;
// Only handle left clicks. If isPressed is true, delay until onClick.
if (e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || e.pointerType);
};
pressProps.onPointerEnter = (e)=>{
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
}
};
pressProps.onPointerLeave = (e)=>{
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit(e);
}
};
let onPointerUp = (e)=>{
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
if ((0, $7mdmh$nodeContains)(state.target, (0, $7mdmh$getEventTarget)(e)) && state.pointerType != null) {
// Wait for onClick to fire onPress. This avoids browser issues when the DOM
// is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
// https://github.com/adobe/react-spectrum/issues/1513
// https://issues.chromium.org/issues/40732224
// However, iOS and Android do not focus or fire onClick after a long press.
// We work around this by triggering a click ourselves after a timeout.
// This timeout is canceled during the click event in case the real one fires first.
// The timeout must be at least 32ms, because Safari on iOS delays the click event on
// non-form elements without certain ARIA roles (for hover emulation).
// https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
let clicked = false;
let timeout = setTimeout(()=>{
if (state.isPressed && state.target instanceof HTMLElement) {
if (clicked) cancel(e);
else {
(0, $7mdmh$focusWithoutScrolling)(state.target);
state.target.click();
}
}
}, 80);
// Use a capturing listener to track if a click occurred.
// If stopPropagation is called it may never reach our handler.
addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
state.disposables.push(()=>clearTimeout(timeout));
} else cancel(e);
// Ignore subsequent onPointerLeave event before onClick on touch devices.
state.isOverTarget = false;
}
};
let onPointerCancel = (e)=>{
cancel(e);
};
pressProps.onDragStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
// Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
cancel(e);
};
} else if (process.env.NODE_ENV === 'test') {
// NOTE: this fallback branch is entirely used by unit tests.
// All browsers now support pointer events, but JSDOM still does not.
pressProps.onMouseDown = (e)=>{
// Only handle left clicks
if (e.button !== 0 || !(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (state.ignoreEmulatedMouseEvents) {
e.stopPropagation();
return;
}
state.isPressed = true;
state.isOverTarget = true;
state.target = e.currentTarget;
state.pointerType = (0, $7mdmh$isVirtualClick)(e.nativeEvent) ? 'virtual' : 'mouse';
// Flush sync so that focus moved during react re-renders occurs before we yield back to the browser.
let shouldStopPropagation = (0, $7mdmh$flushSync)(()=>triggerPressStart(e, state.pointerType));
if (shouldStopPropagation) e.stopPropagation();
if (preventFocusOnPress) {
let dispose = (0, $8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
if (dispose) state.disposables.push(dispose);
}
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'mouseup', onMouseUp, false);
};
pressProps.onMouseEnter = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart(e, state.pointerType);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseLeave = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let shouldStopPropagation = true;
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
cancelOnPointerExit(e);
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onMouseUp = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || 'mouse');
};
let onMouseUp = (e)=>{
// Only handle left clicks
if (e.button !== 0) return;
if (state.ignoreEmulatedMouseEvents) {
state.ignoreEmulatedMouseEvents = false;
return;
}
if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
else cancel(e);
state.isOverTarget = false;
};
pressProps.onTouchStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
if (!touch) return;
state.activePointerId = touch.identifier;
state.ignoreEmulatedMouseEvents = true;
state.isOverTarget = true;
state.isPressed = true;
state.target = e.currentTarget;
state.pointerType = 'touch';
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
if (shouldStopPropagation) e.stopPropagation();
addGlobalListener((0, $7mdmh$getOwnerWindow)(e.currentTarget), 'scroll', onScroll, true);
};
pressProps.onTouchMove = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
if (!state.isOverTarget && state.pointerType != null) {
state.isOverTarget = true;
shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
}
} else if (state.isOverTarget && state.pointerType != null) {
state.isOverTarget = false;
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
cancelOnPointerExit($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
}
if (shouldStopPropagation) e.stopPropagation();
};
pressProps.onTouchEnd = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
if (!state.isPressed) {
e.stopPropagation();
return;
}
let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
let shouldStopPropagation = true;
if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget) && state.pointerType != null) {
triggerPressUp($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
triggerSyntheticClick(e.nativeEvent, state.target);
} else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
if (shouldStopPropagation) e.stopPropagation();
state.isPressed = false;
state.activePointerId = null;
state.isOverTarget = false;
state.ignoreEmulatedMouseEvents = true;
if (state.target && !allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
removeAllGlobalListeners();
};
pressProps.onTouchCancel = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
e.stopPropagation();
if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
};
let onScroll = (e)=>{
if (state.isPressed && (0, $7mdmh$nodeContains)((0, $7mdmh$getEventTarget)(e), state.target)) cancel({
currentTarget: state.target,
shiftKey: false,
ctrlKey: false,
metaKey: false,
altKey: false
});
};
pressProps.onDragStart = (e)=>{
if (!(0, $7mdmh$nodeContains)(e.currentTarget, (0, $7mdmh$getEventTarget)(e.nativeEvent))) return;
cancel(e);
};
}
return pressProps;
}, [
addGlobalListener,
isDisabled,
preventFocusOnPress,
removeAllGlobalListeners,
allowTextSelectionOnPress,
cancel,
cancelOnPointerExit,
triggerPressEnd,
triggerPressStart,
triggerPressUp,
triggerClick,
triggerSyntheticClick
]);
// Avoid onClick delay for double tap to zoom by default.
(0, $7mdmh$useEffect)(()=>{
if (!domRef || process.env.NODE_ENV === 'test') return;
const ownerDocument = (0, $7mdmh$getOwnerDocument)(domRef.current);
if (!ownerDocument || !ownerDocument.head || ownerDocument.getElementById($f6c31cce2adf654f$var$STYLE_ID)) return;
const style = ownerDocument.createElement('style');
style.id = $f6c31cce2adf654f$var$STYLE_ID;
// touchAction: 'manipulation' is supposed to be equivalent, but in
// Safari it causes onPointerCancel not to fire on scroll.
// https://bugs.webkit.org/show_bug.cgi?id=240917
style.textContent = `
@layer {
[${$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE}] {
touch-action: pan-x pan-y pinch-zoom;
}
}
`.trim();
ownerDocument.head.prepend(style);
}, [
domRef
]);
// Remove user-select: none in case component unmounts immediately after pressStart
(0, $7mdmh$useEffect)(()=>{
let state = ref.current;
return ()=>{
var _state_target;
if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)((_state_target = state.target) !== null && _state_target !== void 0 ? _state_target : undefined);
for (let dispose of state.disposables)dispose();
state.disposables = [];
};
}, [
allowTextSelectionOnPress
]);
return {
isPressed: isPressedProp || isPressed,
pressProps: (0, $7mdmh$mergeProps)(domProps, pressProps, {
[$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE]: true
})
};
}
function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
return target.tagName === 'A' && target.hasAttribute('href');
}
function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
const { key: key, code: code } = event;
const element = currentTarget;
const role = element.getAttribute('role');
// Accessibility for keyboards. Space and Enter only.
// "Spacebar" is for IE 11
return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && !(element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof (0, $7mdmh$getOwnerWindow)(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key
!((role === 'link' || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element)) && key !== 'Enter');
}
function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
const { targetTouches: targetTouches } = event;
if (targetTouches.length > 0) return targetTouches[0];
return null;
}
function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
const changedTouches = event.changedTouches;
for(let i = 0; i < changedTouches.length; i++){
const touch = changedTouches[i];
if (touch.identifier === pointerId) return touch;
}
return null;
}
function $f6c31cce2adf654f$var$createTouchEvent(target, e) {
let clientX = 0;
let clientY = 0;
if (e.targetTouches && e.targetTouches.length === 1) {
clientX = e.targetTouches[0].clientX;
clientY = e.targetTouches[0].clientY;
}
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$createEvent(target, e) {
let clientX = e.clientX;
let clientY = e.clientY;
return {
currentTarget: target,
shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
altKey: e.altKey,
clientX: clientX,
clientY: clientY
};
}
function $f6c31cce2adf654f$var$getPointClientRect(point) {
let offsetX = 0;
let offsetY = 0;
if (point.width !== undefined) offsetX = point.width / 2;
else if (point.radiusX !== undefined) offsetX = point.radiusX;
if (point.height !== undefined) offsetY = point.height / 2;
else if (point.radiusY !== undefined) offsetY = point.radiusY;
return {
top: point.clientY - offsetY,
right: point.clientX + offsetX,
bottom: point.clientY + offsetY,
left: point.clientX - offsetX
};
}
function $f6c31cce2adf654f$var$areRectanglesOverlapping(a, b) {
// check if they cannot overlap on x axis
if (a.left > b.right || b.left > a.right) return false;
// check if they cannot overlap on y axis
if (a.top > b.bottom || b.top > a.bottom) return false;
return true;
}
function $f6c31cce2adf654f$var$isOverTarget(point, target) {
let rect = target.getBoundingClientRect();
let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
}
function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) {
if (target instanceof HTMLInputElement) return false;
if (target instanceof HTMLButtonElement) return target.type !== 'submit' && target.type !== 'reset';
if ($f6c31cce2adf654f$var$isHTMLAnchorLink(target)) return false;
return true;
}
function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
if (target instanceof HTMLInputElement) return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
return $f6c31cce2adf654f$var$shouldPreventDefaultUp(target);
}
const $f6c31cce2adf654f$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
// Only space should toggle checkboxes and radios, not enter.
return target.type === 'checkbox' || target.type === 'radio' ? key === ' ' : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
}
export {$f6c31cce2adf654f$export$45712eceda6fad21 as usePress};
//# sourceMappingURL=usePress.module.js.map
@@ -0,0 +1,20 @@
{
"versions": [
{
"version": "*",
"target": {
"node": "all"
},
"response": {
"type": "time-permitting"
},
"backing": {
"npm-funding": true,
"donations": [
"https://github.com/ljharb",
"https://tidelift.com/funding/github/npm/object-inspect"
]
}
}
]
}
@@ -0,0 +1,3 @@
# @react-aria/dialog
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1 @@
{"name":"json-buffer","version":"3.0.1","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532125219,"integrity":"sha512-VborShhSQLyokytjc0AYoOxxONy3N4qfrsB7xjrTAtUTxL1XGQORQSHPDHxkDOaN1PO6usyWedntxaTJ6uQ8/w==","mode":420,"size":878},".travis.yml":{"checkedAt":1794532125219,"integrity":"sha512-/Pm6C1Wjtqv7QM5k5N/+D7VYqrQ7aq/ivAZQA1On7+Vx8WvUNdRSyXPkiWy92WGKwOHTAkSJTF36hDn+6w4YKw==","mode":420,"size":38},"index.js":{"checkedAt":1794532125219,"integrity":"sha512-2xshMdV374F7vtH4ti1tHSIfAXQ7KvGqbWNxD/rpiRQip7RtFBQlcOmmpBvBjXi52MEBP49rUUfRL50bYvuKIA==","mode":420,"size":1504},"LICENSE":{"checkedAt":1794532125219,"integrity":"sha512-qm3bFL/jeaPb+QhmG/ii2H51/Dh9d8VKrSpbf6iljULKI36QUs1WT1ZlDjMPs9GTMoQTwSl21123NsNjW2FCdw==","mode":420,"size":1071},"README.md":{"checkedAt":1794532125219,"integrity":"sha512-bV0BbStmSMscBBCmkGhHFCu310lQWVJ4DQewK7O/NIjetm5m5xBP4jhbqtQ3XX7kQn1SS6XbkK9p0/Yc6063Fg==","mode":420,"size":659},"test/index.js":{"checkedAt":1794532125220,"integrity":"sha512-yuiHs7/Nx9DL+b0MaTWxNR37eHF/9JAUzsCxQIBWc64TwOhnWEjpR89y0BQf+nYju9921SgpUZ8kBRC42yCUew==","mode":420,"size":1254}}}
@@ -0,0 +1,339 @@
/*!
Copyright (c) Peculiar Ventures, LLC
*/
function getUTCDate(date) {
return new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
}
function getParametersValue(parameters, name, defaultValue) {
var _a;
if ((parameters instanceof Object) === false) {
return defaultValue;
}
return (_a = parameters[name]) !== null && _a !== void 0 ? _a : defaultValue;
}
function bufferToHexCodes(inputBuffer, inputOffset = 0, inputLength = (inputBuffer.byteLength - inputOffset), insertSpace = false) {
let result = "";
for (const item of (new Uint8Array(inputBuffer, inputOffset, inputLength))) {
const str = item.toString(16).toUpperCase();
if (str.length === 1) {
result += "0";
}
result += str;
if (insertSpace) {
result += " ";
}
}
return result.trim();
}
function checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) {
if (!(inputBuffer instanceof ArrayBuffer)) {
baseBlock.error = "Wrong parameter: inputBuffer must be \"ArrayBuffer\"";
return false;
}
if (!inputBuffer.byteLength) {
baseBlock.error = "Wrong parameter: inputBuffer has zero length";
return false;
}
if (inputOffset < 0) {
baseBlock.error = "Wrong parameter: inputOffset less than zero";
return false;
}
if (inputLength < 0) {
baseBlock.error = "Wrong parameter: inputLength less than zero";
return false;
}
if ((inputBuffer.byteLength - inputOffset - inputLength) < 0) {
baseBlock.error = "End of input reached before message was fully decoded (inconsistent offset and length values)";
return false;
}
return true;
}
function utilFromBase(inputBuffer, inputBase) {
let result = 0;
if (inputBuffer.length === 1) {
return inputBuffer[0];
}
for (let i = (inputBuffer.length - 1); i >= 0; i--) {
result += inputBuffer[(inputBuffer.length - 1) - i] * Math.pow(2, inputBase * i);
}
return result;
}
function utilToBase(value, base, reserved = (-1)) {
const internalReserved = reserved;
let internalValue = value;
let result = 0;
let biggest = Math.pow(2, base);
for (let i = 1; i < 8; i++) {
if (value < biggest) {
let retBuf;
if (internalReserved < 0) {
retBuf = new ArrayBuffer(i);
result = i;
}
else {
if (internalReserved < i) {
return (new ArrayBuffer(0));
}
retBuf = new ArrayBuffer(internalReserved);
result = internalReserved;
}
const retView = new Uint8Array(retBuf);
for (let j = (i - 1); j >= 0; j--) {
const basis = Math.pow(2, j * base);
retView[result - j - 1] = Math.floor(internalValue / basis);
internalValue -= (retView[result - j - 1]) * basis;
}
return retBuf;
}
biggest *= Math.pow(2, base);
}
return new ArrayBuffer(0);
}
function utilConcatBuf(...buffers) {
let outputLength = 0;
let prevLength = 0;
for (const buffer of buffers) {
outputLength += buffer.byteLength;
}
const retBuf = new ArrayBuffer(outputLength);
const retView = new Uint8Array(retBuf);
for (const buffer of buffers) {
retView.set(new Uint8Array(buffer), prevLength);
prevLength += buffer.byteLength;
}
return retBuf;
}
function utilConcatView(...views) {
let outputLength = 0;
let prevLength = 0;
for (const view of views) {
outputLength += view.length;
}
const retBuf = new ArrayBuffer(outputLength);
const retView = new Uint8Array(retBuf);
for (const view of views) {
retView.set(view, prevLength);
prevLength += view.length;
}
return retView;
}
function utilDecodeTC() {
const buf = new Uint8Array(this.valueHex);
if (this.valueHex.byteLength >= 2) {
const condition1 = (buf[0] === 0xFF) && (buf[1] & 0x80);
const condition2 = (buf[0] === 0x00) && ((buf[1] & 0x80) === 0x00);
if (condition1 || condition2) {
this.warnings.push("Needlessly long format");
}
}
const bigIntBuffer = new ArrayBuffer(this.valueHex.byteLength);
const bigIntView = new Uint8Array(bigIntBuffer);
for (let i = 0; i < this.valueHex.byteLength; i++) {
bigIntView[i] = 0;
}
bigIntView[0] = (buf[0] & 0x80);
const bigInt = utilFromBase(bigIntView, 8);
const smallIntBuffer = new ArrayBuffer(this.valueHex.byteLength);
const smallIntView = new Uint8Array(smallIntBuffer);
for (let j = 0; j < this.valueHex.byteLength; j++) {
smallIntView[j] = buf[j];
}
smallIntView[0] &= 0x7F;
const smallInt = utilFromBase(smallIntView, 8);
return (smallInt - bigInt);
}
function utilEncodeTC(value) {
const modValue = (value < 0) ? (value * (-1)) : value;
let bigInt = 128;
for (let i = 1; i < 8; i++) {
if (modValue <= bigInt) {
if (value < 0) {
const smallInt = bigInt - modValue;
const retBuf = utilToBase(smallInt, 8, i);
const retView = new Uint8Array(retBuf);
retView[0] |= 0x80;
return retBuf;
}
let retBuf = utilToBase(modValue, 8, i);
let retView = new Uint8Array(retBuf);
if (retView[0] & 0x80) {
const tempBuf = retBuf.slice(0);
const tempView = new Uint8Array(tempBuf);
retBuf = new ArrayBuffer(retBuf.byteLength + 1);
retView = new Uint8Array(retBuf);
for (let k = 0; k < tempBuf.byteLength; k++) {
retView[k + 1] = tempView[k];
}
retView[0] = 0x00;
}
return retBuf;
}
bigInt *= Math.pow(2, 8);
}
return (new ArrayBuffer(0));
}
function isEqualBuffer(inputBuffer1, inputBuffer2) {
if (inputBuffer1.byteLength !== inputBuffer2.byteLength) {
return false;
}
const view1 = new Uint8Array(inputBuffer1);
const view2 = new Uint8Array(inputBuffer2);
for (let i = 0; i < view1.length; i++) {
if (view1[i] !== view2[i]) {
return false;
}
}
return true;
}
function padNumber(inputNumber, fullLength) {
const str = inputNumber.toString(10);
if (fullLength < str.length) {
return "";
}
const dif = fullLength - str.length;
const padding = new Array(dif);
for (let i = 0; i < dif; i++) {
padding[i] = "0";
}
const paddingString = padding.join("");
return paddingString.concat(str);
}
const base64Template = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
const base64UrlTemplate = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";
function toBase64(input, useUrlTemplate = false, skipPadding = false, skipLeadingZeros = false) {
let i = 0;
let flag1 = 0;
let flag2 = 0;
let output = "";
const template = (useUrlTemplate) ? base64UrlTemplate : base64Template;
if (skipLeadingZeros) {
let nonZeroPosition = 0;
for (let i = 0; i < input.length; i++) {
if (input.charCodeAt(i) !== 0) {
nonZeroPosition = i;
break;
}
}
input = input.slice(nonZeroPosition);
}
while (i < input.length) {
const chr1 = input.charCodeAt(i++);
if (i >= input.length) {
flag1 = 1;
}
const chr2 = input.charCodeAt(i++);
if (i >= input.length) {
flag2 = 1;
}
const chr3 = input.charCodeAt(i++);
const enc1 = chr1 >> 2;
const enc2 = ((chr1 & 0x03) << 4) | (chr2 >> 4);
let enc3 = ((chr2 & 0x0F) << 2) | (chr3 >> 6);
let enc4 = chr3 & 0x3F;
if (flag1 === 1) {
enc3 = enc4 = 64;
}
else {
if (flag2 === 1) {
enc4 = 64;
}
}
if (skipPadding) {
if (enc3 === 64) {
output += `${template.charAt(enc1)}${template.charAt(enc2)}`;
}
else {
if (enc4 === 64) {
output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}`;
}
else {
output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`;
}
}
}
else {
output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`;
}
}
return output;
}
function fromBase64(input, useUrlTemplate = false, cutTailZeros = false) {
const template = (useUrlTemplate) ? base64UrlTemplate : base64Template;
function indexOf(toSearch) {
for (let i = 0; i < 64; i++) {
if (template.charAt(i) === toSearch)
return i;
}
return 64;
}
function test(incoming) {
return ((incoming === 64) ? 0x00 : incoming);
}
let i = 0;
let output = "";
while (i < input.length) {
const enc1 = indexOf(input.charAt(i++));
const enc2 = (i >= input.length) ? 0x00 : indexOf(input.charAt(i++));
const enc3 = (i >= input.length) ? 0x00 : indexOf(input.charAt(i++));
const enc4 = (i >= input.length) ? 0x00 : indexOf(input.charAt(i++));
const chr1 = (test(enc1) << 2) | (test(enc2) >> 4);
const chr2 = ((test(enc2) & 0x0F) << 4) | (test(enc3) >> 2);
const chr3 = ((test(enc3) & 0x03) << 6) | test(enc4);
output += String.fromCharCode(chr1);
if (enc3 !== 64) {
output += String.fromCharCode(chr2);
}
if (enc4 !== 64) {
output += String.fromCharCode(chr3);
}
}
if (cutTailZeros) {
const outputLength = output.length;
let nonZeroStart = (-1);
for (let i = (outputLength - 1); i >= 0; i--) {
if (output.charCodeAt(i) !== 0) {
nonZeroStart = i;
break;
}
}
if (nonZeroStart !== (-1)) {
output = output.slice(0, nonZeroStart + 1);
}
else {
output = "";
}
}
return output;
}
function arrayBufferToString(buffer) {
let resultString = "";
const view = new Uint8Array(buffer);
for (const element of view) {
resultString += String.fromCharCode(element);
}
return resultString;
}
function stringToArrayBuffer(str) {
const stringLength = str.length;
const resultBuffer = new ArrayBuffer(stringLength);
const resultView = new Uint8Array(resultBuffer);
for (let i = 0; i < stringLength; i++) {
resultView[i] = str.charCodeAt(i);
}
return resultBuffer;
}
const log2 = Math.log(2);
function nearestPowerOf2(length) {
const base = (Math.log(length) / log2);
const floor = Math.floor(base);
const round = Math.round(base);
return ((floor === round) ? floor : round);
}
function clearProps(object, propsArray) {
for (const prop of propsArray) {
delete object[prop];
}
}
export { arrayBufferToString, bufferToHexCodes, checkBufferParams, clearProps, fromBase64, getParametersValue, getUTCDate, isEqualBuffer, nearestPowerOf2, padNumber, stringToArrayBuffer, toBase64, utilConcatBuf, utilConcatView, utilDecodeTC, utilEncodeTC, utilFromBase, utilToBase };
@@ -0,0 +1,1000 @@
import { inspect } from 'node:util';
import { parseArgs } from './parse-args.js';
// it's a tiny API, just cast it inline, it's fine
//@ts-ignore
import cliui from '@isaacs/cliui';
import { basename } from 'node:path';
const width = Math.min((process && process.stdout && process.stdout.columns) || 80, 80);
// indentation spaces from heading level
const indent = (n) => (n - 1) * 2;
const toEnvKey = (pref, key) => {
return [pref, key.replace(/[^a-zA-Z0-9]+/g, ' ')]
.join(' ')
.trim()
.toUpperCase()
.replace(/ /g, '_');
};
const toEnvVal = (value, delim = '\n') => {
const str = typeof value === 'string' ? value
: typeof value === 'boolean' ?
value ? '1'
: '0'
: typeof value === 'number' ? String(value)
: Array.isArray(value) ?
value.map((v) => toEnvVal(v)).join(delim)
: /* c8 ignore start */ undefined;
if (typeof str !== 'string') {
throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`);
}
/* c8 ignore stop */
return str;
};
const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ?
env ? env.split(delim).map(v => fromEnvVal(v, type, false))
: []
: type === 'string' ? env
: type === 'boolean' ? env === '1'
: +env.trim());
export const isConfigType = (t) => typeof t === 'string' &&
(t === 'string' || t === 'number' || t === 'boolean');
const undefOrType = (v, t) => v === undefined || typeof v === t;
const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t));
const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v);
// print the value type, for error message reporting
const valueType = (v) => typeof v === 'string' ? 'string'
: typeof v === 'boolean' ? 'boolean'
: typeof v === 'number' ? 'number'
: Array.isArray(v) ?
joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]'
: `${v.type}${v.multiple ? '[]' : ''}`;
const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ?
types[0]
: `(${types.join('|')})`;
const isValidValue = (v, type, multi) => {
if (multi) {
if (!Array.isArray(v))
return false;
return !v.some((v) => !isValidValue(v, type, false));
}
if (Array.isArray(v))
return false;
return typeof v === type;
};
export const isConfigOption = (o, type, multi) => !!o &&
typeof o === 'object' &&
isConfigType(o.type) &&
o.type === type &&
undefOrType(o.short, 'string') &&
undefOrType(o.description, 'string') &&
undefOrType(o.hint, 'string') &&
undefOrType(o.validate, 'function') &&
(o.type === 'boolean' ?
o.validOptions === undefined
: undefOrTypeArray(o.validOptions, o.type)) &&
(o.default === undefined || isValidValue(o.default, type, multi)) &&
!!o.multiple === multi;
function num(o = {}) {
const { default: def, validate: val, validOptions, ...rest } = o;
if (def !== undefined && !isValidValue(def, 'number', false)) {
throw new TypeError('invalid default value', {
cause: {
found: def,
wanted: 'number',
},
});
}
if (!undefOrTypeArray(validOptions, 'number')) {
throw new TypeError('invalid validOptions', {
cause: {
found: validOptions,
wanted: 'number[]',
},
});
}
const validate = val ?
val
: undefined;
return {
...rest,
default: def,
validate,
validOptions,
type: 'number',
multiple: false,
};
}
function numList(o = {}) {
const { default: def, validate: val, validOptions, ...rest } = o;
if (def !== undefined && !isValidValue(def, 'number', true)) {
throw new TypeError('invalid default value', {
cause: {
found: def,
wanted: 'number[]',
},
});
}
if (!undefOrTypeArray(validOptions, 'number')) {
throw new TypeError('invalid validOptions', {
cause: {
found: validOptions,
wanted: 'number[]',
},
});
}
const validate = val ?
val
: undefined;
return {
...rest,
default: def,
validate,
validOptions,
type: 'number',
multiple: true,
};
}
function opt(o = {}) {
const { default: def, validate: val, validOptions, ...rest } = o;
if (def !== undefined && !isValidValue(def, 'string', false)) {
throw new TypeError('invalid default value', {
cause: {
found: def,
wanted: 'string',
},
});
}
if (!undefOrTypeArray(validOptions, 'string')) {
throw new TypeError('invalid validOptions', {
cause: {
found: validOptions,
wanted: 'string[]',
},
});
}
const validate = val ?
val
: undefined;
return {
...rest,
default: def,
validate,
validOptions,
type: 'string',
multiple: false,
};
}
function optList(o = {}) {
const { default: def, validate: val, validOptions, ...rest } = o;
if (def !== undefined && !isValidValue(def, 'string', true)) {
throw new TypeError('invalid default value', {
cause: {
found: def,
wanted: 'string[]',
},
});
}
if (!undefOrTypeArray(validOptions, 'string')) {
throw new TypeError('invalid validOptions', {
cause: {
found: validOptions,
wanted: 'string[]',
},
});
}
const validate = val ?
val
: undefined;
return {
...rest,
default: def,
validate,
validOptions,
type: 'string',
multiple: true,
};
}
function flag(o = {}) {
const { hint, default: def, validate: val, ...rest } = o;
delete rest.validOptions;
if (def !== undefined && !isValidValue(def, 'boolean', false)) {
throw new TypeError('invalid default value');
}
const validate = val ?
val
: undefined;
if (hint !== undefined) {
throw new TypeError('cannot provide hint for flag');
}
return {
...rest,
default: def,
validate,
type: 'boolean',
multiple: false,
};
}
function flagList(o = {}) {
const { hint, default: def, validate: val, ...rest } = o;
delete rest.validOptions;
if (def !== undefined && !isValidValue(def, 'boolean', true)) {
throw new TypeError('invalid default value');
}
const validate = val ?
val
: undefined;
if (hint !== undefined) {
throw new TypeError('cannot provide hint for flag list');
}
return {
...rest,
default: def,
validate,
type: 'boolean',
multiple: true,
};
}
const toParseArgsOptionsConfig = (options) => {
const c = {};
for (const longOption in options) {
const config = options[longOption];
/* c8 ignore start */
if (!config) {
throw new Error('config must be an object: ' + longOption);
}
/* c8 ignore start */
if (isConfigOption(config, 'number', true)) {
c[longOption] = {
type: 'string',
multiple: true,
default: config.default?.map(c => String(c)),
};
}
else if (isConfigOption(config, 'number', false)) {
c[longOption] = {
type: 'string',
multiple: false,
default: config.default === undefined ?
undefined
: String(config.default),
};
}
else {
const conf = config;
c[longOption] = {
type: conf.type,
multiple: !!conf.multiple,
default: conf.default,
};
}
const clo = c[longOption];
if (typeof config.short === 'string') {
clo.short = config.short;
}
if (config.type === 'boolean' &&
!longOption.startsWith('no-') &&
!options[`no-${longOption}`]) {
c[`no-${longOption}`] = {
type: 'boolean',
multiple: config.multiple,
};
}
}
return c;
};
const isHeading = (r) => r.type === 'heading';
const isDescription = (r) => r.type === 'description';
/**
* Class returned by the {@link jack} function and all configuration
* definition methods. This is what gets chained together.
*/
export class Jack {
#configSet;
#shorts;
#options;
#fields = [];
#env;
#envPrefix;
#allowPositionals;
#usage;
#usageMarkdown;
constructor(options = {}) {
this.#options = options;
this.#allowPositionals = options.allowPositionals !== false;
this.#env =
this.#options.env === undefined ? process.env : this.#options.env;
this.#envPrefix = options.envPrefix;
// We need to fib a little, because it's always the same object, but it
// starts out as having an empty config set. Then each method that adds
// fields returns `this as Jack<C & { ...newConfigs }>`
this.#configSet = Object.create(null);
this.#shorts = Object.create(null);
}
/**
* Set the default value (which will still be overridden by env or cli)
* as if from a parsed config file. The optional `source` param, if
* provided, will be included in error messages if a value is invalid or
* unknown.
*/
setConfigValues(values, source = '') {
try {
this.validate(values);
}
catch (er) {
const e = er;
if (source && e && typeof e === 'object') {
if (e.cause && typeof e.cause === 'object') {
Object.assign(e.cause, { path: source });
}
else {
e.cause = { path: source };
}
}
throw e;
}
for (const [field, value] of Object.entries(values)) {
const my = this.#configSet[field];
// already validated, just for TS's benefit
/* c8 ignore start */
if (!my) {
throw new Error('unexpected field in config set: ' + field, {
cause: { found: field },
});
}
/* c8 ignore stop */
my.default = value;
}
return this;
}
/**
* Parse a string of arguments, and return the resulting
* `{ values, positionals }` object.
*
* If an {@link JackOptions#envPrefix} is set, then it will read default
* values from the environment, and write the resulting values back
* to the environment as well.
*
* Environment values always take precedence over any other value, except
* an explicit CLI setting.
*/
parse(args = process.argv) {
this.loadEnvDefaults();
const p = this.parseRaw(args);
this.applyDefaults(p);
this.writeEnv(p);
return p;
}
loadEnvDefaults() {
if (this.#envPrefix) {
for (const [field, my] of Object.entries(this.#configSet)) {
const ek = toEnvKey(this.#envPrefix, field);
const env = this.#env[ek];
if (env !== undefined) {
my.default = fromEnvVal(env, my.type, !!my.multiple, my.delim);
}
}
}
}
applyDefaults(p) {
for (const [field, c] of Object.entries(this.#configSet)) {
if (c.default !== undefined && !(field in p.values)) {
//@ts-ignore
p.values[field] = c.default;
}
}
}
/**
* Only parse the command line arguments passed in.
* Does not strip off the `node script.js` bits, so it must be just the
* arguments you wish to have parsed.
* Does not read from or write to the environment, or set defaults.
*/
parseRaw(args) {
if (args === process.argv) {
args = args.slice(process._eval !== undefined ? 1 : 2);
}
const options = toParseArgsOptionsConfig(this.#configSet);
const result = parseArgs({
args,
options,
// always strict, but using our own logic
strict: false,
allowPositionals: this.#allowPositionals,
tokens: true,
});
const p = {
values: {},
positionals: [],
};
for (const token of result.tokens) {
if (token.kind === 'positional') {
p.positionals.push(token.value);
if (this.#options.stopAtPositional ||
this.#options.stopAtPositionalTest?.(token.value)) {
p.positionals.push(...args.slice(token.index + 1));
break;
}
}
else if (token.kind === 'option') {
let value = undefined;
if (token.name.startsWith('no-')) {
const my = this.#configSet[token.name];
const pname = token.name.substring('no-'.length);
const pos = this.#configSet[pname];
if (pos &&
pos.type === 'boolean' &&
(!my ||
(my.type === 'boolean' && !!my.multiple === !!pos.multiple))) {
value = false;
token.name = pname;
}
}
const my = this.#configSet[token.name];
if (!my) {
throw new Error(`Unknown option '${token.rawName}'. ` +
`To specify a positional argument starting with a '-', ` +
`place it at the end of the command after '--', as in ` +
`'-- ${token.rawName}'`, {
cause: {
found: token.rawName + (token.value ? `=${token.value}` : ''),
},
});
}
if (value === undefined) {
if (token.value === undefined) {
if (my.type !== 'boolean') {
throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, {
cause: {
name: token.rawName,
wanted: valueType(my),
},
});
}
value = true;
}
else {
if (my.type === 'boolean') {
throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } });
}
if (my.type === 'string') {
value = token.value;
}
else {
value = +token.value;
if (value !== value) {
throw new Error(`Invalid value '${token.value}' provided for ` +
`'${token.rawName}' option, expected number`, {
cause: {
name: token.rawName,
found: token.value,
wanted: 'number',
},
});
}
}
}
}
if (my.multiple) {
const pv = p.values;
const tn = pv[token.name] ?? [];
pv[token.name] = tn;
tn.push(value);
}
else {
const pv = p.values;
pv[token.name] = value;
}
}
}
for (const [field, value] of Object.entries(p.values)) {
const valid = this.#configSet[field]?.validate;
const validOptions = this.#configSet[field]?.validOptions;
let cause;
if (validOptions && !isValidOption(value, validOptions)) {
cause = { name: field, found: value, validOptions: validOptions };
}
if (valid && !valid(value)) {
cause = cause || { name: field, found: value };
}
if (cause) {
throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause });
}
}
return p;
}
/**
* do not set fields as 'no-foo' if 'foo' exists and both are bools
* just set foo.
*/
#noNoFields(f, val, s = f) {
if (!f.startsWith('no-') || typeof val !== 'boolean')
return;
const yes = f.substring('no-'.length);
// recurse so we get the core config key we care about.
this.#noNoFields(yes, val, s);
if (this.#configSet[yes]?.type === 'boolean') {
throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } });
}
}
/**
* Validate that any arbitrary object is a valid configuration `values`
* object. Useful when loading config files or other sources.
*/
validate(o) {
if (!o || typeof o !== 'object') {
throw new Error('Invalid config: not an object', {
cause: { found: o },
});
}
const opts = o;
for (const field in o) {
const value = opts[field];
/* c8 ignore next - for TS */
if (value === undefined)
continue;
this.#noNoFields(field, value);
const config = this.#configSet[field];
if (!config) {
throw new Error(`Unknown config option: ${field}`, {
cause: { found: field },
});
}
if (!isValidValue(value, config.type, !!config.multiple)) {
throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, {
cause: {
name: field,
found: value,
wanted: valueType(config),
},
});
}
let cause;
if (config.validOptions &&
!isValidOption(value, config.validOptions)) {
cause = {
name: field,
found: value,
validOptions: config.validOptions,
};
}
if (config.validate && !config.validate(value)) {
cause = cause || { name: field, found: value };
}
if (cause) {
throw new Error(`Invalid config value for ${field}: ${value}`, {
cause,
});
}
}
}
writeEnv(p) {
if (!this.#env || !this.#envPrefix)
return;
for (const [field, value] of Object.entries(p.values)) {
const my = this.#configSet[field];
this.#env[toEnvKey(this.#envPrefix, field)] = toEnvVal(value, my?.delim);
}
}
/**
* Add a heading to the usage output banner
*/
heading(text, level, { pre = false } = {}) {
if (level === undefined) {
level = this.#fields.some(r => isHeading(r)) ? 2 : 1;
}
this.#fields.push({ type: 'heading', text, level, pre });
return this;
}
/**
* Add a long-form description to the usage output at this position.
*/
description(text, { pre } = {}) {
this.#fields.push({ type: 'description', text, pre });
return this;
}
/**
* Add one or more number fields.
*/
num(fields) {
return this.#addFields(fields, num);
}
/**
* Add one or more multiple number fields.
*/
numList(fields) {
return this.#addFields(fields, numList);
}
/**
* Add one or more string option fields.
*/
opt(fields) {
return this.#addFields(fields, opt);
}
/**
* Add one or more multiple string option fields.
*/
optList(fields) {
return this.#addFields(fields, optList);
}
/**
* Add one or more flag fields.
*/
flag(fields) {
return this.#addFields(fields, flag);
}
/**
* Add one or more multiple flag fields.
*/
flagList(fields) {
return this.#addFields(fields, flagList);
}
/**
* Generic field definition method. Similar to flag/flagList/number/etc,
* but you must specify the `type` (and optionally `multiple` and `delim`)
* fields on each one, or Jack won't know how to define them.
*/
addFields(fields) {
const next = this;
for (const [name, field] of Object.entries(fields)) {
this.#validateName(name, field);
next.#fields.push({
type: 'config',
name,
value: field,
});
}
Object.assign(next.#configSet, fields);
return next;
}
#addFields(fields, fn) {
const next = this;
Object.assign(next.#configSet, Object.fromEntries(Object.entries(fields).map(([name, field]) => {
this.#validateName(name, field);
const option = fn(field);
next.#fields.push({
type: 'config',
name,
value: option,
});
return [name, option];
})));
return next;
}
#validateName(name, field) {
if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(name)) {
throw new TypeError(`Invalid option name: ${name}, ` +
`must be '-' delimited ASCII alphanumeric`);
}
if (this.#configSet[name]) {
throw new TypeError(`Cannot redefine option ${field}`);
}
if (this.#shorts[name]) {
throw new TypeError(`Cannot redefine option ${name}, already ` +
`in use for ${this.#shorts[name]}`);
}
if (field.short) {
if (!/^[a-zA-Z0-9]$/.test(field.short)) {
throw new TypeError(`Invalid ${name} short option: ${field.short}, ` +
'must be 1 ASCII alphanumeric character');
}
if (this.#shorts[field.short]) {
throw new TypeError(`Invalid ${name} short option: ${field.short}, ` +
`already in use for ${this.#shorts[field.short]}`);
}
this.#shorts[field.short] = name;
this.#shorts[name] = name;
}
}
/**
* Return the usage banner for the given configuration
*/
usage() {
if (this.#usage)
return this.#usage;
let headingLevel = 1;
const ui = cliui({ width });
const first = this.#fields[0];
let start = first?.type === 'heading' ? 1 : 0;
if (first?.type === 'heading') {
ui.div({
padding: [0, 0, 0, 0],
text: normalize(first.text),
});
}
ui.div({ padding: [0, 0, 0, 0], text: 'Usage:' });
if (this.#options.usage) {
ui.div({
text: this.#options.usage,
padding: [0, 0, 0, 2],
});
}
else {
const cmd = basename(String(process.argv[1]));
const shortFlags = [];
const shorts = [];
const flags = [];
const opts = [];
for (const [field, config] of Object.entries(this.#configSet)) {
if (config.short) {
if (config.type === 'boolean')
shortFlags.push(config.short);
else
shorts.push([config.short, config.hint || field]);
}
else {
if (config.type === 'boolean')
flags.push(field);
else
opts.push([field, config.hint || field]);
}
}
const sf = shortFlags.length ? ' -' + shortFlags.join('') : '';
const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('');
const lf = flags.map(k => ` --${k}`).join('');
const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('');
const usage = `${cmd}${sf}${so}${lf}${lo}`.trim();
ui.div({
text: usage,
padding: [0, 0, 0, 2],
});
}
ui.div({ padding: [0, 0, 0, 0], text: '' });
const maybeDesc = this.#fields[start];
if (maybeDesc && isDescription(maybeDesc)) {
const print = normalize(maybeDesc.text, maybeDesc.pre);
start++;
ui.div({ padding: [0, 0, 0, 0], text: print });
ui.div({ padding: [0, 0, 0, 0], text: '' });
}
const { rows, maxWidth } = this.#usageRows(start);
// every heading/description after the first gets indented by 2
// extra spaces.
for (const row of rows) {
if (row.left) {
// If the row is too long, don't wrap it
// Bump the right-hand side down a line to make room
const configIndent = indent(Math.max(headingLevel, 2));
if (row.left.length > maxWidth - 3) {
ui.div({ text: row.left, padding: [0, 0, 0, configIndent] });
ui.div({ text: row.text, padding: [0, 0, 0, maxWidth] });
}
else {
ui.div({
text: row.left,
padding: [0, 1, 0, configIndent],
width: maxWidth,
}, { padding: [0, 0, 0, 0], text: row.text });
}
if (row.skipLine) {
ui.div({ padding: [0, 0, 0, 0], text: '' });
}
}
else {
if (isHeading(row)) {
const { level } = row;
headingLevel = level;
// only h1 and h2 have bottom padding
// h3-h6 do not
const b = level <= 2 ? 1 : 0;
ui.div({ ...row, padding: [0, 0, b, indent(level)] });
}
else {
ui.div({ ...row, padding: [0, 0, 1, indent(headingLevel + 1)] });
}
}
}
return (this.#usage = ui.toString());
}
/**
* Return the usage banner markdown for the given configuration
*/
usageMarkdown() {
if (this.#usageMarkdown)
return this.#usageMarkdown;
const out = [];
let headingLevel = 1;
const first = this.#fields[0];
let start = first?.type === 'heading' ? 1 : 0;
if (first?.type === 'heading') {
out.push(`# ${normalizeOneLine(first.text)}`);
}
out.push('Usage:');
if (this.#options.usage) {
out.push(normalizeMarkdown(this.#options.usage, true));
}
else {
const cmd = basename(String(process.argv[1]));
const shortFlags = [];
const shorts = [];
const flags = [];
const opts = [];
for (const [field, config] of Object.entries(this.#configSet)) {
if (config.short) {
if (config.type === 'boolean')
shortFlags.push(config.short);
else
shorts.push([config.short, config.hint || field]);
}
else {
if (config.type === 'boolean')
flags.push(field);
else
opts.push([field, config.hint || field]);
}
}
const sf = shortFlags.length ? ' -' + shortFlags.join('') : '';
const so = shorts.map(([k, v]) => ` --${k}=<${v}>`).join('');
const lf = flags.map(k => ` --${k}`).join('');
const lo = opts.map(([k, v]) => ` --${k}=<${v}>`).join('');
const usage = `${cmd}${sf}${so}${lf}${lo}`.trim();
out.push(normalizeMarkdown(usage, true));
}
const maybeDesc = this.#fields[start];
if (maybeDesc && isDescription(maybeDesc)) {
out.push(normalizeMarkdown(maybeDesc.text, maybeDesc.pre));
start++;
}
const { rows } = this.#usageRows(start);
// heading level in markdown is number of # ahead of text
for (const row of rows) {
if (row.left) {
out.push('#'.repeat(headingLevel + 1) +
' ' +
normalizeOneLine(row.left, true));
if (row.text)
out.push(normalizeMarkdown(row.text));
}
else if (isHeading(row)) {
const { level } = row;
headingLevel = level;
out.push(`${'#'.repeat(headingLevel)} ${normalizeOneLine(row.text, row.pre)}`);
}
else {
out.push(normalizeMarkdown(row.text, !!row.pre));
}
}
return (this.#usageMarkdown = out.join('\n\n') + '\n');
}
#usageRows(start) {
// turn each config type into a row, and figure out the width of the
// left hand indentation for the option descriptions.
let maxMax = Math.max(12, Math.min(26, Math.floor(width / 3)));
let maxWidth = 8;
let prev = undefined;
const rows = [];
for (const field of this.#fields.slice(start)) {
if (field.type !== 'config') {
if (prev?.type === 'config')
prev.skipLine = true;
prev = undefined;
field.text = normalize(field.text, !!field.pre);
rows.push(field);
continue;
}
const { value } = field;
const desc = value.description || '';
const mult = value.multiple ? 'Can be set multiple times' : '';
const opts = value.validOptions?.length ?
`Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}`
: '';
const dmDelim = desc.includes('\n') ? '\n\n' : '\n';
const extra = [opts, mult].join(dmDelim).trim();
const text = (normalize(desc) + dmDelim + extra).trim();
const hint = value.hint ||
(value.type === 'number' ? 'n'
: value.type === 'string' ? field.name
: undefined);
const short = !value.short ? ''
: value.type === 'boolean' ? `-${value.short} `
: `-${value.short}<${hint}> `;
const left = value.type === 'boolean' ?
`${short}--${field.name}`
: `${short}--${field.name}=<${hint}>`;
const row = { text, left, type: 'config' };
if (text.length > width - maxMax) {
row.skipLine = true;
}
if (prev && left.length > maxMax)
prev.skipLine = true;
prev = row;
const len = left.length + 4;
if (len > maxWidth && len < maxMax) {
maxWidth = len;
}
rows.push(row);
}
return { rows, maxWidth };
}
/**
* Return the configuration options as a plain object
*/
toJSON() {
return Object.fromEntries(Object.entries(this.#configSet).map(([field, def]) => [
field,
{
type: def.type,
...(def.multiple ? { multiple: true } : {}),
...(def.delim ? { delim: def.delim } : {}),
...(def.short ? { short: def.short } : {}),
...(def.description ?
{ description: normalize(def.description) }
: {}),
...(def.validate ? { validate: def.validate } : {}),
...(def.validOptions ? { validOptions: def.validOptions } : {}),
...(def.default !== undefined ? { default: def.default } : {}),
...(def.hint ? { hint: def.hint } : {}),
},
]));
}
/**
* Custom printer for `util.inspect`
*/
[inspect.custom](_, options) {
return `Jack ${inspect(this.toJSON(), options)}`;
}
}
// Unwrap and un-indent, so we can wrap description
// strings however makes them look nice in the code.
const normalize = (s, pre = false) => {
if (pre)
// prepend a ZWSP to each line so cliui doesn't strip it.
return s
.split('\n')
.map(l => `\u200b${l}`)
.join('\n');
return s
.split(/^\s*```\s*$/gm)
.map((s, i) => {
if (i % 2 === 1) {
if (!s.trim()) {
return `\`\`\`\n\`\`\`\n`;
}
// outdent the ``` blocks, but preserve whitespace otherwise.
const split = s.split('\n');
// throw out the \n at the start and end
split.pop();
split.shift();
const si = split.reduce((shortest, l) => {
/* c8 ignore next */
const ind = l.match(/^\s*/)?.[0] ?? '';
if (ind.length)
return Math.min(ind.length, shortest);
else
return shortest;
}, Infinity);
/* c8 ignore next */
const i = isFinite(si) ? si : 0;
return ('\n```\n' +
split.map(s => `\u200b${s.substring(i)}`).join('\n') +
'\n```\n');
}
return (s
// remove single line breaks, except for lists
.replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`)
// normalize mid-line whitespace
.replace(/([^\n])[ \t]+([^\n])/g, '$1 $2')
// two line breaks are enough
.replace(/\n{3,}/g, '\n\n')
// remove any spaces at the start of a line
.replace(/\n[ \t]+/g, '\n')
.trim());
})
.join('\n');
};
// normalize for markdown printing, remove leading spaces on lines
const normalizeMarkdown = (s, pre = false) => {
const n = normalize(s, pre).replace(/\\/g, '\\\\');
return pre ?
`\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\``
: n.replace(/\n +/g, '\n').trim();
};
const normalizeOneLine = (s, pre = false) => {
const n = normalize(s, pre)
.replace(/[\s\u200b]+/g, ' ')
.trim();
return pre ? `\`${n}\`` : n;
};
/**
* Main entry point. Create and return a {@link Jack} object.
*/
export const jack = (options = {}) => new Jack(options);
//# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
declare const MailIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { MailIcon };
@@ -0,0 +1,44 @@
"use client";
import {
useSwitch
} from "./chunk-EN4B57RQ.mjs";
// src/switch.tsx
import { cloneElement } from "react";
import { forwardRef } from "@heroui/system";
import { jsx, jsxs } from "react/jsx-runtime";
var Switch = forwardRef((props, ref) => {
const {
Component,
children,
startContent,
endContent,
thumbIcon,
getBaseProps,
getInputProps,
getWrapperProps,
getThumbProps,
getThumbIconProps,
getLabelProps,
getStartContentProps,
getEndContentProps
} = useSwitch({ ...props, ref });
const clonedThumbIcon = typeof thumbIcon === "function" ? thumbIcon(getThumbIconProps({ includeStateProps: true })) : thumbIcon && cloneElement(thumbIcon, getThumbIconProps());
const clonedStartContent = startContent && cloneElement(startContent, getStartContentProps());
const clonedEndContent = endContent && cloneElement(endContent, getEndContentProps());
return /* @__PURE__ */ jsxs(Component, { ...getBaseProps(), children: [
/* @__PURE__ */ jsx("input", { ...getInputProps() }),
/* @__PURE__ */ jsxs("span", { ...getWrapperProps(), children: [
startContent && clonedStartContent,
/* @__PURE__ */ jsx("span", { ...getThumbProps(), children: thumbIcon && clonedThumbIcon }),
endContent && clonedEndContent
] }),
children && /* @__PURE__ */ jsx("span", { ...getLabelProps(), children })
] });
});
Switch.displayName = "HeroUI.Switch";
var switch_default = Switch;
export {
switch_default
};
@@ -0,0 +1 @@
{"version":3,"file":"getDecoratorInfo.d.ts","sourceRoot":"","sources":["../../../../src/decorator/calculations/getDecoratorInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,cAAc,EAAE,MAAM,GACrB,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,UAAU,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,GAC1D,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,aAAa,CAAC;AACjB,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAClC,aAAa,CAAC"}
@@ -0,0 +1,44 @@
{
"name": "mz",
"description": "modernize node.js to current ECMAScript standards",
"version": "2.7.0",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com",
"twitter": "https://twitter.com/jongleberry"
},
"license": "MIT",
"repository": "normalize/mz",
"dependencies": {
"any-promise": "^1.0.0",
"object-assign": "^4.0.1",
"thenify-all": "^1.0.0"
},
"devDependencies": {
"istanbul": "^0.4.0",
"bluebird": "^3.0.0",
"mocha": "^3.0.0"
},
"scripts": {
"test": "mocha --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
},
"keywords": [
"promisify",
"promise",
"thenify",
"then",
"es6"
],
"files": [
"index.js",
"child_process.js",
"crypto.js",
"dns.js",
"fs.js",
"readline.js",
"zlib.js"
]
}
@@ -0,0 +1,39 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.lastIndexOf` method.",
category: "ES5",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-lastindexof.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["lastIndexOf"],
})
},
}
@@ -0,0 +1,114 @@
import {useRef as $6dfIe$useRef, useCallback as $6dfIe$useCallback} from "react";
import {useLayoutEffect as $6dfIe$useLayoutEffect, useEffectEvent as $6dfIe$useEffectEvent} from "@react-aria/utils";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
class $8a9cb279dc87e130$export$905e7fc544a71f36 {
isDefaultPrevented() {
return this.nativeEvent.defaultPrevented;
}
preventDefault() {
this.defaultPrevented = true;
this.nativeEvent.preventDefault();
}
stopPropagation() {
this.nativeEvent.stopPropagation();
this.isPropagationStopped = ()=>true;
}
isPropagationStopped() {
return false;
}
persist() {}
constructor(type, nativeEvent){
this.nativeEvent = nativeEvent;
this.target = nativeEvent.target;
this.currentTarget = nativeEvent.currentTarget;
this.relatedTarget = nativeEvent.relatedTarget;
this.bubbles = nativeEvent.bubbles;
this.cancelable = nativeEvent.cancelable;
this.defaultPrevented = nativeEvent.defaultPrevented;
this.eventPhase = nativeEvent.eventPhase;
this.isTrusted = nativeEvent.isTrusted;
this.timeStamp = nativeEvent.timeStamp;
this.type = type;
}
}
function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
let stateRef = (0, $6dfIe$useRef)({
isFocused: false,
observer: null
});
// Clean up MutationObserver on unmount. See below.
(0, $6dfIe$useLayoutEffect)(()=>{
const state = stateRef.current;
return ()=>{
if (state.observer) {
state.observer.disconnect();
state.observer = null;
}
};
}, []);
let dispatchBlur = (0, $6dfIe$useEffectEvent)((e)=>{
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
});
// This function is called during a React onFocus event.
return (0, $6dfIe$useCallback)((e)=>{
// React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
// Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
// MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
// For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
if (e.target instanceof HTMLButtonElement || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement) {
stateRef.current.isFocused = true;
let target = e.target;
let onBlurHandler = (e)=>{
stateRef.current.isFocused = false;
if (target.disabled) // For backward compatibility, dispatch a (fake) React synthetic event.
dispatchBlur(new $8a9cb279dc87e130$export$905e7fc544a71f36('blur', e));
// We no longer need the MutationObserver once the target is blurred.
if (stateRef.current.observer) {
stateRef.current.observer.disconnect();
stateRef.current.observer = null;
}
};
target.addEventListener('focusout', onBlurHandler, {
once: true
});
stateRef.current.observer = new MutationObserver(()=>{
if (stateRef.current.isFocused && target.disabled) {
var _stateRef_current_observer;
(_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
target.dispatchEvent(new FocusEvent('blur', {
relatedTarget: relatedTargetEl
}));
target.dispatchEvent(new FocusEvent('focusout', {
bubbles: true,
relatedTarget: relatedTargetEl
}));
}
});
stateRef.current.observer.observe(target, {
attributes: true,
attributeFilter: [
'disabled'
]
});
}
}, [
dispatchBlur
]);
}
export {$8a9cb279dc87e130$export$905e7fc544a71f36 as SyntheticFocusEvent, $8a9cb279dc87e130$export$715c682d09d639cc as useSyntheticBlurEvent};
//# sourceMappingURL=utils.module.js.map
@@ -0,0 +1,8 @@
/**
* https://tc39.es/ecma402/#sec-defaultnumberoption
* @param val
* @param min
* @param max
* @param fallback
*/
export declare function DefaultNumberOption<F extends number | undefined>(inputVal: unknown, min: number, max: number, fallback: F): F extends number ? number : number | undefined;
@@ -0,0 +1,18 @@
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
return CryptoJS.enc.Latin1;
}));
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from '../types.js';
import 'react';
declare const SendFilledIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { SendFilledIcon };
@@ -0,0 +1,2 @@
export declare function preDestroy(): MethodDecorator;
//# sourceMappingURL=preDestroy.d.ts.map
@@ -0,0 +1,28 @@
import getTag from './_getTag.js';
import isObjectLike from './isObjectLike.js';
/** `Object#toString` result references. */
var weakMapTag = '[object WeakMap]';
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
export default isWeakMap;
@@ -0,0 +1,85 @@
# PostCSS Nested
<img align="right" width="135" height="95"
title="Philosopher’s stone, logo of PostCSS"
src="https://postcss.org/logo-leftp.svg">
[PostCSS] plugin to unwrap nested rules closer to Sass syntax.
```css
.phone {
&_title {
width: 500px;
@media (max-width: 500px) {
width: auto;
}
body.is_dark & {
color: white;
}
}
img {
display: block;
}
}
.title {
font-size: var(--font);
@at-root html {
--font: 16px;
}
}
```
will be processed to:
```css
.phone_title {
width: 500px;
}
@media (max-width: 500px) {
.phone_title {
width: auto;
}
}
body.is_dark .phone_title {
color: white;
}
.phone img {
display: block;
}
.title {
font-size: var(--font);
}
html {
--font: 16px;
}
```
Related plugins:
- Use [`postcss-current-selector`] **after** this plugin if you want
to use current selector in properties or variables values.
- Use [`postcss-nested-ancestors`] **before** this plugin if you want
to reference any ancestor element directly in your selectors with `^&`.
Alternatives:
- See also [`postcss-nesting`], which implements [CSSWG draft].
- [`postcss-nested-props`] for nested properties like `font-size`.
<a href="https://evilmartians.com/?utm_source=postcss-nested">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
alt="Sponsored by Evil Martians" width="236" height="54">
</a>
[`postcss-current-selector`]: https://github.com/komlev/postcss-current-selector
[`postcss-nested-ancestors`]: https://github.com/toomuchdesign/postcss-nested-ancestors
[`postcss-nested-props`]: https://github.com/jedmao/postcss-nested-props
[`postcss-nesting`]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting
[CSSWG draft]: https://drafts.csswg.org/css-nesting-1/
[PostCSS]: https://github.com/postcss/postcss
## Docs
Read full docs **[here](https://github.com/postcss/postcss-nested#readme)**.
@@ -0,0 +1,7 @@
export = error;
/**
* Logs out a message if there is no format option set.
* @param {string} message - Message to log.
*/
declare function error(message: string): void;
//# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,635 @@
flf2a$ 6 6 30 0 22
Explanation of first line: *** GoofY 0.1 ***
flf2a - necessary stuff to identify the kind of file
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
6 - height of a character, not including descenders
30 - max line length (excluding comment lines) + a fudge factor
0 - put characters together, no smushing or whatever, please!
22 - number of comment lines (starting with the 'Explanation' line)
Written by Steven <GoofY> de Brouwer (Goofsel@dds.nl)
Based on the stupid reaction from people to watch the 'foreground-objects'
first (it's a kind of goofy, isn't it? :)
This font is NOT designed to be used for clear, long text!
Therefore lower-case is equal to UPPER-case!
____ _____ _____ ___ ___ __ _____
/ ) ____) ) ( ) ( \ ___) ( ( ) ) )
( / / __ / (_\ / \ | (__ \ \/ / /
) ( ( ( \ ( ) ( _ ) | __) \ / (
/ \ \__) ) \ / \ ) / | ( ) / )
(______) (____) (_____) (___/ \______/ (______/
*** Use the % for a double-o (oo), and the {} as begin- and end-markers! ***
___@
$$$@
$$$@
$$$@
$$$@
___@@
_$$$$__@
($$$$)$@
$\$$/$$@
$$\/$$$@
$$__$$$@
_($$)__@@
_$$$_$$$__@
($$$)$$$)$@
$)_/$)_/$$@
$$$$$$$$$$@
$$$$$$$$$$@
__________@@
__$$$_$$$___@
$_)$(_)$(_$$@
(_$$$_$$$_)$@
$_)$(_)$(_$$@
(_$$$_$$$_)$@
__)$(_)$(___@@
_$$$$$$$__@
$)$$_$$_)$@
($$(_||$$$@
$\$$_$$\$$@
$_||_)$$)$@
($$$$$$(__@@
__$$$$$_____$$$$$___@
$$)$$$($$$$$)$$$($$$@
$/$$$(_\$$$/$$$$$\$$@
($$$$$$$)$($_$$$$$)$@
$\$$$$$/$$$\$)$$$/$$@
__)$$$(_____)$$$(___@@
__$$$$_____@
$($()$)$$$$@
$$>$$<$$_$$@
$/$/\$\/$)$@
($(__)$$<$$@
_\$$$$<>$)_@@
_$$$__@
($$$)$@
$)_/$$@
$$$$$$@
$$$$$$@
______@@
___$$$_@
$$/$$/$@
$/$$/$$@
($$($$$@
$\$$\$$@
__\$$\_@@
$$$____@
\$$\$$$@
$\$$\$$@
$$)$$)$@
$/$$/$$@
/$$/___@@
___________@
$$$_$$_$$$$@
$_($\/$)_$$@
(__$$$$__)$@
$$(_/\_)$$$@
___________@@
________@
$$$_$$$$@
$_($)_$$@
(__$__)$@
$$(_)$$$@
________@@
_____@
$$$$$@
$$$$$@
$__$$@
($$)$@
($/__@@
______@
$$$$$$@
$___$$@
(___)$@
$$$$$$@
______@@
_____@
$$$$$@
$$$$$@
$$$$$@
$__$$@
($$)_@@
____$$$$_@
$$$$)$$/$@
$$$/$$/$$@
$$/$$/$$$@
$/$$/$$$$@
/$$(_____@@
__$$$___@
$/$$$\$$@
|$$$$$|$@
|$$$$$|$@
|$$$$$|$@
_\$$$/__@@
_$$$$$___@
/_$$$|$$$@
$$|$$|$$$@
$$|$$|$$$@
$_|$$|_$$@
($$$$$$)_@@
__$$$$____@
$/$_$$\$$$@
(_/$)$$)$$@
$$$/$$/$$$@
$$/$$/__$$@
_($$$$$$)_@@
_$$$$___@
(__$$\$$@
$__)$$|$@
(__$$$|$@
$__)$$|$@
($$$$/__@@
___$$$$___@
$$/$$$|$$$@
$/$$$$|_$$@
(__$$$$_)$@
$$_|$$|_$$@
_($$$$$$)_@@
$$$$$$$__@
|$$____)$@
|$|___$$$@
|___$$\$$@
$___)$$)$@
($$$$$/__@@
__$$$$___@
$/$$__)$$@
|$$(__$$$@
|$$$$$\$$@
|$$$$$$)$@
_\$$$$/__@@
$$$$$$$__@
(___$$$)$@
$$$/$$/$$@
$$/$$/$$$@
$/$$/$$$$@
($$/_____@@
__$$$___@
$/$$$\$$@
($$$$$)$@
$>$$$<$$@
($$$$$)$@
_\$$$/__@@
__$$$$___@
$/$$$$\$$@
($$$$$$|$@
$\__$$$|$@
$$__)$$|$@
_($$$$/__@@
____@
$_$$@
(_)$@
$_$$@
(_)$@
____@@
____@
$_$$@
(_)$@
$_$$@
($)$@
|/__@@
___$$$_@
$$/$$/$@
$/$$/$$@
<$$<$$$@
$\$$\$$@
__\$$\_@@
______@
$___$$@
(___)$@
$___$$@
(___)$@
______@@
$$$____@
\$$\$$$@
$\$$\$$@
$$>$$>$@
$/$$/$$@
/$$/___@@
_$$$__@
(_$$)$@
$/$/$$@
(_($$$@
$_$$$$@
($)___@@
__$$$$$$$___@
$/$$___$$\$$@
|$$/$/\)$$)$@
|$|$(____/$$@
|$$\______$$@
_\$$$$$$$$)_@@
____$$_____@
$$$/$$\$$$$@
$$/$$$$\$$$@
$/$$()$$\$$@
|$$$__$$$|$@
|$$(__)$$|_@@
$$$$$$___@
\$$$$$\$$@
$|$$$$$)$@
$|$$$$<$$@
$|$$$$$)$@
/$$$$$/__@@
__$$$$__@
$/$$__)$@
|$$/$$$$@
|$|$$$$$@
|$$\__$$@
_\$$$$)_@@
$$$$$___@
|$$$$\$$@
|$$$$$|$@
|$$$$$|$@
|$$$$$|$@
|$$$$/__@@
$$$$$$$$__@
\$$$$___)$@
$|$$(__$$$@
$|$$$__)$$@
$|$$(___$$@
/$$$$$$$)_@@
$$$$$$$$__@
\$$$$___)$@
$|$$(__$$$@
$|$$$__)$$@
$|$$($$$$$@
/$$$$\____@@
__$$$$$$$___@
$$)$$____)$$@
$/$$/$$__$$$@
($$($$($$\$$@
$\$$\__)$$)$@
__)$$$$$$(__@@
$$$$___$$$$_@
\$$|$$$|$$/$@
$|$$\_/$$|$$@
$|$$$_$$$|$$@
$|$$/$\$$|$$@
/$$|___|$$\_@@
_$$$$$$__@
(_$$$$_)$@
$$|$$|$$$@
$$|$$|$$$@
$_|$$|_$$@
($$$$$$)_@@
___$$$$$_@
$$(_$$$|$@
$$$$|$$|$@
$_$$|$$|$@
($|_|$$|$@
_\$$$$/__@@
$$$$$_$$$$_@
\$$$|$)$$/$@
$|$$|/$$/$$@
$|$$$$$($$$@
$|$$|\$$\$$@
/$$$|_)$$\_@@
$$$$$____@
\$$$|$$$$@
$|$$|$$$$@
$|$$|$$$$@
$|$$|__$$@
/$$$$$$)_@@
$$$$$$$$$$_@
|$$$$$$$$|$@
|$$|\/|$$|$@
|$$|$$|$$|$@
|$$|$$|$$|$@
|$$|__|$$|_@@
$$$$$___$$$$_@
|$$$$\$$|$$|$@
|$$|\$\$|$$|$@
|$$|$\$\|$$|$@
|$$|$$\$$$$|$@
|$$|___\$$$|_@@
__$$$$$___@
$$)$$$($$$@
$/$$$$$\$$@
($$$$$$$)$@
$\$$$$$/$$@
__)$$$(___@@
$$$$$___@
|$$$$\$$@
|$$$$$)$@
|$$__/$$@
|$|$$$$$@
|$|_____@@
__$$$$$_@
$/$$$$|$@
($$$$$|$@
$\__$$|$@
$$$$|$|$@
____|$|_@@
$$$$$___@
|$$$$\$$@
|$$$$$)$@
|$$$$/$$@
|$|\$\$$@
|$|_\$\_@@
_$$$$$$$__@
$)$$____)$@
($$(___$$$@
$\___$$\$$@
$____)$$)$@
($$$$$$(__@@
_$$$$$$$$__@
(__$$$$__)$@
$$$|$$|$$$$@
$$$|$$|$$$$@
$$$|$$|$$$$@
___|$$|____@@
$$$$___$$$$_@
|$$|$$$|$$|$@
|$$|$$$|$$|$@
|$$|$$$|$$|$@
|$$$\_/$$$|$@
_\$$$$$$$/__@@
$$$$__$$$$_@
|$$|$$|$$|$@
|$$|$$|$$|$@
|$$|$$|$$|$@
$\$$\/$$/$$@
__\$$$$/___@@
$$$$____$$$$_@
|$$|$$$$|$$|$@
|$$|$$$$|$$|$@
|$$|$$$$|$$|$@
$\$$\/\/$$/$$@
__\$$$$$$/___@@
$$$____$$$_@
\$$\$$/$$/$@
$\$$\/$$/$$@
$$>$$$$<$$$@
$/$$/\$$\$$@
/$$/__\$$\_@@
_$$$__$$$__@
($$($$)$$)$@
$\$$\/$$/$$@
$$\$$$$/$$$@
$$$)$$/$$$$@
__/$$(_____@@
_$$$$$$__@
(___$$$)$@
$$$/$$/$$@
$$/$$/$$$@
$/$$/__$$@
($$$$$$)_@@
$$$$$$$_@
|$$$__|$@
|$$|$$$$@
|$$|$$$$@
|$$|__$$@
|$$$$$|_@@
$$$$_____@
\$$($$$$$@
$\$$\$$$$@
$$\$$\$$$@
$$$\$$\$$@
____)$$\_@@
$$$$$$$_@
|__$$$|$@
$$$|$$|$@
$$$|$$|$@
$__|$$|$@
|$$$$$|_@@
__$$$$___@
$/$/\$\$$@
(_/$$\_)$@
$$$$$$$$$@
$$$$$$$$$@
_________@@
______@
$$$$$$@
$$$$$$@
$$$$$$@
____$$@
)$$$)_@@
_$$$__@
($$$)$@
$\_($$@
$$$$$$@
$$$$$$@
______@@
____$$_____@
$$$/$$\$$$$@
$$/$$$$\$$$@
$/$$()$$\$$@
|$$$__$$$|$@
|$$(__)$$|_@@
$$$$$$___@
\$$$$$\$$@
$|$$$$$)$@
$|$$$$<$$@
$|$$$$$)$@
/$$$$$/__@@
__$$$$__@
$/$$__)$@
|$$/$$$$@
|$|$$$$$@
|$$\__$$@
_\$$$$)_@@
$$$$$___@
|$$$$\$$@
|$$$$$|$@
|$$$$$|$@
|$$$$$|$@
|$$$$/__@@
$$$$$$$$__@
\$$$$___)$@
$|$$(__$$$@
$|$$$__)$$@
$|$$(___$$@
/$$$$$$$)_@@
$$$$$$$$__@
\$$$$___)$@
$|$$(__$$$@
$|$$$__)$$@
$|$$($$$$$@
/$$$$\____@@
__$$$$$$$___@
$$)$$____)$$@
$/$$/$$__$$$@
($$($$($$\$$@
$\$$\__)$$)$@
__)$$$$$$(__@@
$$$$___$$$$_@
\$$|$$$|$$/$@
$|$$\_/$$|$$@
$|$$$_$$$|$$@
$|$$/$\$$|$$@
/$$|___|$$\_@@
_$$$$$$__@
(_$$$$_)$@
$$|$$|$$$@
$$|$$|$$$@
$_|$$|_$$@
($$$$$$)_@@
___$$$$$_@
$$(_$$$|$@
$$$$|$$|$@
$_$$|$$|$@
($|_|$$|$@
_\$$$$/__@@
$$$$$_$$$$_@
\$$$|$)$$/$@
$|$$|/$$/$$@
$|$$$$$($$$@
$|$$|\$$\$$@
/$$$|_)$$\_@@
$$$$$____@
\$$$|$$$$@
$|$$|$$$$@
$|$$|$$$$@
$|$$|__$$@
/$$$$$$)_@@
$$$$$$$$$$_@
|$$$$$$$$|$@
|$$|\/|$$|$@
|$$|$$|$$|$@
|$$|$$|$$|$@
|$$|__|$$|_@@
$$$$$___$$$$_@
|$$$$\$$|$$|$@
|$$|\$\$|$$|$@
|$$|$\$\|$$|$@
|$$|$$\$$$$|$@
|$$|___\$$$|_@@
__$$$$$___@
$$)$$$($$$@
$/$$$$$\$$@
($$$$$$$)$@
$\$$$$$/$$@
__)$$$(___@@
$$$$$___@
|$$$$\$$@
|$$$$$)$@
|$$__/$$@
|$|$$$$$@
|$|_____@@
__$$$$$_@
$/$$$$|$@
($$$$$|$@
$\__$$|$@
$$$$|$|$@
____|$|_@@
$$$$$___@
|$$$$\$$@
|$$$$$)$@
|$$$$/$$@
|$|\$\$$@
|$|_\$\_@@
_$$$$$$$__@
$)$$____)$@
($$(___$$$@
$\___$$\$$@
$____)$$)$@
($$$$$$(__@@
_$$$$$$$$__@
(__$$$$__)$@
$$$|$$|$$$$@
$$$|$$|$$$$@
$$$|$$|$$$$@
___|$$|____@@
$$$$___$$$$_@
|$$|$$$|$$|$@
|$$|$$$|$$|$@
|$$|$$$|$$|$@
|$$$\_/$$$|$@
_\$$$$$$$/__@@
$$$$__$$$$_@
|$$|$$|$$|$@
|$$|$$|$$|$@
|$$|$$|$$|$@
$\$$\/$$/$$@
__\$$$$/___@@
$$$$____$$$$_@
|$$|$$$$|$$|$@
|$$|$$$$|$$|$@
|$$|$$$$|$$|$@
$\$$\/\/$$/$$@
__\$$$$$$/___@@
$$$____$$$_@
\$$\$$/$$/$@
$\$$\/$$/$$@
$$>$$$$<$$$@
$/$$/\$$\$$@
/$$/__\$$\_@@
_$$$__$$$__@
($$($$)$$)$@
$\$$\/$$/$$@
$$\$$$$/$$$@
$$$)$$/$$$$@
__/$$(_____@@
_$$$$$$__@
(___$$$)$@
$$$/$$/$$@
$$/$$/$$$@
$/$$/__$$@
($$$$$$)_@@
$$$__@
$$/$$@
$($$$@
$$)$$@
$/$$$@
(____@@
$$$_@
|$|$@
|$|$@
|$|$@
|$|$@
|$|_@@
___$@
$$$)@
$$/$@
$($$@
$$)$@
_/$$@@
__$$__$$_@
$/$$\/$/$@
(_/\__/$$@
$$$$$$$$$@
$$$$$$$$$@
_________@@
_$___$__@
(_)$(_)$@
$$___$$$@
$/$$$\$$@
|$$_$$|$@
|$(_)$|_@@
_$___$__@
(_)$(_)$@
$$___$$$@
$/$$$\$$@
($$$$$)$@
_\$$$/__@@
_$___$__@
(_)$(_)$@
$_$$$_$$@
|$|$|$|$@
|$|_|$|$@
_\$$$/__@@
_$___$__@
(_)$(_)$@
$$___$$$@
$/$$$\$$@
|$$_$$|$@
|$(_)$|_@@
_$___$__@
(_)$(_)$@
$$___$$$@
$/$$$\$$@
($$$$$)$@
_\$$$/__@@
_$___$__@
(_)$(_)$@
$_$$$_$$@
|$|$|$|$@
|$|_|$|$@
_\$$$/__@@
__$$$$$___@
$/$$__$\$$@
|$$/$_)$)$@
|$|$(_$($$@
|$|$__)$)$@
|$|($$$/__@@
@@ -0,0 +1,39 @@
/**
* This is not the set of all possible signals.
*
* It IS, however, the set of all signals that trigger
* an exit on either Linux or BSD systems. Linux is a
* superset of the signal names supported on BSD, and
* the unknown signals just fail to register, so we can
* catch that easily enough.
*
* Windows signals are a different set, since there are
* signals that terminate Windows processes, but don't
* terminate (or don't even exist) on Posix systems.
*
* Don't bother with SIGKILL. It's uncatchable, which
* means that we can't fire any callbacks anyway.
*
* If a user does happen to register a handler on a non-
* fatal signal like SIGWINCH or something, and then
* exit, it'll end up firing `process.emit('exit')`, so
* the handler will be fired anyway.
*
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
* artificially, inherently leave the process in a
* state from which it is not safe to try and enter JS
* listeners.
*/
export const signals = [];
signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
if (process.platform !== 'win32') {
signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
// should detect profiler and enable/disable accordingly.
// see #21
// 'SIGPROF'
);
}
if (process.platform === 'linux') {
signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
}
//# sourceMappingURL=signals.js.map
@@ -0,0 +1,2 @@
var G=(l,t,e)=>{if(!t.has(l))throw TypeError("Cannot "+e)};var I=(l,t,e)=>(G(l,t,"read from private field"),e?e.call(l):t.get(l)),j=(l,t,e)=>{if(t.has(l))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(l):t.set(l,e)},x=(l,t,e,i)=>(G(l,t,"write to private field"),i?i.call(l,e):t.set(l,e),e);var T=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,P=new Set,M=typeof process=="object"&&process?process:{},H=(l,t,e,i)=>{typeof M.emitWarning=="function"?M.emitWarning(l,t,e,i):console.error(`[${e}] ${t}: ${l}`)},W=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof W>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},W=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let l=M.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=!1,H("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var V=l=>!P.has(l),Y=Symbol("type"),A=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),k=l=>A(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0)}},z,E=class{heap;length;static create(t){let e=k(t);if(!e)return[];x(E,z,!0);let i=new E(t,e);return x(E,z,!1),i}constructor(t,e){if(!I(E,z))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},R=E;z=new WeakMap,j(R,z,!1);var D=class{#g;#f;#p;#w;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#c;#o;#h;#_;#r;#m;#b;#u;#y;#O;#a;static unsafeExposeInternals(t){return{starts:t.#b,ttls:t.#u,sizes:t.#m,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#x(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#F(e),isStale:e=>t.#d(e)}}get max(){return this.#g}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:r,dispose:g,disposeAfter:m,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,memoMethod:a,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:v}=t;if(e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let y=e?k(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#g=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(a!==void 0&&typeof a!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=a,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=S,this.#O=!!S,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new y(e),this.#c=new y(e),this.#o=0,this.#h=0,this.#_=R.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#y=!!this.#p,this.#a=!!this.#w,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TLine truncated
//# sourceMappingURL=index.min.js.map
@@ -0,0 +1 @@
{"name":"clean-stack","version":"2.2.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532121461,"integrity":"sha512-I+WkSYJKy0aFcsMe3vi9zde9Z3w7V+6pTaXV2PM0oHlLZFnQrwpU9Y6NEPJLK8AhvTuyYi8FhSfdyFj8JHUerA==","mode":420,"size":603},"index.d.ts":{"checkedAt":1794532121461,"integrity":"sha512-SmjGZP16nhr0UEI8ibt1ie9LM+9W7sU98K1kfPYwBFujcBLYdN/IxP2yX9/3pKt9O/pgitXDZq9XIfgPfXEv/A==","mode":420,"size":1181},"index.js":{"checkedAt":1794532121461,"integrity":"sha512-nUYtR0QVyqk3glZGRqIgXugtvahfNWJ8c0GwknW+qnP2FmYIwaMi5NBzhOZs76E2Iz+qrTGrLUZD4V11o7TXhg==","mode":420,"size":1055},"license":{"checkedAt":1794532121461,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"readme.md":{"checkedAt":1794532121461,"integrity":"sha512-2CfTkBSiHLBclu+EQxEsla8AzBXV5F5X+Uct2VmQ0Kij0AY6WBTPrt9zzqv5NyBhB5vMD5KKlX8fIMkDNNCzfg==","mode":420,"size":1560}}}
@@ -0,0 +1,140 @@
'use strict';
var test = require('tape');
var toPrimitive = require('../es2015');
var is = require('object-is');
var forEach = require('for-each');
var functionName = require('function.prototype.name');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
/** @typedef {{ toString?: unknown, valueOf?: unknown, [Symbol.toPrimitive]?: unknown }} Coercible */
test('function properties', function (t) {
t.equal(toPrimitive.length, 1, 'length is 1');
t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
t.end();
});
test('primitives', function (t) {
forEach(v.primitives, function (i) {
t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value');
t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value');
});
t.end();
});
test('Symbols', { skip: !v.hasSymbols }, function (t) {
forEach(v.symbols, function (sym) {
t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same value');
t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same value');
});
var primitiveSym = Symbol('primitiveSym');
var objectSym = Object(primitiveSym);
t.equal(toPrimitive(objectSym), primitiveSym, 'toPrimitive(' + debug(objectSym) + ') returns ' + debug(primitiveSym));
t.equal(toPrimitive(objectSym, String), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', String) returns ' + debug(primitiveSym));
t.equal(toPrimitive(objectSym, Number), primitiveSym, 'toPrimitive(' + debug(objectSym) + ', Number) returns ' + debug(primitiveSym));
t.end();
});
test('Arrays', function (t) {
var arrays = [[], ['a', 'b'], [1, 2]];
forEach(arrays, function (arr) {
t.equal(toPrimitive(arr), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
t.equal(toPrimitive(arr, String), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
t.equal(toPrimitive(arr, Number), String(arr), 'toPrimitive(' + debug(arr) + ') returns the string version of the array');
});
t.end();
});
test('Dates', function (t) {
var dates = [new Date(), new Date(0), new Date(NaN)];
forEach(dates, function (date) {
t.equal(toPrimitive(date), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
t.equal(toPrimitive(date, String), String(date), 'toPrimitive(' + debug(date) + ') returns the string version of the date');
t.ok(is(toPrimitive(date, Number), Number(date)), 'toPrimitive(' + debug(date) + ') returns the number version of the date');
});
t.end();
});
test('Objects', function (t) {
t.equal(toPrimitive(v.coercibleObject), v.coercibleObject.valueOf(), 'coercibleObject with no hint coerces to valueOf');
t.equal(toPrimitive(v.coercibleObject, Number), v.coercibleObject.valueOf(), 'coercibleObject with hint Number coerces to valueOf');
t.equal(toPrimitive(v.coercibleObject, String), v.coercibleObject.toString(), 'coercibleObject with hint String coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject), v.coercibleFnObject.toString(), 'coercibleFnObject coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject, Number), v.coercibleFnObject.toString(), 'coercibleFnObject with hint Number coerces to non-stringified toString');
t.equal(toPrimitive(v.coercibleFnObject, String), v.coercibleFnObject.toString(), 'coercibleFnObject with hint String coerces to non-stringified toString');
t.equal(toPrimitive({}), '[object Object]', '{} with no hint coerces to Object#toString');
t.equal(toPrimitive({}, Number), '[object Object]', '{} with hint Number coerces to Object#toString');
t.equal(toPrimitive({}, String), '[object Object]', '{} with hint String coerces to Object#toString');
t.equal(toPrimitive(v.toStringOnlyObject), v.toStringOnlyObject.toString(), 'toStringOnlyObject returns non-stringified toString');
t.equal(toPrimitive(v.toStringOnlyObject, Number), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint Number returns non-stringified toString');
t.equal(toPrimitive(v.toStringOnlyObject, String), v.toStringOnlyObject.toString(), 'toStringOnlyObject with hint String returns non-stringified toString');
t.equal(toPrimitive(v.valueOfOnlyObject), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject returns valueOf');
t.equal(toPrimitive(v.valueOfOnlyObject, Number), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint Number returns valueOf');
t.equal(toPrimitive(v.valueOfOnlyObject, String), v.valueOfOnlyObject.valueOf(), 'valueOfOnlyObject with hint String returns non-stringified valueOf');
t.test('Symbol.toPrimitive', { skip: !v.hasSymbols || !Symbol.toPrimitive }, function (st) {
/** @type {Coercible} */
var overriddenObject = { toString: st.fail, valueOf: st.fail };
overriddenObject[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
return String(hint);
};
st.equal(toPrimitive(overriddenObject), 'default', 'object with Symbol.toPrimitive + no hint invokes that');
st.equal(toPrimitive(overriddenObject, Number), 'number', 'object with Symbol.toPrimitive + hint Number invokes that');
st.equal(toPrimitive(overriddenObject, String), 'string', 'object with Symbol.toPrimitive + hint String invokes that');
/** @type {Coercible} */
var nullToPrimitive = { toString: v.coercibleObject.toString, valueOf: v.coercibleObject.valueOf };
nullToPrimitive[Symbol.toPrimitive] = null;
st.equal(toPrimitive(nullToPrimitive), toPrimitive(v.coercibleObject), 'object with no hint + null Symbol.toPrimitive ignores it');
st.equal(toPrimitive(nullToPrimitive, Number), toPrimitive(v.coercibleObject, Number), 'object with hint Number + null Symbol.toPrimitive ignores it');
st.equal(toPrimitive(nullToPrimitive, String), toPrimitive(v.coercibleObject, String), 'object with hint String + null Symbol.toPrimitive ignores it');
st.test('exceptions', function (sst) {
/** @type {Coercible} */
var nonFunctionToPrimitive = { toString: sst.fail, valueOf: sst.fail };
nonFunctionToPrimitive[Symbol.toPrimitive] = {};
sst['throws'](toPrimitive.bind(null, nonFunctionToPrimitive), TypeError, 'Symbol.toPrimitive returning a non-function throws');
/** @type {Coercible} */
var uncoercibleToPrimitive = { toString: sst.fail, valueOf: sst.fail };
uncoercibleToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
return { toString: function () { return hint; } };
};
sst['throws'](toPrimitive.bind(null, uncoercibleToPrimitive), TypeError, 'Symbol.toPrimitive returning an object throws');
/** @type {Coercible} */
var throwingToPrimitive = { toString: sst.fail, valueOf: sst.fail };
throwingToPrimitive[Symbol.toPrimitive] = /** @type {(hint: string) => unknown} */ function (hint) {
throw new RangeError(hint);
};
sst['throws'](toPrimitive.bind(null, throwingToPrimitive), RangeError, 'Symbol.toPrimitive throwing throws');
sst.end();
});
st.end();
});
t.test('exceptions', function (st) {
st['throws'](toPrimitive.bind(null, v.uncoercibleObject), TypeError, 'uncoercibleObject throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, Number), TypeError, 'uncoercibleObject with hint Number throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleObject, String), TypeError, 'uncoercibleObject with hint String throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject), TypeError, 'uncoercibleFnObject throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, Number), TypeError, 'uncoercibleFnObject with hint Number throws a TypeError');
st['throws'](toPrimitive.bind(null, v.uncoercibleFnObject, String), TypeError, 'uncoercibleFnObject with hint String throws a TypeError');
st.end();
});
t.end();
});
@@ -0,0 +1,73 @@
{
"name": "bail",
"version": "2.0.2",
"description": "Throw a given error",
"license": "MIT",
"keywords": [
"fail",
"bail",
"throw",
"callback",
"error"
],
"repository": "wooorm/bail",
"bugs": "https://github.com/wooorm/bail/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.d.ts",
"index.js"
],
"devDependencies": {
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"tsd": "^0.18.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.46.0"
},
"scripts": {
"prepublishOnly": "npm run build && npm run format",
"build": "rimraf \"*.d.ts\" && tsc && tsd && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true
}
}
@@ -0,0 +1,33 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.z = void 0;
const z = __importStar(require("./v3/external.cjs"));
exports.z = z;
__exportStar(require("./v3/external.cjs"), exports);
exports.default = z;
@@ -0,0 +1,120 @@
/// <reference types="../types/index.d.ts" />
// (c) 2020-present Andrea Giammarchi
const {parse: $parse, stringify: $stringify} = JSON;
const {keys} = Object;
const Primitive = String; // it could be Number
const primitive = 'string'; // it could be 'number'
const ignore = {};
const object = 'object';
const noop = (_, value) => value;
const primitives = value => (
value instanceof Primitive ? Primitive(value) : value
);
const Primitives = (_, value) => (
typeof value === primitive ? new Primitive(value) : value
);
const revive = (input, parsed, output, $) => {
const lazy = [];
for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
const k = ke[y];
const value = output[k];
if (value instanceof Primitive) {
const tmp = input[value];
if (typeof tmp === object && !parsed.has(tmp)) {
parsed.add(tmp);
output[k] = ignore;
lazy.push({k, a: [input, parsed, tmp, $]});
}
else
output[k] = $.call(output, k, tmp);
}
else if (output[k] !== ignore)
output[k] = $.call(output, k, value);
}
for (let {length} = lazy, i = 0; i < length; i++) {
const {k, a} = lazy[i];
output[k] = $.call(output, k, revive.apply(null, a));
}
return output;
};
const set = (known, input, value) => {
const index = Primitive(input.push(value) - 1);
known.set(value, index);
return index;
};
/**
* Converts a specialized flatted string into a JS value.
* @param {string} text
* @param {(this: any, key: string, value: any) => any} [reviver]
* @returns {any}
*/
export const parse = (text, reviver) => {
const input = $parse(text, Primitives).map(primitives);
const value = input[0];
const $ = reviver || noop;
const tmp = typeof value === object && value ?
revive(input, new Set, value, $) :
value;
return $.call({'': tmp}, '', tmp);
};
/**
* Converts a JS value into a specialized flatted string.
* @param {any} value
* @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
* @param {string | number | undefined} [space]
* @returns {string}
*/
export const stringify = (value, replacer, space) => {
const $ = replacer && typeof replacer === object ?
(k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
(replacer || noop);
const known = new Map;
const input = [];
const output = [];
let i = +set(known, input, $.call({'': value}, '', value));
let firstRun = !i;
while (i < input.length) {
firstRun = true;
output[i] = $stringify(input[i++], replace, space);
}
return '[' + output.join(',') + ']';
function replace(key, value) {
if (firstRun) {
firstRun = !firstRun;
return value;
}
const after = $.call(this, key, value);
switch (typeof after) {
case object:
if (after === null) return after;
case primitive:
return known.get(after) || set(known, input, after);
}
return after;
}
};
/**
* Converts a generic value into a JSON serializable object without losing recursion.
* @param {any} value
* @returns {any}
*/
export const toJSON = value => $parse(stringify(value));
/**
* Converts a previously serialized object with recursion into a recursive one.
* @param {any} value
* @returns {any}
*/
export const fromJSON = value => parse($stringify(value));
@@ -0,0 +1,23 @@
'use strict';
var modulo = require('./modulo');
var ToNumber = require('./ToNumber');
var truncate = require('./truncate');
var isFinite = require('math-intrinsics/isFinite');
// https://262.ecma-international.org/14.0/#sec-toint32
var two31 = 0x80000000; // Math.pow(2, 31);
var two32 = 0x100000000; // Math.pow(2, 32);
module.exports = function ToInt32(argument) {
var number = ToNumber(argument);
if (!isFinite(number) || number === 0) {
return 0;
}
var int = truncate(number);
var int32bit = modulo(int, two32);
var result = int32bit >= two31 ? int32bit - two32 : int32bit;
return result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here
};
@@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _genMapping = require("@jridgewell/gen-mapping");
var _traceMapping = require("@jridgewell/trace-mapping");
class SourceMap {
constructor(opts, code) {
var _opts$sourceFileName;
this._map = void 0;
this._rawMappings = void 0;
this._sourceFileName = void 0;
this._lastGenLine = 0;
this._lastSourceLine = 0;
this._lastSourceColumn = 0;
this._inputMap = null;
const map = this._map = new _genMapping.GenMapping({
sourceRoot: opts.sourceRoot
});
this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/");
this._rawMappings = undefined;
if (opts.inputSourceMap) {
this._inputMap = new _traceMapping.TraceMap(opts.inputSourceMap);
const resolvedSources = this._inputMap.resolvedSources;
if (resolvedSources.length) {
for (let i = 0; i < resolvedSources.length; i++) {
var _this$_inputMap$sourc;
(0, _genMapping.setSourceContent)(map, resolvedSources[i], (_this$_inputMap$sourc = this._inputMap.sourcesContent) == null ? void 0 : _this$_inputMap$sourc[i]);
}
}
}
if (typeof code === "string" && !opts.inputSourceMap) {
(0, _genMapping.setSourceContent)(map, this._sourceFileName, code);
} else if (typeof code === "object") {
for (const sourceFileName of Object.keys(code)) {
(0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
}
}
}
get() {
return (0, _genMapping.toEncodedMap)(this._map);
}
getDecoded() {
return (0, _genMapping.toDecodedMap)(this._map);
}
getRawMappings() {
return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map));
}
mark(generated, line, column, identifierName, identifierNamePos, filename) {
var _originalMapping;
this._rawMappings = undefined;
let originalMapping;
if (line != null) {
if (this._inputMap) {
originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, {
line,
column: column
});
if (!originalMapping.name && identifierNamePos) {
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
if (originalIdentifierMapping.name) {
identifierName = originalIdentifierMapping.name;
}
}
} else {
originalMapping = {
name: null,
source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
line: line,
column: column
};
}
}
(0, _genMapping.maybeAddMapping)(this._map, {
name: identifierName,
generated,
source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source,
original: originalMapping
});
}
}
exports.default = SourceMap;
//# sourceMappingURL=source-map.js.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more