@push.rocks/webrequest
Version:
Modern, fetch-compatible web request library with intelligent HTTP caching, retry strategies, and fault tolerance.
1,297 lines (1,288 loc) • 516 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/.deno/@push.rocks+isounique@1.0.5/node_modules/@push.rocks/isounique/dist_ts/index.js
var require_dist_ts = __commonJS({
"node_modules/.deno/@push.rocks+isounique@1.0.5/node_modules/@push.rocks/isounique/dist_ts/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uni = void 0;
var uni2 = (prefix = "uni") => {
return `${prefix}_${`xxxxxxxxxxxxxxxxxxxxxxxx`.replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v2 = c === "x" ? r : r & 3 | 8;
return v2.toString(16);
})}`;
};
exports.uni = uni2;
}
});
// node_modules/.deno/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js
var require_lodash = __commonJS({
"node_modules/.deno/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js"(exports, module) {
var LARGE_ARRAY_SIZE = 200;
var HASH_UNDEFINED = "__lodash_hash_undefined__";
var MAX_SAFE_INTEGER = 9007199254740991;
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reFlags = /\w*$/;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var reIsUint = /^(?:0|[1-9]\d*)$/;
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function("return this")();
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
function addMapEntry(map3, pair) {
map3.set(pair[0], pair[1]);
return map3;
}
function addSetEntry(set2, value) {
set2.add(value);
return set2;
}
function arrayEach(array, iteratee) {
var index = -1, length = array ? array.length : 0;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
function arrayPush(array, values) {
var index = -1, length = values.length, offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1, length = array ? array.length : 0;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
function baseTimes(n2, iteratee) {
var index = -1, result = Array(n2);
while (++index < n2) {
result[index] = iteratee(index);
}
return result;
}
function getValue(object, key) {
return object == null ? void 0 : object[key];
}
function isHostObject(value) {
var result = false;
if (value != null && typeof value.toString != "function") {
try {
result = !!(value + "");
} catch (e) {
}
}
return result;
}
function mapToArray(map3) {
var index = -1, result = Array(map3.size);
map3.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
function setToArray(set2) {
var index = -1, result = Array(set2.size);
set2.forEach(function(value) {
result[++index] = value;
});
return result;
}
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
var coreJsData = root["__core-js_shared__"];
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
})();
var funcToString = funcProto.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
var objectToString = objectProto.toString;
var reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
var DataView = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function Hash(entries) {
var index = -1, length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
function hashDelete(key) {
return this.has(key) && delete this.__data__[key];
}
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? void 0 : result;
}
return hasOwnProperty.call(data, key) ? data[key] : void 0;
}
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
}
function hashSet(key, value) {
var data = this.__data__;
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
return this;
}
Hash.prototype.clear = hashClear;
Hash.prototype["delete"] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
function ListCache(entries) {
var index = -1, length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
function listCacheClear() {
this.__data__ = [];
}
function listCacheDelete(key) {
var data = this.__data__, index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
return true;
}
function listCacheGet(key) {
var data = this.__data__, index = assocIndexOf(data, key);
return index < 0 ? void 0 : data[index][1];
}
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
function listCacheSet(key, value) {
var data = this.__data__, index = assocIndexOf(data, key);
if (index < 0) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
ListCache.prototype.clear = listCacheClear;
ListCache.prototype["delete"] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
function MapCache(entries) {
var index = -1, length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
function mapCacheClear() {
this.__data__ = {
"hash": new Hash(),
"map": new (Map2 || ListCache)(),
"string": new Hash()
};
}
function mapCacheDelete(key) {
return getMapData(this, key)["delete"](key);
}
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
function mapCacheSet(key, value) {
getMapData(this, key).set(key, value);
return this;
}
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype["delete"] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
function stackClear() {
this.__data__ = new ListCache();
}
function stackDelete(key) {
return this.__data__["delete"](key);
}
function stackGet(key) {
return this.__data__.get(key);
}
function stackHas(key) {
return this.__data__.has(key);
}
function stackSet(key, value) {
var cache = this.__data__;
if (cache instanceof ListCache) {
var pairs2 = cache.__data__;
if (!Map2 || pairs2.length < LARGE_ARRAY_SIZE - 1) {
pairs2.push([key, value]);
return this;
}
cache = this.__data__ = new MapCache(pairs2);
}
cache.set(key, value);
return this;
}
Stack.prototype.clear = stackClear;
Stack.prototype["delete"] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
function arrayLikeKeys(value, inherited) {
var result = isArray3(value) || isArguments(value) ? baseTimes(value.length, String) : [];
var length = result.length, skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
object[key] = value;
}
}
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== void 0) {
return result;
}
if (!isObject2(value)) {
return value;
}
var isArr = isArray3(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || isFunc && !object) {
if (isHostObject(value)) {
return object ? value : {};
}
result = initCloneObject(isFunc ? {} : value);
if (!isDeep) {
return copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
stack || (stack = new Stack());
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (!isArr) {
var props = isFull ? getAllKeys(value) : keys(value);
}
arrayEach(props || value, function(subValue, key2) {
if (props) {
key2 = subValue;
subValue = value[key2];
}
assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
});
return result;
}
function baseCreate(proto) {
return isObject2(proto) ? objectCreate(proto) : {};
}
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray3(object) ? result : arrayPush(result, symbolsFunc(object));
}
function baseGetTag(value) {
return objectToString.call(value);
}
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
return false;
}
var pattern = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != "constructor") {
result.push(key);
}
}
return result;
}
function cloneBuffer(buffer2, isDeep) {
if (isDeep) {
return buffer2.slice();
}
var result = new buffer2.constructor(buffer2.length);
buffer2.copy(result);
return result;
}
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
return result;
}
function cloneDataView(dataView, isDeep) {
var buffer2 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength);
}
function cloneMap(map3, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map3), true) : mapToArray(map3);
return arrayReduce(array, addMapEntry, new map3.constructor());
}
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
function cloneSet(set2, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set2), true) : setToArray(set2);
return arrayReduce(array, addSetEntry, new set2.constructor());
}
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
function cloneTypedArray(typedArray, isDeep) {
var buffer2 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length);
}
function copyArray(source, array) {
var index = -1, length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
function copyObject(source, props, object, customizer) {
object || (object = {});
var index = -1, length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
assignValue(object, key, newValue === void 0 ? source[key] : newValue);
}
return object;
}
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
function getMapData(map3, key) {
var data = map3.__data__;
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
}
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : void 0;
}
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
var getTag = baseGetTag;
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
getTag = function(value) {
var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
function initCloneArray(array) {
var length = array.length, result = array.constructor(length);
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
result.index = array.index;
result.input = array.input;
}
return result;
}
function initCloneObject(object) {
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
}
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag:
case float64Tag:
case int8Tag:
case int16Tag:
case int32Tag:
case uint8Tag:
case uint8ClampedTag:
case uint16Tag:
case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
}
function isKeyable(value) {
var type = typeof value;
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
}
function isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
function isPrototype(value) {
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
return value === proto;
}
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {
}
try {
return func + "";
} catch (e) {
}
}
return "";
}
function cloneDeep(value) {
return baseClone(value, true, true);
}
function eq(value, other) {
return value === other || value !== value && other !== other;
}
function isArguments(value) {
return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
}
var isArray3 = Array.isArray;
function isArrayLike2(value) {
return value != null && isLength(value.length) && !isFunction2(value);
}
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike2(value);
}
var isBuffer = nativeIsBuffer || stubFalse;
function isFunction2(value) {
var tag = isObject2(value) ? objectToString.call(value) : "";
return tag == funcTag || tag == genTag;
}
function isLength(value) {
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
function isObject2(value) {
var type = typeof value;
return !!value && (type == "object" || type == "function");
}
function isObjectLike(value) {
return !!value && typeof value == "object";
}
function keys(object) {
return isArrayLike2(object) ? arrayLikeKeys(object) : baseKeys(object);
}
function stubArray() {
return [];
}
function stubFalse() {
return false;
}
module.exports = cloneDeep;
}
});
// node_modules/.deno/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js
var require_fast_json_stable_stringify = __commonJS({
"node_modules/.deno/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(exports, module) {
"use strict";
module.exports = function(data, opts) {
if (!opts) opts = {};
if (typeof opts === "function") opts = { cmp: opts };
var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
var cmp = opts.cmp && /* @__PURE__ */ (function(f2) {
return function(node) {
return function(a, b2) {
var aobj = { key: a, value: node[a] };
var bobj = { key: b2, value: node[b2] };
return f2(aobj, bobj);
};
};
})(opts.cmp);
var seen = [];
return (function stringify3(node) {
if (node && node.toJSON && typeof node.toJSON === "function") {
node = node.toJSON();
}
if (node === void 0) return;
if (typeof node == "number") return isFinite(node) ? "" + node : "null";
if (typeof node !== "object") return JSON.stringify(node);
var i, out;
if (Array.isArray(node)) {
out = "[";
for (i = 0; i < node.length; i++) {
if (i) out += ",";
out += stringify3(node[i]) || "null";
}
return out + "]";
}
if (node === null) return "null";
if (seen.indexOf(node) !== -1) {
if (cycles) return JSON.stringify("__cycle__");
throw new TypeError("Converting circular structure to JSON");
}
var seenIndex = seen.push(node) - 1;
var keys = Object.keys(node).sort(cmp && cmp(node));
out = "";
for (i = 0; i < keys.length; i++) {
var key = keys[i];
var value = stringify3(node[key]);
if (!value) continue;
if (out) out += ",";
out += JSON.stringify(key) + ":" + value;
}
seen.splice(seenIndex, 1);
return "{" + out + "}";
})(data);
};
}
});
// node_modules/.deno/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js
var require_dayjs_min = __commonJS({
"node_modules/.deno/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js"(exports, module) {
!(function(t, e) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
})(exports, (function() {
"use strict";
var t = 1e3, e = 6e4, n2 = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f2 = "quarter", h2 = "year", d2 = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
var e2 = ["th", "st", "nd", "rd"], n3 = t2 % 100;
return "[" + t2 + (e2[(n3 - 20) % 10] || e2[n3] || e2[0]) + "]";
} }, m2 = function(t2, e2, n3) {
var r2 = String(t2);
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n3) + t2;
}, v2 = { s: m2, z: function(t2) {
var e2 = -t2.utcOffset(), n3 = Math.abs(e2), r2 = Math.floor(n3 / 60), i2 = n3 % 60;
return (e2 <= 0 ? "+" : "-") + m2(r2, 2, "0") + ":" + m2(i2, 2, "0");
}, m: function t2(e2, n3) {
if (e2.date() < n3.date()) return -t2(n3, e2);
var r2 = 12 * (n3.year() - e2.year()) + (n3.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n3 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
return +(-(r2 + (n3 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
}, a: function(t2) {
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
}, p: function(t2) {
return { M: c, y: h2, w: o, d: a, D: d2, h: u, m: s, s: i, ms: r, Q: f2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
}, u: function(t2) {
return void 0 === t2;
} }, g2 = "en", D2 = {};
D2[g2] = M;
var p2 = "$isDayjsObject", S2 = function(t2) {
return t2 instanceof _2 || !(!t2 || !t2[p2]);
}, w = function t2(e2, n3, r2) {
var i2;
if (!e2) return g2;
if ("string" == typeof e2) {
var s2 = e2.toLowerCase();
D2[s2] && (i2 = s2), n3 && (D2[s2] = n3, i2 = s2);
var u2 = e2.split("-");
if (!i2 && u2.length > 1) return t2(u2[0]);
} else {
var a2 = e2.name;
D2[a2] = e2, i2 = a2;
}
return !r2 && i2 && (g2 = i2), i2 || !r2 && g2;
}, O2 = function(t2, e2) {
if (S2(t2)) return t2.clone();
var n3 = "object" == typeof e2 ? e2 : {};
return n3.date = t2, n3.args = arguments, new _2(n3);
}, b2 = v2;
b2.l = w, b2.i = S2, b2.w = function(t2, e2) {
return O2(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
};
var _2 = (function() {
function M2(t2) {
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p2] = true;
}
var m3 = M2.prototype;
return m3.parse = function(t2) {
this.$d = (function(t3) {
var e2 = t3.date, n3 = t3.utc;
if (null === e2) return /* @__PURE__ */ new Date(NaN);
if (b2.u(e2)) return /* @__PURE__ */ new Date();
if (e2 instanceof Date) return new Date(e2);
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
var r2 = e2.match($);
if (r2) {
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
return n3 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
}
}
return new Date(e2);
})(t2), this.init();
}, m3.init = function() {
var t2 = this.$d;
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
}, m3.$utils = function() {
return b2;
}, m3.isValid = function() {
return !(this.$d.toString() === l);
}, m3.isSame = function(t2, e2) {
var n3 = O2(t2);
return this.startOf(e2) <= n3 && n3 <= this.endOf(e2);
}, m3.isAfter = function(t2, e2) {
return O2(t2) < this.startOf(e2);
}, m3.isBefore = function(t2, e2) {
return this.endOf(e2) < O2(t2);
}, m3.$g = function(t2, e2, n3) {
return b2.u(t2) ? this[e2] : this.set(n3, t2);
}, m3.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m3.valueOf = function() {
return this.$d.getTime();
}, m3.startOf = function(t2, e2) {
var n3 = this, r2 = !!b2.u(e2) || e2, f3 = b2.p(t2), l2 = function(t3, e3) {
var i2 = b2.w(n3.$u ? Date.UTC(n3.$y, e3, t3) : new Date(n3.$y, e3, t3), n3);
return r2 ? i2 : i2.endOf(a);
}, $2 = function(t3, e3) {
return b2.w(n3.toDate()[t3].apply(n3.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n3);
}, y3 = this.$W, M3 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
switch (f3) {
case h2:
return r2 ? l2(1, 0) : l2(31, 11);
case c:
return r2 ? l2(1, M3) : l2(0, M3 + 1);
case o:
var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3;
return l2(r2 ? m4 - D3 : m4 + (6 - D3), M3);
case a:
case d2:
return $2(v3 + "Hours", 0);
case u:
return $2(v3 + "Minutes", 1);
case s:
return $2(v3 + "Seconds", 2);
case i:
return $2(v3 + "Milliseconds", 3);
default:
return this.clone();
}
}, m3.endOf = function(t2) {
return this.startOf(t2, false);
}, m3.$set = function(t2, e2) {
var n3, o2 = b2.p(t2), f3 = "set" + (this.$u ? "UTC" : ""), l2 = (n3 = {}, n3[a] = f3 + "Date", n3[d2] = f3 + "Date", n3[c] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u] = f3 + "Hours", n3[s] = f3 + "Minutes", n3[i] = f3 + "Seconds", n3[r] = f3 + "Milliseconds", n3)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
if (o2 === c || o2 === h2) {
var y3 = this.clone().set(d2, 1);
y3.$d[l2]($2), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
} else l2 && this.$d[l2]($2);
return this.init(), this;
}, m3.set = function(t2, e2) {
return this.clone().$set(t2, e2);
}, m3.get = function(t2) {
return this[b2.p(t2)]();
}, m3.add = function(r2, f3) {
var d3, l2 = this;
r2 = Number(r2);
var $2 = b2.p(f3), y3 = function(t2) {
var e2 = O2(l2);
return b2.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
};
if ($2 === c) return this.set(c, this.$M + r2);
if ($2 === h2) return this.set(h2, this.$y + r2);
if ($2 === a) return y3(1);
if ($2 === o) return y3(7);
var M3 = (d3 = {}, d3[s] = e, d3[u] = n2, d3[i] = t, d3)[$2] || 1, m4 = this.$d.getTime() + r2 * M3;
return b2.w(m4, this);
}, m3.subtract = function(t2, e2) {
return this.add(-1 * t2, e2);
}, m3.format = function(t2) {
var e2 = this, n3 = this.$locale();
if (!this.isValid()) return n3.invalidDate || l;
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b2.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n3.weekdays, c2 = n3.months, f3 = n3.meridiem, h3 = function(t3, n4, i3, s3) {
return t3 && (t3[n4] || t3(e2, r2)) || i3[n4].slice(0, s3);
}, d3 = function(t3) {
return b2.s(s2 % 12 || 12, t3, "0");
}, $2 = f3 || function(t3, e3, n4) {
var r3 = t3 < 12 ? "AM" : "PM";
return n4 ? r3.toLowerCase() : r3;
};
return r2.replace(y2, (function(t3, r3) {
return r3 || (function(t4) {
switch (t4) {
case "YY":
return String(e2.$y).slice(-2);
case "YYYY":
return b2.s(e2.$y, 4, "0");
case "M":
return a2 + 1;
case "MM":
return b2.s(a2 + 1, 2, "0");
case "MMM":
return h3(n3.monthsShort, a2, c2, 3);
case "MMMM":
return h3(c2, a2);
case "D":
return e2.$D;
case "DD":
return b2.s(e2.$D, 2, "0");
case "d":
return String(e2.$W);
case "dd":
return h3(n3.weekdaysMin, e2.$W, o2, 2);
case "ddd":
return h3(n3.weekdaysShort, e2.$W, o2, 3);
case "dddd":
return o2[e2.$W];
case "H":
return String(s2);
case "HH":
return b2.s(s2, 2, "0");
case "h":
return d3(1);
case "hh":
return d3(2);
case "a":
return $2(s2, u2, true);
case "A":
return $2(s2, u2, false);
case "m":
return String(u2);
case "mm":
return b2.s(u2, 2, "0");
case "s":
return String(e2.$s);
case "ss":
return b2.s(e2.$s, 2, "0");
case "SSS":
return b2.s(e2.$ms, 3, "0");
case "Z":
return i2;
}
return null;
})(t3) || i2.replace(":", "");
}));
}, m3.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m3.diff = function(r2, d3, l2) {
var $2, y3 = this, M3 = b2.p(d3), m4 = O2(r2), v3 = (m4.utcOffset() - this.utcOffset()) * e, g3 = this - m4, D3 = function() {
return b2.m(y3, m4);
};
switch (M3) {
case h2:
$2 = D3() / 12;
break;
case c:
$2 = D3();
break;
case f2:
$2 = D3() / 3;
break;
case o:
$2 = (g3 - v3) / 6048e5;
break;
case a:
$2 = (g3 - v3) / 864e5;
break;
case u:
$2 = g3 / n2;
break;
case s:
$2 = g3 / e;
break;
case i:
$2 = g3 / t;
break;
default:
$2 = g3;
}
return l2 ? $2 : b2.a($2);
}, m3.daysInMonth = function() {
return this.endOf(c).$D;
}, m3.$locale = function() {
return D2[this.$L];
}, m3.locale = function(t2, e2) {
if (!t2) return this.$L;
var n3 = this.clone(), r2 = w(t2, e2, true);
return r2 && (n3.$L = r2), n3;
}, m3.clone = function() {
return b2.w(this.$d, this);
}, m3.toDate = function() {
return new Date(this.valueOf());
}, m3.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m3.toISOString = function() {
return this.$d.toISOString();
}, m3.toString = function() {
return this.$d.toUTCString();
}, M2;
})(), k2 = _2.prototype;
return O2.prototype = k2, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h2], ["$D", d2]].forEach((function(t2) {
k2[t2[1]] = function(e2) {
return this.$g(e2, t2[0], t2[1]);
};
})), O2.extend = function(t2, e2) {
return t2.$i || (t2(e2, _2, O2), t2.$i = true), O2;
}, O2.locale = w, O2.isDayjs = S2, O2.unix = function(t2) {
return O2(1e3 * t2);
}, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2;
}));
}
});
// node_modules/.deno/dayjs@1.11.18/node_modules/dayjs/plugin/isToday.js
var require_isToday = __commonJS({
"node_modules/.deno/dayjs@1.11.18/node_modules/dayjs/plugin/isToday.js"(exports, module) {
!(function(e, o) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = o() : "function" == typeof define && define.amd ? define(o) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isToday = o();
})(exports, (function() {
"use strict";
return function(e, o, t) {
o.prototype.isToday = function() {
var e2 = "YYYY-MM-DD", o2 = t();
return this.format(e2) === o2.format(e2);
};
};
}));
}
});
// node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTreeNode.js
var require_SymbolTreeNode = __commonJS({
"node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTreeNode.js"(exports, module) {
"use strict";
module.exports = class SymbolTreeNode {
constructor() {
this.parent = null;
this.previousSibling = null;
this.nextSibling = null;
this.firstChild = null;
this.lastChild = null;
this.childrenVersion = 0;
this.childIndexCachedUpTo = null;
this.cachedIndex = -1;
this.cachedIndexVersion = NaN;
}
get isAttached() {
return Boolean(this.parent || this.previousSibling || this.nextSibling);
}
get hasChildren() {
return Boolean(this.firstChild);
}
childrenChanged() {
this.childrenVersion = this.childrenVersion + 1 & 4294967295;
this.childIndexCachedUpTo = null;
}
getCachedIndex(parentNode) {
if (this.cachedIndexVersion !== parentNode.childrenVersion) {
this.cachedIndexVersion = NaN;
return -1;
}
return this.cachedIndex;
}
setCachedIndex(parentNode, index) {
this.cachedIndexVersion = parentNode.childrenVersion;
this.cachedIndex = index;
}
};
}
});
// node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreePosition.js
var require_TreePosition = __commonJS({
"node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreePosition.js"(exports, module) {
"use strict";
module.exports = Object.freeze({
// same as DOM DOCUMENT_POSITION_
DISCONNECTED: 1,
PRECEDING: 2,
FOLLOWING: 4,
CONTAINS: 8,
CONTAINED_BY: 16
});
}
});
// node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreeIterator.js
var require_TreeIterator = __commonJS({
"node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/TreeIterator.js"(exports, module) {
"use strict";
var TREE = Symbol();
var ROOT = Symbol();
var NEXT = Symbol();
var ITERATE_FUNC = Symbol();
var TreeIterator = class {
constructor(tree, root, firstResult, iterateFunction) {
this[TREE] = tree;
this[ROOT] = root;
this[NEXT] = firstResult;
this[ITERATE_FUNC] = iterateFunction;
}
next() {
const tree = this[TREE];
const iterateFunc = this[ITERATE_FUNC];
const root = this[ROOT];
if (!this[NEXT]) {
return {
done: true,
value: root
};
}
const value = this[NEXT];
if (iterateFunc === 1) {
this[NEXT] = tree._node(value).previousSibling;
} else if (iterateFunc === 2) {
this[NEXT] = tree._node(value).nextSibling;
} else if (iterateFunc === 3) {
this[NEXT] = tree._node(value).parent;
} else if (iterateFunc === 4) {
this[NEXT] = tree.preceding(value, { root });
} else {
this[NEXT] = tree.following(value, { root });
}
return {
done: false,
value
};
}
};
Object.defineProperty(TreeIterator.prototype, Symbol.iterator, {
value: function() {
return this;
},
writable: false
});
TreeIterator.PREV = 1;
TreeIterator.NEXT = 2;
TreeIterator.PARENT = 3;
TreeIterator.PRECEDING = 4;
TreeIterator.FOLLOWING = 5;
Object.freeze(TreeIterator);
Object.freeze(TreeIterator.prototype);
module.exports = TreeIterator;
}
});
// node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTree.js
var require_SymbolTree = __commonJS({
"node_modules/.deno/symbol-tree@3.2.4/node_modules/symbol-tree/lib/SymbolTree.js"(exports, module) {
"use strict";
var SymbolTreeNode = require_SymbolTreeNode();
var TreePosition = require_TreePosition();
var TreeIterator = require_TreeIterator();
function returnTrue() {
return true;
}
function reverseArrayIndex(array, reverseIndex) {
return array[array.length - 1 - reverseIndex];
}
var SymbolTree = class {
/**
* @constructor
* @alias module:symbol-tree
* @param {string} [description='SymbolTree data'] Description used for the Symbol
*/
constructor(description) {
this.symbol = Symbol(description || "SymbolTree data");
}
/**
* You can use this function to (optionally) initialize an object right after its creation,
* to take advantage of V8's fast properties. Also useful if you would like to
* freeze your object.
*
* `O(1)`
*
* @method
* @alias module:symbol-tree#initialize
* @param {Object} object
* @return {Object} object
*/
initialize(object) {
this._node(object);
return object;
}
_node(object) {
if (!object) {
return null;
}
const node = object[this.symbol];
if (node) {
return node;
}
return object[this.symbol] = new SymbolTreeNode();
}
/**
* Returns `true` if the object has any children. Otherwise it returns `false`.
*
* * `O(1)`
*
* @method hasChildren
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Boolean}
*/
hasChildren(object) {
return this._node(object).hasChildren;
}
/**
* Returns the first child of the given object.
*
* * `O(1)`
*
* @method firstChild
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
firstChild(object) {
return this._node(object).firstChild;
}
/**
* Returns the last child of the given object.
*
* * `O(1)`
*
* @method lastChild
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
lastChild(object) {
return this._node(object).lastChild;
}
/**
* Returns the previous sibling of the given object.
*
* * `O(1)`
*
* @method previousSibling
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
previousSibling(object) {
return this._node(object).previousSibling;
}
/**
* Returns the next sibling of the given object.
*
* * `O(1)`
*
* @method nextSibling
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
nextSibling(object) {
return this._node(object).nextSibling;
}
/**
* Return the parent of the given object.
*
* * `O(1)`
*
* @method parent
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
parent(object) {
return this._node(object).parent;
}
/**
* Find the inclusive descendant that is last in tree order of the given object.
*
* * `O(n)` (worst case) where `n` is the depth of the subtree of `object`
*
* @method lastInclusiveDescendant
* @memberOf module:symbol-tree#
* @param {Object} object
* @return {Object}
*/
lastInclusiveDescendant(object) {
let lastChild;
let current = object;
while (lastChild = this._node(current).lastChild) {
current = lastChild;
}
return current;
}
/**
* Find the preceding object (A) of the given object (B).
* An object A is preceding an object B if A and B are in the same tree
* and A comes before B in tree order.
*
* * `O(n)` (worst case)
* * `O(1)` (amortized when walking the entire tree)
*
* @method preceding
* @memberOf module:symbol-tree#
* @param {Object} object
* @param {Object} [options]
* @param {Object} [options.root] If set, `root` must be an inclusive ancestor
* of the return value (or else null is returned). This check _assumes_
* that `root` is also an inclusive ancestor of the given `object`
* @return {?Object}
*/
preceding(object, options) {
const treeRoot = options && options.root;
if (object === treeRoot) {
return null;
}
const previousSibling = this._node(object).previousSibling;
if (previousSibling) {
return this.lastInclusiveDescendant(previousSibling);
}
return this._node(object).parent;
}
/**
* Find the following object (A) of the given object (B).
* An object A is following an object B if A and B are in the same tree
* and A comes after B in tree order.
*
* * `O(n)` (worst case) where `n` is the amount of objects in the entire tree
* * `O(1)` (amortized when walking the entire tree)
*
* @method following
* @memberOf module:symbol-tree#
* @param {!Object} object
* @param {Object} [options]
* @param {Object} [options.root] If set, `root` must be an inclusive ancestor
* of the return value (or else null is returned). This check _assumes_
* that `root` is also an inclusive ancestor of the given `object`
* @param {Boolean} [options.skipChildren=false] If set, ignore the children of `object`
* @return {?Object}
*/
following(object, options) {
const treeRoot = options && options.root;
const skipChildren = options && options.skipChildren;
const firstChild = !skipChildren && this._node(object).firstChild;
if (firstChild) {
return firstChild;
}
let current = object;
do {
if (current === treeRoot) {
return null;
}
const nextSibling = this._node(current).nextSibling;
if