{
  "version": 3,
  "sources": ["../forge.ts", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/error.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/util.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/date.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/primitive.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/extract.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/struct.js", "../../../node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/parse.js", "../forgeConfig.ts", "../liteloader.ts", "../fabric.ts", "../quilt.ts"],
  "sourcesContent": ["import { resolveFileSystem, FileSystem } from '@xmcl/system'\nimport { TomlDate, parse as parseToml } from 'smol-toml'\nimport { AnnotationVisitor, ClassReader, ClassVisitor, MethodVisitor, Opcodes } from '@xmcl/asm'\n\n/**\n * The @Mod data from class file\n */\nexport interface ForgeModAnnotationData {\n  [key: string]: any\n  value: string\n  modid: string\n  name: string\n  version: string\n  /**\n     * A dependency string for this mod, which specifies which mod(s) it depends on in order to run.\n     *\n     * A dependency string must start with a combination of these prefixes, separated by \"-\":\n     *     [before, after], [required], [client, server]\n     *     At least one \"before\", \"after\", or \"required\" must be specified.\n     * Then \":\" and the mod id.\n     * Then a version range should be specified for the mod by adding \"@\" and the version range.\n     *     The version range format is described in the javadoc here:\n     *     {@link VersionRange#createFromVersionSpec(java.lang.String)}\n     * Then a \";\".\n     *\n     * If a \"required\" mod is missing, or a mod exists with a version outside the specified range,\n     * the game will not start and an error screen will tell the player which versions are required.\n     *\n     * Example:\n     *     Our example mod:\n     *      * depends on Forge and uses new features that were introduced in Forge version 14.21.1.2395\n     *         \"required:forge@[14.21.1.2395,);\"\n     *\n     *          1.12.2 Note: for compatibility with Forge older than 14.23.0.2501 the syntax must follow this older format:\n     *          \"required-after:forge@[14.21.1.2395,);\"\n     *          For more explanation see https://github.com/MinecraftForge/MinecraftForge/issues/4918\n     *\n     *      * is a dedicated addon to mod1 and has to have its event handlers run after mod1's are run,\n     *         \"required-after:mod1;\"\n     *      * has optional integration with mod2 which depends on features introduced in mod2 version 4.7.0,\n     *         \"after:mod2@[4.7.0,);\"\n     *      * depends on a client-side-only rendering library called rendermod\n     *         \"required-client:rendermod;\"\n     *\n     *     The full dependencies string is all of those combined:\n     *         \"required:forge@[14.21.1.2395,);required-after:mod1;after:mod2@[4.7.0,);required-client:rendermod;\"\n     *\n     *     This will stop the game and display an error message if any of these is true:\n     *         The installed forge is too old,\n     *         mod1 is missing,\n     *         an old version of mod2 is present,\n     *         rendermod is missing on the client.\n     */\n  dependencies: string\n  useMetadata: boolean\n  acceptedMinecraftVersions: string\n  acceptableRemoteVersions: string\n  acceptableSaveVersions: string\n  modLanguage: string\n  modLanguageAdapter: string\n  clientSideOnly: boolean\n  serverSideOnly: boolean\n}\n\n/**\n * Represent the forge `mcmod.info` format.\n */\nexport interface ForgeModMcmodInfo {\n  /**\n     * The modid this description is linked to. If the mod is not loaded, the description is ignored.\n     */\n  modid: string\n  /**\n     * The user-friendly name of this mod.\n     */\n  name: string\n  /**\n     * A description of this mod in 1-2 paragraphs.\n     */\n  description: string\n  /**\n     * The version of the mod.\n     */\n  version: string\n  /**\n     * The Minecraft version.\n     */\n  mcversion: string\n  /**\n     * A link to the mod\u2019s homepage.\n     */\n  url: string\n  /**\n     * Defined but unused. Superseded by updateJSON.\n     */\n  updateUrl: string\n  /**\n     * The URL to a version JSON.\n     */\n  updateJSON: string\n  /**\n     * A list of authors to this mod.\n     */\n  authorList: string[]\n  /**\n     * A string that contains any acknowledgements you want to mention.\n     */\n  credits: string\n  /**\n     * The path to the mod\u2019s logo. It is resolved on top of the classpath, so you should put it in a location where the name will not conflict, maybe under your own assets folder.\n     */\n  logoFile: string\n  /**\n     * A list of images to be shown on the info page. Currently unimplemented.\n     */\n  screenshots: string[]\n  /**\n     * The modid of a parent mod, if applicable. Using this allows modules of another mod to be listed under it in the info page, like BuildCraft.\n     */\n  parent: string\n  /**\n     * If true and `Mod.useMetadata`, the below 3 lists of dependencies will be used. If not, they do nothing.\n     */\n  useDependencyInformation: boolean\n  /**\n     * A list of modids. If one is missing, the game will crash. This does not affect the ordering of mod loading! To specify ordering as well as requirement, have a coupled entry in dependencies.\n     */\n  requiredMods: string[]\n  /**\n     * A list of modids. All of the listed mods will load before this one. If one is not present, nothing happens.\n     */\n  dependencies: string[]\n  /**\n     * A list of modids. All of the listed mods will load after this one. If one is not present, nothing happens.\n     */\n  dependants: string[]\n}\n\n/**\n * This file defines the metadata of your mod. Its information may be viewed by users from the main screen of the game through the Mods button. A single info file can describe several mods.\n *\n * The mods.toml file is formatted as TOML, the example mods.toml file in the MDK provides comments explaining the contents of the file. It should be stored as src/main/resources/META-INF/mods.toml. A basic mods.toml, describing one mod, may look like this:\n */\nexport interface ForgeModTOMLData {\n  /**\n     * The modid this file is linked to\n     */\n  modid: string\n  /**\n     * The version of the mod.It should be just numbers seperated by dots, ideally conforming to Semantic Versioning\n     */\n  version: string\n  /**\n     * The user - friendly name of this mod\n     */\n  displayName: string\n  /**\n     * The URL to a version JSON\n     */\n  updateJSONURL: string\n  /**\n     * A link to the mod\u2019s homepage\n     */\n  displayURL: string\n  /**\n     * The filename of the mod\u2019s logo.It must be placed in the root resource folder, not in a subfolder\n     */\n  logoFile: string\n  /**\n     * A string that contains any acknowledgements you want to mention\n     */\n  credits: string\n  /**\n     * The authors to this mod\n     */\n  authors: string\n  /**\n     * A description of this mod\n     */\n  description: string\n  /**\n     * A list of dependencies of this mod\n     */\n  dependencies: { modId: string; mandatory: boolean; versionRange: string; ordering: 'NONE' | 'BEFORE' | 'AFTER'; side: 'BOTH' | 'CLIENT' | 'SERVER' }[]\n\n  provides: string[]\n  /**\n     * The name of the mod loader type to load - for regular FML @Mod mods it should be javafml\n     */\n  modLoader: string\n  /**\n     * A version range to match for said mod loader - for regular FML @Mod it will be the forge version\n     */\n  loaderVersion: string\n  /**\n     * A URL to refer people to when problems occur with this mod\n     */\n  issueTrackerURL: string\n}\n\nexport interface ForgeModASMData {\n  /**\n     * Does class files contain cpw package\n     */\n  usedLegacyFMLPackage: boolean\n  /**\n     * Does class files contain forge package\n     */\n  usedForgePackage: boolean\n  /**\n     * Does class files contain minecraft package\n     */\n  usedMinecraftPackage: boolean\n  /**\n     * Does class files contain minecraft.client package\n     */\n  usedMinecraftClientPackage: boolean\n\n  fmlPluginClassName?: string\n  fmlPluginMcVersion?: string\n\n  modAnnotations: ForgeModAnnotationData[]\n}\n\n/**\n * The metadata inferred from manifest\n */\nexport interface ManifestMetadata {\n  modid: string\n  name: string\n  authors: string[]\n  version: string\n  description: string\n  url: string\n}\n\nclass ModAnnotationVisitor extends AnnotationVisitor {\n  constructor(readonly map: ForgeModAnnotationData) { super(Opcodes.ASM5) }\n  public visit(s: string, o: any) {\n    if (s === 'value') {\n      this.map.modid = o\n    } else {\n      this.map[s] = o\n    }\n  }\n}\nclass McVersionAnnotationVisitor extends AnnotationVisitor {\n  constructor(readonly map: (v: string) => void) { super(Opcodes.ASM5) }\n  public visit(s: string, o: any) {\n    if (s === 'value') {\n      this.map(o)\n    }\n  }\n}\n\nclass DummyModConstructorVisitor extends MethodVisitor {\n  private stack: any[] = []\n  constructor(private parent: ModClassVisitor, api: number) {\n    super(api)\n  }\n\n  visitLdcInsn(value: any) {\n    this.stack.push(value)\n  }\n\n  visitFieldInsn(opcode: number, owner: string, name: string, desc: string) {\n    if (opcode === Opcodes.PUTFIELD) {\n      const last = this.stack.pop()\n      if (last) {\n        if (name === 'modId') {\n          this.parent.guess.modid = last\n        } else if (name === 'version') {\n          this.parent.guess.version = last\n        } else if (name === 'name') {\n          this.parent.guess.name = last\n        } else if (name === 'url') {\n          this.parent.guess.url = last\n        } else if (name === 'parent') {\n          this.parent.guess.parent = last\n        } else if (name === 'mcversion') {\n          this.parent.guess.mcversion = last\n        }\n      }\n    }\n  }\n}\n\nclass ModClassVisitor extends ClassVisitor {\n  public fields: Record<string, any> = {}\n  public className = ''\n  public isDummyModContainer = false\n  public isPluginClass = false\n  public mcVersionInPlugin = ''\n  public pluginName = ''\n\n  public constructor(readonly result: ForgeModASMData, public guess: Partial<ForgeModAnnotationData>, readonly corePlugin?: string) {\n    super(Opcodes.ASM5)\n  }\n\n  private validateType(desc: string) {\n    if (desc.indexOf('net/minecraftforge') !== -1) {\n      this.result.usedForgePackage = true\n    }\n    if (desc.indexOf('net/minecraft') !== -1) {\n      this.result.usedMinecraftPackage = true\n    }\n    if (desc.indexOf('cpw/mods/fml') !== -1) {\n      this.result.usedLegacyFMLPackage = true\n    }\n    if (desc.indexOf('net/minecraft/client') !== -1) {\n      this.result.usedMinecraftClientPackage = true\n    }\n  }\n\n  visit(version: number, access: number, name: string, signature: string, superName: string, interfaces: string[]): void {\n    this.className = name\n    this.isPluginClass = name === this.corePlugin\n    if (superName === 'net/minecraftforge/fml/common/DummyModContainer') {\n      this.isDummyModContainer = true\n    }\n    this.validateType(superName)\n    for (const intef of interfaces) {\n      this.validateType(intef)\n      if (intef.indexOf('net/minecraftforge/fml/relauncher/IFMLLoadingPlugin') !== -1) {\n        this.result.fmlPluginClassName = name\n      }\n    }\n  }\n\n  public visitMethod(access: number, name: string, desc: string, signature: string, exceptions: string[]) {\n    if (this.isDummyModContainer && name === '<init>') {\n      return new DummyModConstructorVisitor(this, Opcodes.ASM5)\n    }\n    this.validateType(desc)\n    return null\n  }\n\n  public visitField(access: number, name: string, desc: string, signature: string, value: any) {\n    this.fields[name] = value\n    return null\n  }\n\n  public visitAnnotation(desc: string, visible: boolean): AnnotationVisitor | null {\n    if (desc === 'Lnet/minecraftforge/fml/common/Mod;' || desc === 'Lcpw/mods/fml/common/Mod;') {\n      const annotationData: ForgeModAnnotationData = {\n        modid: '',\n        name: '',\n        version: '',\n        dependencies: '',\n        useMetadata: true,\n        clientSideOnly: false,\n        serverSideOnly: false,\n        acceptedMinecraftVersions: '',\n        acceptableRemoteVersions: '',\n        acceptableSaveVersions: '',\n        modLanguage: 'java',\n        modLanguageAdapter: '',\n        value: '',\n      }\n      this.result.modAnnotations.push(annotationData)\n      return new ModAnnotationVisitor(annotationData)\n    } else if (desc === 'Lnet/minecraftforge/fml/relauncher/IFMLLoadingPlugin$MCVersion;') {\n      return new McVersionAnnotationVisitor((v) => { this.result.fmlPluginMcVersion = v })\n    }\n    return null\n  }\n\n  visitEnd() {\n    if ((this.className === 'Config' || this.className === 'net/optifine/Config' || this.className === 'notch/net/optifine/Config') && this.fields && this.fields.OF_NAME) {\n      this.result.modAnnotations.push({\n        modid: this.fields.OF_NAME,\n        name: this.fields.OF_NAME,\n        mcversion: this.fields.MC_VERSION,\n        version: `${this.fields.OF_EDITION}_${this.fields.OF_RELEASE}`,\n        description: 'OptiFine is a Minecraft optimization mod. It allows Minecraft to run faster and look better with full support for HD textures and many configuration options.',\n        authorList: ['sp614x'],\n        url: 'https://optifine.net',\n        clientSideOnly: true,\n        serverSideOnly: false,\n        value: '',\n        dependencies: '',\n        useMetadata: false,\n        acceptableRemoteVersions: '',\n        acceptableSaveVersions: '',\n        acceptedMinecraftVersions: `[${this.fields.MC_VERSION}]`,\n        modLanguage: 'java',\n        modLanguageAdapter: '',\n      })\n    }\n    for (const [k, v] of Object.entries(this.fields)) {\n      switch (k.toUpperCase()) {\n        case 'MODID':\n        case 'MOD_ID':\n          this.guess.modid = this.guess.modid || v\n          break\n        case 'MODNAME':\n        case 'MOD_NAME':\n          this.guess.name = this.guess.name || v\n          break\n        case 'VERSION':\n        case 'MOD_VERSION':\n          this.guess.version = this.guess.version || v\n          break\n        case 'MCVERSION':\n          this.guess.mcversion = this.guess.mcversion || v\n          break\n      }\n    }\n  }\n}\n\n/**\n * Read the mod info from `META-INF/MANIFEST.MF`\n * @returns The manifest directionary\n */\nexport async function readForgeModManifest(mod: ForgeModInput, manifestStore: Record<string, any> = {}): Promise<ManifestMetadata | undefined> {\n  const fs = await resolveFileSystem(mod)\n  if (!await fs.existsFile('META-INF/MANIFEST.MF')) { return undefined }\n  const data = await fs.readFile('META-INF/MANIFEST.MF')\n  const manifest: Record<string, string> = data.toString().split('\\n')\n    .map((l) => l.trim())\n    .filter((l) => l.length > 0)\n    .map((l) => l.split(':').map((s) => s.trim()))\n    .reduce((a, b) => ({ ...a, [b[0]]: b[1] }), {}) as any\n  Object.assign(manifestStore, manifest)\n  const metadata: ManifestMetadata = {\n    modid: '',\n    name: '',\n    authors: [],\n    version: '',\n    description: '',\n    url: '',\n  }\n  if (typeof manifest.TweakName === 'string') {\n    metadata.modid = manifest.TweakName\n    metadata.name = manifest.TweakName\n  }\n  if (typeof manifest.TweakAuthor === 'string') {\n    metadata.authors = [manifest.TweakAuthor]\n  }\n  if (typeof manifest.TweakVersion === 'string') {\n    metadata.version = manifest.TweakVersion\n  }\n  if (manifest.TweakMetaFile) {\n    const file = manifest.TweakMetaFile\n    if (await fs.existsFile(`META-INF/${file}`)) {\n      const metadataContent = await fs.readFile(`META-INF/${file}`, 'utf-8').then((s) => s.replace(/^\\uFEFF/, '')).then(JSON.parse)\n      if (metadataContent.id) {\n        metadata.modid = metadataContent.id\n      }\n      if (metadataContent.name) {\n        metadata.name = metadataContent.name\n      }\n      if (metadataContent.version) {\n        metadata.version = metadataContent.version\n      }\n      if (metadataContent.authors) {\n        metadata.authors = metadataContent.authors\n      }\n      if (metadataContent.description) {\n        metadata.description = metadataContent.description\n      }\n      if (metadataContent.url) {\n        metadata.url = metadataContent.url\n      }\n    }\n  }\n  return metadata\n}\n\n/**\n * Read mod metadata from new toml metadata file.\n */\nexport async function readForgeModToml(mod: ForgeModInput, manifest?: Record<string, string>, fileName = 'mods.toml') {\n  const fs = await resolveFileSystem(mod)\n  const existed = await fs.existsFile('META-INF/' + fileName)\n  const all: ForgeModTOMLData[] = []\n  if (existed) {\n    const str = await fs.readFile('META-INF/' + fileName, 'utf-8')\n    const root = parseToml(str)\n    if (root.mods instanceof Array) {\n      for (const mod of root.mods) {\n        const tomlMod = mod\n        if (typeof tomlMod === 'object' && !(tomlMod instanceof TomlDate) && !(tomlMod instanceof Array)) {\n          const modObject: ForgeModTOMLData = {\n            modid: tomlMod.modId as string ?? '',\n            authors: tomlMod.authors as string ?? root.authors as string ?? '',\n            // eslint-disable-next-line no-template-curly-in-string\n            version: tomlMod.version === '${file.jarVersion}' && typeof manifest?.['Implementation-Version'] === 'string'\n              ? manifest?.['Implementation-Version']\n              : tomlMod.version as string,\n            displayName: tomlMod.displayName as string ?? '',\n            description: tomlMod.description as string ?? '',\n            displayURL: tomlMod.displayURL as string ?? root.displayURL as string ?? '',\n            updateJSONURL: tomlMod.updateJSONURL as string ?? root.updateJSONURL ?? '',\n            provides: tomlMod.provides as string[] ?? [],\n            dependencies: [],\n            logoFile: tomlMod.logoFile as string ?? '',\n            credits: tomlMod.credits as string ?? '',\n            loaderVersion: root.loaderVersion as string ?? '',\n            modLoader: root.modLoader as string ?? '',\n            issueTrackerURL: root.issueTrackerURL as string ?? '',\n          }\n          all.push(modObject)\n        }\n      }\n    }\n    if (typeof root.dependencies === 'object') {\n      for (const mod of all) {\n        const dep = (root.dependencies as Record<string, any>)[mod.modid]\n        if (dep) { mod.dependencies = dep }\n      }\n    }\n  }\n  return all\n}\n\n/**\n * Use asm to scan all the class files of the mod. This might take long time to read.\n */\nexport async function readForgeModAsm(mod: ForgeModInput, manifest: Record<string, string> = {}): Promise<ForgeModASMData> {\n  const fs = await resolveFileSystem(mod)\n  let corePluginClass: string | undefined\n  if (manifest) {\n    if (typeof manifest.FMLCorePlugin === 'string') {\n      const clazz = manifest.FMLCorePlugin.replace(/\\./g, '/')\n      if (await fs.existsFile(clazz) || await fs.existsFile(`/${clazz}`) || await fs.existsFile(`/${clazz}.class`) || await fs.existsFile(clazz + '.class')) {\n        corePluginClass = clazz\n      }\n    }\n  }\n  const result: ForgeModASMData = {\n    usedForgePackage: false,\n    usedLegacyFMLPackage: false,\n    usedMinecraftClientPackage: false,\n    usedMinecraftPackage: false,\n    modAnnotations: [],\n  }\n  const guessing: Partial<ForgeModAnnotationData> = {}\n  await fs.walkFiles('/', async (f) => {\n    if (!f.endsWith('.class')) { return }\n    const data = await fs.readFile(f)\n    const visitor = new ModClassVisitor(result, guessing, corePluginClass)\n\n    new ClassReader(data).accept(visitor)\n  })\n  if (result.modAnnotations.length === 0 && guessing.modid && (result.usedForgePackage || result.usedLegacyFMLPackage)) {\n    result.modAnnotations.push({\n      modid: guessing.modid ?? '',\n      name: guessing.name ?? '',\n      version: guessing.version ?? '',\n      dependencies: guessing.dependencies ?? '',\n      useMetadata: guessing.useMetadata ?? false,\n      clientSideOnly: guessing.clientSideOnly ?? false,\n      serverSideOnly: guessing.serverSideOnly ?? false,\n      acceptedMinecraftVersions: guessing.acceptedMinecraftVersions ?? '',\n      acceptableRemoteVersions: guessing.acceptableRemoteVersions ?? '',\n      acceptableSaveVersions: guessing.acceptableSaveVersions ?? '',\n      modLanguage: guessing.modLanguage ?? 'java',\n      modLanguageAdapter: guessing.modLanguageAdapter ?? '',\n      value: guessing.value ?? '',\n    })\n  }\n  return result\n}\n/**\n * Read `mcmod.info`, `cccmod.info`, and `neimod.info` json file\n * @param mod The mod path or buffer or opened file system.\n */\nexport async function readForgeModJson(mod: ForgeModInput): Promise<ForgeModMcmodInfo[]> {\n  const fs = await resolveFileSystem(mod)\n  const all = [] as ForgeModMcmodInfo[]\n  function normalize(json: Partial<ForgeModMcmodInfo>) {\n    const metadata: ForgeModMcmodInfo = {\n      modid: '',\n      name: '',\n      description: '',\n      version: '',\n      mcversion: '',\n      url: '',\n      updateUrl: '',\n      updateJSON: '',\n      authorList: [],\n      credits: '',\n      logoFile: '',\n      screenshots: [],\n      parent: '',\n      useDependencyInformation: false,\n      requiredMods: [],\n      dependencies: [],\n      dependants: [],\n    }\n    metadata.modid = json.modid ?? metadata.modid\n    metadata.name = json.name ?? metadata.name\n    metadata.description = json.description ?? metadata.description\n    metadata.version = json.version ?? metadata.version\n    metadata.mcversion = json.mcversion ?? metadata.mcversion\n    metadata.url = json.url ?? metadata.url\n    metadata.updateUrl = json.updateUrl ?? metadata.updateUrl\n    metadata.updateJSON = json.updateJSON ?? metadata.updateJSON\n    metadata.authorList = json.authorList ?? metadata.authorList\n    metadata.credits = json.credits ?? metadata.credits\n    metadata.logoFile = json.logoFile ?? metadata.logoFile\n    metadata.screenshots = json.screenshots ?? metadata.screenshots\n    metadata.parent = json.parent ?? metadata.parent\n    metadata.useDependencyInformation = json.useDependencyInformation ?? metadata.useDependencyInformation\n    metadata.requiredMods = json.requiredMods ?? metadata.requiredMods\n    metadata.dependencies = json.dependencies ?? metadata.dependencies\n    metadata.dependants = json.dependants ?? metadata.dependants\n    return metadata\n  }\n  function readJsonMetadata(json: any) {\n    const modList: Array<Partial<ForgeModMcmodInfo>> = []\n    if (json instanceof Array) {\n      modList.push(...json)\n    } else if (json.modList instanceof Array) {\n      modList.push(...json.modList)\n    } else if (json.modid) {\n      modList.push(json)\n    }\n    all.push(...modList.map(normalize))\n  }\n  if (await fs.existsFile('mcmod.info')) {\n    try {\n      const json = JSON.parse((await fs.readFile('mcmod.info', 'utf-8')).replace(/^\\uFEFF/, ''))\n      readJsonMetadata(json)\n    } catch (e) { }\n  } else if (await fs.existsFile('cccmod.info')) {\n    try {\n      const text = (await fs.readFile('cccmod.info', 'utf-8')).replace(/^\\uFEFF/, '').replace(/\\n\\n/g, '\\\\n').replace(/\\n/g, '')\n      const json = JSON.parse(text)\n      readJsonMetadata(json)\n    } catch (e) { }\n  } else if (await fs.existsFile('neimod.info')) {\n    try {\n      const text = (await fs.readFile('neimod.info', 'utf-8')).replace(/^\\uFEFF/, '').replace(/\\n\\n/g, '\\\\n').replace(/\\n/g, '')\n      const json = JSON.parse(text)\n      readJsonMetadata(json)\n    } catch (e) { }\n  } else {\n    const files = await fs.listFiles('./')\n    const infoFile = files.find((f) => f.endsWith('.info'))\n    if (infoFile) {\n      try {\n        const text = (await fs.readFile(infoFile, 'utf-8')).replace(/^\\uFEFF/, '').replace(/\\n\\n/g, '\\\\n').replace(/\\n/g, '')\n        const json = JSON.parse(text)\n        readJsonMetadata(json)\n      } catch (e) { }\n    }\n  }\n  return all\n}\n\ntype ForgeModInput = Uint8Array | string | FileSystem\n\n/**\n * Represnet a full scan of a mod file data.\n */\nexport interface ForgeModMetadata extends ForgeModASMData {\n  /**\n     * The mcmod.info file metadata. If no mcmod.info file, it will be an empty array\n     */\n  mcmodInfo: ForgeModMcmodInfo[]\n  /**\n     * The java manifest file data. If no metadata, it will be an empty object\n     */\n  manifest: Record<string, any>\n  /**\n     * The mod info extract from manfiest. If no manifest, it will be undefined!\n     */\n  manifestMetadata?: ManifestMetadata\n  /**\n     * The toml mod metadata\n     */\n  modsToml: ForgeModTOMLData[]\n}\n\n/**\n * Read metadata of the input mod.\n *\n * This will scan the mcmod.info file, all class file for `@Mod` & coremod `DummyModContainer` class.\n * This will also scan the manifest file on `META-INF/MANIFEST.MF` for tweak mod.\n *\n * If the input is totally not a mod. It will throw {@link NonForgeModFileError}.\n *\n * @throws {@link NonForgeModFileError}\n * @param mod The mod path or data\n * @returns The mod metadata\n */\nexport async function readForgeMod(mod: ForgeModInput): Promise<ForgeModMetadata> {\n  const fs = await resolveFileSystem(mod)\n  try {\n    const jsons = await readForgeModJson(fs)\n    const manifest: Record<string, any> = {}\n    const manifestMetadata = await readForgeModManifest(fs, manifest)\n    const tomls = await readForgeModToml(fs, manifest)\n    const base = await readForgeModAsm(fs, manifest).catch(() => ({\n      usedLegacyFMLPackage: false,\n      usedForgePackage: false,\n      usedMinecraftPackage: false,\n      usedMinecraftClientPackage: false,\n      modAnnotations: [],\n    }))\n\n    if (jsons.length === 0 && (!manifestMetadata || !manifestMetadata.modid) && tomls.length === 0 && base.modAnnotations.length === 0) {\n      throw new ForgeModParseFailedError(mod, base, manifest)\n    }\n\n    const result: ForgeModMetadata = {\n      mcmodInfo: jsons,\n      manifest,\n      manifestMetadata: manifestMetadata?.modid ? manifestMetadata : undefined,\n      modsToml: tomls,\n      ...base,\n    }\n    return result\n  } finally {\n    if (mod !== fs) fs.close()\n  }\n}\n\nexport class ForgeModParseFailedError extends Error {\n  constructor(readonly mod: ForgeModInput, readonly asm: ForgeModASMData, readonly manifest: Record<string, any>) {\n    super('Cannot find the mod metadata in the mod!')\n    this.name = 'ForgeModParseFailedError'\n  }\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nfunction getLineColFromPtr(string, ptr) {\n    let lines = string.slice(0, ptr).split(/\\r\\n|\\n|\\r/g);\n    return [lines.length, lines.pop().length + 1];\n}\nfunction makeCodeBlock(string, line, column) {\n    let lines = string.split(/\\r\\n|\\n|\\r/g);\n    let codeblock = '';\n    let numberLen = (Math.log10(line + 1) | 0) + 1;\n    for (let i = line - 1; i <= line + 1; i++) {\n        let l = lines[i - 1];\n        if (!l)\n            continue;\n        codeblock += i.toString().padEnd(numberLen, ' ');\n        codeblock += ':  ';\n        codeblock += l;\n        codeblock += '\\n';\n        if (i === line) {\n            codeblock += ' '.repeat(numberLen + column + 2);\n            codeblock += '^\\n';\n        }\n    }\n    return codeblock;\n}\nexport class TomlError extends Error {\n    line;\n    column;\n    codeblock;\n    constructor(message, options) {\n        const [line, column] = getLineColFromPtr(options.toml, options.ptr);\n        const codeblock = makeCodeBlock(options.toml, line, column);\n        super(`Invalid TOML document: ${message}\\n\\n${codeblock}`, options);\n        this.line = line;\n        this.column = column;\n        this.codeblock = codeblock;\n    }\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { TomlError } from './error.js';\nexport function indexOfNewline(str, start = 0, end = str.length) {\n    let idx = str.indexOf('\\n', start);\n    if (str[idx - 1] === '\\r')\n        idx--;\n    return idx <= end ? idx : -1;\n}\nexport function skipComment(str, ptr) {\n    for (let i = ptr; i < str.length; i++) {\n        let c = str[i];\n        if (c === '\\n')\n            return i;\n        if (c === '\\r' && str[i + 1] === '\\n')\n            return i + 1;\n        if ((c < '\\x20' && c !== '\\t') || c === '\\x7f') {\n            throw new TomlError('control characters are not allowed in comments', {\n                toml: str,\n                ptr: ptr,\n            });\n        }\n    }\n    return str.length;\n}\nexport function skipVoid(str, ptr, banNewLines, banComments) {\n    let c;\n    while ((c = str[ptr]) === ' ' || c === '\\t' || (!banNewLines && (c === '\\n' || c === '\\r' && str[ptr + 1] === '\\n')))\n        ptr++;\n    return banComments || c !== '#'\n        ? ptr\n        : skipVoid(str, skipComment(str, ptr), banNewLines);\n}\nexport function skipUntil(str, ptr, sep, end, banNewLines = false) {\n    if (!end) {\n        ptr = indexOfNewline(str, ptr);\n        return ptr < 0 ? str.length : ptr;\n    }\n    for (let i = ptr; i < str.length; i++) {\n        let c = str[i];\n        if (c === '#') {\n            i = indexOfNewline(str, i);\n        }\n        else if (c === sep) {\n            return i + 1;\n        }\n        else if (c === end || (banNewLines && (c === '\\n' || (c === '\\r' && str[i + 1] === '\\n')))) {\n            return i;\n        }\n    }\n    throw new TomlError('cannot find end of structure', {\n        toml: str,\n        ptr: ptr\n    });\n}\nexport function getStringEnd(str, seek) {\n    let first = str[seek];\n    let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2]\n        ? str.slice(seek, seek + 3)\n        : first;\n    seek += target.length - 1;\n    do\n        seek = str.indexOf(target, ++seek);\n    while (seek > -1 && first !== \"'\" && str[seek - 1] === '\\\\' && (str[seek - 2] !== '\\\\' || str[seek - 3] === '\\\\'));\n    if (seek > -1) {\n        seek += target.length;\n        if (target.length > 1) {\n            if (str[seek] === first)\n                seek++;\n            if (str[seek] === first)\n                seek++;\n        }\n    }\n    return seek;\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nlet DATE_TIME_RE = /^(\\d{4}-\\d{2}-\\d{2})?[T ]?(?:(\\d{2}):\\d{2}:\\d{2}(?:\\.\\d+)?)?(Z|[-+]\\d{2}:\\d{2})?$/i;\nexport class TomlDate extends Date {\n    #hasDate = false;\n    #hasTime = false;\n    #offset = null;\n    constructor(date) {\n        let hasDate = true;\n        let hasTime = true;\n        let offset = 'Z';\n        if (typeof date === 'string') {\n            let match = date.match(DATE_TIME_RE);\n            if (match) {\n                if (!match[1]) {\n                    hasDate = false;\n                    date = `0000-01-01T${date}`;\n                }\n                hasTime = !!match[2];\n                // Make sure to use T instead of a space. Breaks in case of extreme values otherwise.\n                hasTime && date[10] === ' ' && (date = date.replace(' ', 'T'));\n                // Do not allow rollover hours.\n                if (match[2] && +match[2] > 23) {\n                    date = '';\n                }\n                else {\n                    offset = match[3] || null;\n                    date = date.toUpperCase();\n                    if (!offset && hasTime)\n                        date += 'Z';\n                }\n            }\n            else {\n                date = '';\n            }\n        }\n        super(date);\n        if (!isNaN(this.getTime())) {\n            this.#hasDate = hasDate;\n            this.#hasTime = hasTime;\n            this.#offset = offset;\n        }\n    }\n    isDateTime() {\n        return this.#hasDate && this.#hasTime;\n    }\n    isLocal() {\n        return !this.#hasDate || !this.#hasTime || !this.#offset;\n    }\n    isDate() {\n        return this.#hasDate && !this.#hasTime;\n    }\n    isTime() {\n        return this.#hasTime && !this.#hasDate;\n    }\n    isValid() {\n        return this.#hasDate || this.#hasTime;\n    }\n    toISOString() {\n        let iso = super.toISOString();\n        // Local Date\n        if (this.isDate())\n            return iso.slice(0, 10);\n        // Local Time\n        if (this.isTime())\n            return iso.slice(11, 23);\n        // Local DateTime\n        if (this.#offset === null)\n            return iso.slice(0, -1);\n        // Offset DateTime\n        if (this.#offset === 'Z')\n            return iso;\n        // This part is quite annoying: JS strips the original timezone from the ISO string representation\n        // Instead of using a \"modified\" date and \"Z\", we restore the representation \"as authored\"\n        let offset = (+(this.#offset.slice(1, 3)) * 60) + +(this.#offset.slice(4, 6));\n        offset = this.#offset[0] === '-' ? offset : -offset;\n        let offsetDate = new Date(this.getTime() - (offset * 60e3));\n        return offsetDate.toISOString().slice(0, -1) + this.#offset;\n    }\n    static wrapAsOffsetDateTime(jsDate, offset = 'Z') {\n        let date = new TomlDate(jsDate);\n        date.#offset = offset;\n        return date;\n    }\n    static wrapAsLocalDateTime(jsDate) {\n        let date = new TomlDate(jsDate);\n        date.#offset = null;\n        return date;\n    }\n    static wrapAsLocalDate(jsDate) {\n        let date = new TomlDate(jsDate);\n        date.#hasTime = false;\n        date.#offset = null;\n        return date;\n    }\n    static wrapAsLocalTime(jsDate) {\n        let date = new TomlDate(jsDate);\n        date.#hasDate = false;\n        date.#offset = null;\n        return date;\n    }\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { skipVoid } from './util.js';\nimport { TomlDate } from './date.js';\nimport { TomlError } from './error.js';\nlet INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\\d(_?\\d)*))$/;\nlet FLOAT_REGEX = /^[+-]?\\d(_?\\d)*(\\.\\d(_?\\d)*)?([eE][+-]?\\d(_?\\d)*)?$/;\nlet LEADING_ZERO = /^[+-]?0[0-9_]/;\nlet ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;\nlet ESC_MAP = {\n    b: '\\b',\n    t: '\\t',\n    n: '\\n',\n    f: '\\f',\n    r: '\\r',\n    '\"': '\"',\n    '\\\\': '\\\\',\n};\nexport function parseString(str, ptr = 0, endPtr = str.length) {\n    let isLiteral = str[ptr] === '\\'';\n    let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];\n    if (isMultiline) {\n        endPtr -= 2;\n        if (str[ptr += 2] === '\\r')\n            ptr++;\n        if (str[ptr] === '\\n')\n            ptr++;\n    }\n    let tmp = 0;\n    let isEscape;\n    let parsed = '';\n    let sliceStart = ptr;\n    while (ptr < endPtr - 1) {\n        let c = str[ptr++];\n        if (c === '\\n' || (c === '\\r' && str[ptr] === '\\n')) {\n            if (!isMultiline) {\n                throw new TomlError('newlines are not allowed in strings', {\n                    toml: str,\n                    ptr: ptr - 1,\n                });\n            }\n        }\n        else if ((c < '\\x20' && c !== '\\t') || c === '\\x7f') {\n            throw new TomlError('control characters are not allowed in strings', {\n                toml: str,\n                ptr: ptr - 1,\n            });\n        }\n        if (isEscape) {\n            isEscape = false;\n            if (c === 'u' || c === 'U') {\n                // Unicode escape\n                let code = str.slice(ptr, (ptr += (c === 'u' ? 4 : 8)));\n                if (!ESCAPE_REGEX.test(code)) {\n                    throw new TomlError('invalid unicode escape', {\n                        toml: str,\n                        ptr: tmp,\n                    });\n                }\n                try {\n                    parsed += String.fromCodePoint(parseInt(code, 16));\n                }\n                catch {\n                    throw new TomlError('invalid unicode escape', {\n                        toml: str,\n                        ptr: tmp,\n                    });\n                }\n            }\n            else if (isMultiline && (c === '\\n' || c === ' ' || c === '\\t' || c === '\\r')) {\n                // Multiline escape\n                ptr = skipVoid(str, ptr - 1, true);\n                if (str[ptr] !== '\\n' && str[ptr] !== '\\r') {\n                    throw new TomlError('invalid escape: only line-ending whitespace may be escaped', {\n                        toml: str,\n                        ptr: tmp,\n                    });\n                }\n                ptr = skipVoid(str, ptr);\n            }\n            else if (c in ESC_MAP) {\n                // Classic escape\n                parsed += ESC_MAP[c];\n            }\n            else {\n                throw new TomlError('unrecognized escape sequence', {\n                    toml: str,\n                    ptr: tmp,\n                });\n            }\n            sliceStart = ptr;\n        }\n        else if (!isLiteral && c === '\\\\') {\n            tmp = ptr - 1;\n            isEscape = true;\n            parsed += str.slice(sliceStart, tmp);\n        }\n    }\n    return parsed + str.slice(sliceStart, endPtr - 1);\n}\nexport function parseValue(value, toml, ptr, integersAsBigInt) {\n    // Constant values\n    if (value === 'true')\n        return true;\n    if (value === 'false')\n        return false;\n    if (value === '-inf')\n        return -Infinity;\n    if (value === 'inf' || value === '+inf')\n        return Infinity;\n    if (value === 'nan' || value === '+nan' || value === '-nan')\n        return NaN;\n    // Avoid FP representation of -0\n    if (value === '-0')\n        return integersAsBigInt ? 0n : 0;\n    // Numbers\n    let isInt = INT_REGEX.test(value);\n    if (isInt || FLOAT_REGEX.test(value)) {\n        if (LEADING_ZERO.test(value)) {\n            throw new TomlError('leading zeroes are not allowed', {\n                toml: toml,\n                ptr: ptr,\n            });\n        }\n        value = value.replace(/_/g, '');\n        let numeric = +value;\n        if (isNaN(numeric)) {\n            throw new TomlError('invalid number', {\n                toml: toml,\n                ptr: ptr,\n            });\n        }\n        if (isInt) {\n            if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {\n                throw new TomlError('integer value cannot be represented losslessly', {\n                    toml: toml,\n                    ptr: ptr,\n                });\n            }\n            if (isInt || integersAsBigInt === true)\n                numeric = BigInt(value);\n        }\n        return numeric;\n    }\n    const date = new TomlDate(value);\n    if (!date.isValid()) {\n        throw new TomlError('invalid value', {\n            toml: toml,\n            ptr: ptr,\n        });\n    }\n    return date;\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseString, parseValue } from './primitive.js';\nimport { parseArray, parseInlineTable } from './struct.js';\nimport { indexOfNewline, skipVoid, skipUntil, skipComment, getStringEnd } from './util.js';\nimport { TomlError } from './error.js';\nfunction sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {\n    let value = str.slice(startPtr, endPtr);\n    let commentIdx = value.indexOf('#');\n    if (commentIdx > -1) {\n        // The call to skipComment allows to \"validate\" the comment\n        // (absence of control characters)\n        skipComment(str, commentIdx);\n        value = value.slice(0, commentIdx);\n    }\n    let trimmed = value.trimEnd();\n    if (!allowNewLines) {\n        let newlineIdx = value.indexOf('\\n', trimmed.length);\n        if (newlineIdx > -1) {\n            throw new TomlError('newlines are not allowed in inline tables', {\n                toml: str,\n                ptr: startPtr + newlineIdx\n            });\n        }\n    }\n    return [trimmed, commentIdx];\n}\nexport function extractValue(str, ptr, end, depth, integersAsBigInt) {\n    if (depth === 0) {\n        throw new TomlError('document contains excessively nested structures. aborting.', {\n            toml: str,\n            ptr: ptr\n        });\n    }\n    let c = str[ptr];\n    if (c === '[' || c === '{') {\n        let [value, endPtr] = c === '['\n            ? parseArray(str, ptr, depth, integersAsBigInt)\n            : parseInlineTable(str, ptr, depth, integersAsBigInt);\n        let newPtr = end ? skipUntil(str, endPtr, ',', end) : endPtr;\n        if (endPtr - newPtr && end === '}') {\n            let nextNewLine = indexOfNewline(str, endPtr, newPtr);\n            if (nextNewLine > -1) {\n                throw new TomlError('newlines are not allowed in inline tables', {\n                    toml: str,\n                    ptr: nextNewLine\n                });\n            }\n        }\n        return [value, newPtr];\n    }\n    let endPtr;\n    if (c === '\"' || c === \"'\") {\n        endPtr = getStringEnd(str, ptr);\n        let parsed = parseString(str, ptr, endPtr);\n        if (end) {\n            endPtr = skipVoid(str, endPtr, end !== ']');\n            if (str[endPtr] && str[endPtr] !== ',' && str[endPtr] !== end && str[endPtr] !== '\\n' && str[endPtr] !== '\\r') {\n                throw new TomlError('unexpected character encountered', {\n                    toml: str,\n                    ptr: endPtr,\n                });\n            }\n            endPtr += (+(str[endPtr] === ','));\n        }\n        return [parsed, endPtr];\n    }\n    endPtr = skipUntil(str, ptr, ',', end);\n    let slice = sliceAndTrimEndOf(str, ptr, endPtr - (+(str[endPtr - 1] === ',')), end === ']');\n    if (!slice[0]) {\n        throw new TomlError('incomplete key-value declaration: no value specified', {\n            toml: str,\n            ptr: ptr\n        });\n    }\n    if (end && slice[1] > -1) {\n        endPtr = skipVoid(str, ptr + slice[1]);\n        endPtr += +(str[endPtr] === ',');\n    }\n    return [\n        parseValue(slice[0], str, ptr, integersAsBigInt),\n        endPtr,\n    ];\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseString } from './primitive.js';\nimport { extractValue } from './extract.js';\nimport { getStringEnd, indexOfNewline, skipComment, skipVoid } from './util.js';\nimport { TomlError } from './error.js';\nlet KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \\t]*$/;\nexport function parseKey(str, ptr, end = '=') {\n    let dot = ptr - 1;\n    let parsed = [];\n    let endPtr = str.indexOf(end, ptr);\n    if (endPtr < 0) {\n        throw new TomlError('incomplete key-value: cannot find end of key', {\n            toml: str,\n            ptr: ptr,\n        });\n    }\n    do {\n        let c = str[ptr = ++dot];\n        // If it's whitespace, ignore\n        if (c !== ' ' && c !== '\\t') {\n            // If it's a string\n            if (c === '\"' || c === '\\'') {\n                if (c === str[ptr + 1] && c === str[ptr + 2]) {\n                    throw new TomlError('multiline strings are not allowed in keys', {\n                        toml: str,\n                        ptr: ptr,\n                    });\n                }\n                let eos = getStringEnd(str, ptr);\n                if (eos < 0) {\n                    throw new TomlError('unfinished string encountered', {\n                        toml: str,\n                        ptr: ptr,\n                    });\n                }\n                dot = str.indexOf('.', eos);\n                let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);\n                let newLine = indexOfNewline(strEnd);\n                if (newLine > -1) {\n                    throw new TomlError('newlines are not allowed in keys', {\n                        toml: str,\n                        ptr: ptr + dot + newLine,\n                    });\n                }\n                if (strEnd.trimStart()) {\n                    throw new TomlError('found extra tokens after the string part', {\n                        toml: str,\n                        ptr: eos,\n                    });\n                }\n                if (endPtr < eos) {\n                    endPtr = str.indexOf(end, eos);\n                    if (endPtr < 0) {\n                        throw new TomlError('incomplete key-value: cannot find end of key', {\n                            toml: str,\n                            ptr: ptr,\n                        });\n                    }\n                }\n                parsed.push(parseString(str, ptr, eos));\n            }\n            else {\n                // Normal raw key part consumption and validation\n                dot = str.indexOf('.', ptr);\n                let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);\n                if (!KEY_PART_RE.test(part)) {\n                    throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {\n                        toml: str,\n                        ptr: ptr,\n                    });\n                }\n                parsed.push(part.trimEnd());\n            }\n        }\n        // Until there's no more dot\n    } while (dot + 1 && dot < endPtr);\n    return [parsed, skipVoid(str, endPtr + 1, true, true)];\n}\nexport function parseInlineTable(str, ptr, depth, integersAsBigInt) {\n    let res = {};\n    let seen = new Set();\n    let c;\n    let comma = 0;\n    ptr++;\n    while ((c = str[ptr++]) !== '}' && c) {\n        let err = { toml: str, ptr: ptr - 1 };\n        if (c === '\\n') {\n            throw new TomlError('newlines are not allowed in inline tables', err);\n        }\n        else if (c === '#') {\n            throw new TomlError('inline tables cannot contain comments', err);\n        }\n        else if (c === ',') {\n            throw new TomlError('expected key-value, found comma', err);\n        }\n        else if (c !== ' ' && c !== '\\t') {\n            let k;\n            let t = res;\n            let hasOwn = false;\n            let [key, keyEndPtr] = parseKey(str, ptr - 1);\n            for (let i = 0; i < key.length; i++) {\n                if (i)\n                    t = hasOwn ? t[k] : (t[k] = {});\n                k = key[i];\n                if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {\n                    throw new TomlError('trying to redefine an already defined value', {\n                        toml: str,\n                        ptr: ptr,\n                    });\n                }\n                if (!hasOwn && k === '__proto__') {\n                    Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n                }\n            }\n            if (hasOwn) {\n                throw new TomlError('trying to redefine an already defined value', {\n                    toml: str,\n                    ptr: ptr,\n                });\n            }\n            let [value, valueEndPtr] = extractValue(str, keyEndPtr, '}', depth - 1, integersAsBigInt);\n            seen.add(value);\n            t[k] = value;\n            ptr = valueEndPtr;\n            comma = str[ptr - 1] === ',' ? ptr - 1 : 0;\n        }\n    }\n    if (comma) {\n        throw new TomlError('trailing commas are not allowed in inline tables', {\n            toml: str,\n            ptr: comma,\n        });\n    }\n    if (!c) {\n        throw new TomlError('unfinished table encountered', {\n            toml: str,\n            ptr: ptr,\n        });\n    }\n    return [res, ptr];\n}\nexport function parseArray(str, ptr, depth, integersAsBigInt) {\n    let res = [];\n    let c;\n    ptr++;\n    while ((c = str[ptr++]) !== ']' && c) {\n        if (c === ',') {\n            throw new TomlError('expected value, found comma', {\n                toml: str,\n                ptr: ptr - 1,\n            });\n        }\n        else if (c === '#')\n            ptr = skipComment(str, ptr);\n        else if (c !== ' ' && c !== '\\t' && c !== '\\n' && c !== '\\r') {\n            let e = extractValue(str, ptr - 1, ']', depth - 1, integersAsBigInt);\n            res.push(e[0]);\n            ptr = e[1];\n        }\n    }\n    if (!c) {\n        throw new TomlError('unfinished array encountered', {\n            toml: str,\n            ptr: ptr,\n        });\n    }\n    return [res, ptr];\n}\n", "/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseKey } from './struct.js';\nimport { extractValue } from './extract.js';\nimport { skipVoid } from './util.js';\nimport { TomlError } from './error.js';\nfunction peekTable(key, table, meta, type) {\n    let t = table;\n    let m = meta;\n    let k;\n    let hasOwn = false;\n    let state;\n    for (let i = 0; i < key.length; i++) {\n        if (i) {\n            t = hasOwn ? t[k] : (t[k] = {});\n            m = (state = m[k]).c;\n            if (type === 0 /* Type.DOTTED */ && (state.t === 1 /* Type.EXPLICIT */ || state.t === 2 /* Type.ARRAY */)) {\n                return null;\n            }\n            if (state.t === 2 /* Type.ARRAY */) {\n                let l = t.length - 1;\n                t = t[l];\n                m = m[l].c;\n            }\n        }\n        k = key[i];\n        if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 /* Type.DOTTED */ && m[k]?.d) {\n            return null;\n        }\n        if (!hasOwn) {\n            if (k === '__proto__') {\n                Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n                Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });\n            }\n            m[k] = {\n                t: i < key.length - 1 && type === 2 /* Type.ARRAY */\n                    ? 3 /* Type.ARRAY_DOTTED */\n                    : type,\n                d: false,\n                i: 0,\n                c: {},\n            };\n        }\n    }\n    state = m[k];\n    if (state.t !== type && !(type === 1 /* Type.EXPLICIT */ && state.t === 3 /* Type.ARRAY_DOTTED */)) {\n        // Bad key type!\n        return null;\n    }\n    if (type === 2 /* Type.ARRAY */) {\n        if (!state.d) {\n            state.d = true;\n            t[k] = [];\n        }\n        t[k].push(t = {});\n        state.c[state.i++] = (state = { t: 1 /* Type.EXPLICIT */, d: false, i: 0, c: {} });\n    }\n    if (state.d) {\n        // Redefining a table!\n        return null;\n    }\n    state.d = true;\n    if (type === 1 /* Type.EXPLICIT */) {\n        t = hasOwn ? t[k] : (t[k] = {});\n    }\n    else if (type === 0 /* Type.DOTTED */ && hasOwn) {\n        return null;\n    }\n    return [k, t, state.c];\n}\nexport function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {\n    let res = {};\n    let meta = {};\n    let tbl = res;\n    let m = meta;\n    for (let ptr = skipVoid(toml, 0); ptr < toml.length;) {\n        if (toml[ptr] === '[') {\n            let isTableArray = toml[++ptr] === '[';\n            let k = parseKey(toml, ptr += +isTableArray, ']');\n            if (isTableArray) {\n                if (toml[k[1] - 1] !== ']') {\n                    throw new TomlError('expected end of table declaration', {\n                        toml: toml,\n                        ptr: k[1] - 1,\n                    });\n                }\n                k[1]++;\n            }\n            let p = peekTable(k[0], res, meta, isTableArray ? 2 /* Type.ARRAY */ : 1 /* Type.EXPLICIT */);\n            if (!p) {\n                throw new TomlError('trying to redefine an already defined table or value', {\n                    toml: toml,\n                    ptr: ptr,\n                });\n            }\n            m = p[2];\n            tbl = p[1];\n            ptr = k[1];\n        }\n        else {\n            let k = parseKey(toml, ptr);\n            let p = peekTable(k[0], tbl, m, 0 /* Type.DOTTED */);\n            if (!p) {\n                throw new TomlError('trying to redefine an already defined table or value', {\n                    toml: toml,\n                    ptr: ptr,\n                });\n            }\n            let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt);\n            p[1][p[0]] = v[0];\n            ptr = v[1];\n        }\n        ptr = skipVoid(toml, ptr, true);\n        if (toml[ptr] && toml[ptr] !== '\\n' && toml[ptr] !== '\\r') {\n            throw new TomlError('each key-value declaration must be followed by an end-of-line', {\n                toml: toml,\n                ptr: ptr\n            });\n        }\n        ptr = skipVoid(toml, ptr);\n    }\n    return res;\n}\n", "/**\n * Represent the forge config file\n */\nexport interface ForgeConfig {\n  [category: string]: {\n    comment?: string\n    properties: Array<ForgeConfig.Property<any>>\n  }\n}\n\nexport class CorruptedForgeConfigError extends Error {\n  name = 'CorruptedForgeConfigError'\n\n  constructor(readonly reason: string, readonly line: string) {\n    super(`CorruptedForgeConfigError by ${reason}: ${line}`)\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ForgeConfig {\n  export type Type = 'I' | 'D' | 'S' | 'B'\n  export interface Property<T = number | boolean | string | number[] | boolean[] | string[]> {\n    readonly type: Type\n    readonly name: string\n    readonly comment?: string\n    value: T\n  }\n\n  /**\n     * Convert a forge config to string\n     */\n  export function stringify(config: ForgeConfig) {\n    let content = '# Configuration file\\n\\n\\n'\n    const propIndent = '    '; const arrIndent = '        '\n    Object.keys(config).forEach((cat) => {\n      content += `${cat} {\\n\\n`\n      config[cat].properties.forEach((prop) => {\n        if (prop.comment) {\n          const lines = prop.comment.split('\\n')\n          for (const l of lines) {\n            content += `${propIndent}# ${l}\\n`\n          }\n        }\n        if (prop.value instanceof Array) {\n          content += `${propIndent}${prop.type}:${prop.name} <\\n`\n          prop.value.forEach((v) => { content += `${arrIndent}${v}\\n` })\n          content += `${propIndent}>\\n`\n        } else {\n          content += `${propIndent}${prop.type}:${prop.name}=${prop.value}\\n`\n        }\n        content += '\\n'\n      })\n      content += '}\\n\\n'\n    })\n    return content\n  }\n\n  /**\n     * Parse a forge config string into `Config` object\n     * @param body The forge config string\n     */\n  export function parse(body: string): ForgeConfig {\n    const lines = body.split('\\n').map((s) => s.trim())\n      .filter((s) => s.length !== 0)\n    let category: string | undefined\n    let pendingCategory: string | undefined\n\n    const parseVal = (type: Type, value: any) => {\n      const map: { [key: string]: (s: string) => any } = {\n        I: Number.parseInt,\n        D: Number.parseFloat,\n        S: (s: string) => s,\n        B: (s: string) => s === 'true',\n      }\n      const handler = map[type]\n      return handler(value)\n    }\n    const config: ForgeConfig = {}\n    let inlist = false\n    let comment: string | undefined\n    let last: any\n\n    const readProp = (type: Type, line: string) => {\n      line = line.substring(line.indexOf(':') + 1, line.length)\n      const pair = line.split('=')\n      if (pair.length === 0 || pair.length === 1) {\n        let value\n        let name\n        if (line.endsWith(' <')) {\n          value = []\n          name = line.substring(0, line.length - 2)\n          inlist = true\n        }\n        if (!category) {\n          throw new CorruptedForgeConfigError('MissingCategory', line)\n        }\n        config[category].properties.push(last = { name, type, value, comment } as Property)\n      } else {\n        inlist = false\n        if (!category) {\n          throw new CorruptedForgeConfigError('MissingCategory', line)\n        }\n        config[category].properties.push({ name: pair[0], value: parseVal(type, pair[1]), type, comment } as Property)\n      }\n      comment = undefined\n    }\n    for (const line of lines) {\n      if (inlist) {\n        if (!last) {\n          throw new CorruptedForgeConfigError('CorruptedList', line)\n        }\n        if (line === '>') {\n          inlist = false\n        } else if (line.endsWith(' >')) {\n          last.value.push(parseVal(last.type, line.substring(0, line.length - 2)))\n          inlist = false\n        } else {\n          last.value.push(parseVal(last.type, line))\n        }\n        continue\n      }\n      switch (line.charAt(0)) {\n        case '#':\n          if (!comment) {\n            comment = line.substring(1, line.length).trim()\n          } else {\n            comment = comment.concat('\\n', line.substring(1, line.length).trim())\n          }\n          break\n        case 'I':\n        case 'D':\n        case 'S':\n        case 'B':\n          readProp(line.charAt(0) as Type, line)\n          break\n        case '<':\n          break\n        case '{':\n          if (pendingCategory) {\n            category = pendingCategory\n            config[category] = { comment, properties: [] }\n            comment = undefined\n          } else {\n            throw new CorruptedForgeConfigError('MissingCategory', line)\n          }\n          break\n        case '}':\n          category = undefined\n          break\n        default:\n          if (!category) {\n            if (line.endsWith('{')) {\n              category = line.substring(0, line.length - 1).trim()\n              config[category] = { comment, properties: [] }\n              comment = undefined\n            } else {\n              pendingCategory = line\n            }\n          } else {\n            throw new CorruptedForgeConfigError('Duplicated', line)\n          }\n      }\n    }\n    return config\n  }\n}\n", "import { FileSystem, resolveFileSystem } from '@xmcl/system'\n\nexport interface LiteloaderModMetadata {\n  readonly mcversion: string\n  readonly name: string\n  readonly revision: number\n\n  readonly author?: string\n  readonly version?: string\n  readonly description?: string\n  readonly url?: string\n\n  readonly tweakClass?: string\n  readonly dependsOn?: string[]\n  readonly injectAt?: string\n  readonly requiredAPIs?: string[]\n  readonly classTransformerClasses?: string[]\n}\n\nexport async function readLiteloaderMod(mod: string | Uint8Array | FileSystem) {\n  const fs = await resolveFileSystem(mod)\n\n  try {\n    const text = await fs.readFile('litemod.json', 'utf-8').then((s) => s.replace(/^\\uFEFF/, '')).catch(() => undefined)\n    if (!text) {\n      throw Object.assign(new Error('Illegal input type! Expect a jar file contains litemod.json'), {\n        mod,\n        name: 'IllegalInputType',\n      })\n    }\n    const metadata = JSON.parse(text.trim(), (key, value) => key === 'revision' ? Number.parseInt(value, 10) : value) as LiteloaderModMetadata\n    if (!metadata.version) {\n      (metadata as any).version = `${metadata.mcversion}:${metadata.revision || 0}`\n    }\n    return metadata\n  } finally {\n    if (fs !== mod) fs.close()\n  }\n}\n", "import { FileSystem, resolveFileSystem } from '@xmcl/system'\n\ntype Person = {\n  /**\n     * The real name, or username, of the person. Mandatory.\n     */\n  name: string\n  /**\n     *  Person's contact information. The same as upper level contact. See above. Optional.\n     */\n  contact?: string\n} | string\n\ntype Environment = 'client' | 'server' | '*'\n\n/**\n * The `ModMetadata` is extract from `fabric.mod.json`.\n *\n * The `fabric.mod.json` file is a mod metadata file used by Fabric Loader to load mods.\n * In order to be loaded, a mod must have this file with the exact name placed in the root directory of the mod JAR.\n */\nexport interface FabricModMetadata {\n  /* Required */\n  provides?: string[]\n  /**\n     * Needed for internal mechanisms. Must always be 1.\n     */\n  schemaVersion: number\n  /**\n     * Defines the mod's identifier - a string of Latin letters, digits, underscores with length from 1 to 63.\n     */\n  id: string\n  /**\n     * Defines the mod's version - a string value, optionally matching the Semantic Versioning 2.0.0 specification.\n     */\n  version: string\n\n  /* Mod loading */\n\n  /**\n     * Defines where mod runs: only on the client side (client mod), only on the server side (plugin) or on both sides (regular mod). Contains the environment identifier:\n     * - `*` Runs everywhere. Default.\n     * - `client` Runs on the client side.\n     * - `server` Runs on the server side.\n     */\n  environment?: Environment\n\n  /**\n     * Defines main classes of your mod, that will be loaded.\n     * - There are 3 default entry points for your mod:\n     *  - main Will be run first. For classes implementing ModInitializer.\n     *  - client Will be run second and only on the client side. For classes implementing ClientModInitializer.\n     *  - server Will be run second and only on the server side. For classes implementing DedicatedServerModInitializer.\n     * - Each entry point can contain any number of classes to load. Classes (or methods or static fields) could be defined in two ways:\n     *  - If you're using Java, then just list the classes (or else) full names. For example:\n     * ```json\n     * \"main\": [\n     *      \"net.fabricmc.example.ExampleMod\",\n     *      \"net.fabricmc.example.ExampleMod::handle\"\n     *  ]\n     * ```\n     *  - If you're using any other language, consult the language adapter's documentation. The Kotlin one is located [here](https://github.com/FabricMC/fabric-language-kotlin/blob/master/README.md).\n     */\n  entrypoints?: string[]\n\n  /**\n     * A list of nested JARs inside your mod's JAR to load. Before using the field, check out [the guidelines on the usage of the nested JARs](https://fabricmc.net/wiki/tutorial:loader04x#nested_jars). Each entry is an object containing file key. That should be a path inside your mod's JAR to the nested JAR. For example:\n     * ```json\n     * \"jars\": [\n     *     {\n     *         \"file\": \"nested/vendor/dependency.jar\"\n     *     }\n     * ]\n     * ```\n     */\n  jars?: { file: string }[]\n  /**\n     * A dictionary of adapters for used languages to their adapter classes full names. For example:\n     * ```json\n     * \"languageAdapters\": {\n     *    \"kotlin\": \"net.fabricmc.language.kotlin.KotlinAdapter\"\n     * }\n     * ```\n     */\n  languageAdapters?: string[]\n  /**\n     *  A list of mixin configuration files.Each entry is the path to the mixin configuration file inside your mod's JAR or an object containing following fields:\n     *  - `config` The path to the mixin configuration file inside your mod's JAR.\n     *  - `environment` The same as upper level `environment` field.See above. For example:\n     *  ```json\n     *  \"mixins\": [\n     *       \"modid.mixins.json\",\n     *       {\n     *           \"config\": \"modid.client-mixins.json\",\n     *           \"environment\": \"client\"\n     *       }\n     *   ]\n     *  ```\n     */\n  mixins?: (string | { config: string; environment: Environment })[]\n\n  /* Dependency resolution */\n  /*\n     * The key of each entry of the objects below is a Mod ID of the dependency.\n     * The value of each key is a string or array of strings declaring supported version ranges. In the case of an array, an \u201COR\u201D relationship is assumed - that is, only one range has to match for the collective range to be satisfied.\n     * In the case of all versions, * is a special string declaring that any version is matched by the range. In addition, exact string matches must be possible regardless of the version type.\n     */\n\n  /**\n     * For dependencies required to run. Without them a game will crash.\n     */\n  depends?: Record<string, string | string[]>\n  /**\n     * For dependencies not required to run. Without them a game will log a warning.\n     */\n  recommends?: Record<string, string | string[]>\n  /**\n     * For dependencies not required to run. Use this as a kind of metadata.\n     */\n  suggests?: Record<string, string | string[]>\n  /**\n     * For mods whose together with yours might cause a game crash. With them a game will crash.\n     */\n  breaks?: Record<string, string | string[]>\n  /**\n     * For mods whose together with yours cause some kind of bugs, etc. With them a game will log a warning.\n     */\n  conflicts?: Record<string, string | string[]>\n\n  /* Metadata */\n\n  /**\n     * Defines the user-friendly mod's name. If not present, assume it matches id.\n     */\n  name?: string\n  /**\n     * Defines the mod's description. If not present, assume empty string.\n     */\n  description?: string\n  /**\n     * Defines the contact information for the project. It is an object of the following fields:\n     */\n  contact?: {\n    /**\n         * Contact e-mail pertaining to the mod. Must be a valid e-mail address.\n         */\n    email?: string\n    /**\n         * IRC channel pertaining to the mod. Must be of a valid URL format - for example: irc://irc.esper.net:6667/charset for #charset at EsperNet - the port is optional, and assumed to be 6667 if not present.\n         */\n    irc?: string\n    /**\n         * Project or user homepage. Must be a valid HTTP/HTTPS address.\n         */\n    homepage?: string\n    /**\n         * Project issue tracker. Must be a valid HTTP/HTTPS address.\n         */\n    issues?: string\n    /**\n         * Project source code repository. Must be a valid URL - it can, however, be a specialized URL for a given VCS (such as Git or Mercurial).\n         * The list is not exhaustive - mods may provide additional, non-standard keys (such as discord, slack, twitter, etc) - if possible, they should be valid URLs.\n         */\n    sources?: string[]\n  }\n  /**\n     * A list of authors of the mod. Each entry is a single name or an object containing following fields:\n     */\n  authors?: Person[]\n  /**\n     * A list of contributors to the mod. Each entry is the same as in author field. See above.\n     */\n  contributors?: Person[]\n  /**\n     * Defines the licensing information.Can either be a single license string or a list of them.\n     * - This should provide the complete set of preferred licenses conveying the entire mod package.In other words, compliance with all listed licenses should be sufficient for usage, redistribution, etc.of the mod package as a whole.\n     * - For cases where a part of code is dual - licensed, choose the preferred license.The list is not exhaustive, serves primarily as a kind of hint, and does not prevent you from granting additional rights / licenses on a case -by -case basis.\n     * - To aid automated tools, it is recommended to use SPDX License Identifiers for open - source licenses.\n     */\n  license?: string | string[]\n  /**\n     * Defines the mod's icon. Icons are square PNG files. (Minecraft resource packs use 128\u00D7128, but that is not a hard requirement - a power of two is, however, recommended.) Can be provided in one of two forms:\n     * - A path to a single PNG file.\n     * - A dictionary of images widths to their files' paths.\n     */\n  icon?: string\n}\n\n/**\n * Read fabric mod metadata json from a jar file or a directory\n * @param file The jar file or directory path. I can also be the binary content of the jar if you have already read the jar.\n */\nexport async function readFabricMod(file: FileSystem | string | Uint8Array): Promise<FabricModMetadata> {\n  const fs = await resolveFileSystem(file)\n  try {\n    const content = await fs.readFile('fabric.mod.json', 'utf-8')\n    return JSON.parse(content.replace(/^\\uFEFF/g, '').replace(/\\n/g, ''))\n  } finally {\n    if (file !== fs) fs.close()\n  }\n}\n", "import { FileSystem, resolveFileSystem } from '@xmcl/system'\n\nexport interface QuiltModMetadata {\n  /**\n   * `1` for now\n   */\n  schema_version: number\n  quilt_loader: QuiltLoaderData\n  /**\n   * e.g. \"example_mod.mixins.json\"\n   */\n  mixin?: string | string[]\n}\n\n/**\n * A dependency object defines what mods/plugins a given mod depends on or breaks.\n * It can be represented as either an object containing at least the id field, a string mod identifier in the form of either mavenGroup:modId or modId, or an array of dependency objects.\n * If an array of dependency objects is provided, the dependency matches if it matches ANY of the dependency objects for the \"depends\" and \"unless\" fields, and ALL for the \"breaks\" field.\n */\nexport interface DependencyObject {\n  /**\n   * A mod identifier in the form of either mavenGroup:modId or modId.\n   */\n  id: string\n\n  /**\n   * Should be a version specifier or array of version specifiers defining what versions this dependency applies to. If an array of versions is provided, the dependency matches if it matches ANY of the listed versions.\n   *\n   * @default \"*\"\n   */\n  versions?: string | string[]\n  /**\n   * A short, human-readable reason for the dependency object to exist.\n   */\n  reason?: string\n  /**\n   * Dependencies marked as optional will only be checked if the mod/plugin specified by the id field is present.\n   */\n  optional?: boolean\n  /**\n   * Describes situations where this dependency can be ignored. For example:\n   *\n   * ```\n   * {\n   *     \"id\": \"sodium\",\n   *     \"unless\": \"indium\"\n   * }\n   * ```\n   *\n   * Game providers and loader plugins can also add their own optional fields to the dependency object for extra context when resolving dependencies. The Minecraft game provider, for instance, might define an \"environment\" field that can be used like so:\n   *\n   * ```\n   * {\n   *     \"id\": \"modmenu\",\n   *     \"environment\": \"client\"\n   * }\n   * ```\n   */\n  unless?: DependencyObject\n}\n\nexport interface QuiltLoaderData {\n  /**\n   * A unique identifier for the organization behind or developers of the mod. The group string must match the ^[a-zA-Z0-9-_.]+$ regular expression, and must not begin with the reserved namespace loader.plugin. It is recommended, but not required, to follow Maven's [guide to naming conventions](https://maven.apache.org/guides/mini/guide-naming-conventions.html).\n   */\n  group: string\n  /**\n   * A unique identifier for the mod or library defined by this file, matching the ^[a-z][a-z0-9-_]{1,63}$ regular expression. Best practice is that mod ID's are in snake_case.\n   */\n  id: string\n  /**\n   * An array of ProvidesObjects describing other mods/APIs that this package provides.\n   */\n  provides?: Array<string>\n  /**\n   * Must conform to the Semantic Versioning 2.0.0 specification. In a development environment, the value ${version} can be used as a placeholder by quilt-gradle to be replaced on building the resulting JAR.\n   */\n  version: string\n  /**\n   * Optional metadata that can be used by mods to display information about the mods installed.\n   */\n  metadata?: {\n    /**\n     * A human-readable name for this mod.\n     */\n    name?: string\n    /**\n     * A human-readable description of this mod. This description should be plain text, with the exception of line breaks, which can be represented with the newline character \\n.\n     */\n    description?: string\n    /**\n     * A collection of key: value pairs denoting the persons or organizations that contributed to this project. The key should be the name of the person or organization, while the value can be either a string representing a single role or an array of strings each one representing a single role.\n     *\n     * A role can be any valid string. The \"Owner\" role is defined as being the person(s) or organization in charge of the project.\n     */\n    contributors?: Record<string, string>\n    /**\n     * A collection of key: value pairs denoting various contact information for the people behind this mod, with all values being strings. The following keys are officially defined, though mods can provide as many additional values as they wish:\n     */\n    contact?: {\n      homepage?: string\n      issues?: string\n      sources?: string\n      /**\n       * Valid e-mail address for the organization/developers\n       */\n      email?: string\n    }\n    /**\n     * The license or array of licenses this project operates under.\n     *\n     * A license is defined as either an SPDX identifier string or an object in the following form:\n     *\n     * ```\n     * {\n     *     \"name\": \"Perfectly Awesome License v1.0\",\n     *     \"id\": \"PAL-1.0\",\n     *     \"url\": \"https://theperfectlyawesomelicense.com/\",\n     *     \"description\": \"This license does things and stuff and says that you can do things and stuff too!\"\n     * }\n     * ```\n     */\n    license?: string | {\n      name: string\n      id: string\n      url: string\n      description?: string\n    } | Array<string>\n    /**\n     * One or more paths to a square .PNG file. If an object is provided, the keys must be the resolution of the corresponding file. For example:\n     *\n     * ```\n     * \"icon\": {\n     *     \"32\": \"path/to/icon32.png\",\n     *     \"64\": \"path/to/icon64.png\",\n     *     \"4096\": \"path/to/icon4096.png\"\n     * }\n     * ```\n     *\n     * @example `assets/example_mod/icon.png`\n     */\n    icon?: string | Record<string, string>\n  }\n  /**\n   * A collection of `key: value` pairs, where each key is the type of the entrypoints specified and each values is either a single entrypoint or an array of entrypoints. An entrypoint is an object with the following keys:\n   *\n   * - adapter \u2014 Language adapter to use for this entrypoint. By default this is `default` and tells loader to parse using the JVM entrypoint notation.\n   * - value \u2014 Points to an implementation of the entrypoint. See below for the default JVM notation.\n   *\n   * If an entrypoint does not need to specify a language adapter other than the default language adapter, the entrypoint can be represented simply as the value string instead.\n   *\n   * ### JVM entrypoint notation\n   *\n   * When referring to a class, the binary name is used. An example of a binary name is `my.mod.MyClass$Inner`.\n   *\n   * One of the following `value` notations may be used in the JVM notation:\n   *\n   * - Implementation onto a class\n   *   - The value must contain a fully qualified binary name to the class.\n   *   - Implementing class must extend or implement the entrypoint interface.\n   *   - Class must have a no-argument public constructor.\n   *   - Example: example.mod.MainModClass\n   * - A field inside of a class.\n   *   - The value must contain a fully qualified binary name to the class followed by :: and a field name.\n   *   - The field must be static.\n   *   - The type of the field must be assignable from the field's class.\n   *   - Example: example.mod.MainModClass::THE_INSTANCE\n   *   - If there is ambiguity with a method's name, an exception will be thrown.\n   * - A method inside of a class.\n   *   - The value must contain a fully qualified binary name to the class followed by :: and a method name.\n   *   - The method must be capable to implement the entrypoint type as a method reference. Generally this means classes which are functional interfaces.\n   *   - Constructor requirement varies based on the method being static or instance level:\n   *     - A static method does not require a public no-argument constructor.\n   *     - An instance method requires a public no-argument constructor.\n   *   - Example: example.mod.MainModClass::init\n   *   - If there is ambiguity with a fields's name or other method, an exception will be thrown.\n\n   */\n  entrypoints?: Record<string, string>\n\n  /**\n   * An array of loader plugins. A plugin is an object with the following keys:\n   *\n   * - adapter \u2014 Language adapter to use for this plugin\n   * - value \u2014 Points to an implementation of the `LoaderPlugin` interface. Can be in either of the following forms:\n   *   - `my.package.MyClass` \u2014 A class to be instantiated and used\n   *   - `my.package.MyClass::thing` \u2014 A static field containing an instance of a `LoaderPlugin`\n   *\n   * If a plugin does not need to specify a language adapter other than the default language adapter, the plugin can be represented simply as the value string instead.\n   */\n  plugins?: Array<string>\n\n  /**\n   * A list of paths to nested JAR files to load, relative to the root directory inside of the mods JAR.\n   */\n  jars?: Array<string>\n\n  /**\n   * A collection of `key: value` pairs, where each key is the namespace of a language adapter and the value is an implementation of the `LanguageAdapter` interface.\n   */\n  language_adapters?: Record<string, string>\n\n  /**\n   * An array of dependency objects. Defines mods that this mod will not function without.\n   */\n  depends?: Array<DependencyObject>\n\n  /**\n   * An array of dependency objects. Defines mods that this mod either breaks or is broken by.\n   */\n  breaks?: Array<DependencyObject>\n\n  /**\n   * Influences whether or not a mod candidate should be loaded or not. May be any of these values:\n   *\n   * - \"always\" (default for mods directly in the mods folder)\n   * - \"if_possible\"\n   * - \"if_required\" (default for jar-in-jar mods)\n   *\n   * This doesn't affect mods directly placed in the mods folder.\n   *\n   * ##### Always\n   * If any versions of this mod are present, then one of them will be loaded. Due to how mod loading actually works if any of the different versions of this mod are present, and one of them has \"load_type\" set to \"always\", then all of them are treated as it being set to \"always\".\n   *\n   * ##### If Possible\n   * If this mod can be loaded, then it will - otherwise it will silently not be loaded.\n   *\n   * ##### If Required\n   * If this mod is in another mods \"depends\" field then it will be loaded, otherwise it will silently not be loaded.\n   */\n  load_type?: string\n\n  /**\n   * A list of Maven repository URL strings where dependencies can be looked for in addition to Quilt's central repository.\n   */\n  repositories?: Array<string>\n\n  /**\n   * The intermediate mappings used for this mod. The intermediate mappings string must be a valid maven coordinate and match the ^[a-zA-Z0-9-_.]+:[a-zA-Z0-9-_.]+$ regular expression. This field currently only officially supports org.quiltmc:hashed and net.fabricmc:intermediary.\n   *\n   * @default \"org.quiltmc:hashed\"\n   */\n  intermediate_mappings?: string\n\n  minecraft?: {\n    /**\n     * Defines the environment(s) that this mod should be loaded on. Valid values are:\n     *\n     * - `*` \u2014 All environments (default)\n     * - `client` \u2014 The physical client\n     * - `dedicated_server` \u2014 The dedicated server\n     */\n    environment?: string\n    /**\n     * A single or array of paths to access widener files relative to the root of the mod JAR.\n     */\n    access_widener?: string | string[]\n  }\n}\n\n/**\n * Read fabric mod metadata json from a jar file or a directory\n * @param file The jar file or directory path. I can also be the binary content of the jar if you have already read the jar.\n */\nexport async function readQuiltMod(file: FileSystem | string | Uint8Array): Promise<QuiltModMetadata> {\n  const fs = await resolveFileSystem(file)\n  try {\n    const content = await fs.readFile('quilt.mod.json', 'utf-8')\n    return JSON.parse(content.replace(/^\\uFEFF/g, '').replace(/\\n/g, ''))\n  } finally {\n    if (fs !== file) fs.close()\n  }\n}\n"],
  "mappings": ";AAAA,SAAS,yBAAqC;;;AC2B9C,SAAS,kBAAkB,QAAQ,KAAK;AACpC,MAAI,QAAQ,OAAO,MAAM,GAAG,GAAG,EAAE,MAAM,aAAa;AACpD,SAAO,CAAC,MAAM,QAAQ,MAAM,IAAI,EAAE,SAAS,CAAC;AAChD;AACA,SAAS,cAAc,QAAQ,MAAM,QAAQ;AACzC,MAAI,QAAQ,OAAO,MAAM,aAAa;AACtC,MAAI,YAAY;AAChB,MAAI,aAAa,KAAK,MAAM,OAAO,CAAC,IAAI,KAAK;AAC7C,WAAS,IAAI,OAAO,GAAG,KAAK,OAAO,GAAG,KAAK;AACvC,QAAI,IAAI,MAAM,IAAI,CAAC;AACnB,QAAI,CAAC;AACD;AACJ,iBAAa,EAAE,SAAS,EAAE,OAAO,WAAW,GAAG;AAC/C,iBAAa;AACb,iBAAa;AACb,iBAAa;AACb,QAAI,MAAM,MAAM;AACZ,mBAAa,IAAI,OAAO,YAAY,SAAS,CAAC;AAC9C,mBAAa;AAAA,IACjB;AAAA,EACJ;AACA,SAAO;AACX;AACO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,SAAS,SAAS;AAC1B,UAAM,CAAC,MAAM,MAAM,IAAI,kBAAkB,QAAQ,MAAM,QAAQ,GAAG;AAClE,UAAM,YAAY,cAAc,QAAQ,MAAM,MAAM,MAAM;AAC1D,UAAM,0BAA0B;AAAA;AAAA,EA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