const core = globalThis.Deno.core;
const internals = globalThis.__bootstrap.internals;
const primordials = globalThis.__bootstrap.primordials;
const {
  AggregateErrorPrototype,
  Array,
  ArrayBufferIsView,
  ArrayBufferPrototypeGetByteLength,
  ArrayIsArray,
  ArrayPrototypeFill,
  ArrayPrototypeFilter,
  ArrayPrototypeFind,
  ArrayPrototypeForEach,
  ArrayPrototypeIncludes,
  ArrayPrototypeJoin,
  ArrayPrototypeMap,
  ArrayPrototypePop,
  ArrayPrototypePush,
  ArrayPrototypePushApply,
  ArrayPrototypeReduce,
  ArrayPrototypeShift,
  ArrayPrototypeSlice,
  ArrayPrototypeSort,
  ArrayPrototypeSplice,
  ArrayPrototypeUnshift,
  BigIntPrototypeValueOf,
  Boolean,
  BooleanPrototypeValueOf,
  DateNow,
  DatePrototype,
  DatePrototypeGetTime,
  DatePrototypeToISOString,
  Error,
  ErrorCaptureStackTrace,
  ErrorPrototype,
  FunctionPrototypeBind,
  FunctionPrototypeCall,
  FunctionPrototypeToString,
  MapPrototype,
  MapPrototypeDelete,
  MapPrototypeEntries,
  MapPrototypeForEach,
  MapPrototypeGet,
  MapPrototypeGetSize,
  MapPrototypeHas,
  MapPrototypeSet,
  MathAbs,
  MathFloor,
  MathMax,
  MathMin,
  MathRound,
  MathSqrt,
  Number,
  NumberIsInteger,
  NumberParseInt,
  NumberPrototypeToString,
  NumberPrototypeValueOf,
  ObjectAssign,
  ObjectCreate,
  ObjectDefineProperty,
  ObjectFreeze,
  ObjectFromEntries,
  ObjectGetOwnPropertyDescriptor,
  ObjectGetOwnPropertyNames,
  ObjectGetOwnPropertySymbols,
  ObjectGetPrototypeOf,
  ObjectHasOwn,
  ObjectIs,
  ObjectKeys,
  ObjectPrototype,
  ObjectPrototypeIsPrototypeOf,
  ObjectPrototypePropertyIsEnumerable,
  ObjectPrototypeToString,
  ObjectSetPrototypeOf,
  ObjectValues,
  Proxy,
  ReflectGet,
  ReflectGetOwnPropertyDescriptor,
  ReflectGetPrototypeOf,
  ReflectHas,
  ReflectOwnKeys,
  RegExpPrototypeExec,
  RegExpPrototypeSymbolReplace,
  RegExpPrototypeTest,
  RegExpPrototypeToString,
  SafeArrayIterator,
  SafeMap,
  SafeMapIterator,
  SafeRegExp,
  SafeSet,
  SafeSetIterator,
  SafeStringIterator,
  SetPrototype,
  SetPrototypeAdd,
  SetPrototypeHas,
  SetPrototypeGetSize,
  SetPrototypeValues,
  String,
  StringPrototypeCharCodeAt,
  StringPrototypeCodePointAt,
  StringPrototypeEndsWith,
  StringPrototypeIncludes,
  StringPrototypeIndexOf,
  StringPrototypeLastIndexOf,
  StringPrototypeMatch,
  StringPrototypeNormalize,
  StringPrototypePadEnd,
  StringPrototypePadStart,
  StringPrototypeRepeat,
  StringPrototypeReplace,
  StringPrototypeReplaceAll,
  StringPrototypeSlice,
  StringPrototypeSplit,
  StringPrototypeStartsWith,
  StringPrototypeToLowerCase,
  StringPrototypeTrim,
  StringPrototypeValueOf,
  Symbol,
  SymbolFor,
  SymbolHasInstance,
  SymbolIterator,
  SymbolPrototypeGetDescription,
  SymbolPrototypeToString,
  SymbolPrototypeValueOf,
  SymbolToStringTag,
  TypedArrayPrototypeGetByteLength,
  TypedArrayPrototypeGetLength,
  TypedArrayPrototypeGetSymbolToStringTag,
  Uint8Array,
  WeakMapPrototypeHas,
  WeakSetPrototypeHas,
  isNaN,
} = primordials;
let noColor = false;
function setNoColor(value) {
  noColor = value;
}
function getNoColor() {
  return noColor;
}
const styles = {
  special: "cyan",
  number: "yellow",
  bigint: "yellow",
  boolean: "yellow",
  undefined: "grey",
  null: "bold",
  string: "green",
  symbol: "green",
  date: "magenta",
      regexp: "red",
  module: "underline",
  internalError: "red",
};
const defaultFG = 39;
const defaultBG = 49;
const colors = {
  reset: [0, 0],
  bold: [1, 22],
  dim: [2, 22],   italic: [3, 23],
  underline: [4, 24],
  blink: [5, 25],
    inverse: [7, 27],   hidden: [8, 28],   strikethrough: [9, 29],   doubleunderline: [21, 24],   black: [30, defaultFG],
  red: [31, defaultFG],
  green: [32, defaultFG],
  yellow: [33, defaultFG],
  blue: [34, defaultFG],
  magenta: [35, defaultFG],
  cyan: [36, defaultFG],
  white: [37, defaultFG],
  bgBlack: [40, defaultBG],
  bgRed: [41, defaultBG],
  bgGreen: [42, defaultBG],
  bgYellow: [43, defaultBG],
  bgBlue: [44, defaultBG],
  bgMagenta: [45, defaultBG],
  bgCyan: [46, defaultBG],
  bgWhite: [47, defaultBG],
  framed: [51, 54],
  overlined: [53, 55],
  gray: [90, defaultFG],   redBright: [91, defaultFG],
  greenBright: [92, defaultFG],
  yellowBright: [93, defaultFG],
  blueBright: [94, defaultFG],
  magentaBright: [95, defaultFG],
  cyanBright: [96, defaultFG],
  whiteBright: [97, defaultFG],
  bgGray: [100, defaultBG],   bgRedBright: [101, defaultBG],
  bgGreenBright: [102, defaultBG],
  bgYellowBright: [103, defaultBG],
  bgBlueBright: [104, defaultBG],
  bgMagentaBright: [105, defaultBG],
  bgCyanBright: [106, defaultBG],
  bgWhiteBright: [107, defaultBG],
};
function defineColorAlias(target, alias) {
  ObjectDefineProperty(colors, alias, {
    get() {
      return this[target];
    },
    set(value) {
      this[target] = value;
    },
    configurable: true,
    enumerable: false,
  });
}
defineColorAlias("gray", "grey");
defineColorAlias("gray", "blackBright");
defineColorAlias("bgGray", "bgGrey");
defineColorAlias("bgGray", "bgBlackBright");
defineColorAlias("dim", "faint");
defineColorAlias("strikethrough", "crossedout");
defineColorAlias("strikethrough", "strikeThrough");
defineColorAlias("strikethrough", "crossedOut");
defineColorAlias("hidden", "conceal");
defineColorAlias("inverse", "swapColors");
defineColorAlias("inverse", "swapcolors");
defineColorAlias("doubleunderline", "doubleUnderline");
let _getSharedArrayBufferByteLength;
function isObjectLike(value) {
  return value !== null && typeof value === "object";
}
export function isAnyArrayBuffer(value) {
  return isArrayBuffer(value) || isSharedArrayBuffer(value);
}
export function isArgumentsObject(value) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === undefined &&
    ObjectPrototypeToString(value) === "[object Arguments]"
  );
}
export function isArrayBuffer(value) {
  try {
    ArrayBufferPrototypeGetByteLength(value);
    return true;
  } catch {
    return false;
  }
}
export function isAsyncFunction(value) {
  return (
    typeof value === "function" &&
    (value[SymbolToStringTag] === "AsyncFunction")
  );
}
export function isAsyncGeneratorFunction(value) {
  return (
    typeof value === "function" &&
    (value[SymbolToStringTag] === "AsyncGeneratorFunction")
  );
}
export function isBooleanObject(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  try {
    BooleanPrototypeValueOf(value);
    return true;
  } catch {
    return false;
  }
}
export function isBoxedPrimitive(
  value,
) {
  return (
    isBooleanObject(value) ||
    isStringObject(value) ||
    isNumberObject(value) ||
    isSymbolObject(value) ||
    isBigIntObject(value)
  );
}
export function isDataView(value) {
  return (
    ArrayBufferIsView(value) &&
    TypedArrayPrototypeGetSymbolToStringTag(value) === undefined
  );
}
export function isTypedArray(value) {
  return TypedArrayPrototypeGetSymbolToStringTag(value) !== undefined;
}
export function isGeneratorFunction(
  value,
) {
  return (
    typeof value === "function" &&
    value[SymbolToStringTag] === "GeneratorFunction"
  );
}
export function isMap(value) {
  try {
    MapPrototypeGetSize(value);
    return true;
  } catch {
    return false;
  }
}
export function isMapIterator(
  value,
) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === "Map Iterator"
  );
}
export function isModuleNamespaceObject(
  value,
) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === "Module"
  );
}
export function isNativeError(value) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === undefined &&
    ObjectPrototypeToString(value) === "[object Error]"
  );
}
export function isNumberObject(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  try {
    NumberPrototypeValueOf(value);
    return true;
  } catch {
    return false;
  }
}
export function isBigIntObject(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  try {
    BigIntPrototypeValueOf(value);
    return true;
  } catch {
    return false;
  }
}
export function isPromise(value) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === "Promise"
  );
}
export function isRegExp(value) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === undefined &&
    ObjectPrototypeToString(value) === "[object RegExp]"
  );
}
export function isSet(value) {
  try {
    SetPrototypeGetSize(value);
    return true;
  } catch {
    return false;
  }
}
export function isSetIterator(
  value,
) {
  return (
    isObjectLike(value) &&
    value[SymbolToStringTag] === "Set Iterator"
  );
}
export function isSharedArrayBuffer(
  value,
) {
    _getSharedArrayBufferByteLength ??= ObjectGetOwnPropertyDescriptor(
        SharedArrayBuffer.prototype,
    "byteLength",
  ).get;
  try {
    FunctionPrototypeCall(_getSharedArrayBufferByteLength, value);
    return true;
  } catch {
    return false;
  }
}
export function isStringObject(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  try {
    StringPrototypeValueOf(value);
    return true;
  } catch {
    return false;
  }
}
export function isSymbolObject(value) {
  if (!isObjectLike(value)) {
    return false;
  }
  try {
    SymbolPrototypeValueOf(value);
    return true;
  } catch {
    return false;
  }
}
export function isWeakMap(
  value,
) {
  try {
    WeakMapPrototypeHas(value, null);
    return true;
  } catch {
    return false;
  }
}
export function isWeakSet(
  value,
) {
  try {
    WeakSetPrototypeHas(value, null);
    return true;
  } catch {
    return false;
  }
}
const kObjectType = 0;
const kArrayType = 1;
const kArrayExtrasType = 2;
const kMinLineLength = 16;
const kWeak = 0;
const kIterator = 1;
const kMapEntries = 2;
const meta = [
  '\\x00', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\x07',   '\\b', '\\t', '\\n', '\\x0B', '\\f', '\\r', '\\x0E', '\\x0F',             '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',   '\\x18', '\\x19', '\\x1A', '\\x1B', '\\x1C', '\\x1D', '\\x1E', '\\x1F',   '', '', '', '', '', '', '', "\\'", '', '', '', '', '', '', '', '',        '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',           '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',           '', '', '', '', '', '', '', '', '', '', '', '', '\\\\', '', '', '',       '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',           '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '\\x7F',      '\\x80', '\\x81', '\\x82', '\\x83', '\\x84', '\\x85', '\\x86', '\\x87',   '\\x88', '\\x89', '\\x8A', '\\x8B', '\\x8C', '\\x8D', '\\x8E', '\\x8F',   '\\x90', '\\x91', '\\x92', '\\x93', '\\x94', '\\x95', '\\x96', '\\x97',   '\\x98', '\\x99', '\\x9A', '\\x9B', '\\x9C', '\\x9D', '\\x9E', '\\x9F', ];
const isUndetectableObject = (v) => typeof v === "undefined" && v !== undefined;
const strEscapeSequencesReplacer = new SafeRegExp(
  "[\x00-\x1f\x27\x5c\x7f-\x9f]",
  "g",
);
const keyStrRegExp = new SafeRegExp("^[a-zA-Z_][a-zA-Z_0-9]*$");
const numberRegExp = new SafeRegExp("^(0|[1-9][0-9]*)$");
const escapeFn = (str) => meta[StringPrototypeCharCodeAt(str, 0)];
function stylizeNoColor(str) {
  return str;
}
const nodeCustomInspectSymbol = SymbolFor("nodejs.util.inspect.custom");
const privateCustomInspect = SymbolFor("Deno.privateCustomInspect");
function getUserOptions(ctx, isCrossContext) {
  const ret = {
    stylize: ctx.stylize,
    showHidden: ctx.showHidden,
    depth: ctx.depth,
    colors: ctx.colors,
    customInspect: ctx.customInspect,
    showProxy: ctx.showProxy,
    maxArrayLength: ctx.maxArrayLength,
    maxStringLength: ctx.maxStringLength,
    breakLength: ctx.breakLength,
    compact: ctx.compact,
    sorted: ctx.sorted,
    getters: ctx.getters,
    numericSeparator: ctx.numericSeparator,
    ...ctx.userOptions,
  };
            if (isCrossContext) {
    ObjectSetPrototypeOf(ret, null);
    for (const key of new SafeArrayIterator(ObjectKeys(ret))) {
      if (
        (typeof ret[key] === "object" || typeof ret[key] === "function") &&
        ret[key] !== null
      ) {
        delete ret[key];
      }
    }
    ret.stylize = ObjectSetPrototypeOf((value, flavour) => {
      let stylized;
      try {
        stylized = `${ctx.stylize(value, flavour)}`;
      } catch {
              }
      if (typeof stylized !== "string") return value;
            return stylized;
    }, null);
  }
  return ret;
}
function formatValue(
  ctx,
  value,
  recurseTimes,
  typedArray,
) {
    if (
    typeof value !== "object" &&
    typeof value !== "function" &&
    !isUndetectableObject(value)
  ) {
    return formatPrimitive(ctx.stylize, value, ctx);
  }
  if (value === null) {
    return ctx.stylize("null", "null");
  }
    const context = value;
        const proxyDetails = core.getProxyDetails(value);
              
      if (ctx.customInspect) {
    if (
      ReflectHas(value, customInspect) &&
      typeof value[customInspect] === "function"
    ) {
      return String(value[customInspect](inspect, ctx));
    } else if (
      ReflectHas(value, privateCustomInspect) &&
      typeof value[privateCustomInspect] === "function"
    ) {
                              return String(value[privateCustomInspect](inspect, ctx));
    } else if (ReflectHas(value, nodeCustomInspectSymbol)) {
      const maybeCustom = value[nodeCustomInspectSymbol];
      if (
        typeof maybeCustom === "function" &&
                maybeCustom !== ctx.inspect &&
                !(value.constructor && value.constructor.prototype === value)
      ) {
                        const depth = ctx.depth === null ? null : ctx.depth - recurseTimes;
                const isCrossContext = !ObjectPrototypeIsPrototypeOf(
          ObjectPrototype,
          context,
        );
        const ret = FunctionPrototypeCall(
          maybeCustom,
          context,
          depth,
          getUserOptions(ctx, isCrossContext),
          ctx.inspect,
        );
                        if (ret !== context) {
          if (typeof ret !== "string") {
            return formatValue(ctx, ret, recurseTimes);
          }
          return StringPrototypeReplaceAll(
            ret,
            "\n",
            `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`,
          );
        }
      }
    }
  }
      if (ArrayPrototypeIncludes(ctx.seen, value)) {
    let index = 1;
    if (ctx.circular === undefined) {
      ctx.circular = new SafeMap();
      MapPrototypeSet(ctx.circular, value, index);
    } else {
      index = ctx.circular.get(value);
      if (index === undefined) {
        index = ctx.circular.size + 1;
        MapPrototypeSet(ctx.circular, value, index);
      }
    }
    return ctx.stylize(`[Circular *${index}]`, "special");
  }
  return formatRaw(ctx, value, recurseTimes, typedArray, proxyDetails);
}
function getClassBase(value, constructor, tag) {
  const hasName = ObjectHasOwn(value, "name");
  const name = (hasName && value.name) || "(anonymous)";
  let base = `class ${name}`;
  if (constructor !== "Function" && constructor !== null) {
    base += ` [${constructor}]`;
  }
  if (tag !== "" && constructor !== tag) {
    base += ` [${tag}]`;
  }
  if (constructor !== null) {
    const superName = ObjectGetPrototypeOf(value).name;
    if (superName) {
      base += ` extends ${superName}`;
    }
  } else {
    base += " extends [null prototype]";
  }
  return `[${base}]`;
}
const stripCommentsRegExp = new SafeRegExp(
  "(\\/\\/.*?\\n)|(\\/\\*(.|\\n)*?\\*\\/)",
  "g",
);
const classRegExp = new SafeRegExp("^(\\s+[^(]*?)\\s*{");
function getFunctionBase(value, constructor, tag) {
  const stringified = FunctionPrototypeToString(value);
  if (
    StringPrototypeStartsWith(stringified, "class") &&
    StringPrototypeEndsWith(stringified, "}")
  ) {
    const slice = StringPrototypeSlice(stringified, 5, -1);
    const bracketIndex = StringPrototypeIndexOf(slice, "{");
    if (
      bracketIndex !== -1 &&
      (!StringPrototypeIncludes(
        StringPrototypeSlice(slice, 0, bracketIndex),
        "(",
      ) ||
                RegExpPrototypeExec(
            classRegExp,
            RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice),
          ) !== null)
    ) {
      return getClassBase(value, constructor, tag);
    }
  }
  let type = "Function";
  if (isGeneratorFunction(value)) {
    type = `Generator${type}`;
  }
  if (isAsyncFunction(value)) {
    type = `Async${type}`;
  }
  if (isAsyncGeneratorFunction(value)) {
    type = `AsyncGenerator${type}`;
  }
  let base = `[${type}`;
  if (constructor === null) {
    base += " (null prototype)";
  }
  if (value.name === "") {
    base += " (anonymous)";
  } else {
    base += `: ${value.name}`;
  }
  base += "]";
  if (constructor !== type && constructor !== null) {
    base += ` ${constructor}`;
  }
  if (tag !== "" && constructor !== tag) {
    base += ` [${tag}]`;
  }
  return base;
}
function formatRaw(ctx, value, recurseTimes, typedArray, proxyDetails) {
  let keys;
  let protoProps;
  if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null)) {
    protoProps = [];
  }
  const constructor = getConstructorName(value, ctx, recurseTimes, protoProps);
    if (protoProps !== undefined && protoProps.length === 0) {
    protoProps = undefined;
  }
  let tag = value[SymbolToStringTag];
      if (
    typeof tag !== "string"
                                  ) {
    tag = "";
  }
  let base = "";
  let formatter = () => [];
  let braces;
  let noIterator = true;
  let i = 0;
  const filter = ctx.showHidden ? 0 : 2;
  let extrasType = kObjectType;
  if (proxyDetails != null && ctx.showProxy) {
    return `Proxy ` + formatValue(ctx, proxyDetails, recurseTimes);
  } else {
                if (ReflectHas(value, SymbolIterator) || constructor === null) {
      noIterator = false;
      if (ArrayIsArray(value)) {
                const prefix = (constructor !== "Array" || tag !== "")
          ? getPrefix(constructor, tag, "Array", `(${value.length})`)
          : "";
        keys = core.ops.op_get_non_index_property_names(value, filter);
        braces = [`${prefix}[`, "]"];
        if (
          value.length === 0 && keys.length === 0 && protoProps === undefined
        ) {
          return `${braces[0]}]`;
        }
        extrasType = kArrayExtrasType;
        formatter = formatArray;
      } else if (isSet(value)) {
        const size = SetPrototypeGetSize(value);
        const prefix = getPrefix(constructor, tag, "Set", `(${size})`);
        keys = getKeys(value, ctx.showHidden);
        formatter = constructor !== null
          ? FunctionPrototypeBind(formatSet, null, value)
          : FunctionPrototypeBind(formatSet, null, SetPrototypeValues(value));
        if (size === 0 && keys.length === 0 && protoProps === undefined) {
          return `${prefix}{}`;
        }
        braces = [`${prefix}{`, "}"];
      } else if (isMap(value)) {
        const size = MapPrototypeGetSize(value);
        const prefix = getPrefix(constructor, tag, "Map", `(${size})`);
        keys = getKeys(value, ctx.showHidden);
        formatter = constructor !== null
          ? FunctionPrototypeBind(formatMap, null, value)
          : FunctionPrototypeBind(formatMap, null, MapPrototypeEntries(value));
        if (size === 0 && keys.length === 0 && protoProps === undefined) {
          return `${prefix}{}`;
        }
        braces = [`${prefix}{`, "}"];
      } else if (isTypedArray(value)) {
        keys = core.ops.op_get_non_index_property_names(value, filter);
        const bound = value;
        const fallback = "";
        if (constructor === null) {
                                                }
        const size = TypedArrayPrototypeGetLength(value);
        const prefix = getPrefix(constructor, tag, fallback, `(${size})`);
        braces = [`${prefix}[`, "]"];
        if (value.length === 0 && keys.length === 0 && !ctx.showHidden) {
          return `${braces[0]}]`;
        }
                        formatter = FunctionPrototypeBind(formatTypedArray, null, bound, size);
        extrasType = kArrayExtrasType;
      } else if (isMapIterator(value)) {
        keys = getKeys(value, ctx.showHidden);
        braces = getIteratorBraces("Map", tag);
                formatter = FunctionPrototypeBind(formatIterator, null, braces);
      } else if (isSetIterator(value)) {
        keys = getKeys(value, ctx.showHidden);
        braces = getIteratorBraces("Set", tag);
                formatter = FunctionPrototypeBind(formatIterator, null, braces);
      } else {
        noIterator = true;
      }
    }
    if (noIterator) {
      keys = getKeys(value, ctx.showHidden);
      braces = ["{", "}"];
      if (constructor === "Object") {
        if (isArgumentsObject(value)) {
          braces[0] = "[Arguments] {";
        } else if (tag !== "") {
          braces[0] = `${getPrefix(constructor, tag, "Object")}{`;
        }
        if (keys.length === 0 && protoProps === undefined) {
          return `${braces[0]}}`;
        }
      } else if (typeof value === "function") {
        base = getFunctionBase(value, constructor, tag);
        if (keys.length === 0 && protoProps === undefined) {
          return ctx.stylize(base, "special");
        }
      } else if (isRegExp(value)) {
                base = RegExpPrototypeToString(
          constructor !== null ? value : new SafeRegExp(value),
        );
        const prefix = getPrefix(constructor, tag, "RegExp");
        if (prefix !== "RegExp ") {
          base = `${prefix}${base}`;
        }
        if (
          (keys.length === 0 && protoProps === undefined) ||
          (recurseTimes > ctx.depth && ctx.depth !== null)
        ) {
          return ctx.stylize(base, "regexp");
        }
      } else if (ObjectPrototypeIsPrototypeOf(DatePrototype, value)) {
        const date = proxyDetails ? proxyDetails[0] : value;
        if (isNaN(DatePrototypeGetTime(date))) {
          return ctx.stylize("Invalid Date", "date");
        } else {
          base = DatePrototypeToISOString(date);
          if (keys.length === 0 && protoProps === undefined) {
            return ctx.stylize(base, "date");
          }
        }
      } else if (ObjectPrototypeIsPrototypeOf(ErrorPrototype, value)) {
        base = inspectError(value, ctx);
        if (keys.length === 0 && protoProps === undefined) {
          return base;
        }
      } else if (isAnyArrayBuffer(value)) {
                                const arrayType = isArrayBuffer(value)
          ? "ArrayBuffer"
          : "SharedArrayBuffer";
        const prefix = getPrefix(constructor, tag, arrayType);
        if (typedArray === undefined) {
          formatter = formatArrayBuffer;
        } else if (keys.length === 0 && protoProps === undefined) {
          return prefix +
            `{ byteLength: ${
              formatNumber(ctx.stylize, TypedArrayPrototypeGetByteLength(value))
            } }`;
        }
        braces[0] = `${prefix}{`;
        ArrayPrototypeUnshift(keys, "byteLength");
      } else if (isDataView(value)) {
        braces[0] = `${getPrefix(constructor, tag, "DataView")}{`;
                ArrayPrototypeUnshift(keys, "byteLength", "byteOffset", "buffer");
      } else if (isPromise(value)) {
        braces[0] = `${getPrefix(constructor, tag, "Promise")}{`;
        formatter = formatPromise;
      } else if (isWeakSet(value)) {
        braces[0] = `${getPrefix(constructor, tag, "WeakSet")}{`;
        formatter = ctx.showHidden ? formatWeakSet : formatWeakCollection;
      } else if (isWeakMap(value)) {
        braces[0] = `${getPrefix(constructor, tag, "WeakMap")}{`;
        formatter = ctx.showHidden ? formatWeakMap : formatWeakCollection;
      } else if (isModuleNamespaceObject(value)) {
        braces[0] = `${getPrefix(constructor, tag, "Module")}{`;
                formatter = FunctionPrototypeBind(formatNamespaceObject, null, keys);
      } else if (isBoxedPrimitive(value)) {
        base = getBoxedBase(value, ctx, keys, constructor, tag);
        if (keys.length === 0 && protoProps === undefined) {
          return base;
        }
      } else {
        if (keys.length === 0 && protoProps === undefined) {
                                                            return `${getCtxStyle(value, constructor, tag)}{}`;
        }
        braces[0] = `${getCtxStyle(value, constructor, tag)}{`;
      }
    }
  }
  if (recurseTimes > ctx.depth && ctx.depth !== null) {
    let constructorName = StringPrototypeSlice(
      getCtxStyle(value, constructor, tag),
      0,
      -1,
    );
    if (constructor !== null) {
      constructorName = `[${constructorName}]`;
    }
    return ctx.stylize(constructorName, "special");
  }
  recurseTimes += 1;
  ArrayPrototypePush(ctx.seen, value);
  ctx.currentDepth = recurseTimes;
  let output;
  try {
    output = formatter(ctx, value, recurseTimes);
    for (i = 0; i < keys.length; i++) {
      ArrayPrototypePush(
        output,
        formatProperty(ctx, value, recurseTimes, keys[i], extrasType),
      );
    }
    if (protoProps !== undefined) {
      ArrayPrototypePushApply(output, protoProps);
    }
  } catch (error) {
        return ctx.stylize(
      `[Internal Formatting Error] ${error.stack}`,
      "internalError",
    );
  }
  if (ctx.circular !== undefined) {
    const index = ctx.circular.get(value);
    if (index !== undefined) {
      const reference = ctx.stylize(`<ref *${index}>`, "special");
            if (ctx.compact !== true) {
        base = base === "" ? reference : `${reference} ${base}`;
      } else {
        braces[0] = `${reference} ${braces[0]}`;
      }
    }
  }
  ArrayPrototypePop(ctx.seen);
  if (ctx.sorted) {
    const comparator = ctx.sorted === true ? undefined : ctx.sorted;
    if (extrasType === kObjectType) {
      output = ArrayPrototypeSort(output, comparator);
    } else if (keys.length > 1) {
      const sorted = ArrayPrototypeSort(
        ArrayPrototypeSlice(output, output.length - keys.length),
        comparator,
      );
      ArrayPrototypeSplice(
        output,
        output.length - keys.length,
        keys.length,
        ...new SafeArrayIterator(sorted),
      );
    }
  }
  const res = reduceToSingleString(
    ctx,
    output,
    base,
    braces,
    extrasType,
    recurseTimes,
    value,
  );
  const budget = ctx.budget[ctx.indentationLvl] || 0;
  const newLength = budget + res.length;
  ctx.budget[ctx.indentationLvl] = newLength;
                if (newLength > 2 ** 27) {
    ctx.depth = -1;
  }
  return res;
}
const builtInObjectsRegExp = new SafeRegExp("^[A-Z][a-zA-Z0-9]+$");
const builtInObjects = new SafeSet(
  ArrayPrototypeFilter(
    ObjectGetOwnPropertyNames(globalThis),
    (e) => RegExpPrototypeTest(builtInObjectsRegExp, e),
  ),
);
function addPrototypeProperties(
  ctx,
  main,
  obj,
  recurseTimes,
  output,
) {
  let depth = 0;
  let keys;
  let keySet;
  do {
    if (depth !== 0 || main === obj) {
      obj = ObjectGetPrototypeOf(obj);
            if (obj === null) {
        return;
      }
            const descriptor = ObjectGetOwnPropertyDescriptor(obj, "constructor");
      if (
        descriptor !== undefined &&
        typeof descriptor.value === "function" &&
        SetPrototypeHas(builtInObjects, descriptor.value.name)
      ) {
        return;
      }
    }
    if (depth === 0) {
      keySet = new SafeSet();
    } else {
      ArrayPrototypeForEach(keys, (key) => SetPrototypeAdd(keySet, key));
    }
        keys = ReflectOwnKeys(obj);
    ArrayPrototypePush(ctx.seen, main);
    for (const key of new SafeArrayIterator(keys)) {
            if (
        key === "constructor" ||
        ObjectHasOwn(main, key) ||
        (depth !== 0 && SetPrototypeHas(keySet, key))
      ) {
        continue;
      }
      const desc = ObjectGetOwnPropertyDescriptor(obj, key);
      if (typeof desc.value === "function") {
        continue;
      }
      const value = formatProperty(
        ctx,
        obj,
        recurseTimes,
        key,
        kObjectType,
        desc,
        main,
      );
      if (ctx.colors) {
                ArrayPrototypePush(output, `\u001b[2m${value}\u001b[22m`);
      } else {
        ArrayPrototypePush(output, value);
      }
    }
    ArrayPrototypePop(ctx.seen);
              } while (++depth !== 3);
}
function isInstanceof(proto, object) {
  try {
    return ObjectPrototypeIsPrototypeOf(proto, object);
  } catch {
    return false;
  }
}
function getConstructorName(obj, ctx, recurseTimes, protoProps) {
  let firstProto;
  const tmp = obj;
  while (obj || isUndetectableObject(obj)) {
    const descriptor = ObjectGetOwnPropertyDescriptor(obj, "constructor");
    if (
      descriptor !== undefined &&
      typeof descriptor.value === "function" &&
      descriptor.value.name !== "" &&
      isInstanceof(descriptor.value.prototype, tmp)
    ) {
      if (
        protoProps !== undefined &&
        (firstProto !== obj ||
          !SetPrototypeHas(builtInObjects, descriptor.value.name))
      ) {
        addPrototypeProperties(
          ctx,
          tmp,
          firstProto || tmp,
          recurseTimes,
          protoProps,
        );
      }
      return String(descriptor.value.name);
    }
    obj = ObjectGetPrototypeOf(obj);
    if (firstProto === undefined) {
      firstProto = obj;
    }
  }
  if (firstProto === null) {
    return null;
  }
  const res = core.ops.op_get_constructor_name(tmp);
  if (recurseTimes > ctx.depth && ctx.depth !== null) {
    return `${res} <Complex prototype>`;
  }
  const protoConstr = getConstructorName(
    firstProto,
    ctx,
    recurseTimes + 1,
    protoProps,
  );
  if (protoConstr === null) {
    return `${res} <${
      inspect(firstProto, {
        ...ctx,
        customInspect: false,
        depth: -1,
      })
    }>`;
  }
  return `${res} <${protoConstr}>`;
}
const formatPrimitiveRegExp = new SafeRegExp("(?<=\n)");
function formatPrimitive(fn, value, ctx) {
  if (typeof value === "string") {
    let trailer = "";
    if (value.length > ctx.maxStringLength) {
      const remaining = value.length - ctx.maxStringLength;
      value = StringPrototypeSlice(value, 0, ctx.maxStringLength);
      trailer = `... ${remaining} more character${remaining > 1 ? "s" : ""}`;
    }
    if (
      ctx.compact !== true &&
                  value.length > kMinLineLength &&
      value.length > ctx.breakLength - ctx.indentationLvl - 4
    ) {
      return ArrayPrototypeJoin(
        ArrayPrototypeMap(
          StringPrototypeSplit(value, formatPrimitiveRegExp),
          (line) => fn(quoteString(line, ctx), "string"),
        ),
        ` +\n${StringPrototypeRepeat(" ", ctx.indentationLvl + 2)}`,
      ) + trailer;
    }
    return fn(quoteString(value, ctx), "string") + trailer;
  }
  if (typeof value === "number") {
    return formatNumber(fn, value);
  }
  if (typeof value === "bigint") {
    return formatBigInt(fn, value);
  }
  if (typeof value === "boolean") {
    return fn(`${value}`, "boolean");
  }
  if (typeof value === "undefined") {
    return fn("undefined", "undefined");
  }
    return fn(maybeQuoteSymbol(value, ctx), "symbol");
}
function getPrefix(constructor, tag, fallback, size = "") {
  if (constructor === null) {
    if (tag !== "" && fallback !== tag) {
      return `[${fallback}${size}: null prototype] [${tag}] `;
    }
    return `[${fallback}${size}: null prototype] `;
  }
  if (tag !== "" && constructor !== tag) {
    return `${constructor}${size} [${tag}] `;
  }
  return `${constructor}${size} `;
}
function formatArray(ctx, value, recurseTimes) {
  const valLen = value.length;
  const len = MathMin(MathMax(0, ctx.maxArrayLength), valLen);
  const remaining = valLen - len;
  const output = [];
  for (let i = 0; i < len; i++) {
        if (!ObjectHasOwn(value, i)) {
      return formatSpecialArray(ctx, value, recurseTimes, len, output, i);
    }
    ArrayPrototypePush(
      output,
      formatProperty(ctx, value, recurseTimes, i, kArrayType),
    );
  }
  if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  return output;
}
function getCtxStyle(value, constructor, tag) {
  let fallback = "";
  if (constructor === null) {
    fallback = core.ops.op_get_constructor_name(value);
    if (fallback === tag) {
      fallback = "Object";
    }
  }
  return getPrefix(constructor, tag, fallback);
}
function getKeys(value, showHidden) {
  let keys;
  const symbols = ObjectGetOwnPropertySymbols(value);
  if (showHidden) {
    keys = ObjectGetOwnPropertyNames(value);
    if (symbols.length !== 0) {
      ArrayPrototypePushApply(keys, symbols);
    }
  } else {
                        try {
      keys = ObjectKeys(value);
    } catch (err) {
      assert(
        isNativeError(err) && err.name === "ReferenceError" &&
          isModuleNamespaceObject(value),
      );
      keys = ObjectGetOwnPropertyNames(value);
    }
    if (symbols.length !== 0) {
      const filter = (key) => ObjectPrototypePropertyIsEnumerable(value, key);
      ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, filter));
    }
  }
  return keys;
}
function formatSet(value, ctx, _ignored, recurseTimes) {
  ctx.indentationLvl += 2;
  const values = [...new SafeSetIterator(value)];
  const valLen = SetPrototypeGetSize(value);
  const len = MathMin(MathMax(0, ctx.iterableLimit), valLen);
  const remaining = valLen - len;
  const output = [];
  for (let i = 0; i < len; i++) {
    ArrayPrototypePush(output, formatValue(ctx, values[i], recurseTimes));
  }
  if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  ctx.indentationLvl -= 2;
  return output;
}
function formatMap(value, ctx, _gnored, recurseTimes) {
  ctx.indentationLvl += 2;
  const values = [...new SafeMapIterator(value)];
  const valLen = MapPrototypeGetSize(value);
  const len = MathMin(MathMax(0, ctx.iterableLimit), valLen);
  const remaining = valLen - len;
  const output = [];
  for (let i = 0; i < len; i++) {
    ArrayPrototypePush(
      output,
      `${formatValue(ctx, values[i][0], recurseTimes)} => ${
        formatValue(ctx, values[i][1], recurseTimes)
      }`,
    );
  }
  if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  ctx.indentationLvl -= 2;
  return output;
}
function formatTypedArray(
  value,
  length,
  ctx,
  _ignored,
  recurseTimes,
) {
  const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
  const remaining = value.length - maxLength;
  const output = new Array(maxLength);
  const elementFormatter = value.length > 0 && typeof value[0] === "number"
    ? formatNumber
    : formatBigInt;
  for (let i = 0; i < maxLength; ++i) {
    output[i] = elementFormatter(ctx.stylize, value[i]);
  }
  if (remaining > 0) {
    output[maxLength] = `... ${remaining} more item${remaining > 1 ? "s" : ""}`;
  }
  if (ctx.showHidden) {
            ctx.indentationLvl += 2;
    for (
      const key of new SafeArrayIterator([
        "BYTES_PER_ELEMENT",
        "length",
        "byteLength",
        "byteOffset",
        "buffer",
      ])
    ) {
      const str = formatValue(ctx, value[key], recurseTimes, true);
      ArrayPrototypePush(output, `[${key}]: ${str}`);
    }
    ctx.indentationLvl -= 2;
  }
  return output;
}
function getIteratorBraces(type, tag) {
  if (tag !== `${type} Iterator`) {
    if (tag !== "") {
      tag += "] [";
    }
    tag += `${type} Iterator`;
  }
  return [`[${tag}] {`, "}"];
}
const iteratorRegExp = new SafeRegExp(" Iterator] {$");
function formatIterator(braces, ctx, value, recurseTimes) {
      const { 0: entries, 1: isKeyValue } = value;
  if (isKeyValue) {
        braces[0] = StringPrototypeReplace(
      braces[0],
      iteratorRegExp,
      " Entries] {",
    );
    return formatMapIterInner(ctx, recurseTimes, entries, kMapEntries);
  }
  return formatSetIterInner(ctx, recurseTimes, entries, kIterator);
}
function handleCircular(value, ctx) {
  let index = 1;
  if (ctx.circular === undefined) {
    ctx.circular = new SafeMap();
    MapPrototypeSet(ctx.circular, value, index);
  } else {
    index = MapPrototypeGet(ctx.circular, value);
    if (index === undefined) {
      index = MapPrototypeGetSize(ctx.circular) + 1;
      MapPrototypeSet(ctx.circular, value, index);
    }
  }
    return ctx.stylize(`[Circular *${index}]`, "special");
}
const AGGREGATE_ERROR_HAS_AT_PATTERN = new SafeRegExp(/\s+at/);
const AGGREGATE_ERROR_NOT_EMPTY_LINE_PATTERN = new SafeRegExp(/^(?!\s*$)/gm);
function inspectError(value, ctx) {
  const causes = [value];
  let err = value;
  while (err.cause) {
    if (ArrayPrototypeIncludes(causes, err.cause)) {
      ArrayPrototypePush(causes, handleCircular(err.cause, ctx));
      break;
    } else {
      ArrayPrototypePush(causes, err.cause);
      err = err.cause;
    }
  }
  const refMap = new SafeMap();
  for (let i = 0; i < causes.length; ++i) {
    const cause = causes[i];
    if (ctx.circular !== undefined) {
      const index = MapPrototypeGet(ctx.circular, cause);
      if (index !== undefined) {
        MapPrototypeSet(
          refMap,
          cause,
          ctx.stylize(`<ref *${index}> `, "special"),
        );
      }
    }
  }
  ArrayPrototypeShift(causes);
  let finalMessage = MapPrototypeGet(refMap, value) ?? "";
  if (ObjectPrototypeIsPrototypeOf(AggregateErrorPrototype, value)) {
    const stackLines = StringPrototypeSplit(value.stack, "\n");
    while (true) {
      const line = ArrayPrototypeShift(stackLines);
      if (RegExpPrototypeTest(AGGREGATE_ERROR_HAS_AT_PATTERN, line)) {
        ArrayPrototypeUnshift(stackLines, line);
        break;
      } else if (typeof line === "undefined") {
        break;
      }
      finalMessage += line;
      finalMessage += "\n";
    }
    const aggregateMessage = ArrayPrototypeJoin(
      ArrayPrototypeMap(
        value.errors,
        (error) =>
          StringPrototypeReplace(
            inspectArgs([error]),
            AGGREGATE_ERROR_NOT_EMPTY_LINE_PATTERN,
            StringPrototypeRepeat(" ", 4),
          ),
      ),
      "\n",
    );
    finalMessage += aggregateMessage;
    finalMessage += "\n";
    finalMessage += ArrayPrototypeJoin(stackLines, "\n");
  } else {
    const stack = value.stack;
    if (stack?.includes("\n    at")) {
      finalMessage += stack;
    } else {
      finalMessage += `[${stack || value.toString()}]`;
    }
  }
  finalMessage += ArrayPrototypeJoin(
    ArrayPrototypeMap(
      causes,
      (cause) =>
        "\nCaused by " + (MapPrototypeGet(refMap, cause) ?? "") +
        (cause?.stack ?? cause),
    ),
    "",
  );
  return finalMessage;
}
const hexSliceLookupTable = function () {
  const alphabet = "0123456789abcdef";
  const table = new Array(256);
  for (let i = 0; i < 16; ++i) {
    const i16 = i * 16;
    for (let j = 0; j < 16; ++j) {
      table[i16 + j] = alphabet[i] + alphabet[j];
    }
  }
  return table;
}();
function hexSlice(buf, start, end) {
  const len = buf.length;
  if (!start || start < 0) {
    start = 0;
  }
  if (!end || end < 0 || end > len) {
    end = len;
  }
  let out = "";
  for (let i = start; i < end; ++i) {
    out += hexSliceLookupTable[buf[i]];
  }
  return out;
}
const arrayBufferRegExp = new SafeRegExp("(.{2})", "g");
function formatArrayBuffer(ctx, value) {
  let buffer;
  try {
    buffer = new Uint8Array(value);
  } catch {
    return [ctx.stylize("(detached)", "special")];
  }
  let str = StringPrototypeTrim(
    StringPrototypeReplace(
      hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)),
      arrayBufferRegExp,
      "$1 ",
    ),
  );
  const remaining = buffer.length - ctx.maxArrayLength;
  if (remaining > 0) {
    str += ` ... ${remaining} more byte${remaining > 1 ? "s" : ""}`;
  }
  return [`${ctx.stylize("[Uint8Contents]", "special")}: <${str}>`];
}
function formatNumber(fn, value) {
    return fn(ObjectIs(value, -0) ? "-0" : `${value}`, "number");
}
const PromiseState = {
  Pending: 0,
  Fulfilled: 1,
  Rejected: 2,
};
function formatPromise(ctx, value, recurseTimes) {
  let output;
  let opResult;
    try {
    opResult = core.getPromiseDetails(value);
  } catch {
    return [ctx.stylize("<unknown>", "special")];
  }
  const { 0: state, 1: result } = opResult;
  if (state === PromiseState.Pending) {
    output = [ctx.stylize("<pending>", "special")];
  } else {
    ctx.indentationLvl += 2;
    const str = formatValue(ctx, result, recurseTimes);
    ctx.indentationLvl -= 2;
    output = [
      state === PromiseState.Rejected
        ? `${ctx.stylize("<rejected>", "special")} ${str}`
        : str,
    ];
  }
  return output;
}
function formatWeakCollection(ctx) {
  return [ctx.stylize("<items unknown>", "special")];
}
function formatWeakSet(ctx, value, recurseTimes) {
      const entries = value;
  return formatSetIterInner(ctx, recurseTimes, entries, kWeak);
}
function formatWeakMap(ctx, value, recurseTimes) {
      const entries = value;
  return formatMapIterInner(ctx, recurseTimes, entries, kWeak);
}
function formatProperty(
  ctx,
  value,
  recurseTimes,
  key,
  type,
  desc,
  original = value,
) {
  let name, str;
  let extra = " ";
  desc = desc || ObjectGetOwnPropertyDescriptor(value, key) ||
    { value: value[key], enumerable: true };
  if (desc.value !== undefined) {
    const diff = (ctx.compact !== true || type !== kObjectType) ? 2 : 3;
    ctx.indentationLvl += diff;
    str = formatValue(ctx, desc.value, recurseTimes);
    if (diff === 3 && ctx.breakLength < getStringWidth(str, ctx.colors)) {
      extra = `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`;
    }
    ctx.indentationLvl -= diff;
  } else if (desc.get !== undefined) {
    const label = desc.set !== undefined ? "Getter/Setter" : "Getter";
    const s = ctx.stylize;
    const sp = "special";
    if (
      ctx.getters && (ctx.getters === true ||
        (ctx.getters === "get" && desc.set === undefined) ||
        (ctx.getters === "set" && desc.set !== undefined))
    ) {
      try {
        const tmp = FunctionPrototypeCall(desc.get, original);
        ctx.indentationLvl += 2;
        if (tmp === null) {
          str = `${s(`[${label}:`, sp)} ${s("null", "null")}${s("]", sp)}`;
        } else if (typeof tmp === "object") {
          str = `${s(`[${label}]`, sp)} ${formatValue(ctx, tmp, recurseTimes)}`;
        } else {
          const primitive = formatPrimitive(s, tmp, ctx);
          str = `${s(`[${label}:`, sp)} ${primitive}${s("]", sp)}`;
        }
        ctx.indentationLvl -= 2;
      } catch (err) {
        const message = `<Inspection threw (${err.message})>`;
        str = `${s(`[${label}:`, sp)} ${message}${s("]", sp)}`;
      }
    } else {
      str = ctx.stylize(`[${label}]`, sp);
    }
  } else if (desc.set !== undefined) {
    str = ctx.stylize("[Setter]", "special");
  } else {
    str = ctx.stylize("undefined", "undefined");
  }
  if (type === kArrayType) {
    return str;
  }
  if (typeof key === "symbol") {
    name = `[${ctx.stylize(maybeQuoteSymbol(key, ctx), "symbol")}]`;
  } else if (key === "__proto__") {
    name = "['__proto__']";
  } else if (desc.enumerable === false) {
    const tmp = StringPrototypeReplace(
      key,
      strEscapeSequencesReplacer,
      escapeFn,
    );
    name = `[${tmp}]`;
  } else if (keyStrRegExp.test(key)) {
    name = ctx.stylize(key, "name");
  } else {
    name = ctx.stylize(quoteString(key, ctx), "string");
  }
  return `${name}:${extra}${str}`;
}
const colorRegExp = new SafeRegExp("\u001b\\[\\d\\d?m", "g");
function removeColors(str) {
  return StringPrototypeReplace(str, colorRegExp, "");
}
function isBelowBreakLength(ctx, output, start, base) {
              let totalLength = output.length + start;
  if (totalLength + output.length > ctx.breakLength) {
    return false;
  }
  for (let i = 0; i < output.length; i++) {
    if (ctx.colors) {
      totalLength += removeColors(output[i]).length;
    } else {
      totalLength += output[i].length;
    }
    if (totalLength > ctx.breakLength) {
      return false;
    }
  }
    return base === "" || !StringPrototypeIncludes(base, "\n");
}
function formatBigInt(fn, value) {
  return fn(`${value}n`, "bigint");
}
function formatNamespaceObject(
  keys,
  ctx,
  value,
  recurseTimes,
) {
  const output = new Array(keys.length);
  for (let i = 0; i < keys.length; i++) {
    try {
      output[i] = formatProperty(
        ctx,
        value,
        recurseTimes,
        keys[i],
        kObjectType,
      );
    } catch (_err) {
                                    const tmp = { [keys[i]]: "" };
      output[i] = formatProperty(ctx, tmp, recurseTimes, keys[i], kObjectType);
      const pos = StringPrototypeLastIndexOf(output[i], " ");
                  output[i] = StringPrototypeSlice(output[i], 0, pos + 1) +
        ctx.stylize("<uninitialized>", "special");
    }
  }
    keys.length = 0;
  return output;
}
function formatSpecialArray(
  ctx,
  value,
  recurseTimes,
  maxLength,
  output,
  i,
) {
  const keys = ObjectKeys(value);
  let index = i;
  for (; i < keys.length && output.length < maxLength; i++) {
    const key = keys[i];
    const tmp = +key;
        if (tmp > 2 ** 32 - 2) {
      break;
    }
    if (`${index}` !== key) {
      if (!numberRegExp.test(key)) {
        break;
      }
      const emptyItems = tmp - index;
      const ending = emptyItems > 1 ? "s" : "";
      const message = `<${emptyItems} empty item${ending}>`;
      ArrayPrototypePush(output, ctx.stylize(message, "undefined"));
      index = tmp;
      if (output.length === maxLength) {
        break;
      }
    }
    ArrayPrototypePush(
      output,
      formatProperty(ctx, value, recurseTimes, key, kArrayType),
    );
    index++;
  }
  const remaining = value.length - index;
  if (output.length !== maxLength) {
    if (remaining > 0) {
      const ending = remaining > 1 ? "s" : "";
      const message = `<${remaining} empty item${ending}>`;
      ArrayPrototypePush(output, ctx.stylize(message, "undefined"));
    }
  } else if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  return output;
}
function getBoxedBase(
  value,
  ctx,
  keys,
  constructor,
  tag,
) {
  let type, primitive;
  if (isNumberObject(value)) {
    type = "Number";
    primitive = NumberPrototypeValueOf(value);
  } else if (isStringObject(value)) {
    type = "String";
    primitive = StringPrototypeValueOf(value);
                ArrayPrototypeSplice(keys, 0, value.length);
  } else if (isBooleanObject(value)) {
    type = "Boolean";
    primitive = BooleanPrototypeValueOf(value);
  } else if (isBigIntObject(value)) {
    type = "BigInt";
    primitive = BigIntPrototypeValueOf(value);
  } else {
    type = "Symbol";
    primitive = SymbolPrototypeValueOf(value);
  }
  let base = `[${type}`;
  if (type !== constructor) {
    if (constructor === null) {
      base += " (null prototype)";
    } else {
      base += ` (${constructor})`;
    }
  }
  base += `: ${formatPrimitive(stylizeNoColor, primitive, ctx)}]`;
  if (tag !== "" && tag !== constructor) {
    base += ` [${tag}]`;
  }
  if (keys.length !== 0 || ctx.stylize === stylizeNoColor) {
    return base;
  }
  return ctx.stylize(base, StringPrototypeToLowerCase(type));
}
function reduceToSingleString(
  ctx,
  output,
  base,
  braces,
  extrasType,
  recurseTimes,
  value,
) {
  if (ctx.compact !== true) {
    if (typeof ctx.compact === "number" && ctx.compact >= 1) {
                  const entries = output.length;
                  if (extrasType === kArrayExtrasType && entries > 6) {
        output = groupArrayElements(ctx, output, value);
      }
                                                                                          if (
        ctx.currentDepth - recurseTimes < ctx.compact &&
        entries === output.length
      ) {
                                const start = output.length + ctx.indentationLvl +
          braces[0].length + base.length + 10;
        if (isBelowBreakLength(ctx, output, start, base)) {
          const joinedOutput = ArrayPrototypeJoin(output, ", ");
          if (!StringPrototypeIncludes(joinedOutput, "\n")) {
            return `${base ? `${base} ` : ""}${braces[0]} ${joinedOutput}` +
              ` ${braces[1]}`;
          }
        }
      }
    }
        const indentation = `\n${StringPrototypeRepeat(" ", ctx.indentationLvl)}`;
    return `${base ? `${base} ` : ""}${braces[0]}${indentation}  ` +
      `${ArrayPrototypeJoin(output, `,${indentation}  `)}${
        ctx.trailingComma ? "," : ""
      }${indentation}${braces[1]}`;
  }
      if (isBelowBreakLength(ctx, output, 0, base)) {
    return `${braces[0]}${base ? ` ${base}` : ""} ${
      ArrayPrototypeJoin(output, ", ")
    } ` +
      braces[1];
  }
  const indentation = StringPrototypeRepeat(" ", ctx.indentationLvl);
        const ln = base === "" && braces[0].length === 1
    ? " "
    : `${base ? ` ${base}` : ""}\n${indentation}  `;
    return `${braces[0]}${ln}${
    ArrayPrototypeJoin(output, `,\n${indentation}  `)
  } ${braces[1]}`;
}
function groupArrayElements(ctx, output, value) {
  let totalLength = 0;
  let maxLength = 0;
  let i = 0;
  let outputLength = output.length;
  if (ctx.maxArrayLength < output.length) {
        outputLength--;
  }
  const separatorSpace = 2;   const dataLen = new Array(outputLength);
        for (; i < outputLength; i++) {
    const len = getStringWidth(output[i], ctx.colors);
    dataLen[i] = len;
    totalLength += len + separatorSpace;
    if (maxLength < len) {
      maxLength = len;
    }
  }
      const actualMax = maxLength + separatorSpace;
          if (
    actualMax * 3 + ctx.indentationLvl < ctx.breakLength &&
    (totalLength / actualMax > 5 || maxLength <= 6)
  ) {
    const approxCharHeights = 2.5;
    const averageBias = MathSqrt(actualMax - totalLength / output.length);
    const biasedMax = MathMax(actualMax - 3 - averageBias, 1);
        const columns = MathMin(
                                    MathRound(
        MathSqrt(
          approxCharHeights * biasedMax * outputLength,
        ) / biasedMax,
      ),
            MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax),
                  ctx.compact * 4,
            15,
    );
        if (columns <= 1) {
      return output;
    }
    const tmp = [];
    const maxLineLength = [];
    for (let i = 0; i < columns; i++) {
      let lineMaxLength = 0;
      for (let j = i; j < output.length; j += columns) {
        if (dataLen[j] > lineMaxLength) {
          lineMaxLength = dataLen[j];
        }
      }
      lineMaxLength += separatorSpace;
      maxLineLength[i] = lineMaxLength;
    }
    let order = StringPrototypePadStart;
    if (value !== undefined) {
      for (let i = 0; i < output.length; i++) {
        if (typeof value[i] !== "number" && typeof value[i] !== "bigint") {
          order = StringPrototypePadEnd;
          break;
        }
      }
    }
        for (let i = 0; i < outputLength; i += columns) {
            const max = MathMin(i + columns, outputLength);
      let str = "";
      let j = i;
      for (; j < max - 1; j++) {
                                const padding = maxLineLength[j - i] + output[j].length - dataLen[j];
        str += order(`${output[j]}, `, padding, " ");
      }
      if (order === StringPrototypePadStart) {
        const padding = maxLineLength[j - i] +
          output[j].length -
          dataLen[j] -
          separatorSpace;
        str += StringPrototypePadStart(output[j], padding, " ");
      } else {
        str += output[j];
      }
      ArrayPrototypePush(tmp, str);
    }
    if (ctx.maxArrayLength < output.length) {
      ArrayPrototypePush(tmp, output[outputLength]);
    }
    output = tmp;
  }
  return output;
}
function formatMapIterInner(
  ctx,
  recurseTimes,
  entries,
  state,
) {
  const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
    const len = entries.length / 2;
  const remaining = len - maxArrayLength;
  const maxLength = MathMin(maxArrayLength, len);
  const output = new Array(maxLength);
  let i = 0;
  ctx.indentationLvl += 2;
  if (state === kWeak) {
    for (; i < maxLength; i++) {
      const pos = i * 2;
      output[i] = `${formatValue(ctx, entries[pos], recurseTimes)} => ${
        formatValue(ctx, entries[pos + 1], recurseTimes)
      }`;
    }
                if (!ctx.sorted) {
      ArrayPrototypeSort(output);
    }
  } else {
    for (; i < maxLength; i++) {
      const pos = i * 2;
      const res = [
        formatValue(ctx, entries[pos], recurseTimes),
        formatValue(ctx, entries[pos + 1], recurseTimes),
      ];
      output[i] = reduceToSingleString(
        ctx,
        res,
        "",
        ["[", "]"],
        kArrayExtrasType,
        recurseTimes,
      );
    }
  }
  ctx.indentationLvl -= 2;
  if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  return output;
}
function formatSetIterInner(
  ctx,
  recurseTimes,
  entries,
  state,
) {
  const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
  const maxLength = MathMin(maxArrayLength, entries.length);
  const output = new Array(maxLength);
  ctx.indentationLvl += 2;
  for (let i = 0; i < maxLength; i++) {
    output[i] = formatValue(ctx, entries[i], recurseTimes);
  }
  ctx.indentationLvl -= 2;
  if (state === kWeak && !ctx.sorted) {
                ArrayPrototypeSort(output);
  }
  const remaining = entries.length - maxLength;
  if (remaining > 0) {
    ArrayPrototypePush(
      output,
      `... ${remaining} more item${remaining > 1 ? "s" : ""}`,
    );
  }
  return output;
}
const ansiPattern = "[\\u001B\\u009B][[\\]()#;?]*" +
  "(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*" +
  "|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)" +
  "|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))";
const ansi = new SafeRegExp(ansiPattern, "g");
export function getStringWidth(str, removeControlChars = true) {
  let width = 0;
  if (removeControlChars) {
    str = stripVTControlCharacters(str);
  }
  str = StringPrototypeNormalize(str, "NFC");
  for (const char of new SafeStringIterator(str)) {
    const code = StringPrototypeCodePointAt(char, 0);
    if (isFullWidthCodePoint(code)) {
      width += 2;
    } else if (!isZeroWidthCodePoint(code)) {
      width++;
    }
  }
  return width;
}
const isZeroWidthCodePoint = (code) => {
  return code <= 0x1F ||     (code >= 0x7F && code <= 0x9F) ||     (code >= 0x300 && code <= 0x36F) ||     (code >= 0x200B && code <= 0x200F) ||         (code >= 0x20D0 && code <= 0x20FF) ||
    (code >= 0xFE00 && code <= 0xFE0F) ||     (code >= 0xFE20 && code <= 0xFE2F) ||     (code >= 0xE0100 && code <= 0xE01EF); };
export function stripVTControlCharacters(str) {
  return StringPrototypeReplace(str, ansi, "");
}
function hasOwnProperty(obj, v) {
  if (obj == null) {
    return false;
  }
  return ObjectHasOwn(obj, v);
}
const tableChars = {
  middleMiddle: "\u2500",
  rowMiddle: "\u253c",
  topRight: "\u2510",
  topLeft: "\u250c",
  leftMiddle: "\u251c",
  topMiddle: "\u252c",
  bottomRight: "\u2518",
  bottomLeft: "\u2514",
  bottomMiddle: "\u2534",
  rightMiddle: "\u2524",
  left: "\u2502 ",
  right: " \u2502",
  middle: " \u2502 ",
};
function isFullWidthCodePoint(code) {
      return (
    code >= 0x1100 &&
    (code <= 0x115f ||       code === 0x2329 ||       code === 0x232a ||             (code >= 0x2e80 && code <= 0x3247 && code !== 0x303f) ||
            (code >= 0x3250 && code <= 0x4dbf) ||
            (code >= 0x4e00 && code <= 0xa4c6) ||
            (code >= 0xa960 && code <= 0xa97c) ||
            (code >= 0xac00 && code <= 0xd7a3) ||
            (code >= 0xf900 && code <= 0xfaff) ||
            (code >= 0xfe10 && code <= 0xfe19) ||
            (code >= 0xfe30 && code <= 0xfe6b) ||
            (code >= 0xff01 && code <= 0xff60) ||
      (code >= 0xffe0 && code <= 0xffe6) ||
            (code >= 0x1b000 && code <= 0x1b001) ||
            (code >= 0x1f200 && code <= 0x1f251) ||
                  (code >= 0x1f300 && code <= 0x1f64f) ||
            (code >= 0x20000 && code <= 0x3fffd))
  );
}
function renderRow(row, columnWidths, columnRightAlign) {
  let out = tableChars.left;
  for (let i = 0; i < row.length; i++) {
    const cell = row[i];
    const len = getStringWidth(cell);
    const padding = StringPrototypeRepeat(" ", columnWidths[i] - len);
    if (columnRightAlign?.[i]) {
      out += `${padding}${cell}`;
    } else {
      out += `${cell}${padding}`;
    }
    if (i !== row.length - 1) {
      out += tableChars.middle;
    }
  }
  out += tableChars.right;
  return out;
}
function cliTable(head, columns) {
  const rows = [];
  const columnWidths = ArrayPrototypeMap(head, (h) => getStringWidth(h));
  const longestColumn = ArrayPrototypeReduce(
    columns,
    (n, a) => MathMax(n, a.length),
    0,
  );
  const columnRightAlign = ArrayPrototypeFill(
    new Array(columnWidths.length),
    true,
  );
  for (let i = 0; i < head.length; i++) {
    const column = columns[i];
    for (let j = 0; j < longestColumn; j++) {
      if (rows[j] === undefined) {
        rows[j] = [];
      }
      const value = (rows[j][i] = hasOwnProperty(column, j) ? column[j] : "");
      const width = columnWidths[i] || 0;
      const counted = getStringWidth(value);
      columnWidths[i] = MathMax(width, counted);
      columnRightAlign[i] &= NumberIsInteger(+value);
    }
  }
  const divider = ArrayPrototypeMap(
    columnWidths,
    (i) => StringPrototypeRepeat(tableChars.middleMiddle, i + 2),
  );
  let result =
    `${tableChars.topLeft}${
      ArrayPrototypeJoin(divider, tableChars.topMiddle)
    }` +
    `${tableChars.topRight}\n${renderRow(head, columnWidths)}\n` +
    `${tableChars.leftMiddle}${
      ArrayPrototypeJoin(divider, tableChars.rowMiddle)
    }` +
    `${tableChars.rightMiddle}\n`;
  for (let i = 0; i < rows.length; ++i) {
    const row = rows[i];
    result += `${renderRow(row, columnWidths, columnRightAlign)}\n`;
  }
  result +=
    `${tableChars.bottomLeft}${
      ArrayPrototypeJoin(divider, tableChars.bottomMiddle)
    }` +
    tableChars.bottomRight;
  return result;
}
const denoInspectDefaultOptions = {
  indentationLvl: 0,
  currentDepth: 0,
  stylize: stylizeNoColor,
  showHidden: false,
  depth: 4,
  colors: false,
  showProxy: false,
  breakLength: 80,
  compact: 3,
  sorted: false,
  getters: false,
    maxArrayLength: 100,
  maxStringLength: 100,   customInspect: true,
    
      quotes: ['"', "'", "`"],
  iterableLimit: 100,   trailingComma: false,
  inspect,
    indentLevel: 0,
};
function getDefaultInspectOptions() {
  return {
    budget: {},
    seen: [],
    ...denoInspectDefaultOptions,
  };
}
const DEFAULT_INDENT = "  "; 
const STR_ABBREVIATE_SIZE = 100;
class CSI {
  static kClear = "\x1b[1;1H";
  static kClearScreenDown = "\x1b[0J";
}
const QUOTE_SYMBOL_REG = new SafeRegExp(/^[a-zA-Z_][a-zA-Z_.0-9]*$/);
function maybeQuoteSymbol(symbol, ctx) {
  const description = SymbolPrototypeGetDescription(symbol);
  if (description === undefined) {
    return SymbolPrototypeToString(symbol);
  }
  if (RegExpPrototypeTest(QUOTE_SYMBOL_REG, description)) {
    return SymbolPrototypeToString(symbol);
  }
  return `Symbol(${quoteString(description, ctx)})`;
}
function quoteString(string, ctx) {
  const quote = ArrayPrototypeFind(
    ctx.quotes,
    (c) => !StringPrototypeIncludes(string, c),
  ) ??
    ctx.quotes[0];
  const escapePattern = new SafeRegExp(`(?=[${quote}\\\\])`, "g");
  string = StringPrototypeReplace(string, escapePattern, "\\");
  string = replaceEscapeSequences(string);
  return `${quote}${string}${quote}`;
}
const ESCAPE_PATTERN = new SafeRegExp(/([\b\f\n\r\t\v])/g);
const ESCAPE_MAP = ObjectFreeze({
  "\b": "\\b",
  "\f": "\\f",
  "\n": "\\n",
  "\r": "\\r",
  "\t": "\\t",
  "\v": "\\v",
});
const ESCAPE_PATTERN2 = new SafeRegExp("[\x00-\x1f\x7f-\x9f]", "g");
function replaceEscapeSequences(string) {
  return StringPrototypeReplace(
    StringPrototypeReplace(
      string,
      ESCAPE_PATTERN,
      (c) => ESCAPE_MAP[c],
    ),
    new SafeRegExp(ESCAPE_PATTERN2),
    (c) =>
      "\\x" +
      StringPrototypePadStart(
        NumberPrototypeToString(StringPrototypeCharCodeAt(c, 0), 16),
        2,
        "0",
      ),
  );
}
function inspectValueWithQuotes(
  value,
  ctx,
) {
  const abbreviateSize = typeof ctx.strAbbreviateSize === "undefined"
    ? STR_ABBREVIATE_SIZE
    : ctx.strAbbreviateSize;
  switch (typeof value) {
    case "string": {
      const trunc = value.length > abbreviateSize
        ? StringPrototypeSlice(value, 0, abbreviateSize) + "..."
        : value;
      return ctx.stylize(quoteString(trunc, ctx), "string");     }
    default:
      return formatValue(ctx, value, 0);
  }
}
const colorKeywords = new SafeMap([
  ["black", "#000000"],
  ["silver", "#c0c0c0"],
  ["gray", "#808080"],
  ["white", "#ffffff"],
  ["maroon", "#800000"],
  ["red", "#ff0000"],
  ["purple", "#800080"],
  ["fuchsia", "#ff00ff"],
  ["green", "#008000"],
  ["lime", "#00ff00"],
  ["olive", "#808000"],
  ["yellow", "#ffff00"],
  ["navy", "#000080"],
  ["blue", "#0000ff"],
  ["teal", "#008080"],
  ["aqua", "#00ffff"],
  ["orange", "#ffa500"],
  ["aliceblue", "#f0f8ff"],
  ["antiquewhite", "#faebd7"],
  ["aquamarine", "#7fffd4"],
  ["azure", "#f0ffff"],
  ["beige", "#f5f5dc"],
  ["bisque", "#ffe4c4"],
  ["blanchedalmond", "#ffebcd"],
  ["blueviolet", "#8a2be2"],
  ["brown", "#a52a2a"],
  ["burlywood", "#deb887"],
  ["cadetblue", "#5f9ea0"],
  ["chartreuse", "#7fff00"],
  ["chocolate", "#d2691e"],
  ["coral", "#ff7f50"],
  ["cornflowerblue", "#6495ed"],
  ["cornsilk", "#fff8dc"],
  ["crimson", "#dc143c"],
  ["cyan", "#00ffff"],
  ["darkblue", "#00008b"],
  ["darkcyan", "#008b8b"],
  ["darkgoldenrod", "#b8860b"],
  ["darkgray", "#a9a9a9"],
  ["darkgreen", "#006400"],
  ["darkgrey", "#a9a9a9"],
  ["darkkhaki", "#bdb76b"],
  ["darkmagenta", "#8b008b"],
  ["darkolivegreen", "#556b2f"],
  ["darkorange", "#ff8c00"],
  ["darkorchid", "#9932cc"],
  ["darkred", "#8b0000"],
  ["darksalmon", "#e9967a"],
  ["darkseagreen", "#8fbc8f"],
  ["darkslateblue", "#483d8b"],
  ["darkslategray", "#2f4f4f"],
  ["darkslategrey", "#2f4f4f"],
  ["darkturquoise", "#00ced1"],
  ["darkviolet", "#9400d3"],
  ["deeppink", "#ff1493"],
  ["deepskyblue", "#00bfff"],
  ["dimgray", "#696969"],
  ["dimgrey", "#696969"],
  ["dodgerblue", "#1e90ff"],
  ["firebrick", "#b22222"],
  ["floralwhite", "#fffaf0"],
  ["forestgreen", "#228b22"],
  ["gainsboro", "#dcdcdc"],
  ["ghostwhite", "#f8f8ff"],
  ["gold", "#ffd700"],
  ["goldenrod", "#daa520"],
  ["greenyellow", "#adff2f"],
  ["grey", "#808080"],
  ["honeydew", "#f0fff0"],
  ["hotpink", "#ff69b4"],
  ["indianred", "#cd5c5c"],
  ["indigo", "#4b0082"],
  ["ivory", "#fffff0"],
  ["khaki", "#f0e68c"],
  ["lavender", "#e6e6fa"],
  ["lavenderblush", "#fff0f5"],
  ["lawngreen", "#7cfc00"],
  ["lemonchiffon", "#fffacd"],
  ["lightblue", "#add8e6"],
  ["lightcoral", "#f08080"],
  ["lightcyan", "#e0ffff"],
  ["lightgoldenrodyellow", "#fafad2"],
  ["lightgray", "#d3d3d3"],
  ["lightgreen", "#90ee90"],
  ["lightgrey", "#d3d3d3"],
  ["lightpink", "#ffb6c1"],
  ["lightsalmon", "#ffa07a"],
  ["lightseagreen", "#20b2aa"],
  ["lightskyblue", "#87cefa"],
  ["lightslategray", "#778899"],
  ["lightslategrey", "#778899"],
  ["lightsteelblue", "#b0c4de"],
  ["lightyellow", "#ffffe0"],
  ["limegreen", "#32cd32"],
  ["linen", "#faf0e6"],
  ["magenta", "#ff00ff"],
  ["mediumaquamarine", "#66cdaa"],
  ["mediumblue", "#0000cd"],
  ["mediumorchid", "#ba55d3"],
  ["mediumpurple", "#9370db"],
  ["mediumseagreen", "#3cb371"],
  ["mediumslateblue", "#7b68ee"],
  ["mediumspringgreen", "#00fa9a"],
  ["mediumturquoise", "#48d1cc"],
  ["mediumvioletred", "#c71585"],
  ["midnightblue", "#191970"],
  ["mintcream", "#f5fffa"],
  ["mistyrose", "#ffe4e1"],
  ["moccasin", "#ffe4b5"],
  ["navajowhite", "#ffdead"],
  ["oldlace", "#fdf5e6"],
  ["olivedrab", "#6b8e23"],
  ["orangered", "#ff4500"],
  ["orchid", "#da70d6"],
  ["palegoldenrod", "#eee8aa"],
  ["palegreen", "#98fb98"],
  ["paleturquoise", "#afeeee"],
  ["palevioletred", "#db7093"],
  ["papayawhip", "#ffefd5"],
  ["peachpuff", "#ffdab9"],
  ["peru", "#cd853f"],
  ["pink", "#ffc0cb"],
  ["plum", "#dda0dd"],
  ["powderblue", "#b0e0e6"],
  ["rosybrown", "#bc8f8f"],
  ["royalblue", "#4169e1"],
  ["saddlebrown", "#8b4513"],
  ["salmon", "#fa8072"],
  ["sandybrown", "#f4a460"],
  ["seagreen", "#2e8b57"],
  ["seashell", "#fff5ee"],
  ["sienna", "#a0522d"],
  ["skyblue", "#87ceeb"],
  ["slateblue", "#6a5acd"],
  ["slategray", "#708090"],
  ["slategrey", "#708090"],
  ["snow", "#fffafa"],
  ["springgreen", "#00ff7f"],
  ["steelblue", "#4682b4"],
  ["tan", "#d2b48c"],
  ["thistle", "#d8bfd8"],
  ["tomato", "#ff6347"],
  ["turquoise", "#40e0d0"],
  ["violet", "#ee82ee"],
  ["wheat", "#f5deb3"],
  ["whitesmoke", "#f5f5f5"],
  ["yellowgreen", "#9acd32"],
  ["rebeccapurple", "#663399"],
]);
const HASH_PATTERN = new SafeRegExp(
  /^#([\dA-Fa-f]{2})([\dA-Fa-f]{2})([\dA-Fa-f]{2})([\dA-Fa-f]{2})?$/,
);
const SMALL_HASH_PATTERN = new SafeRegExp(
  /^#([\dA-Fa-f])([\dA-Fa-f])([\dA-Fa-f])([\dA-Fa-f])?$/,
);
const RGB_PATTERN = new SafeRegExp(
  /^rgba?\(\s*([+\-]?\d*\.?\d+)\s*,\s*([+\-]?\d*\.?\d+)\s*,\s*([+\-]?\d*\.?\d+)\s*(,\s*([+\-]?\d*\.?\d+)\s*)?\)$/,
);
const HSL_PATTERN = new SafeRegExp(
  /^hsla?\(\s*([+\-]?\d*\.?\d+)\s*,\s*([+\-]?\d*\.?\d+)%\s*,\s*([+\-]?\d*\.?\d+)%\s*(,\s*([+\-]?\d*\.?\d+)\s*)?\)$/,
);
function parseCssColor(colorString) {
  if (MapPrototypeHas(colorKeywords, colorString)) {
    colorString = MapPrototypeGet(colorKeywords, colorString);
  }
    const hashMatch = StringPrototypeMatch(colorString, HASH_PATTERN);
  if (hashMatch != null) {
    return [
      Number(`0x${hashMatch[1]}`),
      Number(`0x${hashMatch[2]}`),
      Number(`0x${hashMatch[3]}`),
    ];
  }
    const smallHashMatch = StringPrototypeMatch(colorString, SMALL_HASH_PATTERN);
  if (smallHashMatch != null) {
    return [
      Number(`0x${smallHashMatch[1]}0`),
      Number(`0x${smallHashMatch[2]}0`),
      Number(`0x${smallHashMatch[3]}0`),
    ];
  }
    const rgbMatch = StringPrototypeMatch(colorString, RGB_PATTERN);
  if (rgbMatch != null) {
    return [
      MathRound(MathMax(0, MathMin(255, Number(rgbMatch[1])))),
      MathRound(MathMax(0, MathMin(255, Number(rgbMatch[2])))),
      MathRound(MathMax(0, MathMin(255, Number(rgbMatch[3])))),
    ];
  }
    const hslMatch = StringPrototypeMatch(colorString, HSL_PATTERN);
  if (hslMatch != null) {
        let h = Number(hslMatch[1]) % 360;
    if (h < 0) {
      h += 360;
    }
    const s = MathMax(0, MathMin(100, Number(hslMatch[2]))) / 100;
    const l = MathMax(0, MathMin(100, Number(hslMatch[3]))) / 100;
    const c = (1 - MathAbs(2 * l - 1)) * s;
    const x = c * (1 - MathAbs((h / 60) % 2 - 1));
    const m = l - c / 2;
    let r_;
    let g_;
    let b_;
    if (h < 60) {
      ({ 0: r_, 1: g_, 2: b_ } = [c, x, 0]);
    } else if (h < 120) {
      ({ 0: r_, 1: g_, 2: b_ } = [x, c, 0]);
    } else if (h < 180) {
      ({ 0: r_, 1: g_, 2: b_ } = [0, c, x]);
    } else if (h < 240) {
      ({ 0: r_, 1: g_, 2: b_ } = [0, x, c]);
    } else if (h < 300) {
      ({ 0: r_, 1: g_, 2: b_ } = [x, 0, c]);
    } else {
      ({ 0: r_, 1: g_, 2: b_ } = [c, 0, x]);
    }
    return [
      MathRound((r_ + m) * 255),
      MathRound((g_ + m) * 255),
      MathRound((b_ + m) * 255),
    ];
  }
  return null;
}
function getDefaultCss() {
  return {
    backgroundColor: null,
    color: null,
    fontWeight: null,
    fontStyle: null,
    textDecorationColor: null,
    textDecorationLine: [],
  };
}
const SPACE_PATTERN = new SafeRegExp(/\s+/g);
function parseCss(cssString) {
  const css = getDefaultCss();
  const rawEntries = [];
  let inValue = false;
  let currentKey = null;
  let parenthesesDepth = 0;
  let currentPart = "";
  for (let i = 0; i < cssString.length; i++) {
    const c = cssString[i];
    if (c == "(") {
      parenthesesDepth++;
    } else if (parenthesesDepth > 0) {
      if (c == ")") {
        parenthesesDepth--;
      }
    } else if (inValue) {
      if (c == ";") {
        const value = StringPrototypeTrim(currentPart);
        if (value != "") {
          ArrayPrototypePush(rawEntries, [currentKey, value]);
        }
        currentKey = null;
        currentPart = "";
        inValue = false;
        continue;
      }
    } else if (c == ":") {
      currentKey = StringPrototypeTrim(currentPart);
      currentPart = "";
      inValue = true;
      continue;
    }
    currentPart += c;
  }
  if (inValue && parenthesesDepth == 0) {
    const value = StringPrototypeTrim(currentPart);
    if (value != "") {
      ArrayPrototypePush(rawEntries, [currentKey, value]);
    }
    currentKey = null;
    currentPart = "";
  }
  for (let i = 0; i < rawEntries.length; ++i) {
    const { 0: key, 1: value } = rawEntries[i];
    if (key == "background-color") {
      if (value != null) {
        css.backgroundColor = value;
      }
    } else if (key == "color") {
      if (value != null) {
        css.color = value;
      }
    } else if (key == "font-weight") {
      if (value == "bold") {
        css.fontWeight = value;
      }
    } else if (key == "font-style") {
      if (
        ArrayPrototypeIncludes(["italic", "oblique", "oblique 14deg"], value)
      ) {
        css.fontStyle = "italic";
      }
    } else if (key == "text-decoration-line") {
      css.textDecorationLine = [];
      const lineTypes = StringPrototypeSplit(value, SPACE_PATTERN);
      for (let i = 0; i < lineTypes.length; ++i) {
        const lineType = lineTypes[i];
        if (
          ArrayPrototypeIncludes(
            ["line-through", "overline", "underline"],
            lineType,
          )
        ) {
          ArrayPrototypePush(css.textDecorationLine, lineType);
        }
      }
    } else if (key == "text-decoration-color") {
      const color = parseCssColor(value);
      if (color != null) {
        css.textDecorationColor = color;
      }
    } else if (key == "text-decoration") {
      css.textDecorationColor = null;
      css.textDecorationLine = [];
      const args = StringPrototypeSplit(value, SPACE_PATTERN);
      for (let i = 0; i < args.length; ++i) {
        const arg = args[i];
        const maybeColor = parseCssColor(arg);
        if (maybeColor != null) {
          css.textDecorationColor = maybeColor;
        } else if (
          ArrayPrototypeIncludes(
            ["line-through", "overline", "underline"],
            arg,
          )
        ) {
          ArrayPrototypePush(css.textDecorationLine, arg);
        }
      }
    }
  }
  return css;
}
function colorEquals(color1, color2) {
  return color1?.[0] == color2?.[0] && color1?.[1] == color2?.[1] &&
    color1?.[2] == color2?.[2];
}
function cssToAnsi(css, prevCss = null) {
  prevCss = prevCss ?? getDefaultCss();
  let ansi = "";
  if (!colorEquals(css.backgroundColor, prevCss.backgroundColor)) {
    if (css.backgroundColor == null) {
      ansi += "\x1b[49m";
    } else if (css.backgroundColor == "black") {
      ansi += `\x1b[40m`;
    } else if (css.backgroundColor == "red") {
      ansi += `\x1b[41m`;
    } else if (css.backgroundColor == "green") {
      ansi += `\x1b[42m`;
    } else if (css.backgroundColor == "yellow") {
      ansi += `\x1b[43m`;
    } else if (css.backgroundColor == "blue") {
      ansi += `\x1b[44m`;
    } else if (css.backgroundColor == "magenta") {
      ansi += `\x1b[45m`;
    } else if (css.backgroundColor == "cyan") {
      ansi += `\x1b[46m`;
    } else if (css.backgroundColor == "white") {
      ansi += `\x1b[47m`;
    } else {
      if (ArrayIsArray(css.backgroundColor)) {
        const { 0: r, 1: g, 2: b } = css.backgroundColor;
        ansi += `\x1b[48;2;${r};${g};${b}m`;
      } else {
        const parsed = parseCssColor(css.backgroundColor);
        if (parsed !== null) {
          const { 0: r, 1: g, 2: b } = parsed;
          ansi += `\x1b[48;2;${r};${g};${b}m`;
        } else {
          ansi += "\x1b[49m";
        }
      }
    }
  }
  if (!colorEquals(css.color, prevCss.color)) {
    if (css.color == null) {
      ansi += "\x1b[39m";
    } else if (css.color == "black") {
      ansi += `\x1b[30m`;
    } else if (css.color == "red") {
      ansi += `\x1b[31m`;
    } else if (css.color == "green") {
      ansi += `\x1b[32m`;
    } else if (css.color == "yellow") {
      ansi += `\x1b[33m`;
    } else if (css.color == "blue") {
      ansi += `\x1b[34m`;
    } else if (css.color == "magenta") {
      ansi += `\x1b[35m`;
    } else if (css.color == "cyan") {
      ansi += `\x1b[36m`;
    } else if (css.color == "white") {
      ansi += `\x1b[37m`;
    } else {
      if (ArrayIsArray(css.color)) {
        const { 0: r, 1: g, 2: b } = css.color;
        ansi += `\x1b[38;2;${r};${g};${b}m`;
      } else {
        const parsed = parseCssColor(css.color);
        if (parsed !== null) {
          const { 0: r, 1: g, 2: b } = parsed;
          ansi += `\x1b[38;2;${r};${g};${b}m`;
        } else {
          ansi += "\x1b[39m";
        }
      }
    }
  }
  if (css.fontWeight != prevCss.fontWeight) {
    if (css.fontWeight == "bold") {
      ansi += `\x1b[1m`;
    } else {
      ansi += "\x1b[22m";
    }
  }
  if (css.fontStyle != prevCss.fontStyle) {
    if (css.fontStyle == "italic") {
      ansi += `\x1b[3m`;
    } else {
      ansi += "\x1b[23m";
    }
  }
  if (!colorEquals(css.textDecorationColor, prevCss.textDecorationColor)) {
    if (css.textDecorationColor != null) {
      const { 0: r, 1: g, 2: b } = css.textDecorationColor;
      ansi += `\x1b[58;2;${r};${g};${b}m`;
    } else {
      ansi += "\x1b[59m";
    }
  }
  if (
    ArrayPrototypeIncludes(css.textDecorationLine, "line-through") !=
      ArrayPrototypeIncludes(prevCss.textDecorationLine, "line-through")
  ) {
    if (ArrayPrototypeIncludes(css.textDecorationLine, "line-through")) {
      ansi += "\x1b[9m";
    } else {
      ansi += "\x1b[29m";
    }
  }
  if (
    ArrayPrototypeIncludes(css.textDecorationLine, "overline") !=
      ArrayPrototypeIncludes(prevCss.textDecorationLine, "overline")
  ) {
    if (ArrayPrototypeIncludes(css.textDecorationLine, "overline")) {
      ansi += "\x1b[53m";
    } else {
      ansi += "\x1b[55m";
    }
  }
  if (
    ArrayPrototypeIncludes(css.textDecorationLine, "underline") !=
      ArrayPrototypeIncludes(prevCss.textDecorationLine, "underline")
  ) {
    if (ArrayPrototypeIncludes(css.textDecorationLine, "underline")) {
      ansi += "\x1b[4m";
    } else {
      ansi += "\x1b[24m";
    }
  }
  return ansi;
}
function inspectArgs(args, inspectOptions = {}) {
  const ctx = {
    ...getDefaultInspectOptions(),
    ...inspectOptions,
  };
  if (inspectOptions.iterableLimit !== undefined) {
    ctx.maxArrayLength = inspectOptions.iterableLimit;
  }
  if (inspectOptions.strAbbreviateSize !== undefined) {
    ctx.maxStringLength = inspectOptions.strAbbreviateSize;
  }
  if (ctx.colors) ctx.stylize = createStylizeWithColor(styles, colors);
  if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity;
  if (ctx.maxStringLength === null) ctx.maxStringLength = Infinity;
  const noColor = getNoColor();
  const first = args[0];
  let a = 0;
  let string = "";
  if (typeof first == "string" && args.length > 1) {
    a++;
            let appendedChars = 0;
    let usedStyle = false;
    let prevCss = null;
    for (let i = 0; i < first.length - 1; i++) {
      if (first[i] == "%") {
        const char = first[++i];
        if (a < args.length) {
          let formattedArg = null;
          if (char == "s") {
                        formattedArg = String(args[a++]);
          } else if (ArrayPrototypeIncludes(["d", "i"], char)) {
                        const value = args[a++];
            if (typeof value == "bigint") {
              formattedArg = `${value}n`;
            } else if (typeof value == "number") {
              formattedArg = `${NumberParseInt(String(value))}`;
            } else {
              formattedArg = "NaN";
            }
          } else if (char == "f") {
                        const value = args[a++];
            if (typeof value == "number") {
              formattedArg = `${value}`;
            } else {
              formattedArg = "NaN";
            }
          } else if (ArrayPrototypeIncludes(["O", "o"], char)) {
                        formattedArg = formatValue(ctx, args[a++], 0);
          } else if (char == "c") {
            const value = args[a++];
            if (!noColor) {
              const css = parseCss(value);
              formattedArg = cssToAnsi(css, prevCss);
              if (formattedArg != "") {
                usedStyle = true;
                prevCss = css;
              }
            } else {
              formattedArg = "";
            }
          }
          if (formattedArg != null) {
            string += StringPrototypeSlice(first, appendedChars, i - 1) +
              formattedArg;
            appendedChars = i + 1;
          }
        }
        if (char == "%") {
          string += StringPrototypeSlice(first, appendedChars, i - 1) + "%";
          appendedChars = i + 1;
        }
      }
    }
    string += StringPrototypeSlice(first, appendedChars);
    if (usedStyle) {
      string += "\x1b[0m";
    }
  }
  for (; a < args.length; a++) {
    if (a > 0) {
      string += " ";
    }
    if (typeof args[a] == "string") {
      string += args[a];
    } else {
            string += formatValue(ctx, args[a], 0);
    }
  }
  if (ctx.indentLevel > 0) {
    const groupIndent = StringPrototypeRepeat(
      DEFAULT_INDENT,
      ctx.indentLevel,
    );
    string = groupIndent +
      StringPrototypeReplaceAll(string, "\n", `\n${groupIndent}`);
  }
  return string;
}
function createStylizeWithColor(styles, colors) {
  return function stylizeWithColor(str, styleType) {
    const style = styles[styleType];
    if (style !== undefined) {
      const color = colors[style];
      if (color !== undefined) {
        return `\u001b[${color[0]}m${str}\u001b[${color[1]}m`;
      }
    }
    return str;
  };
}
const countMap = new SafeMap();
const timerMap = new SafeMap();
const isConsoleInstance = Symbol("isConsoleInstance");
function getConsoleInspectOptions() {
  const color = !getNoColor();
  return {
    ...getDefaultInspectOptions(),
    colors: color,
    stylize: color ? createStylizeWithColor(styles, colors) : stylizeNoColor,
  };
}
class Console {
  #printFunc = null;
  [isConsoleInstance] = false;
  constructor(printFunc) {
    this.#printFunc = printFunc;
    this.indentLevel = 0;
    this[isConsoleInstance] = true;
                    const console = ObjectCreate({}, {
      [SymbolToStringTag]: {
        enumerable: false,
        writable: false,
        configurable: true,
        value: "console",
      },
    });
    ObjectAssign(console, this);
    return console;
  }
  log = (...args) => {
    this.#printFunc(
      inspectArgs(args, {
        ...getConsoleInspectOptions(),
        indentLevel: this.indentLevel,
      }) + "\n",
      1,
    );
  };
  debug = (...args) => {
    this.#printFunc(
      inspectArgs(args, {
        ...getConsoleInspectOptions(),
        indentLevel: this.indentLevel,
      }) + "\n",
      0,
    );
  };
  info = (...args) => {
    this.#printFunc(
      inspectArgs(args, {
        ...getConsoleInspectOptions(),
        indentLevel: this.indentLevel,
      }) + "\n",
      1,
    );
  };
  dir = (obj = undefined, options = {}) => {
    this.#printFunc(
      inspectArgs([obj], { ...getConsoleInspectOptions(), ...options }) +
        "\n",
      1,
    );
  };
  dirxml = this.dir;
  warn = (...args) => {
    this.#printFunc(
      inspectArgs(args, {
        ...getConsoleInspectOptions(),
        indentLevel: this.indentLevel,
      }) + "\n",
      2,
    );
  };
  error = (...args) => {
    this.#printFunc(
      inspectArgs(args, {
        ...getConsoleInspectOptions(),
        indentLevel: this.indentLevel,
      }) + "\n",
      3,
    );
  };
  assert = (condition = false, ...args) => {
    if (condition) {
      return;
    }
    if (args.length === 0) {
      this.error("Assertion failed");
      return;
    }
    const [first, ...rest] = new SafeArrayIterator(args);
    if (typeof first === "string") {
      this.error(
        `Assertion failed: ${first}`,
        ...new SafeArrayIterator(rest),
      );
      return;
    }
    this.error(`Assertion failed:`, ...new SafeArrayIterator(args));
  };
  count = (label = "default") => {
    label = String(label);
    if (MapPrototypeHas(countMap, label)) {
      const current = MapPrototypeGet(countMap, label) || 0;
      MapPrototypeSet(countMap, label, current + 1);
    } else {
      MapPrototypeSet(countMap, label, 1);
    }
    this.info(`${label}: ${MapPrototypeGet(countMap, label)}`);
  };
  countReset = (label = "default") => {
    label = String(label);
    if (MapPrototypeHas(countMap, label)) {
      MapPrototypeSet(countMap, label, 0);
    } else {
      this.warn(`Count for '${label}' does not exist`);
    }
  };
  table = (data = undefined, properties = undefined) => {
    if (properties !== undefined && !ArrayIsArray(properties)) {
      throw new Error(
        "The 'properties' argument must be of type Array. " +
          "Received type string",
      );
    }
    if (data === null || typeof data !== "object") {
      return this.log(data);
    }
    const stringifyValue = (value) =>
      inspectValueWithQuotes(value, {
        ...getDefaultInspectOptions(),
        depth: 1,
        compact: true,
      });
    const toTable = (header, body) => this.log(cliTable(header, body));
    let resultData;
    const isSet = ObjectPrototypeIsPrototypeOf(SetPrototype, data);
    const isMap = ObjectPrototypeIsPrototypeOf(MapPrototype, data);
    const valuesKey = "Values";
    const indexKey = isSet || isMap ? "(iter idx)" : "(idx)";
    if (isSet) {
      resultData = [...new SafeSetIterator(data)];
    } else if (isMap) {
      let idx = 0;
      resultData = {};
      MapPrototypeForEach(data, (v, k) => {
        resultData[idx] = { Key: k, Values: v };
        idx++;
      });
    } else {
      resultData = data;
    }
    const keys = ObjectKeys(resultData);
    const numRows = keys.length;
    const objectValues = properties
      ? ObjectFromEntries(
        ArrayPrototypeMap(
          properties,
          (name) => [name, ArrayPrototypeFill(new Array(numRows), "")],
        ),
      )
      : {};
    const indexKeys = [];
    const values = [];
    let hasPrimitives = false;
    ArrayPrototypeForEach(keys, (k, idx) => {
      const value = resultData[k];
      const primitive = value === null ||
        (typeof value !== "function" && typeof value !== "object");
      if (properties === undefined && primitive) {
        hasPrimitives = true;
        ArrayPrototypePush(values, stringifyValue(value));
      } else {
        const valueObj = value || {};
        const keys = properties || ObjectKeys(valueObj);
        for (let i = 0; i < keys.length; ++i) {
          const k = keys[i];
          if (!primitive && ReflectHas(valueObj, k)) {
            if (!(ReflectHas(objectValues, k))) {
              objectValues[k] = ArrayPrototypeFill(new Array(numRows), "");
            }
            objectValues[k][idx] = stringifyValue(valueObj[k]);
          }
        }
        ArrayPrototypePush(values, "");
      }
      ArrayPrototypePush(indexKeys, k);
    });
    const headerKeys = ObjectKeys(objectValues);
    const bodyValues = ObjectValues(objectValues);
    const headerProps = properties ||
      [
        ...new SafeArrayIterator(headerKeys),
        !isMap && hasPrimitives && valuesKey,
      ];
    const header = ArrayPrototypeFilter([
      indexKey,
      ...new SafeArrayIterator(headerProps),
    ], Boolean);
    const body = [indexKeys, ...new SafeArrayIterator(bodyValues), values];
    toTable(header, body);
  };
  time = (label = "default") => {
    label = String(label);
    if (MapPrototypeHas(timerMap, label)) {
      this.warn(`Timer '${label}' already exists`);
      return;
    }
    MapPrototypeSet(timerMap, label, DateNow());
  };
  timeLog = (label = "default", ...args) => {
    label = String(label);
    if (!MapPrototypeHas(timerMap, label)) {
      this.warn(`Timer '${label}' does not exists`);
      return;
    }
    const startTime = MapPrototypeGet(timerMap, label);
    const duration = DateNow() - startTime;
    this.info(`${label}: ${duration}ms`, ...new SafeArrayIterator(args));
  };
  timeEnd = (label = "default") => {
    label = String(label);
    if (!MapPrototypeHas(timerMap, label)) {
      this.warn(`Timer '${label}' does not exist`);
      return;
    }
    const startTime = MapPrototypeGet(timerMap, label);
    MapPrototypeDelete(timerMap, label);
    const duration = DateNow() - startTime;
    this.info(`${label}: ${duration}ms`);
  };
  group = (...label) => {
    if (label.length > 0) {
      this.log(...new SafeArrayIterator(label));
    }
    this.indentLevel += 2;
  };
  groupCollapsed = this.group;
  groupEnd = () => {
    if (this.indentLevel > 0) {
      this.indentLevel -= 2;
    }
  };
  clear = () => {
    this.indentLevel = 0;
    this.#printFunc(CSI.kClear, 1);
    this.#printFunc(CSI.kClearScreenDown, 1);
  };
  trace = (...args) => {
    const message = inspectArgs(
      args,
      { ...getConsoleInspectOptions(), indentLevel: 0 },
    );
    const err = {
      name: "Trace",
      message,
    };
    ErrorCaptureStackTrace(err, this.trace);
    this.error(err.stack);
  };
      profile = (_label) => {};
  profileEnd = (_label) => {};
  timeStamp = (_label) => {};
  static [SymbolHasInstance](instance) {
    return instance[isConsoleInstance];
  }
}
const customInspect = SymbolFor("Deno.customInspect");
function inspect(
  value,
  inspectOptions = {},
) {
    const ctx = {
    ...getDefaultInspectOptions(),
    ...inspectOptions,
  };
  if (inspectOptions.iterableLimit !== undefined) {
    ctx.maxArrayLength = inspectOptions.iterableLimit;
  }
  if (inspectOptions.strAbbreviateSize !== undefined) {
    ctx.maxStringLength = inspectOptions.strAbbreviateSize;
  }
  if (ctx.colors) ctx.stylize = createStylizeWithColor(styles, colors);
  if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity;
  if (ctx.maxStringLength === null) ctx.maxStringLength = Infinity;
  return formatValue(ctx, value, 0);
}
function createFilteredInspectProxy({ object, keys, evaluate }) {
  const obj = class {};
  if (object.constructor?.name) {
    ObjectDefineProperty(obj, "name", { value: object.constructor.name });
  }
  return new Proxy(new obj(), {
    get(_target, key) {
      if (key === SymbolToStringTag) {
        return object.constructor?.name;
      } else if (ArrayPrototypeIncludes(keys, key)) {
        return ReflectGet(object, key);
      } else {
        return undefined;
      }
    },
    getOwnPropertyDescriptor(_target, key) {
      if (!ArrayPrototypeIncludes(keys, key)) {
        return undefined;
      } else if (evaluate) {
        return getEvaluatedDescriptor(object, key);
      } else {
        return getDescendantPropertyDescriptor(object, key) ??
          getEvaluatedDescriptor(object, key);
      }
    },
    has(_target, key) {
      return ArrayPrototypeIncludes(keys, key);
    },
    ownKeys() {
      return keys;
    },
  });
  function getDescendantPropertyDescriptor(object, key) {
    let propertyDescriptor = ReflectGetOwnPropertyDescriptor(object, key);
    if (!propertyDescriptor) {
      const prototype = ReflectGetPrototypeOf(object);
      if (prototype) {
        propertyDescriptor = getDescendantPropertyDescriptor(prototype, key);
      }
    }
    return propertyDescriptor;
  }
  function getEvaluatedDescriptor(object, key) {
    return {
      configurable: true,
      enumerable: true,
      value: object[key],
    };
  }
}
function wrapConsole(consoleFromDeno, consoleFromV8) {
  const callConsole = core.callConsole;
  const keys = ObjectKeys(consoleFromV8);
  for (let i = 0; i < keys.length; ++i) {
    const key = keys[i];
    if (ObjectHasOwn(consoleFromDeno, key)) {
      consoleFromDeno[key] = FunctionPrototypeBind(
        callConsole,
        consoleFromDeno,
        consoleFromV8[key],
        consoleFromDeno[key],
      );
    } else {
            consoleFromDeno[key] = consoleFromV8[key];
    }
  }
}
internals.Console = Console;
internals.cssToAnsi = cssToAnsi;
internals.inspectArgs = inspectArgs;
internals.parseCss = parseCss;
internals.parseCssColor = parseCssColor;
export {
  colors,
  Console,
  createFilteredInspectProxy,
  createStylizeWithColor,
  CSI,
  customInspect,
  formatBigInt,
  formatNumber,
  formatValue,
  getDefaultInspectOptions,
  getNoColor,
  inspect,
  inspectArgs,
  quoteString,
  setNoColor,
  styles,
  wrapConsole,
};