UNPKG

@vladmandic/face-api

Version:

FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS

1,566 lines (1,562 loc) 2.48 MB
/* Face-API homepage: <https://github.com/vladmandic/face-api> author: <https://github.com/vladmandic>' */ var faceapi = (() => { var __defProp = Object.defineProperty; var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __require = (x) => { if (typeof require !== "undefined") return require(x); throw new Error('Dynamic require of "' + x + '" is not supported'); }; var __export = (target, all5) => { __markAsModule(target); for (var name in all5) __defProp(target, name, { get: all5[name], enumerable: true }); }; // src/index.ts var src_exports = {}; __export(src_exports, { AgeGenderNet: () => AgeGenderNet, BoundingBox: () => BoundingBox, Box: () => Box, ComposableTask: () => ComposableTask, ComputeAllFaceDescriptorsTask: () => ComputeAllFaceDescriptorsTask, ComputeFaceDescriptorsTaskBase: () => ComputeFaceDescriptorsTaskBase, ComputeSingleFaceDescriptorTask: () => ComputeSingleFaceDescriptorTask, DetectAllFaceLandmarksTask: () => DetectAllFaceLandmarksTask, DetectAllFacesTask: () => DetectAllFacesTask, DetectFaceLandmarksTaskBase: () => DetectFaceLandmarksTaskBase, DetectFacesTaskBase: () => DetectFacesTaskBase, DetectSingleFaceLandmarksTask: () => DetectSingleFaceLandmarksTask, DetectSingleFaceTask: () => DetectSingleFaceTask, Dimensions: () => Dimensions, FACE_EXPRESSION_LABELS: () => FACE_EXPRESSION_LABELS, FaceDetection: () => FaceDetection, FaceDetectionNet: () => FaceDetectionNet, FaceExpressionNet: () => FaceExpressionNet, FaceExpressions: () => FaceExpressions, FaceLandmark68Net: () => FaceLandmark68Net, FaceLandmark68TinyNet: () => FaceLandmark68TinyNet, FaceLandmarkNet: () => FaceLandmarkNet, FaceLandmarks: () => FaceLandmarks, FaceLandmarks5: () => FaceLandmarks5, FaceLandmarks68: () => FaceLandmarks68, FaceMatch: () => FaceMatch, FaceMatcher: () => FaceMatcher, FaceRecognitionNet: () => FaceRecognitionNet, Gender: () => Gender, LabeledBox: () => LabeledBox, LabeledFaceDescriptors: () => LabeledFaceDescriptors, NetInput: () => NetInput, NeuralNetwork: () => NeuralNetwork, ObjectDetection: () => ObjectDetection, Point: () => Point, PredictedBox: () => PredictedBox, Rect: () => Rect, SsdMobilenetv1: () => SsdMobilenetv1, SsdMobilenetv1Options: () => SsdMobilenetv1Options, TinyFaceDetector: () => TinyFaceDetector, TinyFaceDetectorOptions: () => TinyFaceDetectorOptions, TinyYolov2: () => TinyYolov2, TinyYolov2Options: () => TinyYolov2Options, allFaces: () => allFaces, allFacesSsdMobilenetv1: () => allFacesSsdMobilenetv1, allFacesTinyYolov2: () => allFacesTinyYolov2, awaitMediaLoaded: () => awaitMediaLoaded, bufferToImage: () => bufferToImage, computeFaceDescriptor: () => computeFaceDescriptor, createCanvas: () => createCanvas2, createCanvasFromMedia: () => createCanvasFromMedia, createFaceDetectionNet: () => createFaceDetectionNet, createFaceRecognitionNet: () => createFaceRecognitionNet, createSsdMobilenetv1: () => createSsdMobilenetv1, createTinyFaceDetector: () => createTinyFaceDetector, createTinyYolov2: () => createTinyYolov2, detectAllFaces: () => detectAllFaces, detectFaceLandmarks: () => detectFaceLandmarks, detectFaceLandmarksTiny: () => detectFaceLandmarksTiny, detectLandmarks: () => detectLandmarks, detectSingleFace: () => detectSingleFace, draw: () => draw_exports, env: () => env2, euclideanDistance: () => euclideanDistance, extendWithAge: () => extendWithAge, extendWithFaceDescriptor: () => extendWithFaceDescriptor, extendWithFaceDetection: () => extendWithFaceDetection, extendWithFaceExpressions: () => extendWithFaceExpressions, extendWithFaceLandmarks: () => extendWithFaceLandmarks, extendWithGender: () => extendWithGender, extractFaceTensors: () => extractFaceTensors, extractFaces: () => extractFaces, fetchImage: () => fetchImage, fetchJson: () => fetchJson, fetchNetWeights: () => fetchNetWeights, fetchOrThrow: () => fetchOrThrow, fetchVideo: () => fetchVideo, getContext2dOrThrow: () => getContext2dOrThrow, getMediaDimensions: () => getMediaDimensions, imageTensorToCanvas: () => imageTensorToCanvas, imageToSquare: () => imageToSquare, inverseSigmoid: () => inverseSigmoid, iou: () => iou, isMediaElement: () => isMediaElement, isMediaLoaded: () => isMediaLoaded, isWithAge: () => isWithAge, isWithFaceDetection: () => isWithFaceDetection, isWithFaceExpressions: () => isWithFaceExpressions, isWithFaceLandmarks: () => isWithFaceLandmarks, isWithGender: () => isWithGender, loadAgeGenderModel: () => loadAgeGenderModel, loadFaceDetectionModel: () => loadFaceDetectionModel, loadFaceExpressionModel: () => loadFaceExpressionModel, loadFaceLandmarkModel: () => loadFaceLandmarkModel, loadFaceLandmarkTinyModel: () => loadFaceLandmarkTinyModel, loadFaceRecognitionModel: () => loadFaceRecognitionModel, loadSsdMobilenetv1Model: () => loadSsdMobilenetv1Model, loadTinyFaceDetectorModel: () => loadTinyFaceDetectorModel, loadTinyYolov2Model: () => loadTinyYolov2Model, loadWeightMap: () => loadWeightMap, locateFaces: () => locateFaces, matchDimensions: () => matchDimensions, minBbox: () => minBbox, nets: () => nets, nonMaxSuppression: () => nonMaxSuppression2, normalize: () => normalize, padToSquare: () => padToSquare, predictAgeAndGender: () => predictAgeAndGender, recognizeFaceExpressions: () => recognizeFaceExpressions, resizeResults: () => resizeResults, resolveInput: () => resolveInput, shuffleArray: () => shuffleArray, sigmoid: () => sigmoid5, ssdMobilenetv1: () => ssdMobilenetv1, tf: () => tfjs_esm_exports, tinyFaceDetector: () => tinyFaceDetector, tinyYolov2: () => tinyYolov2, toNetInput: () => toNetInput, utils: () => utils_exports, validateConfig: () => validateConfig, version: () => version11 }); // dist/tfjs.esm.js var tfjs_esm_exports = {}; __export(tfjs_esm_exports, { Abs: () => Abs, Acos: () => Acos, Acosh: () => Acosh, AdadeltaOptimizer: () => AdadeltaOptimizer, AdagradOptimizer: () => AdagradOptimizer, AdamOptimizer: () => AdamOptimizer, AdamaxOptimizer: () => AdamaxOptimizer, Add: () => Add, AddN: () => AddN, All: () => All, Any: () => Any, ArgMax: () => ArgMax, ArgMin: () => ArgMin, Asin: () => Asin, Asinh: () => Asinh, Atan: () => Atan, Atan2: () => Atan2, Atanh: () => Atanh, AvgPool: () => AvgPool, AvgPool3D: () => AvgPool3D, AvgPool3DGrad: () => AvgPool3DGrad, AvgPoolGrad: () => AvgPoolGrad, BackendWasm: () => BackendWasm, BatchMatMul: () => BatchMatMul, BatchToSpaceND: () => BatchToSpaceND, Bincount: () => Bincount, BroadcastTo: () => BroadcastTo, Callback: () => Callback, CallbackList: () => CallbackList, Cast: () => Cast, Ceil: () => Ceil, ClipByValue: () => ClipByValue, Complex: () => Complex, ComplexAbs: () => ComplexAbs, Concat: () => Concat, Conv2D: () => Conv2D, Conv2DBackpropFilter: () => Conv2DBackpropFilter, Conv2DBackpropInput: () => Conv2DBackpropInput, Conv3D: () => Conv3D, Conv3DBackpropFilterV2: () => Conv3DBackpropFilterV2, Conv3DBackpropInputV2: () => Conv3DBackpropInputV2, Cos: () => Cos, Cosh: () => Cosh, CropAndResize: () => CropAndResize, Cumsum: () => Cumsum, CustomCallback: () => CustomCallback, DataStorage: () => DataStorage, DenseBincount: () => DenseBincount, DepthToSpace: () => DepthToSpace, DepthwiseConv2dNative: () => DepthwiseConv2dNative, DepthwiseConv2dNativeBackpropFilter: () => DepthwiseConv2dNativeBackpropFilter, DepthwiseConv2dNativeBackpropInput: () => DepthwiseConv2dNativeBackpropInput, Diag: () => Diag, Dilation2D: () => Dilation2D, Dilation2DBackpropFilter: () => Dilation2DBackpropFilter, Dilation2DBackpropInput: () => Dilation2DBackpropInput, ENV: () => ENV, EarlyStopping: () => EarlyStopping, Einsum: () => Einsum, Elu: () => Elu, EluGrad: () => EluGrad, Environment: () => Environment, Equal: () => Equal, Erf: () => Erf, Exp: () => Exp, ExpandDims: () => ExpandDims, Expm1: () => Expm1, FFT: () => FFT, Fill: () => Fill, FlipLeftRight: () => FlipLeftRight, Floor: () => Floor, FloorDiv: () => FloorDiv, FromPixels: () => FromPixels, FusedBatchNorm: () => FusedBatchNorm, FusedConv2D: () => FusedConv2D, FusedDepthwiseConv2D: () => FusedDepthwiseConv2D, GatherNd: () => GatherNd, GatherV2: () => GatherV2, GraphModel: () => GraphModel, Greater: () => Greater, GreaterEqual: () => GreaterEqual, History: () => History, IFFT: () => IFFT, Identity: () => Identity, Imag: () => Imag, InputSpec: () => InputSpec, IsFinite: () => IsFinite, IsInf: () => IsInf, IsNan: () => IsNan, KernelBackend: () => KernelBackend, LRN: () => LRN, LRNGrad: () => LRNGrad, LayerVariable: () => LayerVariable, LayersModel: () => LayersModel, LeakyRelu: () => LeakyRelu, Less: () => Less, LessEqual: () => LessEqual, LinSpace: () => LinSpace, Log: () => Log, Log1p: () => Log1p, LogSoftmax: () => LogSoftmax, LogicalAnd: () => LogicalAnd, LogicalNot: () => LogicalNot, LogicalOr: () => LogicalOr, Max: () => Max, MaxPool: () => MaxPool, MaxPool3D: () => MaxPool3D, MaxPool3DGrad: () => MaxPool3DGrad, MaxPoolGrad: () => MaxPoolGrad, MaxPoolWithArgmax: () => MaxPoolWithArgmax, Maximum: () => Maximum, Mean: () => Mean, Min: () => Min, Minimum: () => Minimum, MirrorPad: () => MirrorPad, Mod: () => Mod, MomentumOptimizer: () => MomentumOptimizer, Multinomial: () => Multinomial, Multiply: () => Multiply, Neg: () => Neg, NonMaxSuppressionV3: () => NonMaxSuppressionV3, NonMaxSuppressionV4: () => NonMaxSuppressionV4, NonMaxSuppressionV5: () => NonMaxSuppressionV5, NotEqual: () => NotEqual, OP_SCOPE_SUFFIX: () => OP_SCOPE_SUFFIX, OneHot: () => OneHot, OnesLike: () => OnesLike, Optimizer: () => Optimizer, Pack: () => Pack, PadV2: () => PadV2, Pool: () => Pool, Pow: () => Pow, Prelu: () => Prelu, Prod: () => Prod, RMSPropOptimizer: () => RMSPropOptimizer, RNN: () => RNN, Range: () => Range, Rank: () => Rank, Real: () => Real, RealDiv: () => RealDiv, Reciprocal: () => Reciprocal, Reduction: () => Reduction, Relu: () => Relu, Relu6: () => Relu6, Reshape: () => Reshape, ResizeBilinear: () => ResizeBilinear, ResizeBilinearGrad: () => ResizeBilinearGrad, ResizeNearestNeighbor: () => ResizeNearestNeighbor, ResizeNearestNeighborGrad: () => ResizeNearestNeighborGrad, Reverse: () => Reverse, RotateWithOffset: () => RotateWithOffset, Round: () => Round, Rsqrt: () => Rsqrt, SGDOptimizer: () => SGDOptimizer, ScatterNd: () => ScatterNd, Select: () => Select, Selu: () => Selu, Sequential: () => Sequential, Sigmoid: () => Sigmoid, Sign: () => Sign, Sin: () => Sin, Sinh: () => Sinh, Slice: () => Slice, Softmax: () => Softmax, Softplus: () => Softplus, SpaceToBatchND: () => SpaceToBatchND, SparseFillEmptyRows: () => SparseFillEmptyRows, SparseReshape: () => SparseReshape, SparseSegmentMean: () => SparseSegmentMean, SparseSegmentSum: () => SparseSegmentSum, SparseToDense: () => SparseToDense, SplitV: () => SplitV, Sqrt: () => Sqrt, Square: () => Square, SquaredDifference: () => SquaredDifference, Step: () => Step, StridedSlice: () => StridedSlice, StringNGrams: () => StringNGrams, StringSplit: () => StringSplit, StringToHashBucketFast: () => StringToHashBucketFast, Sub: () => Sub, Sum: () => Sum, SymbolicTensor: () => SymbolicTensor, Tan: () => Tan, Tanh: () => Tanh, Tensor: () => Tensor, TensorBuffer: () => TensorBuffer, Tile: () => Tile, TopK: () => TopK, Transform: () => Transform, Transpose: () => Transpose, Unique: () => Unique, Unpack: () => Unpack, UnsortedSegmentSum: () => UnsortedSegmentSum, Variable: () => Variable, ZerosLike: () => ZerosLike, _FusedMatMul: () => _FusedMatMul, abs: () => abs, acos: () => acos, acosh: () => acosh, add: () => add2, addN: () => addN, all: () => all, any: () => any, argMax: () => argMax, argMin: () => argMin, asin: () => asin, asinh: () => asinh, atan: () => atan, atan2: () => atan2, atanh: () => atanh, avgPool: () => avgPool, avgPool3d: () => avgPool3d, backend: () => backend, backend_util: () => backend_util_exports, basicLSTMCell: () => basicLSTMCell, batchNorm: () => batchNorm, batchNorm2d: () => batchNorm2d, batchNorm3d: () => batchNorm3d, batchNorm4d: () => batchNorm4d, batchToSpaceND: () => batchToSpaceND, bincount: () => bincount, booleanMaskAsync: () => booleanMaskAsync, broadcastTo: () => broadcastTo, browser: () => browser_exports, buffer: () => buffer, callbacks: () => callbacks, cast: () => cast, ceil: () => ceil, clipByValue: () => clipByValue, clone: () => clone, complex: () => complex, concat: () => concat, concat1d: () => concat1d, concat2d: () => concat2d, concat3d: () => concat3d, concat4d: () => concat4d, constraints: () => exports_constraints_exports, conv1d: () => conv1d, conv2d: () => conv2d, conv2dTranspose: () => conv2dTranspose, conv3d: () => conv3d, conv3dTranspose: () => conv3dTranspose, copyRegisteredKernels: () => copyRegisteredKernels, cos: () => cos, cosh: () => cosh, cosineWindow: () => cosineWindow, cumsum: () => cumsum, customGrad: () => customGrad, data: () => dist_exports, denseBincount: () => denseBincount, deprecationWarn: () => deprecationWarn, depthToSpace: () => depthToSpace, depthwiseConv2d: () => depthwiseConv2d, deregisterOp: () => deregisterOp, device_util: () => device_util_exports, diag: () => diag, dilation2d: () => dilation2d, disableDeprecationWarnings: () => disableDeprecationWarnings, dispose: () => dispose, disposeVariables: () => disposeVariables, div: () => div, divNoNan: () => divNoNan, dot: () => dot, dropout: () => dropout, einsum: () => einsum, elu: () => elu, enableDebugMode: () => enableDebugMode, enableProdMode: () => enableProdMode, enclosingPowerOfTwo: () => enclosingPowerOfTwo, engine: () => engine, env: () => env, equal: () => equal, erf: () => erf, exp: () => exp, expandDims: () => expandDims, expm1: () => expm1, eye: () => eye, fft: () => fft, fill: () => fill, findBackend: () => findBackend, findBackendFactory: () => findBackendFactory, floor: () => floor, floorDiv: () => floorDiv, fused: () => fused_ops_exports, gather: () => gather, gatherND: () => gatherND, gather_util: () => gather_nd_util_exports, getBackend: () => getBackend, getGradient: () => getGradient, getKernel: () => getKernel, getKernelsForBackend: () => getKernelsForBackend, grad: () => grad, grads: () => grads, greater: () => greater, greaterEqual: () => greaterEqual, ifft: () => ifft, imag: () => imag, image: () => image, inTopKAsync: () => inTopKAsync, initializers: () => exports_initializers_exports, input: () => input, io: () => io_exports, irfft: () => irfft, isFinite: () => isFinite2, isInf: () => isInf, isNaN: () => isNaN2, keep: () => keep, kernel_impls: () => kernel_impls_exports, layers: () => exports_layers_exports, leakyRelu: () => leakyRelu, less: () => less, lessEqual: () => lessEqual, linalg: () => linalg, linspace: () => linspace, loadGraphModel: () => loadGraphModel, loadLayersModel: () => loadLayersModel, localResponseNormalization: () => localResponseNormalization, log: () => log, log1p: () => log1p, logSigmoid: () => logSigmoid, logSoftmax: () => logSoftmax, logSumExp: () => logSumExp, logicalAnd: () => logicalAnd, logicalNot: () => logicalNot, logicalOr: () => logicalOr, logicalXor: () => logicalXor, losses: () => losses, matMul: () => matMul, math: () => math_exports, max: () => max, maxPool: () => maxPool, maxPool3d: () => maxPool3d, maxPoolWithArgmax: () => maxPoolWithArgmax, maximum: () => maximum, mean: () => mean, memory: () => memory, meshgrid: () => meshgrid, metrics: () => exports_metrics_exports, min: () => min, minimum: () => minimum, mirrorPad: () => mirrorPad, mod: () => mod, model: () => model, models: () => exports_models_exports, moments: () => moments, movingAverage: () => movingAverage, mul: () => mul, multiRNNCell: () => multiRNNCell, multinomial: () => multinomial, neg: () => neg, nextFrame: () => nextFrame, norm: () => norm, notEqual: () => notEqual, oneHot: () => oneHot, ones: () => ones2, onesLike: () => onesLike, op: () => op, outerProduct: () => outerProduct, pad: () => pad, pad1d: () => pad1d, pad2d: () => pad2d, pad3d: () => pad3d, pad4d: () => pad4d, pool: () => pool, pow: () => pow, prelu: () => prelu, print: () => print2, prod: () => prod, profile: () => profile, rand: () => rand, randomGamma: () => randomGamma, randomNormal: () => randomNormal, randomUniform: () => randomUniform, range: () => range, ready: () => ready, real: () => real, reciprocal: () => reciprocal, registerBackend: () => registerBackend, registerCallbackConstructor: () => registerCallbackConstructor, registerGradient: () => registerGradient, registerKernel: () => registerKernel, registerOp: () => registerOp, regularizers: () => exports_regularizers_exports, relu: () => relu, relu6: () => relu6, removeBackend: () => removeBackend, reshape: () => reshape, reverse: () => reverse, reverse1d: () => reverse1d, reverse2d: () => reverse2d, reverse3d: () => reverse3d, reverse4d: () => reverse4d, rfft: () => rfft, round: () => round2, rsqrt: () => rsqrt, scalar: () => scalar, scatterND: () => scatterND, scatter_util: () => scatter_nd_util_exports, selu: () => selu, separableConv2d: () => separableConv2d, sequential: () => sequential, serialization: () => serialization_exports, setBackend: () => setBackend, setPlatform: () => setPlatform, setWasmPath: () => setWasmPath, setWasmPaths: () => setWasmPaths, setdiff1dAsync: () => setdiff1dAsync, sigmoid: () => sigmoid, sign: () => sign, signal: () => signal, sin: () => sin, sinh: () => sinh, slice: () => slice, slice1d: () => slice1d, slice2d: () => slice2d, slice3d: () => slice3d, slice4d: () => slice4d, slice_util: () => slice_util_exports, softmax: () => softmax, softplus: () => softplus, spaceToBatchND: () => spaceToBatchND, sparse: () => sparse, sparseToDense: () => sparseToDense, spectral: () => spectral, split: () => split, sqrt: () => sqrt, square: () => square, squaredDifference: () => squaredDifference, squeeze: () => squeeze, stack: () => stack, step: () => step, stridedSlice: () => stridedSlice, string: () => string, sub: () => sub, sum: () => sum2, sumOutType: () => sumOutType, tan: () => tan, tanh: () => tanh2, tensor: () => tensor, tensor1d: () => tensor1d, tensor2d: () => tensor2d, tensor3d: () => tensor3d, tensor4d: () => tensor4d, tensor5d: () => tensor5d, tensor6d: () => tensor6d, tensor_util: () => tensor_util_exports, test_util: () => test_util_exports, tidy: () => tidy, tile: () => tile, time: () => time, topk: () => topk, train: () => train, transpose: () => transpose, truncatedNormal: () => truncatedNormal, unique: () => unique, unregisterGradient: () => unregisterGradient, unregisterKernel: () => unregisterKernel, unsortedSegmentSum: () => unsortedSegmentSum, unstack: () => unstack, upcastType: () => upcastType, util: () => util_exports, valueAndGrad: () => valueAndGrad, valueAndGrads: () => valueAndGrads, variable: () => variable, variableGrads: () => variableGrads, version: () => version8, version_converter: () => version3, version_core: () => version, version_layers: () => version2, version_wasm: () => version9, where: () => where, whereAsync: () => whereAsync, zeros: () => zeros, zerosLike: () => zerosLike }); var __create = Object.create; var __defProp2 = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __markAsModule2 = (target) => __defProp2(target, "__esModule", { value: true }); var __require2 = (x) => { if (typeof __require !== "undefined") return __require(x); throw new Error('Dynamic require of "' + x + '" is not supported'); }; var __commonJS = (cb, mod4) => function __require22() { return mod4 || (0, cb[Object.keys(cb)[0]])((mod4 = { exports: {} }).exports, mod4), mod4.exports; }; var __export2 = (target, all5) => { __markAsModule2(target); for (var name in all5) __defProp2(target, name, { get: all5[name], enumerable: true }); }; var __reExport = (target, module2, desc) => { if (module2 && typeof module2 === "object" || typeof module2 === "function") { for (let key of __getOwnPropNames(module2)) if (!__hasOwnProp.call(target, key) && key !== "default") __defProp2(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); } return target; }; var __toModule = (module2) => { return __reExport(__markAsModule2(__defProp2(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); }; var require_long = __commonJS({ "node_modules/.pnpm/long@4.0.0/node_modules/long/src/long.js"(exports, module2) { module2.exports = Long2; var wasm = null; try { wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 ])), {}).exports; } catch (e) { } function Long2(low, high, unsigned) { this.low = low | 0; this.high = high | 0; this.unsigned = !!unsigned; } Long2.prototype.__isLong__; Object.defineProperty(Long2.prototype, "__isLong__", { value: true }); function isLong(obj) { return (obj && obj["__isLong__"]) === true; } Long2.isLong = isLong; var INT_CACHE = {}; var UINT_CACHE = {}; function fromInt(value, unsigned) { var obj, cachedObj, cache; if (unsigned) { value >>>= 0; if (cache = 0 <= value && value < 256) { cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); if (cache) UINT_CACHE[value] = obj; return obj; } else { value |= 0; if (cache = -128 <= value && value < 128) { cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } obj = fromBits(value, value < 0 ? -1 : 0, false); if (cache) INT_CACHE[value] = obj; return obj; } } Long2.fromInt = fromInt; function fromNumber(value, unsigned) { if (isNaN(value)) return unsigned ? UZERO : ZERO; if (unsigned) { if (value < 0) return UZERO; if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; } else { if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; } if (value < 0) return fromNumber(-value, unsigned).neg(); return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); } Long2.fromNumber = fromNumber; function fromBits(lowBits, highBits, unsigned) { return new Long2(lowBits, highBits, unsigned); } Long2.fromBits = fromBits; var pow_dbl = Math.pow; function fromString(str, unsigned, radix) { if (str.length === 0) throw Error("empty string"); if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return ZERO; if (typeof unsigned === "number") { radix = unsigned, unsigned = false; } else { unsigned = !!unsigned; } radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError("radix"); var p2; if ((p2 = str.indexOf("-")) > 0) throw Error("interior hyphen"); else if (p2 === 0) { return fromString(str.substring(1), unsigned, radix).neg(); } var radixToPower = fromNumber(pow_dbl(radix, 8)); var result = ZERO; for (var i = 0; i < str.length; i += 8) { var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = fromNumber(pow_dbl(radix, size)); result = result.mul(power).add(fromNumber(value)); } else { result = result.mul(radixToPower); result = result.add(fromNumber(value)); } } result.unsigned = unsigned; return result; } Long2.fromString = fromString; function fromValue(val, unsigned) { if (typeof val === "number") return fromNumber(val, unsigned); if (typeof val === "string") return fromString(val, unsigned); return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); } Long2.fromValue = fromValue; var TWO_PWR_16_DBL = 1 << 16; var TWO_PWR_24_DBL = 1 << 24; var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); var ZERO = fromInt(0); Long2.ZERO = ZERO; var UZERO = fromInt(0, true); Long2.UZERO = UZERO; var ONE = fromInt(1); Long2.ONE = ONE; var UONE = fromInt(1, true); Long2.UONE = UONE; var NEG_ONE = fromInt(-1); Long2.NEG_ONE = NEG_ONE; var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); Long2.MAX_VALUE = MAX_VALUE; var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); Long2.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; var MIN_VALUE = fromBits(0, 2147483648 | 0, false); Long2.MIN_VALUE = MIN_VALUE; var LongPrototype = Long2.prototype; LongPrototype.toInt = function toInt() { return this.unsigned ? this.low >>> 0 : this.low; }; LongPrototype.toNumber = function toNumber() { if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); return this.high * TWO_PWR_32_DBL + (this.low >>> 0); }; LongPrototype.toString = function toString(radix) { radix = radix || 10; if (radix < 2 || 36 < radix) throw RangeError("radix"); if (this.isZero()) return "0"; if (this.isNegative()) { if (this.eq(MIN_VALUE)) { var radixLong = fromNumber(radix), div3 = this.div(radixLong), rem1 = div3.mul(radixLong).sub(this); return div3.toString(radix) + rem1.toInt().toString(radix); } else return "-" + this.neg().toString(radix); } var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; var result = ""; while (true) { var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); rem = remDiv; if (rem.isZero()) return digits + result; else { while (digits.length < 6) digits = "0" + digits; result = "" + digits + result; } } }; LongPrototype.getHighBits = function getHighBits() { return this.high; }; LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { return this.high >>> 0; }; LongPrototype.getLowBits = function getLowBits() { return this.low; }; LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { return this.low >>> 0; }; LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); var val = this.high != 0 ? this.high : this.low; for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; return this.high != 0 ? bit + 33 : bit + 1; }; LongPrototype.isZero = function isZero() { return this.high === 0 && this.low === 0; }; LongPrototype.eqz = LongPrototype.isZero; LongPrototype.isNegative = function isNegative() { return !this.unsigned && this.high < 0; }; LongPrototype.isPositive = function isPositive() { return this.unsigned || this.high >= 0; }; LongPrototype.isOdd = function isOdd() { return (this.low & 1) === 1; }; LongPrototype.isEven = function isEven22() { return (this.low & 1) === 0; }; LongPrototype.equals = function equals(other) { if (!isLong(other)) other = fromValue(other); if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; return this.high === other.high && this.low === other.low; }; LongPrototype.eq = LongPrototype.equals; LongPrototype.notEquals = function notEquals(other) { return !this.eq(other); }; LongPrototype.neq = LongPrototype.notEquals; LongPrototype.ne = LongPrototype.notEquals; LongPrototype.lessThan = function lessThan(other) { return this.comp(other) < 0; }; LongPrototype.lt = LongPrototype.lessThan; LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { return this.comp(other) <= 0; }; LongPrototype.lte = LongPrototype.lessThanOrEqual; LongPrototype.le = LongPrototype.lessThanOrEqual; LongPrototype.greaterThan = function greaterThan(other) { return this.comp(other) > 0; }; LongPrototype.gt = LongPrototype.greaterThan; LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { return this.comp(other) >= 0; }; LongPrototype.gte = LongPrototype.greaterThanOrEqual; LongPrototype.ge = LongPrototype.greaterThanOrEqual; LongPrototype.compare = function compare(other) { if (!isLong(other)) other = fromValue(other); if (this.eq(other)) return 0; var thisNeg = this.isNegative(), otherNeg = other.isNegative(); if (thisNeg && !otherNeg) return -1; if (!thisNeg && otherNeg) return 1; if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; }; LongPrototype.comp = LongPrototype.compare; LongPrototype.negate = function negate() { if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; return this.not().add(ONE); }; LongPrototype.neg = LongPrototype.negate; LongPrototype.add = function add5(addend) { if (!isLong(addend)) addend = fromValue(addend); var a48 = this.high >>> 16; var a32 = this.high & 65535; var a16 = this.low >>> 16; var a00 = this.low & 65535; var b48 = addend.high >>> 16; var b32 = addend.high & 65535; var b16 = addend.low >>> 16; var b00 = addend.low & 65535; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 + b00; c16 += c00 >>> 16; c00 &= 65535; c16 += a16 + b16; c32 += c16 >>> 16; c16 &= 65535; c32 += a32 + b32; c48 += c32 >>> 16; c32 &= 65535; c48 += a48 + b48; c48 &= 65535; return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); }; LongPrototype.subtract = function subtract(subtrahend) { if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); return this.add(subtrahend.neg()); }; LongPrototype.sub = LongPrototype.subtract; LongPrototype.multiply = function multiply4(multiplier) { if (this.isZero()) return ZERO; if (!isLong(multiplier)) multiplier = fromValue(multiplier); if (wasm) { var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); return fromBits(low, wasm.get_high(), this.unsigned); } if (multiplier.isZero()) return ZERO; if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; if (this.isNegative()) { if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); else return this.neg().mul(multiplier).neg(); } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); var a48 = this.high >>> 16; var a32 = this.high & 65535; var a16 = this.low >>> 16; var a00 = this.low & 65535; var b48 = multiplier.high >>> 16; var b32 = multiplier.high & 65535; var b16 = multiplier.low >>> 16; var b00 = multiplier.low & 65535; var c48 = 0, c32 = 0, c16 = 0, c00 = 0; c00 += a00 * b00; c16 += c00 >>> 16; c00 &= 65535; c16 += a16 * b00; c32 += c16 >>> 16; c16 &= 65535; c16 += a00 * b16; c32 += c16 >>> 16; c16 &= 65535; c32 += a32 * b00; c48 += c32 >>> 16; c32 &= 65535; c32 += a16 * b16; c48 += c32 >>> 16; c32 &= 65535; c32 += a00 * b32; c48 += c32 >>> 16; c32 &= 65535; c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; c48 &= 65535; return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); }; LongPrototype.mul = LongPrototype.multiply; LongPrototype.divide = function divide(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); if (divisor.isZero()) throw Error("division by zero"); if (wasm) { if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { return this; } var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); return fromBits(low, wasm.get_high(), this.unsigned); } if (this.isZero()) return this.unsigned ? UZERO : ZERO; var approx, rem, res; if (!this.unsigned) { if (this.eq(MIN_VALUE)) { if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; else if (divisor.eq(MIN_VALUE)) return ONE; else { var halfThis = this.shr(1); approx = halfThis.div(divisor).shl(1); if (approx.eq(ZERO)) { return divisor.isNegative() ? ONE : NEG_ONE; } else { rem = this.sub(divisor.mul(approx)); res = approx.add(rem.div(divisor)); return res; } } } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; if (this.isNegative()) { if (divisor.isNegative()) return this.neg().div(divisor.neg()); return this.neg().div(divisor).neg(); } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); res = ZERO; } else { if (!divisor.unsigned) divisor = divisor.toUnsigned(); if (divisor.gt(this)) return UZERO; if (divisor.gt(this.shru(1))) return UONE; res = UZERO; } rem = this; while (rem.gte(divisor)) { approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); var log22 = Math.ceil(Math.log(approx) / Math.LN2), delta = log22 <= 48 ? 1 : pow_dbl(2, log22 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); while (approxRem.isNegative() || approxRem.gt(rem)) { approx -= delta; approxRes = fromNumber(approx, this.unsigned); approxRem = approxRes.mul(divisor); } if (approxRes.isZero()) approxRes = ONE; res = res.add(approxRes); rem = rem.sub(approxRem); } return res; }; LongPrototype.div = LongPrototype.divide; LongPrototype.modulo = function modulo(divisor) { if (!isLong(divisor)) divisor = fromValue(divisor); if (wasm) { var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); return fromBits(low, wasm.get_high(), this.unsigned); } return this.sub(this.div(divisor).mul(divisor)); }; LongPrototype.mod = LongPrototype.modulo; LongPrototype.rem = LongPrototype.modulo; LongPrototype.not = function not() { return fromBits(~this.low, ~this.high, this.unsigned); }; LongPrototype.and = function and(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low & other.low, this.high & other.high, this.unsigned); }; LongPrototype.or = function or(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low | other.low, this.high | other.high, this.unsigned); }; LongPrototype.xor = function xor(other) { if (!isLong(other)) other = fromValue(other); return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); }; LongPrototype.shiftLeft = function shiftLeft(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); else return fromBits(0, this.low << numBits - 32, this.unsigned); }; LongPrototype.shl = LongPrototype.shiftLeft; LongPrototype.shiftRight = function shiftRight(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); if ((numBits &= 63) === 0) return this; else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); }; LongPrototype.shr = LongPrototype.shiftRight; LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { if (isLong(numBits)) numBits = numBits.toInt(); numBits &= 63; if (numBits === 0) return this; else { var high = this.high; if (numBits < 32) { var low = this.low; return fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned); } else if (numBits === 32) return fromBits(high, 0, this.unsigned); else return fromBits(high >>> numBits - 32, 0, this.unsigned); } }; LongPrototype.shru = LongPrototype.shiftRightUnsigned; LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; LongPrototype.toSigned = function toSigned() { if (!this.unsigned) return this; return fromBits(this.low, this.high, false); }; LongPrototype.toUnsigned = function toUnsigned() { if (this.unsigned) return this; return fromBits(this.low, this.high, true); }; LongPrototype.toBytes = function toBytes(le) { return le ? this.toBytesLE() : this.toBytesBE(); }; LongPrototype.toBytesLE = function toBytesLE() { var hi = this.high, lo = this.low; return [ lo & 255, lo >>> 8 & 255, lo >>> 16 & 255, lo >>> 24, hi & 255, hi >>> 8 & 255, hi >>> 16 & 255, hi >>> 24 ]; }; LongPrototype.toBytesBE = function toBytesBE() { var hi = this.high, lo = this.low; return [ hi >>> 24, hi >>> 16 & 255, hi >>> 8 & 255, hi & 255, lo >>> 24, lo >>> 16 & 255, lo >>> 8 & 255, lo & 255 ]; }; Long2.fromBytes = function fromBytes(bytes, unsigned, le) { return le ? Long2.fromBytesLE(bytes, unsigned) : Long2.fromBytesBE(bytes, unsigned); }; Long2.fromBytesLE = function fromBytesLE(bytes, unsigned) { return new Long2(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); }; Long2.fromBytesBE = function fromBytesBE(bytes, unsigned) { return new Long2(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); }; } }); var require_browser = __commonJS({ "(disabled):node_modules/.pnpm/node-fetch@2.6.1/node_modules/node-fetch/browser.js"() { } }); var require_alea = __commonJS({ "node_modules/.pnpm/seedrandom@2.4.3/node_modules/seedrandom/lib/alea.js"(exports, module2) { (function(global2, module22, define2) { function Alea(seed) { var me = this, mash = Mash(); me.next = function() { var t = 2091639 * me.s0 + me.c * 23283064365386963e-26; me.s0 = me.s1; me.s1 = me.s2; return me.s2 = t - (me.c = t | 0); }; me.c = 1; me.s0 = mash(" "); me.s1 = mash(" "); me.s2 = mash(" "); me.s0 -= mash(seed); if (me.s0 < 0) { me.s0 += 1; } me.s1 -= mash(seed); if (me.s1 < 0) { me.s1 += 1; } me.s2 -= mash(seed); if (me.s2 < 0) { me.s2 += 1; } mash = null; } function copy(f, t) { t.c = f.c; t.s0 = f.s0; t.s1 = f.s1; t.s2 = f.s2; return t; } function impl(seed, opts) { var xg = new Alea(seed), state = opts && opts.state, prng = xg.next; prng.int32 = function() { return xg.next() * 4294967296 | 0; }; prng.double = function() { return prng() + (prng() * 2097152 | 0) * 11102230246251565e-32; }; prng.quick = prng; if (state) { if (typeof state == "object") copy(state, xg); prng.state = function() { return copy(xg, {}); }; } return prng; } function Mash() { var n = 4022871197; var mash = function(data) { data = data.toString(); for (var i = 0; i < data.length; i++) { n += data.charCodeAt(i); var h = 0.02519603282416938 * n; n = h >>> 0; h -= n; h *= n; n = h >>> 0; h -= n; n += h * 4294967296; } return (n >>> 0) * 23283064365386963e-26; }; return mash; } if (module22 && module22.exports) { module22.exports = impl; } else if (define2 && define2.amd) { define2(function() { return impl; }); } else { this.alea = impl; } })(exports, typeof module2 == "object" && modul