[
  {
    "path": ".github/workflows/code-analysis.yml",
    "content": "name: Code Analysis\n\non:\n    push:\n        branches:\n            - main\n            - next\n        paths:\n            - \"packages/**\"\n            - \"lib/**\"\n    pull_request:\n        branches:\n            - main\n            - next\n        paths:\n            - \"packages/**\"\n            - \"lib/**\"\n    workflow_dispatch:\n\njobs:\n    dart-analyze:\n        runs-on: ubuntu-latest\n\n        steps:\n            - uses: actions/checkout@v2\n\n            - uses: subosito/flutter-action@v2\n              with:\n                  channel: master\n\n            - name: 🚧 Do prerequisites\n              run: |\n                  flutter pub get\n                  dart run cli/prerequisites.dart\n\n            - name: 🩺 Code Analysis\n              run: dart run cli/code_analysis.dart\n"
  },
  {
    "path": ".gitignore",
    "content": "*.class\n*.log\n*.pyc\n*.swp\n.DS_Store\n.atom/\n.buildlog/\n.history\n.svn/\nmigrate_working_dir/\n*.iml\n*.ipr\n*.iws\n.idea/\n**/doc/api/\n**/ios/Flutter/.last_build_id\n.dart_tool/\n.flutter-plugins\n.flutter-plugins-dependencies\n.packages\n.pub-cache/\n.pub/\n/build/\napp.*.symbols\napp.*.map.json\n/android/app/debug\n/android/app/profile\n/android/app/release\nnode_modules\n*.g.dart\nassets/translations\n"
  },
  {
    "path": ".metadata",
    "content": "# This file tracks properties of this Flutter project.\n# Used by Flutter tool to assess capabilities and perform upgrades etc.\n#\n# This file should be version controlled and should not be manually edited.\n\nversion:\n  revision: \"476aa717cd342d11e16439b71f4f4c9209c50712\"\n  channel: \"beta\"\n\nproject_type: app\n\n# Tracks metadata for the flutter migrate command\nmigration:\n  platforms:\n    - platform: root\n      create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712\n      base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712\n    - platform: linux\n      create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712\n      base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712\n\n  # User provided section\n\n  # List of Local paths (relative to this file) that should be\n  # ignored by the migrate tool.\n  #\n  # Files that are not part of the templates will be ignored by default.\n  unmanaged_files:\n    - 'lib/main.dart'\n    - 'ios/Runner.xcodeproj/project.pbxproj'\n"
  },
  {
    "path": ".phrasey/config.toml",
    "content": "[input]\nfiles = [\"../i18n/**.toml\"]\nformat = \"toml\"\nfallback = \"../i18n/en.toml\"\n\n[schema]\nfile = \"./schema.toml\"\nformat = \"toml\"\n\n[output]\ndir = \"../assets/translations\"\nformat = \"json\"\nstringFormat = \"python-positional-format-string\"\n\n[hooks]\nfiles = [\"./hooks/dart-sync.js\"]\n"
  },
  {
    "path": ".phrasey/hooks/dart-sync.js",
    "content": "const p = require(\"path\");\nconst fs = require(\"fs-extra\");\nconst { rootDir, appI18nDir } = require(\"./utils\");\n\n/**\n * @type {import(\"phrasey\").PhraseyHooksHandler}\n */\nconst hook = {\n    onTranslationsBuildFinished: async ({ phrasey, state, log }) => {\n        if (phrasey.options.source !== \"build\") {\n            log.info(\"Skipping post-build due to non-build source\");\n            return;\n        }\n        await createTranslationDart(phrasey, state, log);\n    },\n};\n\nmodule.exports = hook;\n\n/**\n *\n * @param {import(\"phrasey\").Phrasey} phrasey\n * @param {import(\"phrasey\").PhraseyState} state\n * @param {import(\"phrasey\").PhraseyLogger} log\n */\nasync function createTranslationDart(phrasey, state, log) {\n    const translations = state.getTranslations();\n    const locales = [...translations.translations.keys()];\n    /**\n     * @type {string[]}\n     */\n    const staticKeys = [];\n    /**\n     * @type {string[]}\n     */\n    const dynamicKeys = [];\n\n    for (const x of state.getSchema().z.keys) {\n        const cname = camel(x.name);\n        if (x.parameters && x.parameters.length > 0) {\n            const params = x.parameters\n                .map((x) => `final String ${x}`)\n                .join(\", \");\n            const callArgs = x.parameters.join(\", \");\n            dynamicKeys.push(\n                `    String ${cname}(${params}) => StringUtils.formatPositional(_key('${x.name}'), <String>[${callArgs}]);`\n            );\n        } else {\n            staticKeys.push(`    String get ${cname} => _key('${x.name}');`);\n        }\n    }\n\n    const content = `\npart of 'translator.dart';\n\nclass Translation {\n    const Translation(this._json);\n\n    final Map<dynamic, dynamic> _json;\n\n    JsonMap get _localeJson => _json['locale'] as JsonMap;\n    String get localeDisplayName => _localeJson['display'];\n    String get localeNativeName => _localeJson['native'];\n    String get localeCode => _localeJson['code'];\n    Locale get locale => Locale(localeDisplayName, localeNativeName, localeCode);\n\n    JsonMap get _keysJson => _json['keys'] as JsonMap;\n    String _key(final String name) => _keysJson[name] as String;\n${staticKeys.join(\"\\n\")}\n${dynamicKeys.join(\"\\n\")}\n\n    static const List<String> availableLocales = <String>[${locales\n        .map((x) => `'${x}'`)\n        .join(\", \")}];\n\n    static const String unk = '?';\n}\n    `;\n    const path = p.join(appI18nDir, \"translation.g.dart\");\n    await fs.writeFile(path, content);\n    log.success(`Generated \"${p.relative(rootDir, path)}\".`);\n}\n\n/**\n *\n * @param {string} text\n * @returns {string}\n */\nfunction camel(text) {\n    return text[0].toLowerCase() + text.substring(1);\n}\n"
  },
  {
    "path": ".phrasey/hooks/utils.js",
    "content": "const p = require(\"path\");\n\nconst rootDir = p.resolve(__dirname, \"../..\");\nconst rootI18nDir = p.join(rootDir, \"i18n\");\nconst appI18nDir = p.join(rootDir, \"lib/core/translator\");\n\nmodule.exports = {\n    rootDir,\n    appI18nDir,\n    rootI18nDir,\n};\n"
  },
  {
    "path": ".phrasey/schema.toml",
    "content": "[[keys]]\nname = \"Anime\"\ndescription = \"Anime\"\n\n[[keys]]\nname = \"Manga\"\ndescription = \"Manga\"\n\n[[keys]]\nname = \"SearchAnAnimeOrManga\"\ndescription = \"Search an Anime or Manga\"\n\n[[keys]]\nname = \"MostPopularAnime\"\ndescription = \"Most Popular Anime\"\n\n[[keys]]\nname = \"TopOngoingAnime\"\ndescription = \"Top Ongoing Anime\"\n\n[[keys]]\nname = \"MostPopularManga\"\ndescription = \"Most Popular Manga\"\n\n[[keys]]\nname = \"TopOngoingManga\"\ndescription = \"Top Ongoing Manga\"\n\n[[keys]]\nname = \"Winter\"\ndescription = \"Winter\"\n\n[[keys]]\nname = \"Spring\"\ndescription = \"Spring\"\n\n[[keys]]\nname = \"Summer\"\ndescription = \"Summer\"\n\n[[keys]]\nname = \"Fall\"\ndescription = \"Fall\"\n\n[[keys]]\nname = \"NEps\"\ndescription = \"Episodes\"\nparameters = [\"n\"]\n\n[[keys]]\nname = \"NChs\"\ndescription = \"Chapters\"\nparameters = [\"n\"]\n\n[[keys]]\nname = \"Episodes\"\ndescription = \"Episodes\"\n\n[[keys]]\nname = \"Chapters\"\ndescription = \"Chapters\"\n\n[[keys]]\nname = \"NMins\"\ndescription = \"Minutes\"\nparameters = [\"n\"]\n\n[[keys]]\nname = \"NHrsOMins\"\ndescription = \"Hours and minutes\"\nparameters = [\"n\", \"o\"]\n\n[[keys]]\nname = \"Relations\"\ndescription = \"Relations\"\n\n[[keys]]\nname = \"Cancelled\"\ndescription = \"Cancelled\"\n\n[[keys]]\nname = \"Releasing\"\ndescription = \"Releasing\"\n\n[[keys]]\nname = \"NotYetReleased\"\ndescription = \"Not yet released\"\n\n[[keys]]\nname = \"Finished\"\ndescription = \"Finished\"\n\n[[keys]]\nname = \"Hiatus\"\ndescription = \"Hiatus\"\n\n[[keys]]\nname = \"Nsfw\"\ndescription = \"NSFW\"\n\n[[keys]]\nname = \"Characters\"\ndescription = \"Characters\"\n\n[[keys]]\nname = \"Settings\"\ndescription = \"Settings\"\n\n[[keys]]\nname = \"Appearance\"\ndescription = \"Appearance\"\n\n[[keys]]\nname = \"DarkMode\"\ndescription = \"Dark mode\"\n\n[[keys]]\nname = \"AccentColor\"\ndescription = \"Accent color\"\n\n[[keys]]\nname = \"BackgroundColor\"\ndescription = \"Background color\"\n\n[[keys]]\nname = \"DisableAnimations\"\ndescription = \"Disable animations\"\n\n[[keys]]\nname = \"UseSystemTheme\"\ndescription = \"Use system theme\"\n\n[[keys]]\nname = \"Overview\"\ndescription = \"Overview\"\n\n[[keys]]\nname = \"Extensions\"\ndescription = \"Extensions\"\n\n[[keys]]\nname = \"ByX\"\ndescription = \"By something\"\nparameters = [\"x\"]\n\n[[keys]]\nname = \"AuthenticatedAsX\"\ndescription = \"Authenticated as someone\"\nparameters = [\"x\"]\n\n[[keys]]\nname = \"Anilist\"\ndescription = \"Anilist\"\n\n[[keys]]\nname = \"LoginUsingAnilist\"\ndescription = \"Login using Anilist\"\n\n[[keys]]\nname = \"SomethingWentWrong\"\ndescription = \"Something went wrong\"\n\n[[keys]]\nname = \"TrackYourProgressUsingAnilist\"\ndescription = \"Track your progress using AniList\"\n\n[[keys]]\nname = \"Current\"\ndescription = \"Current\"\n\n[[keys]]\nname = \"Planning\"\ndescription = \"Planning\"\n\n[[keys]]\nname = \"Completed\"\ndescription = \"Completed\"\n\n[[keys]]\nname = \"Dropped\"\ndescription = \"Dropped\"\n\n[[keys]]\nname = \"Paused\"\ndescription = \"Paused\"\n\n[[keys]]\nname = \"Repeating\"\ndescription = \"Repeating\"\n\n[[keys]]\nname = \"TotalAnime\"\ndescription = \"Total anime\"\n\n[[keys]]\nname = \"EpisodesWatched\"\ndescription = \"Episodes watched\"\n\n[[keys]]\nname = \"MeanScore\"\ndescription = \"Mean score\"\n\n[[keys]]\nname = \"TimeSpent\"\ndescription = \"Time spent\"\n\n[[keys]]\nname = \"TotalManga\"\ndescription = \"Total manga\"\n\n[[keys]]\nname = \"ChaptersRead\"\ndescription = \"Chapters read\"\n\n[[keys]]\nname = \"VolumesRead\"\ndescription = \"Volumes read\"\n\n[[keys]]\nname = \"Red\"\ndescription = \"Red\"\n\n[[keys]]\nname = \"Orange\"\ndescription = \"Orange\"\n\n[[keys]]\nname = \"Amber\"\ndescription = \"Amber\"\n\n[[keys]]\nname = \"Yellow\"\ndescription = \"Yellow\"\n\n[[keys]]\nname = \"Lime\"\ndescription = \"Lime\"\n\n[[keys]]\nname = \"Green\"\ndescription = \"Green\"\n\n[[keys]]\nname = \"Emerald\"\ndescription = \"Emerald\"\n\n[[keys]]\nname = \"Teal\"\ndescription = \"Teal\"\n\n[[keys]]\nname = \"Cyan\"\ndescription = \"Cyan\"\n\n[[keys]]\nname = \"Sky\"\ndescription = \"Sky\"\n\n[[keys]]\nname = \"Blue\"\ndescription = \"Blue\"\n\n[[keys]]\nname = \"Indigo\"\ndescription = \"Indigo\"\n\n[[keys]]\nname = \"Violet\"\ndescription = \"Violet\"\n\n[[keys]]\nname = \"Purple\"\ndescription = \"Purple\"\n\n[[keys]]\nname = \"Fuchsia\"\ndescription = \"Fuchsia\"\n\n[[keys]]\nname = \"Pink\"\ndescription = \"Pink\"\n\n[[keys]]\nname = \"Rose\"\ndescription = \"Rose\"\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n    \"tabWidth\": 4,\n    \"useTabs\": false\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    \"editor.formatOnSave\": true,\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n    \"[dart]\": {\n        \"editor.defaultFormatter\": \"Dart-Code.dart-code\"\n    },\n    \"[toml]\": {\n        \"editor.defaultFormatter\": \"tamasfe.even-better-toml\"\n    }\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    Yukino lets you read manga or stream anime ad-free from multiple sources for free!\n    Copyright (C) 2021  Zyrouge\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    Yukino Copyright (C) 2021  Zyrouge\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n    <img src=\"https://github.com/yukino-org/media/blob/main/images/subbanners/gh-kazahana-banner.png?raw=true\">\n</p>\n\n# Kazahana\n\nAn extension-based Anime and Manga client.\n\n[![Code Analysis](https://github.com/yukino-org/kazahana/actions/workflows/code-analysis.yml/badge.svg)](https://github.com/yukino-org/kazahana/actions/workflows/code-analysis.yml)\n\n## Links\n\n<!-- -   [Website](https://yukino-org.github.io/) -->\n\n-   [Wiki](https://yukino-org.github.io/wiki/)\n<!-- -   [Discord](https://yukino-org.github.io/discord/) -->\n-   [GitHub](https://github.com/yukino-org/kazahana/)\n-   [Patreon](https://patreon.com/yukino_app/)\n\nFor any queries, contact me at [yukino-org@hotmail.com](mailto:yukino-org@hotmail.com).\n\n## Branding\n\n### Colors\n\n[![Primary](https://img.shields.io/badge/Primary-%236366F1-white.svg?style=flat&color=6366F1)](https://img.shields.io/badge/Indigo-%236366F1-white.svg?color=6366F1) [![Secondary](https://img.shields.io/badge/Secondary-%2318181b-white.svg?style=flat&color=18181b)](https://img.shields.io/badge/Indigo-%236366F1-white.svg?color=6366F1)\n\n## Technology\n\n-   [Dart](https://dart.dev/) (Language)\n-   [Flutter](https://flutter.dev/) (UI Framework)\n-   [Pub](https://pub.dev/) (Dependency Manager)\n-   [Git](https://git-scm.com/) (Code Manager)\n\n## Code structure\n\n-   [./lib](./lib) - Contains the core application\n-   [./cli](./cli) - Contains the command-line tool\n-   [./android](./android) - Contains the android project\n\n## Contributing\n\nWays to contribute to this project:\n\n-   Submitting bugs and feature requests at [issues](https://github.com/yukino-org/kazahana/issues).\n-   Opening [pull requests](https://github.com/yukino-org/kazahana/pulls) containing bug fixes, new features, etc.\n\n## License\n\n[GPL-3.0](./LICENSE)\n"
  },
  {
    "path": "analysis_options.yaml",
    "content": "include: package:devx/analysis_options.yaml\n\nlinter:\n    rules:\n        prefer_relative_imports: false\n"
  },
  {
    "path": "android/.gitignore",
    "content": "gradle-wrapper.jar\n/.gradle\n/captures/\n/gradlew\n/gradlew.bat\n/local.properties\nGeneratedPluginRegistrant.java\n\n# Remember to never publicly share your keystore.\n# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app\nkey.properties\n**/*.keystore\n**/*.jks\n"
  },
  {
    "path": "android/app/build.gradle",
    "content": "def localProperties = new Properties()\ndef localPropertiesFile = rootProject.file('local.properties')\nif (localPropertiesFile.exists()) {\n    localPropertiesFile.withReader('UTF-8') { reader ->\n        localProperties.load(reader)\n    }\n}\n\ndef flutterRoot = localProperties.getProperty('flutter.sdk')\nif (flutterRoot == null) {\n    throw new GradleException(\"Flutter SDK not found. Define location with flutter.sdk in the local.properties file.\")\n}\n\ndef flutterVersionCode = localProperties.getProperty('flutter.versionCode')\nif (flutterVersionCode == null) {\n    flutterVersionCode = '1'\n}\n\ndef flutterVersionName = localProperties.getProperty('flutter.versionName')\nif (flutterVersionName == null) {\n    flutterVersionName = '1.0'\n}\n\napply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\napply from: \"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle\"\n\nandroid {\n    compileSdkVersion flutter.compileSdkVersion\n    ndkVersion flutter.ndkVersion\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n\n    kotlinOptions {\n        jvmTarget = '1.8'\n    }\n\n    sourceSets {\n        main.java.srcDirs += 'src/main/kotlin'\n    }\n\n    defaultConfig {\n        // ? Application ID\n        applicationId \"io.github.yukino_org.kazahana\"\n        minSdkVersion flutter.minSdkVersion\n        targetSdkVersion flutter.targetSdkVersion\n        versionCode flutterVersionCode.toInteger()\n        versionName flutterVersionName\n    }\n\n    buildTypes {\n        release {\n            // TODO: Add your own signing config for the release build.\n            // Signing with the debug keys for now, so `flutter run --release` works.\n            signingConfig signingConfigs.debug\n        }\n    }\n}\n\nflutter {\n    source '../..'\n}\n\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n}\n"
  },
  {
    "path": "android/app/src/debug/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.kazahana\">\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n</manifest>\n"
  },
  {
    "path": "android/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.kazahana\">\n   <application\n        android:label=\"Kazahana\"\n        android:name=\"${applicationName}\"\n        android:icon=\"@mipmap/ic_launcher\">\n        <activity\n            android:name=\".MainActivity\"\n            android:exported=\"true\"\n            android:launchMode=\"singleTop\"\n            android:theme=\"@style/LaunchTheme\"\n            android:configChanges=\"orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode\"\n            android:hardwareAccelerated=\"true\"\n            android:windowSoftInputMode=\"adjustResize\">\n            <meta-data\n              android:name=\"io.flutter.embedding.android.NormalTheme\"\n              android:resource=\"@style/NormalTheme\"\n              />\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.VIEW\" />\n                <category android:name=\"android.intent.category.DEFAULT\" />\n                <category android:name=\"android.intent.category.BROWSABLE\" />\n                <data android:scheme=\"kazahana\" />\n            </intent-filter>\n        </activity>\n        <meta-data\n            android:name=\"flutterEmbedding\"\n            android:value=\"2\" />\n    </application>\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n</manifest>\n"
  },
  {
    "path": "android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java",
    "content": "// Generated file.\n//\n// If you wish to remove Flutter's multidex support, delete this entire file.\n//\n// Modifications to this file should be done in a copy under a different name\n// as this file may be regenerated.\n\npackage io.flutter.app;\n\nimport android.app.Application;\nimport android.content.Context;\nimport androidx.annotation.CallSuper;\nimport androidx.multidex.MultiDex;\n\n/**\n * Extension of {@link android.app.Application}, adding multidex support.\n */\npublic class FlutterMultiDexApplication extends Application {\n  @Override\n  @CallSuper\n  protected void attachBaseContext(Context base) {\n    super.attachBaseContext(base);\n    MultiDex.install(this);\n  }\n}\n"
  },
  {
    "path": "android/app/src/main/kotlin/com/example/kazahana/MainActivity.kt",
    "content": "package com.example.kazahana\n\nimport io.flutter.embedding.android.FlutterActivity\n\nclass MainActivity: FlutterActivity() {\n}\n"
  },
  {
    "path": "android/app/src/main/res/drawable/launch_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:drawable=\"@android:color/white\" />\n\n    <!-- You can insert your own image assets here -->\n    <!-- <item>\n        <bitmap\n            android:gravity=\"center\"\n            android:src=\"@mipmap/launch_image\" />\n    </item> -->\n</layer-list>\n"
  },
  {
    "path": "android/app/src/main/res/drawable-v21/launch_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:drawable=\"?android:colorBackground\" />\n\n    <!-- You can insert your own image assets here -->\n    <!-- <item>\n        <bitmap\n            android:gravity=\"center\"\n            android:src=\"@mipmap/launch_image\" />\n    </item> -->\n</layer-list>\n"
  },
  {
    "path": "android/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->\n    <style name=\"LaunchTheme\" parent=\"@android:style/Theme.Light.NoTitleBar\">\n        <!-- Show a splash screen on the activity. Automatically removed when\n             the Flutter engine draws its first frame -->\n        <item name=\"android:windowBackground\">@drawable/launch_background</item>\n    </style>\n    <!-- Theme applied to the Android Window as soon as the process has started.\n         This theme determines the color of the Android Window while your\n         Flutter UI initializes, as well as behind your Flutter UI while its\n         running.\n\n         This Theme is only used starting with V2 of Flutter's Android embedding. -->\n    <style name=\"NormalTheme\" parent=\"@android:style/Theme.Light.NoTitleBar\">\n        <item name=\"android:windowBackground\">?android:colorBackground</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "android/app/src/main/res/values-night/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->\n    <style name=\"LaunchTheme\" parent=\"@android:style/Theme.Black.NoTitleBar\">\n        <!-- Show a splash screen on the activity. Automatically removed when\n             the Flutter engine draws its first frame -->\n        <item name=\"android:windowBackground\">@drawable/launch_background</item>\n    </style>\n    <!-- Theme applied to the Android Window as soon as the process has started.\n         This theme determines the color of the Android Window while your\n         Flutter UI initializes, as well as behind your Flutter UI while its\n         running.\n\n         This Theme is only used starting with V2 of Flutter's Android embedding. -->\n    <style name=\"NormalTheme\" parent=\"@android:style/Theme.Black.NoTitleBar\">\n        <item name=\"android:windowBackground\">?android:colorBackground</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "android/app/src/profile/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.kazahana\">\n    <!-- The INTERNET permission is required for development. Specifically,\n         the Flutter tool needs it to communicate with the running application\n         to allow setting breakpoints, to provide hot reload, etc.\n    -->\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n</manifest>\n"
  },
  {
    "path": "android/build.gradle",
    "content": "buildscript {\n    ext.kotlin_version = \"1.9.10\"\n\n    repositories {\n        google()\n        mavenCentral()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:7.1.2'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n\nrootProject.buildDir = '../build'\nsubprojects {\n    project.buildDir = \"${rootProject.buildDir}/${project.name}\"\n}\nsubprojects {\n    project.evaluationDependsOn(':app')\n}\n\ntasks.register(\"clean\", Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip\n"
  },
  {
    "path": "android/gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx1536M\nandroid.useAndroidX=true\nandroid.enableJetifier=true\n"
  },
  {
    "path": "android/settings.gradle",
    "content": "include ':app'\n\ndef localPropertiesFile = new File(rootProject.projectDir, \"local.properties\")\ndef properties = new Properties()\n\nassert localPropertiesFile.exists()\nlocalPropertiesFile.withReader(\"UTF-8\") { reader -> properties.load(reader) }\n\ndef flutterSdkPath = properties.getProperty(\"flutter.sdk\")\nassert flutterSdkPath != null, \"flutter.sdk not set in local.properties\"\napply from: \"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle\"\n"
  },
  {
    "path": "cli/code_analysis.dart",
    "content": "import 'dart:io';\nimport 'utils/exports.dart';\n\nconst Logger _logger = Logger('code-analysis');\n\nFuture<void> main() async {\n  final Stopwatch watch = Stopwatch()..start();\n  _logger.info('Checking code format...');\n  await checkCodeFormat();\n  watch.stop();\n  _logger.info('Validated code format in ${watch.elapsedMilliseconds}ms');\n\n  watch.reset();\n  _logger.info('Analyzing code...');\n  await analyzeCode();\n  watch.stop();\n  _logger.info('Analyzed code in ${watch.elapsedMilliseconds}ms');\n}\n\nFuture<void> analyzeCode() async {\n  final ProcessResult result =\n      await Process.run('flutter', <String>['analyze']);\n  if (result.exitCode == 0) return;\n\n  throw Exception(\n    'Code analyse failed with exit code ${result.exitCode}\\nstdout: ${result.stdout}\\nstdout: ${result.stderr}',\n  );\n}\n\nFuture<void> checkCodeFormat() async {\n  final ProcessResult result = await Process.run(\n    'flutter',\n    <String>[\n      'format',\n      '--output=none',\n      '--set-exit-if-changed',\n      '.',\n    ],\n  );\n  if (result.exitCode == 0) return;\n\n  final List<String> files = RegExp('Changed (.*)')\n      .allMatches(result.stdout.toString())\n      .map((final RegExpMatch x) => x.group(1)!)\n      .toList();\n\n  final RegExp ignoredFilesRegex = RegExp(r'\\.g\\.dart$');\n  final List<String> filtered =\n      files.where(ignoredFilesRegex.hasMatch).toList();\n\n  if (filtered.isNotEmpty) {\n    throw Exception('Invalid files: ${filtered.join(' ')}');\n  }\n}\n"
  },
  {
    "path": "cli/prerequisites.dart",
    "content": "import 'tasks/build_runner.dart' as build_runner;\nimport 'tasks/i18n.dart' as i18n;\nimport 'tasks/icon.dart' as icon;\nimport 'tasks/meta.dart' as meta;\n\nFuture<void> main(final List<String> args) async {\n  await i18n.main(args);\n  await build_runner.main(args);\n  await meta.main();\n  await icon.main();\n}\n"
  },
  {
    "path": "cli/run.dart",
    "content": "import 'dart:io';\nimport 'prerequisites.dart' as prerequisites;\nimport 'utils/exports.dart';\n\nconst Logger _logger = Logger('run');\n\nFuture<void> main(final List<String> args) async {\n  await prerequisites.main(args);\n  _logger.info('Starting...');\n\n  final Process process = await Process.start(\n    'flutter',\n    <String>['run'],\n    mode: ProcessStartMode.inheritStdio,\n    runInShell: true,\n  );\n\n  final int exitCode = await process.exitCode;\n  if (exitCode != 0) {\n    throw Exception('Debug run failed with error code $exitCode');\n  }\n}\n"
  },
  {
    "path": "cli/tasks/build_runner.dart",
    "content": "import 'dart:io';\nimport '../utils/exports.dart';\n\nconst Logger _logger = Logger('build_runner');\n\nFuture<void> main(final List<String> args) async {\n  await runBuildRunner(\n    deleteConflictingOutputs: args.contains('--force-build-runner'),\n  );\n}\n\nFuture<void> runBuildRunner({\n  final bool deleteConflictingOutputs = false,\n}) async {\n  _logger.info('Running...');\n\n  final Stopwatch watch = Stopwatch()..start();\n  final Process process = await Process.start(\n    'dart',\n    <String>[\n      'run',\n      'build_runner',\n      'build',\n      '--fail-on-severe',\n      if (deleteConflictingOutputs) '--delete-conflicting-outputs',\n    ],\n  );\n  process.stdout.listen(stdout.add, onError: stdout.addError);\n\n  final int exitCode = await process.exitCode;\n  watch.stop();\n\n  if (exitCode == 78 && !deleteConflictingOutputs) {\n    _logger.info('Failed with error code $exitCode');\n    _logger.info('Retrying with --delete-conflicting-outputs flag...');\n    return runBuildRunner(deleteConflictingOutputs: true);\n  }\n\n  if (exitCode != 0) {\n    throw Exception('Build runner failed with error code $exitCode');\n  }\n\n  _logger.info('Finished in ${watch.elapsedMilliseconds}ms');\n}\n"
  },
  {
    "path": "cli/tasks/i18n.dart",
    "content": "import 'dart:io';\n\nFuture<void> main(final List<String> args) async {\n  final ProcessResult result = await Process.run(\n    'npm',\n    <String>['run', 'i18n:build'],\n  );\n  if (result.exitCode != 0) {\n    throw Exception('i18n builder failed with error code $exitCode');\n  }\n}\n"
  },
  {
    "path": "cli/tasks/icon.dart",
    "content": "import 'dart:io';\nimport 'dart:typed_data';\nimport 'package:image/image.dart';\nimport 'package:path/path.dart' as path;\nimport '../utils/exports.dart';\n\nconst Logger _logger = Logger('icon');\nconst int defaultImageSize = 1000;\nconst int overlayContentSize = 250;\n\nconst List<(int, String)> androidIconSizes = <(int, String)>[\n  (defaultImageSize ~/ 1, 'mdpi'),\n  (defaultImageSize ~/ 1.5, 'hdpi'),\n  (defaultImageSize ~/ 2, 'xhdpi'),\n  (defaultImageSize ~/ 3, 'xxhdpi'),\n  (defaultImageSize ~/ 4, 'xxxhdpi'),\n];\n\nString getAndroidIconPath(final String code) => path.join(\n      Paths.rootDir,\n      'android/app/src/main/res/mipmap-$code/ic_launcher.png',\n    );\n\nFuture<void> main() async {\n  final String backgroundImagePath =\n      path.join(Paths.iconsDir, 'background.png');\n  final String overlayImagePath = path.join(Paths.iconsDir, 'overlay.png');\n  _logger.info('Background Image Path: $backgroundImagePath');\n  _logger.info('Overlay Image Path: $overlayImagePath');\n\n  final Uint8List backgroundImageBytes =\n      await File(backgroundImagePath).readAsBytes();\n  final Uint8List overlayImageBytes =\n      await File(overlayImagePath).readAsBytes();\n\n  final Image backgroundImage = decodePng(backgroundImageBytes)!;\n  final Image overlayImage = decodePng(overlayImageBytes)!;\n\n  final Image iconImage = compositeImage(\n    overlayImage,\n    copyCrop(\n      backgroundImage,\n      x: 0,\n      y: overlayContentSize ~/ 2,\n      width: defaultImageSize,\n      height: defaultImageSize - overlayContentSize,\n    ),\n  );\n\n  for (final (int size, String code) in androidIconSizes) {\n    final String iconPath = getAndroidIconPath(code);\n    final File iconFile = File(iconPath);\n    final List<int> icon = encodeNamedImage(\n      path.basename(iconFile.path),\n      copyResizeCropSquare(iconImage, size: size),\n    )!;\n    await iconFile.writeAsBytes(icon);\n    _logger.info('Generated $iconPath ($code)');\n  }\n}\n"
  },
  {
    "path": "cli/tasks/meta.dart",
    "content": "import 'dart:io';\nimport 'package:path/path.dart' as path;\nimport '../utils/exports.dart';\nimport 'version.dart';\n\nconst Logger _logger = Logger('meta');\nfinal String generatedAppMetaPath =\n    path.join(Paths.libDir, 'core/app/meta.g.dart');\n\nFuture<void> main() async {\n  await File(generatedAppMetaPath)\n      .writeAsString(await getGeneratedAppMetaContent());\n  _logger.info('Generated $generatedAppMetaPath');\n}\n\nFuture<String> getGeneratedAppMetaContent() async => '''\npart of 'meta.dart';\n\nabstract class GeneratedAppMeta {\n  static const String version = '${await getVersion()}';\n  static const int builtAtMs = ${DateTime.now().millisecondsSinceEpoch};\n}\n''';\n"
  },
  {
    "path": "cli/tasks/version.dart",
    "content": "import 'dart:io';\nimport 'package:path/path.dart' as path;\nimport '../utils/exports.dart';\n\nfinal String pubspecYamlPath = path.join(Paths.rootDir, 'pubspec.yaml');\n\nFuture<String> getVersion() async {\n  final String content = await File(pubspecYamlPath).readAsString();\n  return RegExp(r'version: ([\\w+\\.-]+)').firstMatch(content)!.group(1)!;\n}\n"
  },
  {
    "path": "cli/utils/exports.dart",
    "content": "export 'logger.dart';\nexport 'paths.dart';\n"
  },
  {
    "path": "cli/utils/logger.dart",
    "content": "// ignore_for_file: avoid_print\n\nclass Logger {\n  const Logger(this.name);\n\n  final String name;\n\n  void info(final Object text) {\n    print('[$time info] $name: $text');\n  }\n\n  void fatal(final Object text) {\n    print('[$time err!] $name: $text');\n  }\n\n  void println() {\n    print(' ');\n  }\n\n  String get time {\n    final DateTime now = DateTime.now();\n    return '${now.hour}:${now.minute}:${now.second}';\n  }\n}\n"
  },
  {
    "path": "cli/utils/paths.dart",
    "content": "import 'dart:io';\nimport 'package:path/path.dart' as path;\n\nabstract class Paths {\n  static final String rootDir = Directory.current.path;\n  static final String cliDir = path.join(rootDir, 'cli');\n  static final String assetsDir = path.join(rootDir, 'assets');\n  static final String libDir = path.join(rootDir, 'lib');\n  static final String iconsDir = path.join(assetsDir, 'icon');\n}\n"
  },
  {
    "path": "i18n/en.toml",
    "content": "locale = \"en\"\n\n[keys]\nAnime = \"Anime\"\nManga = \"Manga\"\nSearchAnAnimeOrManga = \"Search an anime or manga\"\nMostPopularAnime = \"Most Popular Anime\"\nTopOngoingAnime = \"Top Ongoing Anime\"\nMostPopularManga = \"Most Popular Manga\"\nTopOngoingManga = \"Top Ongoing Manga\"\nWinter = \"Winter\"\nSpring = \"Spring\"\nSummer = \"Summer\"\nFall = \"Fall\"\nNEps = \"{n} eps.\"\nNChs = \"{n} chs.\"\nEpisodes = \"Episodes\"\nChapters = \"Chapters\"\nNMins = \"{n} mins.\"\nNHrsOMins = \"{n} hrs. {o} mins.\"\nRelations = \"Relations\"\nCancelled = \"Cancelled\"\nReleasing = \"Releasing\"\nNotYetReleased = \"Unreleased\"\nFinished = \"Finished\"\nHiatus = \"Hiatus\"\nNsfw = \"NSFW\"\nCharacters = \"Characters\"\nSettings = \"Settings\"\nAppearance = \"Appearance\"\nDarkMode = \"Dark mode\"\nAccentColor = \"Accent color\"\nBackgroundColor = \"Background color\"\nDisableAnimations = \"Disable animations\"\nUseSystemTheme = \"Use system theme\"\nOverview = \"Overview\"\nExtensions = \"Extensions\"\nByX = \"By {x}\"\nAuthenticatedAsX = \"Authenticated as {x}\"\nAnilist = \"Anilist\"\nLoginUsingAnilist = \"Login using Anilist\"\nSomethingWentWrong = \"Something went wrong!\"\nTrackYourProgressUsingAnilist = \"Track your progress using Anilist\"\nCurrent = \"Current\"\nPlanning = \"Planning\"\nCompleted = \"Completed\"\nDropped = \"Dropped\"\nPaused = \"Paused\"\nRepeating = \"Repeating\"\nTotalAnime = \"Total anime\"\nEpisodesWatched = \"Episodes watched\"\nMeanScore = \"Mean score\"\nTimeSpent = \"Time spent\"\nTotalManga = \"Total manga\"\nChaptersRead = \"Chapters read\"\nVolumesRead = \"Volumes read\"\nRed = \"Red\"\nOrange = \"Orange\"\nAmber = \"Amber\"\nYellow = \"Yellow\"\nLime = \"Lime\"\nGreen = \"Green\"\nEmerald = \"Emerald\"\nTeal = \"Teal\"\nCyan = \"Cyan\"\nSky = \"Sky\"\nBlue = \"Blue\"\nIndigo = \"Indigo\"\nViolet = \"Violet\"\nPurple = \"Purple\"\nFuchsia = \"Fuchsia\"\nPink = \"Pink\"\nRose = \"Rose\"\n"
  },
  {
    "path": "lib/core/anilist/auth.dart",
    "content": "import 'package:anilist/anilist.dart';\nimport 'package:kazahana/ui/exports.dart';\nimport '../app/exports.dart';\nimport '../database/exports.dart';\nimport '../packages.dart';\nimport 'credentials.dart';\n\nabstract class AnilistAuth {\n  static const String baseURL = 'https://anilist.co/api/v2';\n  static AnilistUser? user;\n\n  static Future<void> initialize() async {\n    updateAnilistClient(SecureDatabase.data.anilistToken);\n    await fetchUser();\n  }\n\n  static Future<void> authenticate(final AnilistToken token) async {\n    SecureDatabase.data.anilistToken = token;\n    await SecureDatabase.save();\n    updateAnilistClient(SecureDatabase.data.anilistToken);\n\n    await fetchUser();\n    if (user != null) {\n      Toast(\n        content: Text(\n          <String>[\n            '${gNavigatorKey.currentContext!.t.anilist}:',\n            gNavigatorKey.currentContext!.t.authenticatedAsX(user!.name),\n          ].join(' '),\n        ),\n      ).show();\n    }\n  }\n\n  static Future<void> unauthenticate() async {\n    SecureDatabase.data.anilistToken = null;\n    await SecureDatabase.save();\n    updateAnilistClient(null);\n  }\n\n  static Future<void> fetchUser() async {\n    try {\n      user = await AnilistUserEndpoints.getAuthenticatedUser();\n    } catch (_) {}\n  }\n\n  static void updateAnilistClient(final AnilistToken? token) {\n    AnilistGraphQL.updateClient(\n      token: token,\n      onTokenExpired: token != null ? unauthenticate : null,\n      additionalHeaders: const <String, String>{\n        'User-Agent': '${AppMeta.name} v${AppMeta.version}',\n      },\n    );\n    AppEvents.controller.add(AppEvent.anilistStateChange);\n  }\n\n  static String get oauthURL => Uri.encodeFull(\n        '$baseURL/oauth/authorize?client_id=${AnilistCredentials.clientId}&response_type=token',\n      );\n}\n"
  },
  {
    "path": "lib/core/anilist/credentials.dart",
    "content": "abstract class AnilistCredentials {\n  static const String clientId = '6444';\n}\n"
  },
  {
    "path": "lib/core/anilist/exports.dart",
    "content": "export 'package:anilist/anilist.dart';\nexport 'auth.dart';\nexport 'translations.dart';\n"
  },
  {
    "path": "lib/core/anilist/translations.dart",
    "content": "import 'package:anilist/anilist.dart';\nimport 'package:tenka/tenka.dart';\nimport '../translator/exports.dart';\nimport '../utils/exports.dart';\n\nextension AnilistFuzzyDateTUtils on AnilistFuzzyDate {\n  String get pretty => PrettyDates.constructDateString(\n        day: day?.toString() ?? Translation.unk,\n        month: month?.toString() ?? Translation.unk,\n        year: year?.toString() ?? Translation.unk,\n      );\n\n  String? get maybePretty => isValidDateTime ? pretty : null;\n}\n\nconst Map<AnilistMediaType, TenkaType> _anilistMediaTypeTenkaTypeMap =\n    <AnilistMediaType, TenkaType>{\n  AnilistMediaType.anime: TenkaType.anime,\n  AnilistMediaType.manga: TenkaType.manga,\n};\n\nextension AnilistMediaTypeTUtils on AnilistMediaType {\n  TenkaType get asTenkaType => _anilistMediaTypeTenkaTypeMap[this]!;\n}\n\nextension TenkaTypeAnilistUtils on TenkaType {\n  AnilistMediaType get asAnilistMediaType =>\n      _anilistMediaTypeTenkaTypeMap.entries\n          .firstWhere(\n            (final MapEntry<AnilistMediaType, TenkaType> x) => x.value == this,\n          )\n          .key;\n}\n\nextension AnimeSeasonsTUtils on AnimeSeasons {\n  String getTitleCase(final Translation translation) => switch (this) {\n        AnimeSeasons.winter => translation.winter,\n        AnimeSeasons.spring => translation.spring,\n        AnimeSeasons.summer => translation.summer,\n        AnimeSeasons.fall => translation.fall,\n      };\n}\n\nextension AnilistMediaTUtils on AnilistMedia {\n  String getWatchtime(final Translation translation) => switch (type) {\n        AnilistMediaType.anime when format == AnilistMediaFormat.movie =>\n          duration != null\n              ? PrettyDurations.prettyHoursMinutesShort(\n                  translation,\n                  Duration(minutes: duration!),\n                )\n              : translation.nMins(Translation.unk),\n        AnilistMediaType.anime =>\n          translation.nEps(episodes?.toString() ?? Translation.unk),\n        AnilistMediaType.manga =>\n          translation.nChs(chapters?.toString() ?? Translation.unk),\n      };\n\n  String get airdate {\n    final String startDatePretty = startDate?.maybePretty ?? Translation.unk;\n    final String endDatePretty = endDate?.maybePretty ?? Translation.unk;\n    if (startDatePretty == endDatePretty) return startDatePretty;\n    return '$startDatePretty - $endDatePretty';\n  }\n}\n\nextension AnilistRelationTypeTUtils on AnilistRelationType {\n  String getTitleCase(final Translation translation) =>\n      StringCase(name).titleCase;\n}\n\nextension AnilistCharacterRoleTUtils on AnilistCharacterRole {\n  String getTitleCase(final Translation translation) =>\n      StringCase(name).titleCase;\n}\n\nextension AnilistMediaStatusTUtils on AnilistMediaStatus {\n  String getTitleCase(final Translation translation) => switch (this) {\n        AnilistMediaStatus.cancelled => translation.cancelled,\n        AnilistMediaStatus.releasing => translation.releasing,\n        AnilistMediaStatus.notYetReleased => translation.notYetReleased,\n        AnilistMediaStatus.finished => translation.finished,\n        AnilistMediaStatus.hiatus => translation.hiatus,\n      };\n}\n\nextension AnilistMediaFormatTUtils on AnilistMediaFormat {\n  String getTitleCase(final Translation translation) => switch (this) {\n        AnilistMediaFormat.tv => 'TV',\n        AnilistMediaFormat.tvShort => 'TV (Short)',\n        AnilistMediaFormat.movie => 'Movie',\n        AnilistMediaFormat.special => 'Special',\n        AnilistMediaFormat.ova => 'OVA',\n        AnilistMediaFormat.ona => 'ONA',\n        AnilistMediaFormat.music => 'Music',\n        AnilistMediaFormat.manga => 'Manga',\n        AnilistMediaFormat.novel => 'Novel',\n        AnilistMediaFormat.oneshot => 'OneShot',\n      };\n}\n\nextension AnilistMediaListStatusTUtils on AnilistMediaListStatus {\n  String getTitleCase(final Translation translation) => switch (this) {\n        AnilistMediaListStatus.current => translation.current,\n        AnilistMediaListStatus.planning => translation.planning,\n        AnilistMediaListStatus.completed => translation.completed,\n        AnilistMediaListStatus.dropped => translation.dropped,\n        AnilistMediaListStatus.paused => translation.paused,\n        AnilistMediaListStatus.repeating => translation.repeating,\n      };\n}\n"
  },
  {
    "path": "lib/core/app/events.dart",
    "content": "import 'dart:async';\n\nclass AppEvent {\n  const AppEvent(this.name, [this.data]);\n\n  final String name;\n  final dynamic data;\n\n  @override\n  bool operator ==(final Object other) =>\n      other is AppEvent && other.name == name;\n\n  @override\n  int get hashCode => Object.hash(name, data);\n\n  static const AppEvent initialized = AppEvent('initialized');\n  static const AppEvent afterAnitialized = AppEvent('after_initialized');\n  static const AppEvent anilistStateChange = AppEvent('anilist_state_change');\n  static const AppEvent settingsChange = AppEvent('settings_change');\n  static const AppEvent translationsChange = AppEvent('translations_change');\n}\n\nabstract class AppEvents {\n  static final StreamController<AppEvent> controller =\n      StreamController<AppEvent>.broadcast();\n\n  static final Stream<AppEvent> stream = controller.stream;\n}\n"
  },
  {
    "path": "lib/core/app/exports.dart",
    "content": "export 'events.dart';\nexport 'loader.dart';\nexport 'meta.dart';\n"
  },
  {
    "path": "lib/core/app/loader.dart",
    "content": "import '../anilist/exports.dart';\nimport '../database/exports.dart';\nimport '../internals/exports.dart';\nimport '../paths.dart';\nimport '../tenka/exports.dart';\nimport '../translator/exports.dart';\nimport 'events.dart';\n\nabstract class AppLoader {\n  static bool ready = false;\n\n  static Future<void> initialize() async {\n    await Paths.initialize();\n    await SettingsDatabase.initialize();\n    await SecureDatabase.initialize();\n    await CacheDatabase.initialize();\n    await TenkaManager.initialize();\n    await Translator.initialize();\n    await AnilistAuth.initialize();\n    ready = true;\n    AppEvents.controller.add(AppEvent.initialized);\n    initializeAfterLoad();\n  }\n\n  static Future<void> initializeAfterLoad() async {\n    await Deeplink.initializeAfterLoad();\n    AppEvents.controller.add(AppEvent.afterAnitialized);\n  }\n}\n"
  },
  {
    "path": "lib/core/app/meta.dart",
    "content": "part 'meta.g.dart';\n\nabstract class AppMeta {\n  static const String name = 'Kazahana';\n  static const String code = 'kazahana';\n  static const String scheme = 'kazahana';\n  static const String yuki = '雪';\n\n  static const String version = GeneratedAppMeta.version;\n  static final DateTime builtAt =\n      DateTime.fromMillisecondsSinceEpoch(GeneratedAppMeta.builtAtMs);\n}\n"
  },
  {
    "path": "lib/core/database/cache/database.dart",
    "content": "import 'package:flutter/foundation.dart';\nimport 'package:path/path.dart' as path;\nimport 'package:perks/perks.dart';\nimport '../../paths.dart';\nimport '../../utils/exports.dart';\n\nabstract class CacheDatabase {\n  static const String kDataKey = 'data';\n  static const String kExpiresAtKey = 'expires_at';\n  static const int recommendedTtlMs = 21600000;\n\n  static final String cacheFilePath = path.join(Paths.docsDir.path, 'cache.db');\n\n  static final PerksNameValueBox<JsonMap> box = PerksNameValueBox<JsonMap>(\n    adapter: PerksFileAdapter(cacheFilePath),\n  );\n\n  static Future<void> initialize() async {\n    _removeExpiredData();\n  }\n\n  static Future<T?> get<T>(final String key) async {\n    final JsonMap? data = await box.get(key);\n    if (data == null) return null;\n\n    final T? value = data[kDataKey] as T?;\n    final int? expiresAtMs = data[kExpiresAtKey] as int?;\n\n    if (expiresAtMs != null &&\n        expiresAtMs < DateTime.now().millisecondsSinceEpoch) {\n      await box.delete(key);\n      return null;\n    }\n\n    return value;\n  }\n\n  static Future<void> set<T>(\n    final String key,\n    final T? data, {\n    final int? ttlMs,\n  }) async {\n    if (data == null) return delete(key);\n\n    await box.set(key, <dynamic, dynamic>{\n      kDataKey: data,\n      if (ttlMs != null)\n        kExpiresAtKey: DateTime.now().millisecondsSinceEpoch + ttlMs,\n    });\n  }\n\n  static Future<void> delete(final String key) async => box.delete(key);\n\n  static Future<void> _removeExpiredData() async {\n    await box.transaction((final PerksNameValueMap<JsonMap> data) async {\n      await compute(_filterExpiredData, data);\n      return data;\n    });\n  }\n\n  static void _filterExpiredData(\n    final Map<String, JsonMap> data,\n  ) {\n    final int nowMs = DateTime.now().millisecondsSinceEpoch;\n    for (final MapEntry<String, JsonMap> x in data.entries) {\n      final int? expiresAtMs = x.value[kExpiresAtKey] as int?;\n      if (expiresAtMs != null && expiresAtMs < nowMs) {\n        data.remove(x.key);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "lib/core/database/cache/exports.dart",
    "content": "export 'database.dart';\n"
  },
  {
    "path": "lib/core/database/exports.dart",
    "content": "export 'cache/exports.dart';\nexport 'secure/exports.dart';\nexport 'settings/exports.dart';\n"
  },
  {
    "path": "lib/core/database/secure/database.dart",
    "content": "import 'dart:convert';\nimport 'package:encrypt/encrypt.dart';\nimport 'package:path/path.dart' as path;\nimport 'package:perks/perks.dart';\nimport '../../paths.dart';\nimport '../../utils/exports.dart';\nimport 'schema.dart';\n\nabstract class SecureDatabase {\n  static final Key key = Key.fromUtf8('ThIs_Is_HiGhLy_SeCuRe_KeY_nO_cAp');\n  static final IV iv = IV.fromLength(16);\n  static final Encrypter encrypter = Encrypter(AES(key, mode: AESMode.cbc));\n\n  static final PerksFileAdapter adapter =\n      PerksFileAdapter(path.join(Paths.docsDir.path, 'secure.db'));\n\n  static late SecureSchema data;\n\n  static Future<void> initialize() async {\n    final String content = await adapter.read();\n    data = content.isNotEmpty\n        ? SecureSchema.fromJson(json.decode(decryptData(content)) as JsonMap)\n        : SecureSchema();\n  }\n\n  static Future<void> save() async {\n    await adapter.write(encryptData(json.encode(data.toJson())));\n  }\n\n  static String encryptData(final String data) =>\n      encrypter.encrypt(data, iv: iv).base64;\n\n  static String decryptData(final String data) =>\n      encrypter.decrypt(Encrypted.fromBase64(data), iv: iv);\n}\n"
  },
  {
    "path": "lib/core/database/secure/exports.dart",
    "content": "export 'database.dart';\nexport 'schema.dart';\n"
  },
  {
    "path": "lib/core/database/secure/schema.dart",
    "content": "import 'package:json_annotation/json_annotation.dart';\nimport '../../exports.dart';\n\npart 'schema.g.dart';\n\n@JsonSerializable()\nclass SecureSchema {\n  SecureSchema({\n    this.anilistToken,\n  });\n\n  factory SecureSchema.fromJson(final JsonMap json) =>\n      _$SecureSchemaFromJson(json.cast<String, dynamic>());\n\n  @JsonKey(fromJson: _anilistTokenFromJson, toJson: _anilistTokenToJson)\n  AnilistToken? anilistToken;\n\n  JsonMap toJson() => _$SecureSchemaToJson(this);\n\n  static AnilistToken? _anilistTokenFromJson(final dynamic value) =>\n      value is JsonMap ? AnilistToken(value.cast<String, String>()) : null;\n  static JsonMap? _anilistTokenToJson(final AnilistToken? value) => value?.json;\n}\n"
  },
  {
    "path": "lib/core/database/settings/database.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:path/path.dart' as path;\nimport 'package:perks/perks.dart';\nimport '../../app/events.dart';\nimport '../../paths.dart';\nimport '../../utils/exports.dart';\nimport 'schema.dart';\n\nabstract class SettingsDatabase {\n  static final PerksFileAdapter adapter =\n      PerksFileAdapter(path.join(Paths.docsDir.path, 'settings.db'));\n\n  static bool ready = false;\n  static late SettingsSchema settings;\n\n  static Future<void> initialize() async {\n    final String content = await adapter.read();\n    settings = content.isNotEmpty\n        ? SettingsSchema.fromJson(json.decode(content) as JsonMap)\n        : SettingsSchema();\n    ready = true;\n    AppEvents.controller.add(AppEvent.settingsChange);\n  }\n\n  static Future<void> save() async {\n    await adapter.write(json.encode(settings.toJson()));\n    AppEvents.controller.add(AppEvent.settingsChange);\n  }\n}\n"
  },
  {
    "path": "lib/core/database/settings/exports.dart",
    "content": "export 'database.dart';\nexport 'schema.dart';\n"
  },
  {
    "path": "lib/core/database/settings/schema.dart",
    "content": "import 'package:json_annotation/json_annotation.dart';\nimport 'package:kazahana/ui/utils/relative_scale.dart';\nimport '../../utils/exports.dart';\n\npart 'schema.g.dart';\n\n@JsonSerializable()\nclass SettingsSchema {\n  SettingsSchema({\n    this.locale,\n    this.ignoreSSLCertificate = true,\n    this.darkMode = true,\n    this.primaryColor,\n    this.backgroundColor,\n    this.disableAnimations = false,\n    this.useSystemPreferredTheme = false,\n    this.scaleMultiplier = RelativeScaleData.defaultScaleMultiplier,\n  });\n\n  factory SettingsSchema.fromJson(final JsonMap json) =>\n      _$SettingsSchemaFromJson(json.cast<String, dynamic>());\n\n  @JsonKey(fromJson: _localeFromJson, toJson: _localeToJson)\n  Locale? locale;\n  bool ignoreSSLCertificate;\n  bool darkMode;\n  String? primaryColor;\n  String? backgroundColor;\n  bool disableAnimations;\n  bool useSystemPreferredTheme;\n  double scaleMultiplier;\n\n  JsonMap toJson() => _$SettingsSchemaToJson(this);\n\n  static Locale? _localeFromJson(final String? value) =>\n      value != null ? Locale.parse(value) : null;\n  static String? _localeToJson(final Locale? value) => value?.code;\n}\n"
  },
  {
    "path": "lib/core/exports.dart",
    "content": "export 'anilist/exports.dart';\nexport 'app/exports.dart';\nexport 'database/exports.dart';\nexport 'packages.dart';\nexport 'paths.dart';\nexport 'state/exports.dart';\nexport 'tenka/exports.dart';\nexport 'themes/exports.dart';\nexport 'translator/exports.dart';\nexport 'utils/exports.dart';\n"
  },
  {
    "path": "lib/core/internals/deeplink.dart",
    "content": "import 'package:kazahana/ui/exports.dart';\nimport 'package:uni_links/uni_links.dart' as uni_links;\nimport '../app/exports.dart';\nimport '../packages.dart';\nimport 'router/exports.dart';\n\nabstract class Deeplink {\n  static Future<void> initializeAfterLoad() async {\n    final String? path = await uni_links.getInitialLink();\n    if (path != null) handle(path);\n    listen();\n  }\n\n  static void listen() {\n    uni_links.linkStream.listen((final String? path) {\n      if (path == null) return;\n      handle(path);\n    });\n  }\n\n  static void handle(final String path) {\n    String resolvedPath = path;\n    if (resolvedPath.startsWith(fullScheme)) {\n      resolvedPath = resolvedPath.replaceFirst(fullScheme, '');\n    }\n    debugPrint('Incoming deeplink: $resolvedPath');\n\n    final InternalRoute? internalRoute = InternalRoutes.findMatch(resolvedPath);\n    if (internalRoute != null) {\n      internalRoute.handle(resolvedPath);\n      return;\n    }\n    gNavigatorKey.currentState!.pushNamed(resolvedPath);\n  }\n\n  static const String fullScheme = '${AppMeta.scheme}://';\n}\n"
  },
  {
    "path": "lib/core/internals/exports.dart",
    "content": "export 'deeplink.dart';\n"
  },
  {
    "path": "lib/core/internals/router/exports.dart",
    "content": "export 'route.dart';\nexport 'routes.dart';\n"
  },
  {
    "path": "lib/core/internals/router/route.dart",
    "content": "abstract class InternalRoute {\n  bool matches(final String route);\n  Future<void> handle(final String route);\n}\n"
  },
  {
    "path": "lib/core/internals/router/routes/anilist.dart",
    "content": "import '../../../anilist/exports.dart';\nimport '../route.dart';\n\nclass AnilistAuthRoute extends InternalRoute {\n  @override\n  bool matches(final String route) => route.startsWith(routeName);\n\n  @override\n  Future<void> handle(final String route) async {\n    final AnilistToken token = AnilistToken.parseURL(route);\n    await AnilistAuth.authenticate(token);\n  }\n\n  static const String routeName = '/anilist/auth';\n}\n"
  },
  {
    "path": "lib/core/internals/router/routes/exports.dart",
    "content": "export 'anilist.dart';\n"
  },
  {
    "path": "lib/core/internals/router/routes.dart",
    "content": "import '../../utils/exports.dart';\nimport 'route.dart';\nimport 'routes/exports.dart';\n\nabstract class InternalRoutes {\n  static AnilistAuthRoute anilistAuth = AnilistAuthRoute();\n\n  static InternalRoute? findMatch(final String route) =>\n      all.firstWhereOrNull((final InternalRoute x) => x.matches(route));\n\n  static List<InternalRoute> get all => <InternalRoute>[anilistAuth];\n}\n"
  },
  {
    "path": "lib/core/packages.dart",
    "content": "export 'dart:ui' show ImageFilter;\nexport 'package:animations/animations.dart';\nexport 'package:flutter/material.dart' hide Locale;\nexport 'package:provider/provider.dart';\nexport 'package:provider/single_child_widget.dart';\nexport 'package:url_launcher/url_launcher.dart'\n    show LaunchMode, canLaunchUrl, launchUrl;\n"
  },
  {
    "path": "lib/core/paths.dart",
    "content": "import 'dart:io';\nimport 'package:path_provider/path_provider.dart' as path_provider;\n\nabstract class Paths {\n  static late final Directory docsDir;\n\n  static Future<void> initialize() async {\n    docsDir = await path_provider.getApplicationDocumentsDirectory();\n  }\n}\n\nabstract class AssetPaths {\n  static const String anilistLogo = 'assets/images/anilist_logo.png';\n}\n"
  },
  {
    "path": "lib/core/player/video_player.dart",
    "content": "import 'package:flutter/material.dart';\nimport 'package:media_kit/media_kit.dart' as media_kit;\nimport 'package:media_kit_video/media_kit_video.dart' as media_kit;\n\nclass PlayerPage extends StatefulWidget {\n  const PlayerPage({super.key});\n\n  @override\n  _PlayerPageState createState() => _PlayerPageState();\n}\n\nString sourceurl =\n    ''; // TODO: Placeholder variable. Swap this out for the new video url provider.\nString fileContents =\n    ''; // TODO: Placeholder variable. Subtitles will have to be implemented later.\n\nclass _PlayerPageState extends State<PlayerPage> {\n  late media_kit.Player _player;\n  late media_kit.VideoController _controller;\n\n  // final ValueNotifier<bool> _subtitlesEnabled = ValueNotifier<bool>(true);\n\n  @override\n  void initState() {\n    super.initState();\n    _player = media_kit.Player();\n    _controller = media_kit.VideoController(_player);\n    _setDataSource();\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    _player.dispose();\n  }\n\n  Future<void> _setDataSource() async {\n    await _player.open(media_kit.Media(sourceurl));\n    // _controller.onClosedCaptionEnabled(true);\n  }\n\n  // Future<ClosedCaptionFile> _loadCaptions() async =>\n  //     SubRipCaptionFile(fileContents);\n\n  @override\n  Widget build(final BuildContext context) => Scaffold(\n        appBar: AppBar(),\n        body: SafeArea(\n          child: AspectRatio(\n            aspectRatio: 16 / 9,\n            child: media_kit.Video(\n              controller: _controller,\n              // bottomRight: (\n              //   final BuildContext ctx,\n              //   final MeeduPlayerController controller,\n              //   final Responsive responsive,\n              // ) {\n              //   final double fontSize = responsive.ip(3);\n\n              //   return CupertinoButton(\n              //     padding: const EdgeInsets.all(5),\n              //     minSize: 25,\n              //     child: ValueListenableBuilder<bool>(\n              //       valueListenable: _subtitlesEnabled,\n              //       builder: (\n              //         final BuildContext context,\n              //         final bool enabled,\n              //         final _,\n              //       ) =>\n              //           Text(\n              //         'CC',\n              //         style: TextStyle(\n              //           fontSize: fontSize > 18 ? 18 : fontSize,\n              //           color: Colors.white.withOpacity(\n              //             enabled ? 1 : 0.4,\n              //           ),\n              //         ),\n              //       ),\n              //     ),\n              //     onPressed: () {\n              //       _subtitlesEnabled.value = !_subtitlesEnabled.value;\n              //       _controller.onClosedCaptionEnabled(_subtitlesEnabled.value);\n              //     },\n              //   );\n              // },\n            ),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/core/state/exports.dart",
    "content": "export 'states.dart';\nexport 'value.dart';\n"
  },
  {
    "path": "lib/core/state/states.dart",
    "content": "enum States {\n  waiting,\n  processing,\n  finished,\n  failed,\n}\n"
  },
  {
    "path": "lib/core/state/value.dart",
    "content": "import 'package:flutter/material.dart';\nimport 'states.dart';\n\nclass StatedValue<T> {\n  StatedValue({\n    this.state = States.waiting,\n  });\n\n  States state;\n  late T value;\n  Object? error;\n  StackTrace? stackTrace;\n\n  void _change(\n    final States state, {\n    final T? value,\n    final Object? error,\n    final StackTrace? stackTrace,\n  }) {\n    this.state = state;\n    if (value != null) {\n      this.value = value;\n    }\n    if (error != null) {\n      this.error = error;\n    }\n    if (stackTrace != null) {\n      this.stackTrace = stackTrace;\n    }\n  }\n\n  void waiting([final T? value]) {\n    _change(States.waiting, value: value);\n  }\n\n  void loading([final T? value]) {\n    _change(States.processing, value: value);\n  }\n\n  void finish(final T value) {\n    _change(States.finished, value: value);\n  }\n\n  void fail([\n    final Object? error,\n    final StackTrace? stackTrace,\n  ]) {\n    _change(States.failed, error: error, stackTrace: stackTrace);\n  }\n\n  bool get isWaiting => state == States.waiting;\n  bool get isProcessing => state == States.processing;\n  bool get hasFinished => state == States.finished;\n  bool get hasFailed => state == States.failed;\n  bool get hasFinishedOrFailed => hasFinished || hasFailed;\n}\n\nclass ListenableStatedValue<T> extends StatedValue<T> with ChangeNotifier {\n  @override\n  void _change(\n    final States state, {\n    final T? value,\n    final Object? error,\n    final StackTrace? stackTrace,\n  }) {\n    super._change(state, value: value, error: error, stackTrace: stackTrace);\n    notifyListeners();\n  }\n}\n"
  },
  {
    "path": "lib/core/tenka/exports.dart",
    "content": "export 'package:tenka/tenka.dart';\nexport 'manager.dart';\nexport 'utils.dart';\n"
  },
  {
    "path": "lib/core/tenka/manager.dart",
    "content": "import 'package:path/path.dart' as path;\nimport 'package:tenka/tenka.dart';\nimport '../database/exports.dart';\nimport '../paths.dart';\n\nabstract class TenkaManager {\n  static late final TenkaRepository repository;\n  static final Map<String, dynamic> _extractors = <String, dynamic>{};\n\n  static Future<void> initialize() async {\n    await TenkaInternals.initialize(\n      runtime: TenkaRuntimeOptions(\n        http: TenkaRuntimeHttpClientOptions(\n          ignoreSSLCertificate: SettingsDatabase.settings.ignoreSSLCertificate,\n        ),\n      ),\n    );\n\n    repository = TenkaRepository(\n      resolver: const TenkaStoreURLResolver(),\n      baseDir: path.join(Paths.docsDir.path, 'tenka'),\n    );\n\n    // await repository.initialize();\n  }\n\n  static Future<T> getExtractor<T>(final TenkaMetadata metadata) async {\n    if (!_extractors.containsKey(metadata.id)) {\n      final BeizeProgramConstant program = BeizeProgramConstant.deserialize(\n        (metadata.source as TenkaBase64DS).data,\n      );\n      final TenkaRuntimeInstance runtime =\n          await TenkaRuntimeManager.create(program);\n      final T extractor;\n      if (T is AnimeExtractor) {\n        extractor = await runtime.getAnimeExtractor() as T;\n      } else if (T is MangaExtractor) {\n        extractor = await runtime.getMangaExtractor() as T;\n      } else {\n        throw UnsupportedError('Invalid extractor type: $T');\n      }\n      _extractors[metadata.id] = extractor;\n    }\n\n    return _extractors[metadata.id] as T;\n  }\n}\n"
  },
  {
    "path": "lib/core/tenka/utils.dart",
    "content": "import 'package:tenka/tenka.dart';\nimport '../translator/exports.dart';\n\nextension TenkaTypeUtils on TenkaType {\n  String getTitleCase(final Translation translation) => switch (this) {\n        TenkaType.anime => translation.anime,\n        TenkaType.manga => translation.manga,\n      };\n}\n"
  },
  {
    "path": "lib/core/themes/colors.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../translator/exports.dart';\n\nabstract class ForegroundColors {\n  static const Color red = Color(0xffef4444);\n  static const Color orange = Color(0xfff97316);\n  static const Color amber = Color(0xfff59e0b);\n  static const Color yellow = Color(0xffeab308);\n  static const Color lime = Color(0xff84cc16);\n  static const Color green = Color(0xff22c55e);\n  static const Color emerald = Color(0xff10b981);\n  static const Color teal = Color(0xff14b8a6);\n  static const Color cyan = Color(0xff06b6d4);\n  static const Color sky = Color(0xff0ea5e9);\n  static const Color blue = Color(0xff3b82f6);\n  static const Color indigo = Color(0xff6366f1);\n  static const Color violet = Color(0xff8b5cf6);\n  static const Color purple = Color(0xffa855f7);\n  static const Color fuchsia = Color(0xffd946ef);\n  static const Color pink = Color(0xffec4899);\n  static const Color rose = Color(0xfff43f5e);\n\n  static const Map<String, Color> colors = <String, Color>{\n    'red': red,\n    'orange': orange,\n    'amber': amber,\n    'yellow': yellow,\n    'lime': lime,\n    'green': green,\n    'emerald': emerald,\n    'teal': teal,\n    'cyan': cyan,\n    'sky': sky,\n    'blue': blue,\n    'indigo': indigo,\n    'violet': violet,\n    'purple': purple,\n    'fuchsia': fuchsia,\n    'pink': pink,\n    'rose': rose,\n  };\n\n  static Color? find(final String name) => colors[name];\n\n  static List<String> names() => colors.keys.toList();\n\n  static String getTitleCase(\n    final Translation translation,\n    final String name,\n  ) =>\n      switch (name) {\n        'red' => translation.red,\n        'orange' => translation.orange,\n        'amber' => translation.amber,\n        'yellow' => translation.yellow,\n        'lime' => translation.lime,\n        'green' => translation.green,\n        'emerald' => translation.emerald,\n        'teal' => translation.teal,\n        'cyan' => translation.cyan,\n        'sky' => translation.sky,\n        'blue' => translation.blue,\n        'indigo' => translation.indigo,\n        'violet' => translation.violet,\n        'purple' => translation.purple,\n        'fuchsia' => translation.fuchsia,\n        'pink' => translation.pink,\n        'rose' => translation.rose,\n        _ => name,\n      };\n}\n"
  },
  {
    "path": "lib/core/themes/exports.dart",
    "content": "export 'colors.dart';\nexport 'fonts.dart';\n"
  },
  {
    "path": "lib/core/themes/fonts.dart",
    "content": "abstract class Fonts {\n  static const String inter = 'Inter';\n  static const String greatVibes = 'GreatVibes';\n}\n"
  },
  {
    "path": "lib/core/translator/exports.dart",
    "content": "export 'translator.dart';\n"
  },
  {
    "path": "lib/core/translator/translator.dart",
    "content": "import 'dart:convert';\nimport 'package:flutter/services.dart' show rootBundle;\nimport 'package:utilx/locale.dart';\nimport 'package:utilx/utilx.dart';\nimport '../app/exports.dart';\nimport '../database/exports.dart';\n\npart 'translation.g.dart';\n\nabstract class Translator {\n  static const Locale defaultLocale = LocalesRepository.en;\n\n  static late Translation currentTranslation;\n\n  static Future<void> initialize() async {\n    await updateCurrentTranslation();\n\n    AppEvents.stream.listen((final AppEvent event) async {\n      if (event != AppEvent.settingsChange) return;\n      await updateCurrentTranslation();\n    });\n  }\n\n  static Future<void> updateCurrentTranslation() async {\n    final Locale? settingsLocale = SettingsDatabase.settings.locale;\n    final Locale locale =\n        settingsLocale != null && hasTranslation(settingsLocale)\n            ? settingsLocale\n            : defaultLocale;\n    currentTranslation = await parseTranslation(locale);\n    AppEvents.controller.add(AppEvent.translationsChange);\n  }\n\n  static bool hasTranslation(final Locale locale) =>\n      Translation.availableLocales.contains(locale.code);\n\n  static Future<Translation> parseTranslation(final Locale locale) async {\n    final String content =\n        await rootBundle.loadString('assets/translations/${locale.code}.json');\n    final JsonMap parsed = json.decode(content) as JsonMap;\n    return Translation(parsed);\n  }\n\n  static Locale get locale => currentTranslation.locale;\n\n  static String get identifier => locale.code;\n}\n"
  },
  {
    "path": "lib/core/utils/dates.dart",
    "content": "abstract class PrettyDates {\n  static String constructDateString({\n    required final String day,\n    required final String month,\n    required final String year,\n  }) =>\n      '$day-$month-$year';\n\n  static String toDateString(final DateTime date) => constructDateString(\n        day: date.day.toString(),\n        month: date.month.toString(),\n        year: date.year.toString(),\n      );\n}\n"
  },
  {
    "path": "lib/core/utils/durations.dart",
    "content": "import '../translator/exports.dart';\n\nabstract class PrettyDurations {\n  static String prettyHoursMinutesShort(\n    final Translation translation,\n    final Duration duration,\n  ) {\n    final int hours = duration.inHours;\n    final int mins = duration.inMinutes.remainder(60);\n    if (hours == 0) return translation.nMins(mins.toString());\n    return translation.nHrsOMins(hours.toString(), mins.toString());\n  }\n}\n"
  },
  {
    "path": "lib/core/utils/exports.dart",
    "content": "export 'package:collection/collection.dart';\nexport 'package:utilx/locale.dart';\nexport 'package:utilx/utilx.dart';\nexport 'dates.dart';\nexport 'durations.dart';\nexport 'provider.dart';\n"
  },
  {
    "path": "lib/core/utils/kawaii_faces.dart",
    "content": "// ? Source: https://kawaiiface.net (how pensive)\nabstract class KawaiiFaces {\n  static const List<String> sad = <String>[\n    'ಥ_ಥ',\n    '(-’๏_๏’-)',\n    '˚⌇˚',\n    'o(╥﹏╥)o',\n    '(⊙﹏⊙✿)',\n    '●︿●',\n    '( /)w(\\\\✿)',\n    '(╯︵╰,)',\n    '(︶︹︺)',\n    '(◡﹏◡✿)',\n    '(✖﹏✖)',\n    '‘︿’',\n    'v( ‘.’ )v',\n    '◄.►',\n    '(ㄒoㄒ)',\n    '⊙︿⊙',\n    '(◕︿◕✿)',\n    'ਉ_ਉ',\n    '┐(‘～`；)┌',\n    '(︶︹︺)',\n    '흫_흫',\n    'ب_ب',\n    '╮(─▽─)╭',\n    'ಥ‿ಥ',\n    '(-’_’-)',\n    '(╥╥)',\n    '(•̪●)',\n    '(∩︵∩)',\n    '(o_-)',\n    '(｡-_-｡)',\n    '(╯_╰)',\n    '(╥_╥)',\n    'v(ಥ ̯ ಥ)v',\n    \"<('.'<)\",\n    'ಠ,ಥ',\n    '(◕︵◕)',\n    '(´ヘ｀()',\n    '(✖╭╮✖)',\n    '(◕﹏◕✿)',\n    '(+_+)',\n    '★~(◠︿◕✿)',\n    '(*´д｀*)',\n    '(◡△◡✿)',\n    '٩(×̯×)۶',\n    '(ノ_・。)',\n    '┐(‘～`；)┌',\n    '(つд｀)',\n    '(✖╭╮✖)',\n    'ಥ⌣ಥ',\n    'இ_இ',\n    '✖‿✖',\n  ];\n\n  static const List<String> happy = <String>[\n    '(◕‿◕✿)',\n    '(◠‿◠✿)',\n    '(◠﹏◠✿)',\n    '（＊＾Ｕ＾）人（≧Ｖ≦＊）/',\n    'ôヮô',\n    '∧( ‘Θ’ )∧',\n    '(¤﹏¤)',\n    '●‿●',\n    'ʕ·ᴥ·ʔ',\n    '＼（＾○＾）人（＾○＾）／',\n    'ヾ(＠⌒▽⌒＠)ﾉ',\n    '(°∀°)',\n    'ヾ｜￣ー￣｜ﾉ',\n    '(☉‿☉✿)',\n    '┏(＾0＾)┛┗(＾0＾) ┓',\n    '(◡‿◡✿)',\n    '✿◕ ‿ ◕✿',\n    'ヽ(‘ ∇‘ )ノ',\n    '☆(❁‿❁)☆',\n    '❀◕ ‿ ◕❀',\n    'ヽ(^◇^*)/',\n    '(•⊙ω⊙•)',\n    '!⑈ˆ~ˆ!⑈',\n    '(*^ -^*)',\n    '(⊙‿⊙✿)',\n    '◕3◕',\n    '(ﾟヮﾟ)',\n    '¢‿¢',\n    'ヅ',\n    '●ᴥ●',\n    '(∪ ◡ ∪)',\n    '≖‿≖',\n    '≧◡≦',\n    '٩◔‿◔۶',\n    '｡◕ ‿ ◕｡',\n    'ヾ(＠＾▽＾＠)ﾉ',\n    '◃┆◉◡◉┆▷',\n    '(✿◠‿◠)',\n    '(￣ｰ￣)',\n    '╰(◡‿◡✿╰)',\n    '~,~',\n    '(ﾉ◕ヮ◕)ﾉ*:･ﾟ✧',\n    '(*~▽~)',\n    '❀‿❀',\n    '◕‿◕',\n    '(^L^)',\n    '(^▽^)',\n    '◕ ◡ ◕',\n    '(◕‿◕✿)',\n    '（ ；´Д｀）',\n    '⊙﹏⊙',\n    '✿｡✿',\n    'ヽ(゜∇゜)ノ',\n    '｡(✿‿✿)｡',\n    '(´ー｀)',\n    'ツ',\n    'q(❂‿❂)p',\n    '( ́ ◕◞ε◟◕`)',\n    '☆(◒‿◒)☆',\n    '(∩▂∩)',\n    '(¬‿¬)',\n    '(^Ｏ^)',\n    'ʘ‿ʘ',\n    '（’◎’）',\n    '(◜௰◝)',\n    '(^ｰ^)',\n    '(o´ω｀o)',\n    '(^з^)-☆',\n    '(◕ω◕✿)',\n    '(づ｡◕‿‿◕｡)づ',\n    '(ﾟ▽^*)',\n    '(⌒o⌒)',\n    '(｡◕‿◕｡)',\n    'ت',\n    '(. ﾟーﾟ)',\n    '१˚◡˚५',\n    '＼(●~▽~●)',\n    '(*˘︶˘*)',\n    '(✪㉨✪)',\n    '(ᅌᴗᅌ* )',\n    '^L^',\n    '(\\\\/) (°„°) (\\\\/)',\n    '＼(*^▽^*)/',\n    '(◠△◠✿)',\n    '( ಠ◡ಠ )',\n    '(〃^∇^)ﾉ',\n    '^^',\n    '|◔◡◉|',\n    '(●⌒∇⌒●)',\n    '⊂◉‿◉つ',\n    '.ʕʘ‿ʘʔ.',\n    '(*・∀・*)人(*・∀・*)',\n    '＼(^-^)／',\n    '∩(︶▽︶)∩',\n    '（☉∀☉）',\n    '(´ω｀)',\n    '●﹏●',\n    '（ ´∀｀）☆',\n    '•ᴥ•',\n    '✿◕ ‿ ◕✿',\n    '(≧◡≦)',\n    '(◡‿◡✿)',\n    '(･ｪ-)',\n    '^‿^',\n    '٩(̾●̮̮̃̾•̃̾)۶',\n    '≖‿≖',\n    '(⊙ω⊙✿)',\n    '٩(-̮̮̃•̃)',\n    '(´･ω･`)',\n    '◤(¬‿¬)◥',\n    '^.^',\n    '(•‿•)',\n    '（＾⊆＾）',\n    \"^( '‿' )^\",\n    '☆d(o⌒∇⌒o)b',\n    '∑(゜Д゜;)',\n    '(▰˘◡˘▰)',\n    '(• ε •)',\n    '( ͡° ͜ʖ ͡°)',\n    '(\\\\/) (°,,°) (\\\\/)',\n    '(￣(エ)￣)',\n    '{◕ ◡ ◕}',\n    '(>‘o’)>',\n    'シ',\n    '(❀‿❀)',\n    '< (^^,) >',\n    'ヾ(●⌒∇⌒●)ﾉ',\n    '（ ´∀｀）',\n    '☾˙❀‿❀˙☽',\n    '°٢°',\n    '^o^',\n    '(=ﾟωﾟ)ﾉ',\n    '٩(●̮̮̃•̃)۶',\n    '(☞ﾟ∀ﾟ)☞',\n    '(=゜ω゜)',\n    '(｡✿‿✿｡)',\n    'ó‿ó',\n    '◎[‿]◎',\n    '(▰˘◡˘▰)',\n    '(︶ω︶)',\n    '(ﾉ◕ヮ◕)ﾉ*:･ﾟ✧',\n    '(◠ω◠✿)',\n    '٩(^‿^)۶',\n    '(●*∩_∩*●)',\n    '٩(-̮̮̃-̃)۶',\n    '<丶´Д｀>',\n    '(✿◠‿◠)',\n    'ヽ(´▽｀)ノ',\n    '(°⌣°)',\n    '☆(❁‿❁)☆',\n    '(० ्०)',\n    '٩(-̮̮̃•̃)۶',\n    '（╹ェ╹）',\n    'ᵔᴥᵔ',\n    '•(_)•',\n    'ヽ( ´ ∇ ｀ )ノ',\n    '（ミ￣ー￣ミ）',\n    '(─‿‿─)',\n    '~(^з^)-',\n    '(*≗*)',\n    '~(^з^)-',\n    '(´･ω･`)',\n    '(｡◕‿◕｡)',\n    '.=^.^=',\n    '(◠︿◠✿)',\n    'ッ',\n    '(`･ω･´)',\n    '´ ▽ ` )ﾉ',\n    '(´∀｀)',\n    '(◑‿◐)',\n    'ヽ(ﾟｰﾟ*ヽ)ヽ(*ﾟｰﾟ*)ﾉ(ﾉ*ﾟｰﾟ)ﾉ',\n    '˚ᆺ˚',\n    'ヽ(〃＾▽＾〃)ﾉ',\n    '｡◕‿◕｡',\n    '❀◕ ‿ ◕❀',\n    '( °٢° )',\n    'Ü',\n    '(●´ω｀●)',\n    \"<('o'<)\",\n    '◕‿◕',\n    'ᵔᴥᵔ',\n    '◙‿◙',\n  ];\n}\n"
  },
  {
    "path": "lib/core/utils/provider.dart",
    "content": "import 'package:flutter/material.dart';\n\nclass StatedChangeNotifier extends ChangeNotifier {\n  bool mounted = true;\n\n  @override\n  void dispose() {\n    mounted = false;\n\n    super.dispose();\n  }\n}\n"
  },
  {
    "path": "lib/main.dart",
    "content": "import 'package:flutter/material.dart';\nimport 'package:kazahana/ui/exports.dart';\n\nvoid main() {\n  WidgetsFlutterBinding.ensureInitialized();\n  runApp(const BaseApp());\n}\n"
  },
  {
    "path": "lib/ui/base.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport 'exports.dart';\n\nclass BaseApp extends StatefulWidget {\n  const BaseApp({\n    super.key,\n  });\n\n  @override\n  State<BaseApp> createState() => _BaseAppState();\n}\n\nclass _BaseAppState extends State<BaseApp> {\n  late ThemerThemeData theme;\n  late double scaleMultiplier;\n  late String translationId;\n\n  @override\n  void initState() {\n    super.initState();\n    theme = Themer.defaultTheme();\n    scaleMultiplier = RelativeScaleData.defaultScaleMultiplier;\n    translationId = '';\n    AppEvents.stream.listen((final AppEvent event) {\n      if (event == AppEvent.settingsChange) {\n        final ThemerThemeData nTheme = Themer.getCurrentTheme();\n        if (theme != nTheme) {\n          setState(() {\n            theme = nTheme;\n          });\n        }\n        final double nScaleMultiplier = RelativeScaleData.getScaleMultiplier();\n        if (scaleMultiplier != nScaleMultiplier) {\n          setState(() {\n            scaleMultiplier = nScaleMultiplier;\n          });\n        }\n      }\n      if (event == AppEvent.translationsChange) {\n        final String nTranslationId = Translator.identifier;\n        if (translationId != nTranslationId) {\n          setState(() {\n            translationId = nTranslationId;\n          });\n        }\n      }\n    });\n  }\n\n  @override\n  Widget build(final BuildContext context) => MaterialApp(\n        title: AppMeta.name,\n        navigatorKey: gNavigatorKey,\n        debugShowCheckedModeBanner: false,\n        builder: (\n          final BuildContext context,\n          final Widget? child,\n        ) =>\n            RelativeScaler(\n          data: RelativeScaleData(\n            multiplier: scaleMultiplier,\n            screen: RelativeScaleData.getScreenSize(context),\n          ),\n          child: TranslationWrapper(\n            id: translationId,\n            child: Builder(\n              builder: (final BuildContext context) => Theme(\n                data: theme.getThemeData(context),\n                child: Builder(\n                  builder: (final BuildContext context) =>\n                      ClassicWrapper(child: child!),\n                ),\n              ),\n            ),\n          ),\n        ),\n        onGenerateRoute: (final RouteSettings settings) {\n          final RouteInfo route = RouteInfo(settings);\n          final RoutePage? page = RoutePages.findMatch(route);\n          if (page == null) return null;\n          return page.buildRoutePage(route);\n        },\n      );\n}\n\nclass ClassicWrapper extends StatelessWidget {\n  const ClassicWrapper({\n    required this.child,\n    super.key,\n  });\n\n  final Widget child;\n\n  @override\n  Widget build(final BuildContext context) =>\n      Stack(children: <Widget>[child, const SuperImposer()]);\n}\n"
  },
  {
    "path": "lib/ui/components/anilist/exports.dart",
    "content": "export 'media_row.dart';\nexport 'media_slide.dart';\nexport 'media_tile.dart';\n"
  },
  {
    "path": "lib/ui/components/anilist/media_row.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\n\nclass AnilistMediaRow extends StatelessWidget {\n  const AnilistMediaRow(\n    this.results, {\n    super.key,\n  });\n\n  final List<AnilistMedia> results;\n\n  @override\n  Widget build(final BuildContext context) => ScrollableRow(\n        results\n            .map(\n              (final AnilistMedia x) => SizedBox(\n                width: getTileWidth(context.r),\n                child: AnilistMediaTile(x),\n              ),\n            )\n            .toList(),\n      );\n\n  static const double tileWidthAny = 8;\n  static const double tileWidthMd = 9;\n\n  static double getTileWidth(final RelativeScaler r) =>\n      r.scale(tileWidthAny, md: tileWidthMd);\n}\n"
  },
  {
    "path": "lib/ui/components/anilist/media_slide.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\n\nclass AnilistMediaSlide extends StatefulWidget {\n  const AnilistMediaSlide(\n    this.media, {\n    super.key,\n  });\n\n  final AnilistMedia media;\n\n  @override\n  State<AnilistMediaSlide> createState() => _AnilistMediaSlideState();\n}\n\nclass _AnilistMediaSlideState extends State<AnilistMediaSlide>\n    with AutomaticKeepAliveClientMixin {\n  Widget buildThumbnail(final BuildContext context) => ClipRRect(\n        borderRadius: BorderRadius.circular(context.r.scale(1)),\n        child: AspectRatio(\n          aspectRatio: AnilistMediaTile.coverRatio,\n          child: FadeInImage(\n            placeholder: MemoryImage(Placeholders.transparent1x1Image),\n            image: NetworkImage(widget.media.coverImageExtraLarge),\n            fit: BoxFit.cover,\n          ),\n        ),\n      );\n\n  Widget buildContent(final BuildContext context) => Column(\n        crossAxisAlignment: CrossAxisAlignment.start,\n        children: <Widget>[\n          Wrap(\n            spacing: context.r.scale(0.25),\n            runSpacing: context.r.scale(0.2),\n            alignment: WrapAlignment.center,\n            children: <Widget>[\n              AnilistMediaTile.buildFormatChip(\n                context: context,\n                media: widget.media,\n              ),\n              AnilistMediaTile.buildWatchtimeChip(\n                context: context,\n                media: widget.media,\n              ),\n              if (widget.media.averageScore != null)\n                AnilistMediaTile.buildRatingChip(\n                  context: context,\n                  media: widget.media,\n                ),\n              if (widget.media.startDate != null ||\n                  widget.media.endDate != null)\n                AnilistMediaTile.buildAirdateChip(\n                  context: context,\n                  media: widget.media,\n                ),\n              if (widget.media.isAdult)\n                AnilistMediaTile.buildNSFWChip(\n                  context: context,\n                  media: widget.media,\n                ),\n            ],\n          ),\n          SizedBox(height: context.r.scale(0.5)),\n          Text(\n            widget.media.titleUserPreferred,\n            style: context.r\n                .responsive(\n                  Theme.of(context).textTheme.titleLarge,\n                  md: Theme.of(context).textTheme.headlineSmall,\n                )!\n                .copyWith(fontWeight: FontWeight.bold),\n          ),\n          SizedBox(height: context.r.scale(0.25)),\n          if (widget.media.description != null)\n            Text(\n              widget.media.description!,\n              maxLines: 5,\n              overflow: TextOverflow.ellipsis,\n            ),\n        ],\n      );\n\n  @override\n  Widget build(final BuildContext context) {\n    super.build(context);\n    return Stack(\n      children: <Widget>[\n        Container(color: Theme.of(context).bottomAppBarTheme.color),\n        Positioned.fill(\n          child: FadeInImage(\n            placeholder: MemoryImage(Placeholders.transparent1x1Image),\n            image: NetworkImage(\n              widget.media.bannerImage ?? widget.media.coverImageExtraLarge,\n            ),\n            fit: BoxFit.cover,\n          ),\n        ),\n        if (widget.media.bannerImage == null)\n          ClipRRect(\n            child: BackdropFilter(\n              filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),\n              child: const SizedBox.expand(),\n            ),\n          ),\n        Positioned.fill(\n          child: Material(\n            type: MaterialType.transparency,\n            child: InkWell(\n              child: DecoratedBox(\n                decoration: BoxDecoration(\n                  gradient: LinearGradient(\n                    begin: Alignment.topCenter,\n                    end: Alignment.bottomCenter,\n                    colors: <Color>[\n                      Theme.of(context)\n                          .colorScheme\n                          .background\n                          .withOpacity(0.25),\n                      Theme.of(context)\n                          .colorScheme\n                          .background\n                          .withOpacity(0.75),\n                    ],\n                  ),\n                ),\n              ),\n              onTap: () {\n                Navigator.of(context)\n                    .pusher\n                    .pushToViewPageFromMedia(widget.media);\n              },\n            ),\n          ),\n        ),\n        Align(\n          alignment: Alignment.bottomLeft,\n          child: IgnorePointer(\n            child: Padding(\n              padding: EdgeInsets.all(context.r.scale(1)),\n              child: context.r.responsiveBuilder(\n                () => Column(\n                  mainAxisSize: MainAxisSize.min,\n                  mainAxisAlignment: MainAxisAlignment.end,\n                  crossAxisAlignment: CrossAxisAlignment.start,\n                  children: <Widget>[\n                    Expanded(\n                      child: buildThumbnail(context),\n                    ),\n                    SizedBox(height: context.r.scale(1)),\n                    buildContent(context),\n                  ],\n                ),\n                md: () => Row(\n                  children: <Widget>[\n                    buildThumbnail(context),\n                    SizedBox(width: context.r.scale(1.5)),\n                    Expanded(\n                      child: Column(\n                        mainAxisAlignment: MainAxisAlignment.end,\n                        crossAxisAlignment: CrossAxisAlignment.start,\n                        children: <Widget>[\n                          buildContent(context),\n                        ],\n                      ),\n                    ),\n                  ],\n                ),\n              ),\n            ),\n          ),\n        ),\n      ],\n    );\n  }\n\n  @override\n  bool get wantKeepAlive => true;\n}\n"
  },
  {
    "path": "lib/ui/components/anilist/media_tile.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\n\nclass AnilistMediaTile extends StatelessWidget {\n  const AnilistMediaTile(\n    this.media, {\n    this.additionalBottomChips = const <Widget>[],\n    super.key,\n  });\n\n  final AnilistMedia media;\n  final List<Widget> additionalBottomChips;\n\n  @override\n  Widget build(final BuildContext context) => InkWell(\n        onTap: () {\n          Navigator.of(context).pusher.pushToViewPageFromMedia(media);\n        },\n        borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n        child: Column(\n          mainAxisSize: MainAxisSize.min,\n          children: <Widget>[\n            ClipRRect(\n              borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n              child: AspectRatio(\n                aspectRatio: coverRatio,\n                child: Stack(\n                  children: <Widget>[\n                    Positioned.fill(\n                      child: Container(\n                        color: Theme.of(context).bottomAppBarTheme.color,\n                      ),\n                    ),\n                    Positioned.fill(\n                      child: Image.network(\n                        media.coverImageExtraLarge,\n                        fit: BoxFit.cover,\n                      ),\n                    ),\n                    Align(\n                      alignment: Alignment.bottomRight,\n                      child: Padding(\n                        padding: EdgeInsets.all(context.r.scale(0.25)),\n                        child: Column(\n                          mainAxisAlignment: MainAxisAlignment.end,\n                          crossAxisAlignment: CrossAxisAlignment.end,\n                          children: ListUtils.insertBetween(\n                            <Widget>[\n                              if (media.averageScore != null)\n                                buildRatingChip(\n                                  context: context,\n                                  media: media,\n                                ),\n                              buildWatchtimeChip(\n                                context: context,\n                                media: media,\n                              ),\n                              buildFormatChip(\n                                context: context,\n                                media: media,\n                              ),\n                              if (media.isAdult)\n                                AnilistMediaTile.buildNSFWChip(\n                                  context: context,\n                                  media: media,\n                                ),\n                              ...additionalBottomChips,\n                            ],\n                            SizedBox(height: context.r.scale(0.2)),\n                          ),\n                        ),\n                      ),\n                    ),\n                  ],\n                ),\n              ),\n            ),\n            SizedBox(height: context.r.scale(0.5)),\n            Flexible(\n              child: Text(\n                media.titleUserPreferred,\n                style: Theme.of(context).textTheme.bodyMedium,\n                textAlign: TextAlign.center,\n              ),\n            ),\n            SizedBox(height: context.r.scale(0.25)),\n          ],\n        ),\n      );\n\n  static const double coverRatio = 5 / 8;\n\n  static Widget buildChip({\n    required final BuildContext context,\n    required final Widget child,\n    final Widget? icon,\n    final Color? backgroundColor,\n    final Color? textColor,\n  }) =>\n      DecoratedBox(\n        decoration: BoxDecoration(\n          color: backgroundColor ?? Theme.of(context).colorScheme.background,\n          borderRadius: BorderRadius.circular(context.r.scale(0.3)),\n        ),\n        child: Padding(\n          padding: EdgeInsets.only(\n            top: context.r.scale(0.05),\n            bottom: context.r.scale(0.1),\n            left: context.r.scale(0.25),\n            right: context.r.scale(0.25),\n          ),\n          child: DefaultTextStyle(\n            style: Theme.of(context).textTheme.labelLarge!.copyWith(\n                  fontWeight: FontWeight.normal,\n                  color:\n                      textColor ?? Theme.of(context).colorScheme.onBackground,\n                ),\n            child: Row(\n              mainAxisSize: MainAxisSize.min,\n              mainAxisAlignment: MainAxisAlignment.center,\n              children: <Widget>[\n                if (icon != null) ...<Widget>[\n                  IconTheme(\n                    data: Theme.of(context)\n                        .iconTheme\n                        .copyWith(size: context.r.scale(1)),\n                    child: icon,\n                  ),\n                  SizedBox(width: context.r.scale(0.25)),\n                ],\n                child,\n              ],\n            ),\n          ),\n        ),\n      );\n\n  static Widget buildFormatChip({\n    required final BuildContext context,\n    required final AnilistMedia media,\n    final Color? backgroundColor,\n    final Color? textColor,\n  }) =>\n      AnilistMediaTile.buildChip(\n        context: context,\n        icon: media.status == AnilistMediaStatus.releasing\n            ? AnilistMediaTile.ongoingIcon\n            : null,\n        child: Text(media.format.getTitleCase(context.t)),\n        backgroundColor: backgroundColor,\n        textColor: textColor,\n      );\n\n  static Widget buildWatchtimeChip({\n    required final BuildContext context,\n    required final AnilistMedia media,\n    final Color? backgroundColor,\n    final Color? textColor,\n  }) =>\n      AnilistMediaTile.buildChip(\n        context: context,\n        child: Text(media.getWatchtime(context.t)),\n        backgroundColor: backgroundColor,\n        textColor: textColor,\n      );\n\n  static Widget buildRatingChip({\n    required final BuildContext context,\n    required final AnilistMedia media,\n    final Color? backgroundColor,\n    final Color? textColor,\n  }) =>\n      AnilistMediaTile.buildChip(\n        context: context,\n        icon: AnilistMediaTile.ratingIcon,\n        child: Text('${media.averageScore}%'),\n        backgroundColor: backgroundColor,\n        textColor: textColor,\n      );\n\n  static Widget buildAirdateChip({\n    required final BuildContext context,\n    required final AnilistMedia media,\n    final Color? backgroundColor,\n    final Color? textColor,\n  }) =>\n      AnilistMediaTile.buildChip(\n        context: context,\n        icon: airdateIcon,\n        child: Text(media.airdate),\n        backgroundColor: backgroundColor,\n        textColor: textColor,\n      );\n\n  static Widget buildNSFWChip({\n    required final BuildContext context,\n    required final AnilistMedia media,\n  }) =>\n      AnilistMediaTile.buildChip(\n        context: context,\n        backgroundColor: ForegroundColors.red,\n        child: Text(context.t.nsfw),\n      );\n\n  static const Icon ratingIcon = Icon(\n    Icons.star_rounded,\n    color: ForegroundColors.yellow,\n  );\n\n  static const Icon ongoingIcon = Icon(\n    Icons.fiber_manual_record_outlined,\n    color: ForegroundColors.green,\n  );\n\n  static const Icon airdateIcon = Icon(\n    Icons.date_range_rounded,\n    color: ForegroundColors.fuchsia,\n  );\n}\n"
  },
  {
    "path": "lib/ui/components/body_padding.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../exports.dart';\n\nclass HorizontalBodyPadding extends StatelessWidget {\n  const HorizontalBodyPadding(\n    this.child, {\n    super.key,\n  });\n\n  final Widget child;\n\n  @override\n  Widget build(final BuildContext context) =>\n      Padding(padding: padding(context), child: child);\n\n  static const double paddingAny = 0.75;\n  static const double paddingMd = 1;\n\n  static double paddingValue(final BuildContext context) =>\n      context.r.scale(paddingAny, md: paddingMd);\n\n  static EdgeInsets padding(final BuildContext context) =>\n      EdgeInsets.symmetric(horizontal: paddingValue(context));\n}\n"
  },
  {
    "path": "lib/ui/components/cross_draggable_scroll_behaviour.dart",
    "content": "import 'dart:ui';\nimport 'package:kazahana/core/exports.dart';\n\nclass DraggableScrollBehavior extends MaterialScrollBehavior {\n  @override\n  Set<PointerDeviceKind> get dragDevices => <PointerDeviceKind>{\n        PointerDeviceKind.touch,\n        PointerDeviceKind.mouse,\n      };\n}\n\nclass DraggableScrollConfiguration extends StatelessWidget {\n  const DraggableScrollConfiguration({\n    required this.child,\n    super.key,\n  });\n\n  final Widget child;\n\n  @override\n  Widget build(final BuildContext context) => ScrollConfiguration(\n        behavior: DraggableScrollBehavior(),\n        child: child,\n      );\n}\n"
  },
  {
    "path": "lib/ui/components/exports.dart",
    "content": "export 'anilist/exports.dart';\nexport 'body_padding.dart';\nexport 'cross_draggable_scroll_behaviour.dart';\nexport 'rounded_back_button.dart';\nexport 'scrollable_row.dart';\nexport 'slideshow.dart';\nexport 'stated_builder.dart';\nexport 'super_imposer.dart';\nexport 'toast.dart';\n"
  },
  {
    "path": "lib/ui/components/kawaii_face.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass KawaiiFace extends StatelessWidget {\n  const KawaiiFace({\n    required this.face,\n    this.text,\n    this.child,\n    super.key,\n  }) : assert(text != null || child != null);\n\n  final String face;\n  final String? text;\n  final InlineSpan? child;\n\n  @override\n  Widget build(final BuildContext context) => RichText(\n        text: TextSpan(\n          children: <InlineSpan>[\n            TextSpan(text: face),\n            if (text != null) TextSpan(text: text),\n            if (child != null) child!,\n          ],\n        ),\n        textAlign: TextAlign.center,\n      );\n}\n"
  },
  {
    "path": "lib/ui/components/rounded_back_button.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass RoundedBackButton extends StatelessWidget {\n  const RoundedBackButton({\n    super.key,\n  });\n\n  @override\n  Widget build(final BuildContext context) => IconButton(\n        icon: const Icon(Icons.arrow_back_rounded),\n        onPressed: () {\n          Navigator.maybePop(context);\n        },\n      );\n}\n"
  },
  {
    "path": "lib/ui/components/scrollable_row.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport 'package:kazahana/ui/components/exports.dart';\nimport 'body_padding.dart';\n\nclass ScrollableRow extends StatefulWidget {\n  const ScrollableRow(\n    this.children, {\n    super.key,\n  });\n\n  final List<Widget> children;\n\n  @override\n  State<ScrollableRow> createState() => _ScrollableRowState();\n}\n\nclass _ScrollableRowState extends State<ScrollableRow> {\n  late final ScrollController scrollController;\n\n  @override\n  void initState() {\n    super.initState();\n    scrollController = ScrollController();\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    scrollController.dispose();\n  }\n\n  SizedBox buildSpacer(final BuildContext context) =>\n      SizedBox(width: HorizontalBodyPadding.paddingValue(context));\n\n  @override\n  Widget build(final BuildContext context) => DraggableScrollConfiguration(\n        child: SingleChildScrollView(\n          controller: scrollController,\n          scrollDirection: Axis.horizontal,\n          child: Row(\n            mainAxisSize: MainAxisSize.min,\n            crossAxisAlignment: CrossAxisAlignment.start,\n            children: <Widget>[\n              buildSpacer(context),\n              ...ListUtils.insertBetween(\n                widget.children,\n                buildSpacer(context),\n              ),\n              buildSpacer(context),\n            ],\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/components/slideshow.dart",
    "content": "import 'dart:async';\nimport 'package:flutter/material.dart';\nimport 'package:kazahana/ui/components/exports.dart';\n\nclass Slideshow extends StatefulWidget {\n  const Slideshow({\n    required this.children,\n    required this.slideDuration,\n    required this.animationDuration,\n    super.key,\n  });\n\n  final List<Widget> children;\n  final Duration slideDuration;\n  final Duration animationDuration;\n\n  @override\n  State<Slideshow> createState() => _SlideshowState();\n}\n\nclass _SlideshowState extends State<Slideshow>\n    with SingleTickerProviderStateMixin {\n  late final TabController tabController;\n  Timer? timer;\n  bool isDragged = false;\n\n  @override\n  void initState() {\n    super.initState();\n    tabController = TabController(\n      length: widget.children.length,\n      vsync: this,\n    );\n    scheduleSlideChange();\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    timer?.cancel();\n    tabController.dispose();\n  }\n\n  void scheduleSlideChange() {\n    timer = Timer(widget.slideDuration, () {\n      if (!isDragged) {\n        final int nextIndex =\n            currentIndex + 1 < widget.children.length ? currentIndex + 1 : 0;\n        tabController.animateTo(nextIndex, duration: widget.animationDuration);\n      }\n      scheduleSlideChange();\n    });\n  }\n\n  @override\n  Widget build(final BuildContext context) => DraggableScrollConfiguration(\n        child: NotificationListener<ScrollNotification>(\n          onNotification: (final ScrollNotification x) {\n            if (x is ScrollStartNotification) {\n              isDragged = true;\n            } else if (x is ScrollEndNotification) {\n              isDragged = false;\n            }\n            return false;\n          },\n          child: TabBarView(\n            controller: tabController,\n            children: widget.children,\n          ),\n        ),\n      );\n\n  int get currentIndex => tabController.index;\n}\n"
  },
  {
    "path": "lib/ui/components/stated_builder.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass StatedBuilder extends StatelessWidget {\n  const StatedBuilder(\n    this.state, {\n    required this.waiting,\n    required this.processing,\n    required this.finished,\n    required this.failed,\n    super.key,\n  });\n\n  final States state;\n  final WidgetBuilder waiting;\n  final WidgetBuilder processing;\n  final WidgetBuilder finished;\n  final WidgetBuilder failed;\n\n  @override\n  Widget build(final BuildContext context) {\n    if (state == States.waiting) return waiting(context);\n    if (state == States.processing) return processing(context);\n    if (state == States.finished) return finished(context);\n    return failed(context);\n  }\n}\n"
  },
  {
    "path": "lib/ui/components/super_imposer.dart",
    "content": "import 'dart:async';\nimport 'package:kazahana/core/exports.dart';\n\nclass SuperImposerEntry {\n  const SuperImposerEntry._({\n    required this.id,\n    required this.builder,\n  });\n\n  factory SuperImposerEntry.create(final WidgetBuilder builder) =>\n      SuperImposerEntry._(id: StringUtils.random(), builder: builder);\n\n  final String id;\n  final WidgetBuilder builder;\n}\n\nclass SuperImposer extends StatefulWidget {\n  const SuperImposer({\n    super.key,\n  });\n\n  @override\n  State<SuperImposer> createState() => _SuperImposerState();\n\n  static final Map<String, SuperImposerEntry> entries =\n      <String, SuperImposerEntry>{};\n\n  static final StreamController<void> onChangeController =\n      StreamController<void>.broadcast();\n\n  static final Stream<void> onChange = onChangeController.stream;\n\n  static void insert(final SuperImposerEntry entry) {\n    entries[entry.id] = entry;\n    onChangeController.add(null);\n  }\n\n  static void remove(final SuperImposerEntry entry) {\n    entries.remove(entry.id);\n    onChangeController.add(null);\n  }\n}\n\nclass _SuperImposerState extends State<SuperImposer> {\n  StreamSubscription<void>? subscription;\n\n  @override\n  void initState() {\n    super.initState();\n    subscription = SuperImposer.onChange.listen((final _) {\n      if (!mounted) return;\n      setState(() {});\n    });\n  }\n\n  @override\n  void dispose() {\n    subscription?.cancel();\n\n    super.dispose();\n  }\n\n  @override\n  Widget build(final BuildContext context) => Stack(\n        children: SuperImposer.entries.values\n            .map((final SuperImposerEntry x) => x.builder(context))\n            .toList(),\n      );\n}\n"
  },
  {
    "path": "lib/ui/components/toast.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../utils/exports.dart';\nimport 'super_imposer.dart';\n\nclass Toast extends StatefulWidget {\n  const Toast({\n    required this.content,\n    this.duration = defaultToastDuration,\n    this.animationDuration,\n    super.key,\n  });\n\n  final Widget content;\n  final Duration duration;\n  final Duration? animationDuration;\n\n  @override\n  State<Toast> createState() => _ToastState();\n\n  Future<void> show() async => showToast(this);\n\n  Duration get resolvedAnimationDuration =>\n      animationDuration ?? AnimationDurations.defaultNormalAnimation;\n\n  static const Duration defaultToastDuration = Duration(seconds: 3);\n\n  static Future<void> showToast(final Toast toast) async {\n    final SuperImposerEntry entry = SuperImposerEntry.create(\n      (final _) => Align(\n        alignment: Alignment.bottomCenter,\n        child: toast,\n      ),\n    );\n    SuperImposer.insert(entry);\n    await Future<void>.delayed(\n      toast.duration + (toast.resolvedAnimationDuration * 2),\n    );\n    SuperImposer.remove(entry);\n  }\n}\n\nclass _ToastState extends State<Toast> {\n  bool visible = false;\n\n  @override\n  void initState() {\n    super.initState();\n    Future<void>.microtask(() async {\n      setState(() {\n        visible = true;\n      });\n      await Future<void>.delayed(widget.duration);\n      if (!mounted) return;\n      setState(() {\n        visible = false;\n      });\n    });\n  }\n\n  @override\n  Widget build(final BuildContext context) => AnimatedSwitcher(\n        duration: widget.resolvedAnimationDuration,\n        transitionBuilder:\n            (final Widget child, final Animation<double> animation) =>\n                FadeScaleTransition(animation: animation, child: child),\n        child: visible\n            ? Padding(\n                padding: EdgeInsets.all(context.r.scale(0.4)),\n                child: SizedBox(\n                  width: double.infinity,\n                  child: Material(\n                    color: Colors.transparent,\n                    child: DecoratedBox(\n                      decoration: BoxDecoration(\n                        color: Theme.of(context).bottomAppBarTheme.color,\n                        borderRadius:\n                            BorderRadius.circular(context.r.scale(0.25)),\n                      ),\n                      child: Padding(\n                        padding: EdgeInsets.all(context.r.scale(0.5)),\n                        child: Row(\n                          children: <Widget>[\n                            widget.content,\n                          ],\n                        ),\n                      ),\n                    ),\n                  ),\n                ),\n              )\n            : const SizedBox.shrink(),\n      );\n}\n"
  },
  {
    "path": "lib/ui/exports.dart",
    "content": "export 'base.dart';\nexport 'components/exports.dart';\nexport 'keys.dart';\nexport 'router/exports.dart';\nexport 'utils/exports.dart';\n"
  },
  {
    "path": "lib/ui/keys.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nfinal GlobalKey<NavigatorState> gNavigatorKey = GlobalKey<NavigatorState>();\n"
  },
  {
    "path": "lib/ui/pages/_home/components/appbar.dart",
    "content": "import 'dart:async';\nimport 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\n\nclass UnderScoreHomePageAppBar extends StatefulWidget\n    implements PreferredSizeWidget {\n  const UnderScoreHomePageAppBar({\n    super.key,\n  });\n\n  @override\n  State<UnderScoreHomePageAppBar> createState() =>\n      _UnderScoreHomePageAppBarState();\n\n  @override\n  Size get preferredSize => const Size.fromHeight(kToolbarHeight);\n}\n\nclass _UnderScoreHomePageAppBarState extends State<UnderScoreHomePageAppBar> {\n  StreamSubscription<AppEvent>? appEventSubscription;\n\n  @override\n  void initState() {\n    super.initState();\n    appEventSubscription = AppEvents.stream.listen((final AppEvent event) {\n      if (event != AppEvent.anilistStateChange) return;\n      setState(() {});\n    });\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    appEventSubscription?.cancel();\n  }\n\n  @override\n  Widget build(final BuildContext context) => AppBar(\n        centerTitle: true,\n        title: Text(\n          AppMeta.name,\n          style: Theme.of(context).textTheme.headlineSmall!.copyWith(\n                fontFamily: Fonts.greatVibes,\n                color: Theme.of(context).textTheme.bodyLarge?.color,\n              ),\n        ),\n        actions: <Widget>[\n          Row(\n            children: <Widget>[\n              InkWell(\n                child: Padding(\n                  padding: EdgeInsets.all(context.r.scale(0.5)),\n                  child: AnilistAuth.user?.avatarLarge != null\n                      ? ClipRRect(\n                          borderRadius:\n                              BorderRadius.circular(context.r.scale(1)),\n                          child: Image.network(AnilistAuth.user!.avatarLarge!),\n                        )\n                      : ClipRRect(\n                          borderRadius:\n                              BorderRadius.circular(context.r.scale(0.2)),\n                          child: Image.asset(AssetPaths.anilistLogo),\n                        ),\n                ),\n                onTap: () {\n                  Navigator.of(context).pusher.pushToAnilistPage();\n                },\n              ),\n            ],\n          ),\n          SizedBox(width: context.r.scale(0.5)),\n        ],\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/_home/components/body.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport '../provider.dart';\n\nclass UnderScoreHomePageBody extends StatelessWidget {\n  const UnderScoreHomePageBody({\n    super.key,\n  });\n\n  Widget buildOnWaiting(final BuildContext context) => SizedBox(\n        height: context.r.scale(12),\n        child: const Center(child: CircularProgressIndicator()),\n      );\n\n  Widget buildCarousel({\n    required final BuildContext context,\n    required final StatedValue<List<AnilistMedia>> results,\n  }) =>\n      Padding(\n        padding: EdgeInsets.only(bottom: context.r.scale(1)),\n        child: StatedBuilder(\n          results.state,\n          waiting: buildOnWaiting,\n          processing: buildOnWaiting,\n          finished: (final _) => AnilistMediaRow(results.value),\n          failed: (final _) => Text('Error: ${results.error}'),\n        ),\n      );\n\n  Widget buildText(\n    final String text, {\n    required final BuildContext context,\n  }) =>\n      Padding(\n        padding: HorizontalBodyPadding.padding(context)\n            .copyWith(bottom: context.r.scale(0.75, md: 1)),\n        child: Text(text, style: Theme.of(context).textTheme.titleMedium),\n      );\n\n  Widget buildTrendsSlideshow(final StatedValue<List<AnilistMedia>> data) =>\n      StatedBuilder(\n        data.state,\n        waiting: buildOnWaiting,\n        processing: buildOnWaiting,\n        finished: (final BuildContext context) => SizedBox(\n          height: context.r.scale(25),\n          child: Slideshow(\n            slideDuration: defaultSlideDuration,\n            animationDuration: AnimationDurations.defaultNormalAnimation,\n            children: data.value\n                .map((final AnilistMedia x) => AnilistMediaSlide(x))\n                .toList(),\n          ),\n        ),\n        failed: (final _) => const Text('Error'),\n      );\n\n  Widget buildBody(final BuildContext context) {\n    final UnderScoreHomePageProvider provider =\n        context.watch<UnderScoreHomePageProvider>();\n\n    return switch (provider.type) {\n      TenkaType.anime => Column(\n          key: const ValueKey<TenkaType>(TenkaType.anime),\n          mainAxisSize: MainAxisSize.min,\n          crossAxisAlignment: CrossAxisAlignment.start,\n          children: <Widget>[\n            buildTrendsSlideshow(provider.trendingAnime),\n            SizedBox(height: context.r.scale(2)),\n            buildText(context.t.topOngoingAnime, context: context),\n            buildCarousel(\n              context: context,\n              results: provider.topOngoingAnime,\n            ),\n            SizedBox(height: context.r.scale(1)),\n            buildText(context.t.mostPopularAnime, context: context),\n            buildCarousel(\n              context: context,\n              results: provider.mostPopularAnime,\n            ),\n            SizedBox(height: context.r.scale(1)),\n          ],\n        ),\n      TenkaType.manga => Column(\n          key: const ValueKey<TenkaType>(TenkaType.manga),\n          mainAxisSize: MainAxisSize.min,\n          crossAxisAlignment: CrossAxisAlignment.start,\n          children: <Widget>[\n            buildTrendsSlideshow(provider.trendingManga),\n            SizedBox(height: context.r.scale(2)),\n            buildText(context.t.topOngoingManga, context: context),\n            buildCarousel(\n              context: context,\n              results: provider.topOngoingManga,\n            ),\n            SizedBox(height: context.r.scale(1)),\n            buildText(context.t.mostPopularManga, context: context),\n            buildCarousel(\n              context: context,\n              results: provider.mostPopularManga,\n            ),\n            SizedBox(height: context.r.scale(1)),\n          ],\n        ),\n    };\n  }\n\n  @override\n  Widget build(final BuildContext context) => PageTransitionSwitcher(\n        duration: AnimationDurations.defaultLongAnimation,\n        transitionBuilder: (\n          final Widget child,\n          final Animation<double> animation,\n          final Animation<double> secondaryAnimation,\n        ) =>\n            SharedAxisTransition(\n          transitionType: SharedAxisTransitionType.vertical,\n          fillColor: Colors.transparent,\n          animation: animation,\n          secondaryAnimation: secondaryAnimation,\n          child: child,\n        ),\n        layoutBuilder: (final List<Widget> children) =>\n            Stack(children: children),\n        child: buildBody(context),\n      );\n\n  static const Duration defaultSlideDuration = Duration(seconds: 5);\n}\n"
  },
  {
    "path": "lib/ui/pages/_home/components/bottombar.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport '../provider.dart';\n\nclass UnderScoreHomePageBottomBar extends StatelessWidget {\n  const UnderScoreHomePageBottomBar({\n    required this.provider,\n    super.key,\n  });\n\n  final UnderScoreHomePageProvider provider;\n\n  Future<void> showTypeModal({\n    required final BuildContext context,\n    required final UnderScoreHomePageProvider provider,\n  }) async {\n    await showModalBottomSheet(\n      context: context,\n      shape: RoundedRectangleBorder(\n        borderRadius:\n            BorderRadius.vertical(top: Radius.circular(context.r.scale(1))),\n      ),\n      builder: (final BuildContext context) => Padding(\n        padding: EdgeInsets.symmetric(vertical: context.r.scale(0.5)),\n        child: Column(\n          mainAxisSize: MainAxisSize.min,\n          children: <Widget>[\n            ...TenkaType.values.map(\n              (final TenkaType x) => RadioListTile<TenkaType>(\n                title: Text(x.getTitleCase(context.t)),\n                value: x,\n                groupValue: provider.type,\n                onChanged: (final TenkaType? type) {\n                  if (type == null) return;\n                  provider.setType(type);\n                  Navigator.of(context).pop();\n                },\n              ),\n            ),\n          ],\n        ),\n      ),\n    );\n  }\n\n  @override\n  Widget build(final BuildContext context) => Padding(\n        padding: EdgeInsets.symmetric(\n          horizontal: context.r.scale(1),\n          vertical: context.r.scale(0.5),\n        ),\n        child: SizedBox(\n          height: context.r.scale(2.5),\n          child: Row(\n            children: <Widget>[\n              Expanded(\n                child: Builder(\n                  builder: (final BuildContext context) => TextButton(\n                    style: TextButton.styleFrom(\n                      backgroundColor:\n                          Theme.of(context).colorScheme.surfaceVariant,\n                      padding: EdgeInsets.symmetric(\n                        vertical: context.r.scale(0.5),\n                      ),\n                    ),\n                    child: Row(\n                      mainAxisAlignment: MainAxisAlignment.center,\n                      children: <Widget>[\n                        SizedBox(width: context.r.scale(0.5)),\n                        Text(provider.type.getTitleCase(context.t)),\n                        const Icon(Icons.arrow_drop_up_rounded),\n                      ],\n                    ),\n                    onPressed: () {\n                      showTypeModal(context: context, provider: provider);\n                    },\n                  ),\n                ),\n              ),\n              SizedBox(width: context.r.scale(0.5)),\n              DecoratedBox(\n                decoration: BoxDecoration(\n                  color: Theme.of(context).colorScheme.surfaceVariant,\n                  borderRadius: BorderRadius.circular(context.r.scale(999)),\n                ),\n                child: IconTheme(\n                  data: IconThemeData(\n                    color: Theme.of(context).colorScheme.onSurfaceVariant,\n                    size: Theme.of(context).textTheme.titleSmall!.fontSize,\n                  ),\n                  child: Row(\n                    children: <Widget>[\n                      IconButton(\n                        icon: const Icon(Icons.search_rounded),\n                        onPressed: () {\n                          Navigator.of(context).pusher.pushToSearchPage();\n                        },\n                      ),\n                      SizedBox(width: context.r.scale(0.25)),\n                      IconButton(\n                        icon: const Icon(Icons.extension_rounded),\n                        onPressed: () {\n                          Navigator.of(context).pusher.pushToModulesPage();\n                        },\n                      ),\n                      SizedBox(width: context.r.scale(0.25)),\n                      IconButton(\n                        icon: const Icon(Icons.settings_rounded),\n                        onPressed: () {\n                          Navigator.of(context).pusher.pushToSettingsPage();\n                        },\n                      ),\n                    ],\n                  ),\n                ),\n              ),\n            ],\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/_home/components/exports.dart",
    "content": "export 'appbar.dart';\nexport 'body.dart';\nexport 'bottombar.dart';\n"
  },
  {
    "path": "lib/ui/pages/_home/provider.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass UnderScoreHomePageProvider extends StatedChangeNotifier {\n  TenkaType type = TenkaType.anime;\n\n  final StatedValue<List<AnilistMedia>> trendingAnime =\n      StatedValue<List<AnilistMedia>>();\n  final StatedValue<List<AnilistMedia>> topOngoingAnime =\n      StatedValue<List<AnilistMedia>>();\n  final StatedValue<List<AnilistMedia>> mostPopularAnime =\n      StatedValue<List<AnilistMedia>>();\n\n  final StatedValue<List<AnilistMedia>> trendingManga =\n      StatedValue<List<AnilistMedia>>();\n  final StatedValue<List<AnilistMedia>> topOngoingManga =\n      StatedValue<List<AnilistMedia>>();\n  final StatedValue<List<AnilistMedia>> mostPopularManga =\n      StatedValue<List<AnilistMedia>>();\n\n  Future<void> initialize() async {\n    final TenkaType? lastVisitedType = await getHomeLastVisited();\n    if (lastVisitedType != null && type != lastVisitedType) {\n      type = lastVisitedType;\n      notifyListeners();\n    }\n\n    fetch(type);\n  }\n\n  Future<void> setType(final TenkaType type) async {\n    this.type = type;\n    fetch(type);\n    notifyListeners();\n    await setHomeLastVisited(type);\n  }\n\n  void fetch(final TenkaType type) {\n    switch (type) {\n      case TenkaType.anime:\n        fetchTrendingAnimes();\n        fetchTopOngoingAnimes();\n        fetchMostPopularAnimes();\n\n      case TenkaType.manga:\n        fetchTrendingMangas();\n        fetchTopOngoingMangas();\n        fetchMostPopularMangas();\n    }\n  }\n\n  Future<void> fetchTrendingAnimes() async {\n    if (!trendingAnime.isWaiting) return;\n\n    try {\n      trendingAnime.finish(await AnilistMediaEndpoints.trendingAnimes());\n    } catch (error, stackTrace) {\n      trendingAnime.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  Future<void> fetchTopOngoingAnimes() async {\n    if (!topOngoingAnime.isWaiting) return;\n\n    try {\n      topOngoingAnime.finish(await AnilistMediaEndpoints.topOngoingAnimes());\n    } catch (error, stackTrace) {\n      topOngoingAnime.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  Future<void> fetchMostPopularAnimes() async {\n    if (!mostPopularAnime.isWaiting) return;\n\n    try {\n      mostPopularAnime.finish(await AnilistMediaEndpoints.mostPopularAnimes());\n    } catch (error, stackTrace) {\n      mostPopularAnime.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  Future<void> fetchTrendingMangas() async {\n    if (!trendingManga.isWaiting) return;\n\n    try {\n      trendingManga.finish(await AnilistMediaEndpoints.trendingMangas());\n    } catch (error, stackTrace) {\n      trendingManga.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  Future<void> fetchTopOngoingMangas() async {\n    if (!topOngoingManga.isWaiting) return;\n\n    try {\n      topOngoingManga.finish(await AnilistMediaEndpoints.topOngoingMangas());\n    } catch (error, stackTrace) {\n      topOngoingManga.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  Future<void> fetchMostPopularMangas() async {\n    if (!mostPopularManga.isWaiting) return;\n\n    try {\n      mostPopularManga.finish(await AnilistMediaEndpoints.mostPopularMangas());\n    } catch (error, stackTrace) {\n      mostPopularManga.fail(error, stackTrace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n\n  static const String kHomeLastVisitedKey = 'home_last_visited';\n\n  static Future<TenkaType?> getHomeLastVisited() async {\n    final String? value = await CacheDatabase.get<String?>(kHomeLastVisitedKey);\n    return value != null ? EnumUtils.find(TenkaType.values, value) : null;\n  }\n\n  static Future<void> setHomeLastVisited(final TenkaType type) async {\n    await CacheDatabase.set(kHomeLastVisitedKey, type.name);\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/_home/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'components/exports.dart';\nimport 'provider.dart';\n\nclass UnderScoreHomePage extends StatelessWidget {\n  const UnderScoreHomePage({\n    super.key,\n  });\n\n  @override\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<UnderScoreHomePageProvider>(\n        create: (final _) => UnderScoreHomePageProvider()..initialize(),\n        lazy: false,\n        child: Consumer<UnderScoreHomePageProvider>(\n          builder: (\n            final BuildContext context,\n            final UnderScoreHomePageProvider provider,\n            final _,\n          ) =>\n              Scaffold(\n            appBar: const UnderScoreHomePageAppBar(),\n            extendBody: true,\n            body: SingleChildScrollView(\n              padding: EdgeInsets.only(bottom: context.r.scale(2.5)),\n              child: const UnderScoreHomePageBody(),\n            ),\n            bottomNavigationBar:\n                UnderScoreHomePageBottomBar(provider: provider),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/_splash/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\n\nclass UnderScoreSplashPage extends StatelessWidget {\n  const UnderScoreSplashPage({\n    super.key,\n  });\n\n  @override\n  Widget build(final BuildContext context) => Scaffold(\n        body: Stack(\n          children: <Widget>[\n            Align(\n              child: Column(\n                mainAxisSize: MainAxisSize.min,\n                children: <Widget>[\n                  Text(\n                    AppMeta.name,\n                    style: Theme.of(context)\n                        .textTheme\n                        .displayMedium!\n                        .copyWith(fontFamily: Fonts.greatVibes),\n                  ),\n                  Text(\n                    'v${AppMeta.version}',\n                    style: Theme.of(context).textTheme.bodySmall,\n                  ),\n                ],\n              ),\n            ),\n            Align(\n              alignment: Alignment.bottomRight,\n              child: Padding(\n                padding: EdgeInsets.all(context.r.scale(1)),\n                child: Text(\n                  AppMeta.yuki,\n                  style: Theme.of(context)\n                      .textTheme\n                      .headlineMedium!\n                      .copyWith(color: Theme.of(context).colorScheme.primary),\n                ),\n              ),\n            ),\n          ],\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/exports.dart",
    "content": "export 'login.dart';\nexport 'profile/exports.dart';\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/login.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../../exports.dart';\n\nclass AnilistPageLoginBody extends StatelessWidget {\n  const AnilistPageLoginBody({\n    super.key,\n  });\n\n  @override\n  Widget build(final BuildContext context) => SingleChildScrollView(\n        padding: EdgeInsets.symmetric(\n          horizontal: HorizontalBodyPadding.paddingValue(context),\n          vertical: MediaQuery.of(context).size.height * 0.2,\n        ),\n        child: Column(\n          children: <Widget>[\n            Row(\n              mainAxisAlignment: MainAxisAlignment.center,\n              children: <Widget>[\n                Text(\n                  AppMeta.name,\n                  style: Theme.of(context)\n                      .textTheme\n                      .headlineLarge!\n                      .copyWith(fontFamily: Fonts.greatVibes),\n                ),\n                SizedBox(width: context.r.scale(1)),\n                Text(\n                  '+',\n                  style: Theme.of(context).textTheme.titleLarge!.copyWith(\n                        color: Theme.of(context)\n                            .textTheme\n                            .titleLarge!\n                            .color!\n                            .withOpacity(0.3),\n                      ),\n                ),\n                SizedBox(width: context.r.scale(1)),\n                ClipRRect(\n                  borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n                  child: SizedBox.square(\n                    dimension: context.r.scale(2.5),\n                    child: Image.asset(\n                      AssetPaths.anilistLogo,\n                      fit: BoxFit.cover,\n                    ),\n                  ),\n                ),\n              ],\n            ),\n            SizedBox(height: context.r.scale(1)),\n            const Divider(),\n            SizedBox(height: context.r.scale(1)),\n            Text(\n              context.t.trackYourProgressUsingAnilist,\n              style: Theme.of(context).textTheme.titleLarge,\n            ),\n            SizedBox(height: context.r.scale(1)),\n            TextButton.icon(\n              icon: const Icon(Icons.login_rounded),\n              label: Text(context.t.loginUsingAnilist),\n              style: TextButton.styleFrom(\n                backgroundColor: Theme.of(context).colorScheme.primary,\n                foregroundColor: Theme.of(context).colorScheme.onPrimary,\n                padding:\n                    EdgeInsets.symmetric(horizontal: context.r.scale(0.75)),\n                shape: RoundedRectangleBorder(\n                  borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n                ),\n              ),\n              onPressed: () async {\n                try {\n                  final bool didLaunch = await launchUrl(\n                    Uri.parse(AnilistAuth.oauthURL),\n                    mode: LaunchMode.externalApplication,\n                  );\n                  if (!didLaunch) {\n                    throw Exception('Failed to launch URL');\n                  }\n                } catch (err) {\n                  if (!context.mounted) return;\n                  Toast(\n                    content: Text(\n                      '${context.t.somethingWentWrong} $err',\n                    ), //dart(use_build_context_synchronously)\n                  ).show();\n                }\n              },\n            ),\n          ],\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/profile/body.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../../../exports.dart';\nimport 'provider.dart';\n\nclass AnilistPageProfileBodyBody extends StatelessWidget {\n  const AnilistPageProfileBodyBody({\n    required this.provider,\n    super.key,\n  });\n\n  final AnilistPageProfileProvider provider;\n\n  Widget buildOnWaiting(final BuildContext context) => SizedBox(\n        height: context.r.scale(12),\n        child: const Center(child: CircularProgressIndicator()),\n      );\n\n  Widget buildGridRow({\n    required final BuildContext context,\n    required final List<Widget> children,\n  }) =>\n      Padding(\n        padding: EdgeInsets.only(bottom: context.r.scale(1)),\n        child: Row(\n          crossAxisAlignment: CrossAxisAlignment.start,\n          children: ListUtils.insertBetween(\n            children.map((final Widget x) => Expanded(child: x)).toList(),\n            SizedBox(width: context.r.scale(1)),\n          ),\n        ),\n      );\n\n  String getMediaProgressText(final AnilistMedia media) => switch (media.type) {\n        AnilistMediaType.anime =>\n          '${media.mediaListEntry?.progress ?? 0}/${media.episodes ?? Translation.unk}',\n        AnilistMediaType.manga => <String>[\n            '${media.mediaListEntry?.progress ?? 0}/${media.episodes ?? 0}',\n            '(${media.mediaListEntry?.progressVolumes ?? 0}/${media.volumes ?? Translation.unk})',\n          ].join(' '),\n      };\n\n  List<Widget> buildTiles({\n    required final BuildContext context,\n    required final List<AnilistMedia> list,\n  }) =>\n      list\n          .map(\n            (final AnilistMedia x) => AnilistMediaTile(\n              x,\n              additionalBottomChips: <Widget>[\n                AnilistMediaTile.buildChip(\n                  context: context,\n                  backgroundColor: Theme.of(context).colorScheme.primary,\n                  textColor: Theme.of(context).colorScheme.onPrimary,\n                  child: Text(getMediaProgressText(x)),\n                ),\n              ],\n            ),\n          )\n          .toList();\n\n  @override\n  Widget build(final BuildContext context) => Padding(\n        padding: EdgeInsets.symmetric(\n          horizontal: HorizontalBodyPadding.paddingValue(context),\n          vertical: context.r.scale(0.5),\n        ),\n        child: StatedBuilder(\n          provider.list.state,\n          waiting: buildOnWaiting,\n          processing: buildOnWaiting,\n          finished: (final _) => Column(\n            children: ListUtils.chunk(\n              buildTiles(context: context, list: provider.list.value.last),\n              2,\n              const SizedBox.shrink(),\n            )\n                .map(\n                  (final List<Widget> x) =>\n                      buildGridRow(context: context, children: x),\n                )\n                .toList(),\n          ),\n          failed: (final _) => Text('Error: ${provider.list.error}'),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/profile/exports.dart",
    "content": "export 'wrapper.dart';\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/profile/hero.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../../../exports.dart';\nimport 'provider.dart';\n\nclass AnilistPageProfileBodyHero extends StatelessWidget {\n  const AnilistPageProfileBodyHero({\n    required this.provider,\n    super.key,\n  });\n\n  final AnilistPageProfileProvider provider;\n\n  Widget buildStatisticsChild({\n    required final BuildContext context,\n    required final String title,\n    required final String value,\n  }) =>\n      RichText(\n        text: TextSpan(\n          children: <InlineSpan>[\n            TextSpan(\n              text: '$title: ',\n              style: Theme.of(context).textTheme.bodySmall,\n            ),\n            TextSpan(\n              text: value,\n              style: Theme.of(context).textTheme.bodySmall!.copyWith(\n                    fontWeight: FontWeight.bold,\n                    color: Theme.of(context).colorScheme.primary,\n                  ),\n            ),\n          ],\n        ),\n        textAlign: TextAlign.center,\n      );\n\n  List<Widget> buildStatisticsTiles(final BuildContext context) {\n    switch (provider.category.type) {\n      case AnilistMediaType.anime:\n        final AnilistUserStatistics? stats = user.animeStatistics;\n        return <Widget>[\n          buildStatisticsChild(\n            context: context,\n            title: context.t.totalAnime,\n            value: stats?.count.toString() ?? Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.episodesWatched,\n            value: stats?.episodesWatched.toString() ?? Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.timeSpent,\n            value: stats?.minutesWatched != null\n                ? PrettyDurations.prettyHoursMinutesShort(\n                    context.t,\n                    Duration(minutes: stats!.minutesWatched!),\n                  )\n                : Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.meanScore,\n            value: stats != null ? '${stats.meanScore}%' : Translation.unk,\n          ),\n        ];\n\n      case AnilistMediaType.manga:\n        final AnilistUserStatistics? stats = user.mangaStatistics;\n        return <Widget>[\n          buildStatisticsChild(\n            context: context,\n            title: context.t.totalManga,\n            value: stats?.count.toString() ?? Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.volumesRead,\n            value: stats?.volumesRead.toString() ?? Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.chaptersRead,\n            value: stats?.chaptersRead.toString() ?? Translation.unk,\n          ),\n          buildStatisticsChild(\n            context: context,\n            title: context.t.meanScore,\n            value: stats != null ? '${stats.meanScore}%' : Translation.unk,\n          ),\n        ];\n    }\n  }\n\n  Widget buildHeroContent(final BuildContext context) => Row(\n        mainAxisSize: MainAxisSize.min,\n        crossAxisAlignment: CrossAxisAlignment.end,\n        children: <Widget>[\n          ClipRRect(\n            borderRadius: BorderRadius.circular(context.r.scale(0.25)),\n            child: SizedBox(\n              height: context.r.scale(5),\n              child: user.avatarLarge != null\n                  ? Image.network(\n                      user.avatarLarge!,\n                      fit: BoxFit.cover,\n                    )\n                  : Image.asset(AssetPaths.anilistLogo),\n            ),\n          ),\n          SizedBox(width: context.r.scale(1)),\n          Expanded(\n            child: Column(\n              mainAxisSize: MainAxisSize.min,\n              crossAxisAlignment: CrossAxisAlignment.start,\n              children: <Widget>[\n                ...buildStatisticsTiles(context),\n                const Divider(),\n                Text(\n                  user.name,\n                  style: Theme.of(context).textTheme.titleLarge!.copyWith(\n                        fontWeight: FontWeight.bold,\n                      ),\n                ),\n              ],\n            ),\n          ),\n        ],\n      );\n\n  @override\n  Widget build(final BuildContext context) => SliverList(\n        delegate: SliverChildListDelegate.fixed(\n          <Widget>[\n            Container(\n              color: Theme.of(context).bottomAppBarTheme.color,\n              height: context.r.scale(10),\n              child: Stack(\n                children: <Widget>[\n                  if (user.bannerImage != null)\n                    Positioned.fill(\n                      child: Image.network(\n                        user.bannerImage!,\n                        fit: BoxFit.cover,\n                      ),\n                    ),\n                  Positioned.fill(\n                    child: DecoratedBox(\n                      decoration: BoxDecoration(\n                        gradient: LinearGradient(\n                          begin: Alignment.topCenter,\n                          end: Alignment.bottomCenter,\n                          colors: <Color>[\n                            Colors.transparent,\n                            Theme.of(context)\n                                .bottomAppBarTheme\n                                .color!\n                                .withOpacity(0.75),\n                          ],\n                        ),\n                      ),\n                      child: const SizedBox.expand(),\n                    ),\n                  ),\n                  Align(\n                    alignment: Alignment.bottomCenter,\n                    child: Padding(\n                      padding: EdgeInsets.all(\n                        HorizontalBodyPadding.paddingValue(context),\n                      ),\n                      child: buildHeroContent(context),\n                    ),\n                  ),\n                ],\n              ),\n            ),\n          ],\n        ),\n      );\n\n  AnilistUser get user => provider.pageProvider.user!;\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/profile/provider.dart",
    "content": "import 'dart:async';\nimport 'package:kazahana/core/exports.dart';\nimport '../../../provider.dart';\n\nclass AnilistProfileCategory {\n  const AnilistProfileCategory(this.type, this.status);\n\n  factory AnilistProfileCategory.parse(final String value) {\n    final List<String> split = value.split('_');\n    return AnilistProfileCategory(\n      parseAnilistMediaType(split.first),\n      parseAnilistMediaListStatus(split.last),\n    );\n  }\n\n  final AnilistMediaType type;\n  final AnilistMediaListStatus status;\n\n  AnilistProfileCategory copyWith({\n    final AnilistMediaType? type,\n    final AnilistMediaListStatus? status,\n  }) =>\n      AnilistProfileCategory(type ?? this.type, status ?? this.status);\n\n  String get stringify => '${type.stringify}_${status.stringify}';\n\n  @override\n  bool operator ==(final Object other) =>\n      other is AnilistProfileCategory &&\n      type == other.type &&\n      status == other.status;\n\n  @override\n  int get hashCode => Object.hash(type, status);\n}\n\nclass AnilistPageProfileProvider extends StatedChangeNotifier {\n  AnilistPageProfileProvider(this.pageProvider);\n\n  final AnilistPageProvider pageProvider;\n\n  AnilistProfileCategory category = const AnilistProfileCategory(\n    AnilistMediaType.anime,\n    AnilistMediaListStatus.current,\n  );\n  final StatedValue<TwinTuple<AnilistProfileCategory, List<AnilistMedia>>>\n      list =\n      StatedValue<TwinTuple<AnilistProfileCategory, List<AnilistMedia>>>();\n\n  Future<void> initialize() async {\n    final AnilistProfileCategory? lastVisitedCategory =\n        await getAnilistLastVisitedCategory();\n    if (lastVisitedCategory != null && lastVisitedCategory != category) {\n      category = lastVisitedCategory;\n      notifyListeners();\n    }\n\n    fetch();\n  }\n\n  Future<void> change(final AnilistProfileCategory nCategory) async {\n    if (category == nCategory) return;\n    category = nCategory;\n    await setAnilistLastVisitedCategory(category);\n    await fetch();\n  }\n\n  Future<void> fetch() async {\n    if (list.hasFinished && list.value.first == category) return;\n    list.waiting();\n    notifyListeners();\n\n    try {\n      list.finish(\n        TwinTuple<AnilistProfileCategory, List<AnilistMedia>>(\n          category,\n          await AnilistMediaListEndpoints.fetch(\n            userId: pageProvider.user!.id,\n            type: category.type,\n            status: category.status,\n            sort: AnilistMediaListSort.addedTimeDesc,\n          ),\n        ),\n      );\n    } catch (error, stackTrace) {\n      list.fail(error, stackTrace);\n    }\n    notifyListeners();\n  }\n\n  static const String kAnilistLastVisitedCategoryKey =\n      'anilist_last_visited_list';\n\n  static Future<AnilistProfileCategory?> getAnilistLastVisitedCategory() async {\n    final String? value =\n        await CacheDatabase.get<String?>(kAnilistLastVisitedCategoryKey);\n    return value != null ? AnilistProfileCategory.parse(value) : null;\n  }\n\n  static Future<void> setAnilistLastVisitedCategory(\n    final AnilistProfileCategory category,\n  ) async {\n    await CacheDatabase.set(kAnilistLastVisitedCategoryKey, category.stringify);\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/body/profile/wrapper.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../../../exports.dart';\nimport '../../../provider.dart';\nimport 'body.dart';\nimport 'hero.dart';\nimport 'provider.dart';\n\nclass AnilistPageProfileBody extends StatefulWidget {\n  const AnilistPageProfileBody({\n    required this.provider,\n    super.key,\n  });\n\n  final AnilistPageProvider provider;\n\n  @override\n  State<AnilistPageProfileBody> createState() => _AnilistPageProfileBodyState();\n}\n\nclass _AnilistPageProfileBodyState extends State<AnilistPageProfileBody> {\n  @override\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<AnilistPageProfileProvider>(\n        create: (final _) =>\n            AnilistPageProfileProvider(widget.provider)..initialize(),\n        builder: (final BuildContext context, final _) =>\n            Consumer<AnilistPageProfileProvider>(\n          builder: (\n            final BuildContext context,\n            final AnilistPageProfileProvider provider,\n            final _,\n          ) =>\n              NestedScrollView(\n            headerSliverBuilder: (\n              final BuildContext context,\n              final bool innerBoxIsScrolled,\n            ) =>\n                <Widget>[\n              AnilistPageProfileBodyHero(provider: provider),\n              SliverOverlapAbsorber(\n                handle:\n                    NestedScrollView.sliverOverlapAbsorberHandleFor(context),\n                sliver: SliverPersistentHeader(\n                  pinned: true,\n                  floating: true,\n                  delegate: _AnilistControlsHeaderDelegate(provider),\n                ),\n              ),\n            ],\n            body: CustomScrollView(\n              slivers: <Widget>[\n                Builder(\n                  builder: (final BuildContext context) =>\n                      SliverOverlapInjector(\n                    handle: NestedScrollView.sliverOverlapAbsorberHandleFor(\n                      context,\n                    ),\n                  ),\n                ),\n                SliverToBoxAdapter(\n                  child: AnilistPageProfileBodyBody(provider: provider),\n                ),\n              ],\n            ),\n          ),\n        ),\n      );\n}\n\nclass _AnilistControlsHeaderDelegate extends SliverPersistentHeaderDelegate {\n  const _AnilistControlsHeaderDelegate(this.provider);\n\n  final AnilistPageProfileProvider provider;\n\n  Future<void> showButtonOptionsModal<T>({\n    required final BuildContext context,\n    required final T value,\n    required final List<T> values,\n    required final Map<T, String> labels,\n    required final void Function(T) onChange,\n  }) async {\n    await showModalBottomSheet(\n      context: context,\n      shape: RoundedRectangleBorder(\n        borderRadius:\n            BorderRadius.vertical(top: Radius.circular(context.r.scale(1))),\n      ),\n      builder: (final BuildContext context) => Padding(\n        padding: EdgeInsets.symmetric(vertical: context.r.scale(0.5)),\n        child: Column(\n          mainAxisSize: MainAxisSize.min,\n          children: values\n              .map(\n                (final T x) => RadioListTile<T>(\n                  title: Text(labels[x]!),\n                  value: x,\n                  groupValue: value,\n                  onChanged: (final T? type) {\n                    if (type == null) return;\n                    onChange(type);\n                    Navigator.of(context).pop();\n                  },\n                ),\n              )\n              .toList(),\n        ),\n      ),\n    );\n  }\n\n  Widget buildButton<T>({\n    required final BuildContext context,\n    required final T value,\n    required final List<T> values,\n    required final Map<T, String> labels,\n    required final void Function(T) onChange,\n  }) =>\n      SizedBox(\n        height: buttonHeight,\n        child: TextButton(\n          style: TextButton.styleFrom(\n            backgroundColor: Theme.of(context).bottomAppBarTheme.color,\n            shape: RoundedRectangleBorder(\n              borderRadius: BorderRadius.circular(context.r.scale(0.25)),\n            ),\n          ),\n          child: Row(\n            mainAxisAlignment: MainAxisAlignment.center,\n            children: <Widget>[\n              SizedBox(width: context.r.scale(0.5)),\n              Text(labels[value]!),\n              const Icon(Icons.arrow_drop_down_rounded),\n            ],\n          ),\n          onPressed: () async {\n            await showButtonOptionsModal(\n              context: context,\n              value: value,\n              values: values,\n              labels: labels,\n              onChange: onChange,\n            );\n          },\n        ),\n      );\n\n  @override\n  Widget build(final BuildContext context, final _, final __) => ColoredBox(\n        color: Theme.of(context).scaffoldBackgroundColor,\n        child: Column(\n          children: <Widget>[\n            SizedBox(height: verticalPaddingSize),\n            Padding(\n              padding: EdgeInsets.symmetric(\n                horizontal: verticalPaddingSize,\n              ),\n              child: Row(\n                children: <Widget>[\n                  Expanded(\n                    child: buildButton<AnilistMediaType>(\n                      context: context,\n                      value: provider.category.type,\n                      values: AnilistMediaType.values,\n                      labels: AnilistMediaType.values.asMap().map(\n                            (final _, final AnilistMediaType x) =>\n                                MapEntry<AnilistMediaType, String>(\n                              x,\n                              x.asTenkaType.getTitleCase(context.t),\n                            ),\n                          ),\n                      onChange: (final AnilistMediaType value) {\n                        provider.change(\n                          provider.category.copyWith(type: value),\n                        );\n                      },\n                    ),\n                  ),\n                  SizedBox(width: verticalPaddingSize),\n                  Expanded(\n                    child: buildButton<AnilistMediaListStatus>(\n                      context: context,\n                      value: provider.category.status,\n                      values: AnilistMediaListStatus.values,\n                      labels: AnilistMediaListStatus.values.asMap().map(\n                            (final _, final AnilistMediaListStatus x) =>\n                                MapEntry<AnilistMediaListStatus, String>(\n                              x,\n                              x.getTitleCase(context.t),\n                            ),\n                          ),\n                      onChange: (final AnilistMediaListStatus value) {\n                        provider.change(\n                          provider.category.copyWith(status: value),\n                        );\n                      },\n                    ),\n                  ),\n                ],\n              ),\n            ),\n            SizedBox(height: verticalPaddingSize),\n            const Divider(height: 1, thickness: 1),\n          ],\n        ),\n      );\n\n  @override\n  bool shouldRebuild(final _AnilistControlsHeaderDelegate oldDelegate) => true;\n\n  @override\n  double get minExtent => fixedHeight;\n\n  @override\n  double get maxExtent => fixedHeight;\n\n  static double get buttonHeight =>\n      RelativeScaleData.fromSettingsNoResponsive().scale(2);\n\n  static double get verticalPaddingSize =>\n      RelativeScaleData.fromSettingsNoResponsive().scale(0.3);\n\n  static double get fixedHeight => buttonHeight + (verticalPaddingSize * 2) + 1;\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/components/exports.dart",
    "content": "export 'body/exports.dart';\n"
  },
  {
    "path": "lib/ui/pages/anilist/provider.dart",
    "content": "import 'dart:async';\nimport 'package:kazahana/core/exports.dart';\n\nclass AnilistPageProvider extends StatedChangeNotifier {\n  StreamSubscription<AppEvent>? appEventSubscription;\n\n  void initialize() {\n    fetch();\n\n    appEventSubscription = AppEvents.stream.listen((final AppEvent event) {\n      if (mounted && event == AppEvent.anilistStateChange) {\n        notifyListeners();\n        fetch();\n      }\n    });\n  }\n\n  @override\n  void dispose() {\n    appEventSubscription?.cancel();\n\n    super.dispose();\n  }\n\n  Future<void> fetch() async {}\n\n  AnilistUser? get user => AnilistAuth.user;\n  bool get isLoggedIn => user != null;\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/route.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass AnilistPageRoute extends RoutePage {\n  @override\n  bool matches(final RouteInfo route) => route.name == routeName;\n\n  @override\n  Widget build(final RouteInfo route) => const AnilistPage();\n\n  static const String routeName = '/anilist';\n}\n\nextension AnilistPageRouteUtils on RoutePusher {\n  Future<void> pushToAnilistPage() =>\n      navigator.pushNamed(AnilistPageRoute.routeName);\n}\n"
  },
  {
    "path": "lib/ui/pages/anilist/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'components/exports.dart';\nimport 'provider.dart';\n\nclass AnilistPage extends StatelessWidget {\n  const AnilistPage({\n    super.key,\n  });\n\n  @override\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<AnilistPageProvider>(\n        create: (final _) => AnilistPageProvider()..initialize(),\n        child: Consumer<AnilistPageProvider>(\n          builder: (\n            final BuildContext context,\n            final AnilistPageProvider provider,\n            final _,\n          ) =>\n              Scaffold(\n            appBar: AppBar(title: Text(context.t.anilist)),\n            body: provider.isLoggedIn\n                ? AnilistPageProfileBody(provider: provider)\n                : const AnilistPageLoginBody(),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/home/route.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass HomePageRoute extends RoutePage {\n  @override\n  bool matches(final RouteInfo route) => route.name == routeName;\n\n  @override\n  Widget build(final RouteInfo route) => const HomePage();\n\n  static const String routeName = '/';\n}\n\nextension HomePageRouteUtils on RoutePusher {\n  Future<void> pushToViewPage() => navigator.pushNamed(HomePageRoute.routeName);\n}\n"
  },
  {
    "path": "lib/ui/pages/home/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport '../_home/view.dart';\nimport '../_splash/view.dart';\n\nclass HomePage extends StatefulWidget {\n  const HomePage({\n    super.key,\n  });\n\n  @override\n  State<HomePage> createState() => _HomePageState();\n}\n\nclass _HomePageState extends State<HomePage> {\n  @override\n  void initState() {\n    super.initState();\n    AppLoader.initialize().then((final _) async {\n      if (mounted) {\n        setState(() {});\n      }\n    });\n  }\n\n  @override\n  Widget build(final BuildContext context) => PageTransitionSwitcher(\n        duration: AnimationDurations.defaultLongAnimation,\n        transitionBuilder: (\n          final Widget child,\n          final Animation<double> animation,\n          final Animation<double> secondaryAnimation,\n        ) =>\n            FadeThroughTransition(\n          animation: animation,\n          secondaryAnimation: secondaryAnimation,\n          child: child,\n        ),\n        child: AppLoader.ready\n            ? const UnderScoreHomePage()\n            : const UnderScoreSplashPage(),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/modules/provider.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass ModulesPageProvider extends StatedChangeNotifier {\n  final Set<String> installing = <String>{};\n  final Set<String> uninstalling = <String>{};\n\n  Future<void> install(final TenkaMetadata metadata) async {\n    installing.add(metadata.id);\n    notifyListeners();\n    await TenkaManager.repository.install(metadata);\n    if (!mounted) return;\n    installing.remove(metadata.id);\n    notifyListeners();\n  }\n\n  Future<void> uninstall(final TenkaMetadata metadata) async {\n    uninstalling.add(metadata.id);\n    notifyListeners();\n    await TenkaManager.repository.uninstall(metadata);\n    if (!mounted) return;\n    uninstalling.remove(metadata.id);\n    notifyListeners();\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/modules/route.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass ModulesPageRoute extends RoutePage {\n  @override\n  bool matches(final RouteInfo route) => route.name == routeName;\n\n  @override\n  Widget build(final RouteInfo route) => const ModulesPage();\n\n  static const String routeName = '/modules';\n}\n\nextension ModulesPageRouteUtils on RoutePusher {\n  Future<void> pushToModulesPage() => navigator.pushNamed(ModulesPageRoute.routeName);\n}\n"
  },
  {
    "path": "lib/ui/pages/modules/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'provider.dart';\n\nclass ModulesPage extends StatelessWidget {\n  const ModulesPage({\n    super.key,\n  });\n\n  VoidCallback createOnPressed({\n    required final ModulesPageProvider provider,\n    required final TenkaMetadata metadata,\n  }) =>\n      () {\n        if (TenkaManager.repository.isInstalled(metadata)) {\n          provider.uninstall(metadata);\n          return;\n        }\n        provider.install(metadata);\n      };\n\n  Widget buildModuleTile({\n    required final BuildContext context,\n    required final ModulesPageProvider provider,\n    required final TenkaMetadata metadata,\n  }) {\n    final bool isInstalling = provider.installing.contains(metadata.id);\n    final bool isUninstalling = provider.uninstalling.contains(metadata.id);\n    final bool isInstalled = TenkaManager.repository.isInstalled(metadata);\n\n    final IconData icon;\n    Color? iconColor;\n    if (isInstalling) {\n      icon = Icons.hourglass_bottom_rounded;\n    } else if (isUninstalling) {\n      icon = Icons.hourglass_bottom_rounded;\n    } else if (isInstalled) {\n      icon = Icons.done_rounded;\n      iconColor = Theme.of(context).colorScheme.primary;\n    } else {\n      icon = Icons.add_rounded;\n      iconColor = Theme.of(context).colorScheme.primary;\n    }\n\n    final VoidCallback? onPressed = isInstalling || isUninstalling\n        ? null\n        : createOnPressed(provider: provider, metadata: metadata);\n\n    return ListTile(\n      contentPadding: EdgeInsets.only(\n        left: context.r.scale(0.75),\n        right: context.r.scale(0.25),\n      ),\n      leading: SizedBox(\n        height: double.infinity,\n        child: SizedBox.square(\n          dimension: context.r.scale(1.5),\n          child: Image.network(\n            TenkaManager.repository.resolver\n                .resolveURL((metadata.thumbnail as TenkaCloudDS).url),\n          ),\n        ),\n      ),\n      title: RichText(\n        text: TextSpan(\n          children: <InlineSpan>[\n            TextSpan(text: metadata.name),\n            if (metadata.nsfw)\n              TextSpan(\n                text: '  (${context.t.nsfw})',\n                style: Theme.of(context)\n                    .textTheme\n                    .labelSmall\n                    ?.copyWith(color: ForegroundColors.red),\n              ),\n          ],\n          style: Theme.of(context).textTheme.titleSmall,\n        ),\n      ),\n      subtitle: Text(\n        <String>[\n          metadata.type.getTitleCase(context.t),\n          context.t.byX(metadata.author),\n          'v${metadata.version}',\n        ].join(' / '),\n      ),\n      trailing: IconButton(\n        icon: Icon(icon, color: iconColor),\n        onPressed: onPressed,\n      ),\n      onTap: onPressed,\n    );\n  }\n\n  @override\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<ModulesPageProvider>(\n        create: (final _) => ModulesPageProvider(),\n        child: Consumer<ModulesPageProvider>(\n          builder: (\n            final BuildContext context,\n            final ModulesPageProvider provider,\n            final _,\n          ) =>\n              Scaffold(\n            appBar: AppBar(title: Text(context.t.extensions)),\n            body: SingleChildScrollView(\n              child: Column(\n                children: TenkaManager.repository.store.modules.values\n                    .sortedBy((final TenkaMetadata x) => x.name)\n                    .map(\n                      (final TenkaMetadata x) => buildModuleTile(\n                        context: context,\n                        provider: provider,\n                        metadata: x,\n                      ),\n                    )\n                    .toList(),\n              ),\n            ),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/search/components/exports.dart",
    "content": "export 'results_grid.dart';\nexport 'search_bar.dart';\n"
  },
  {
    "path": "lib/ui/pages/search/components/results_grid.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\n\nclass ResultsGrid extends StatelessWidget {\n  const ResultsGrid(\n    this.results, {\n    super.key,\n  });\n\n  final List<AnilistMedia> results;\n\n  Widget buildGridRow({\n    required final BuildContext context,\n    required final List<Widget> children,\n  }) =>\n      Padding(\n        padding: EdgeInsets.only(bottom: context.r.scale(1)),\n        child: Row(\n          children: ListUtils.insertBetween(\n            children.map((final Widget x) => Expanded(child: x)).toList(),\n            SizedBox(width: context.r.scale(1)),\n          ),\n        ),\n      );\n\n  List<Widget> buildTiles({\n    required final BuildContext context,\n  }) =>\n      results.map((final AnilistMedia x) => AnilistMediaTile(x)).toList();\n\n  @override\n  Widget build(final BuildContext context) => Column(\n        children: ListUtils.chunk(buildTiles(context: context), 2)\n            .map(\n              (final List<Widget> x) =>\n                  buildGridRow(context: context, children: x),\n            )\n            .toList(),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/search/components/search_bar.dart",
    "content": "import 'dart:async';\nimport 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport '../provider.dart';\n\nclass SearchBar extends StatefulWidget implements PreferredSizeWidget {\n  const SearchBar({\n    super.key,\n  });\n\n  @override\n  State<SearchBar> createState() => _SearchBarState();\n\n  @override\n  // TODO: Do something about this\n  // Size get preferredSize => Size.fromHeight(context.r.size(2.5));\n  Size get preferredSize => const Size.fromHeight(50);\n}\n\nclass _SearchBarState extends State<SearchBar> {\n  late final TextEditingController textEditingController;\n  String? lastInputText;\n  int? lastInputTime;\n  Timer? searchTimer;\n\n  @override\n  void initState() {\n    super.initState();\n    textEditingController = TextEditingController();\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    searchTimer?.cancel();\n    textEditingController.dispose();\n  }\n\n  void onInputChange(\n    final String input, {\n    required final SearchPageProvider provider,\n  }) {\n    if (lastInputText == input) return;\n\n    searchTimer?.cancel();\n    searchTimer = Timer(\n      const Duration(milliseconds: defaultInputTimeInterval),\n      () => provider.search(textEditingController.text),\n    );\n    lastInputTime = DateTime.now().millisecondsSinceEpoch;\n    lastInputText = input;\n  }\n\n  void onCloseButtonTap(final SearchPageProvider provider) {\n    if (textEditingController.text.isNotEmpty) {\n      textEditingController.clear();\n      provider.reset();\n      return;\n    }\n\n    Navigator.of(context).pop();\n  }\n\n  @override\n  Widget build(final BuildContext context) => Consumer<SearchPageProvider>(\n        builder: (\n          final BuildContext context,\n          final SearchPageProvider provider,\n          final _,\n        ) =>\n            SafeArea(\n          child: Padding(\n            padding: EdgeInsets.symmetric(\n              horizontal: context.r.scale(0.75),\n              vertical: context.r.scale(0.5),\n            ),\n            child: SizedBox(\n              height: context.r.scale(1.5),\n              child: DecoratedBox(\n                decoration: BoxDecoration(\n                  borderRadius: BorderRadius.circular(context.r.scale(0.25)),\n                  // TODO\n                  // color: Theme.of(context).appBarTheme.backgroundColor,\n                ),\n                child: Row(\n                  mainAxisAlignment: MainAxisAlignment.center,\n                  children: <Widget>[\n                    SizedBox(width: context.r.scale(0.5)),\n                    Icon(\n                      Icons.search_rounded,\n                      size: Theme.of(context).textTheme.bodyLarge?.fontSize,\n                      color: Theme.of(context).textTheme.bodySmall?.color,\n                    ),\n                    SizedBox(width: context.r.scale(0.4)),\n                    Expanded(\n                      child: Padding(\n                        padding: EdgeInsets.only(bottom: context.r.scale(0.2)),\n                        child: TextField(\n                          textAlignVertical: TextAlignVertical.center,\n                          textCapitalization: TextCapitalization.words,\n                          controller: textEditingController,\n                          autofocus: true,\n                          decoration: InputDecoration.collapsed(\n                            hintText: context.t.searchAnAnimeOrManga,\n                          ),\n                          onChanged: (final String input) =>\n                              onInputChange(input, provider: provider),\n                        ),\n                      ),\n                    ),\n                    SizedBox(width: context.r.scale(0.4)),\n                    Material(\n                      color: Colors.transparent,\n                      child: InkWell(\n                        borderRadius: BorderRadius.circular(context.r.scale(1)),\n                        child: Padding(\n                          padding: EdgeInsets.all(context.r.scale(0.2)),\n                          child: Icon(\n                            Icons.close_rounded,\n                            size:\n                                Theme.of(context).textTheme.bodyLarge?.fontSize,\n                            color: Theme.of(context).textTheme.bodySmall?.color,\n                          ),\n                        ),\n                        onTap: () => onCloseButtonTap(provider),\n                      ),\n                    ),\n                    SizedBox(width: context.r.scale(0.2)),\n                  ],\n                ),\n              ),\n            ),\n          ),\n        ),\n      );\n\n  static const int defaultInputTimeInterval = 500;\n}\n"
  },
  {
    "path": "lib/ui/pages/search/provider.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass SearchPageProvider extends StatedChangeNotifier {\n  final StatedValue<TwinTuple<String, List<AnilistMedia>>> results =\n      StatedValue<TwinTuple<String, List<AnilistMedia>>>();\n\n  void reset() {\n    results.waiting();\n    notifyListeners();\n  }\n\n  Future<void> search(final String terms) async {\n    results.loading();\n    notifyListeners();\n\n    try {\n      results.finish(\n        TwinTuple<String, List<AnilistMedia>>(\n          terms,\n          await AnilistMediaEndpoints.search(terms),\n        ),\n      );\n    } catch (err, trace) {\n      results.fail(err, trace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/search/route.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass SearchPageRoute extends RoutePage {\n  @override\n  bool matches(final RouteInfo route) => route.name == routeName;\n\n  @override\n  Widget build(final RouteInfo route) => const SearchPage();\n\n  static const String routeName = '/search';\n}\n\nextension SearchPageRouteUtils on RoutePusher {\n  Future<void> pushToSearchPage() =>\n      navigator.pushNamed(SearchPageRoute.routeName);\n}\n"
  },
  {
    "path": "lib/ui/pages/search/view.dart",
    "content": "import 'package:kazahana/core/exports.dart' hide SearchBar;\nimport '../../exports.dart';\nimport 'components/exports.dart';\nimport 'provider.dart';\n\nclass SearchPage extends StatefulWidget {\n  const SearchPage({\n    super.key,\n  });\n\n  @override\n  State<SearchPage> createState() => _SearchPageState();\n}\n\nclass _SearchPageState extends State<SearchPage> {\n  @override\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<SearchPageProvider>(\n        create: (final _) => SearchPageProvider(),\n        child: Consumer<SearchPageProvider>(\n          builder: (\n            final BuildContext context,\n            final SearchPageProvider provider,\n            final _,\n          ) =>\n              Scaffold(\n            appBar: const SearchBar(),\n            body: SingleChildScrollView(\n              padding: EdgeInsets.symmetric(\n                horizontal: context.r.scale(0.75),\n                vertical: context.r.scale(0.25),\n              ),\n              child: StatedBuilder(\n                provider.results.state,\n                waiting: (final _) => const SizedBox.shrink(),\n                processing: (final _) => SizedBox(\n                  height: MediaQuery.of(context).size.height / 1.5,\n                  child: const Center(child: CircularProgressIndicator()),\n                ),\n                finished: (final _) => ResultsGrid(provider.results.value.last),\n                failed: (final _) => Text(provider.results.error.toString()),\n              ),\n            ),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/settings/components/appearance.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport 'tiles/exports.dart';\n\nclass ApperanceSettings extends StatefulWidget {\n  const ApperanceSettings({\n    super.key,\n  });\n\n  @override\n  State<ApperanceSettings> createState() => _ApperanceSettingsState();\n}\n\nclass _ApperanceSettingsState extends State<ApperanceSettings> {\n  Future<void> saveSettings() async {\n    await SettingsDatabase.save();\n    if (!mounted) return;\n    setState(() {});\n  }\n\n  @override\n  Widget build(final BuildContext context) => SettingsBodyWrapper(\n        child: Column(\n          children: <Widget>[\n            MultiChoiceListTile<String>(\n              title: Text(context.t.accentColor),\n              secondary: const Icon(Icons.format_color_fill_rounded),\n              value: SettingsDatabase.settings.primaryColor ??\n                  ThemerThemeData.defaultForegroundName,\n              items: ForegroundColors.names().asMap().map(\n                    (final _, final String name) => MapEntry<String, Widget>(\n                      name,\n                      Text(ForegroundColors.getTitleCase(context.t, name)),\n                    ),\n                  ),\n              onChanged: (final String value) {\n                SettingsDatabase.settings.primaryColor = value;\n                saveSettings();\n              },\n            ),\n            SwitchListTile(\n              title: Text(context.t.useSystemTheme),\n              secondary: const Icon(Icons.highlight_rounded),\n              value: SettingsDatabase.settings.useSystemPreferredTheme,\n              onChanged: (final bool value) {\n                SettingsDatabase.settings.useSystemPreferredTheme = value;\n                saveSettings();\n              },\n            ),\n            SwitchListTile(\n              title: Text(context.t.darkMode),\n              secondary: AnimatedSwitcher(\n                duration: AnimationDurations.defaultNormalAnimation,\n                child: Icon(\n                  SettingsDatabase.settings.darkMode\n                      ? Icons.dark_mode_rounded\n                      : Icons.light_mode_rounded,\n                  key: UniqueKey(),\n                ),\n              ),\n              value: SettingsDatabase.settings.darkMode,\n              onChanged: SettingsDatabase.settings.useSystemPreferredTheme\n                  ? null\n                  : (final bool value) {\n                      SettingsDatabase.settings.darkMode = value;\n                      saveSettings();\n                    },\n            ),\n            CheckboxListTile(\n              title: Text(context.t.disableAnimations),\n              secondary: const Icon(Icons.animation_rounded),\n              value: SettingsDatabase.settings.disableAnimations,\n              onChanged: (final bool? value) {\n                if (value == null) return;\n                SettingsDatabase.settings.disableAnimations = value;\n                saveSettings();\n              },\n            ),\n          ],\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/settings/components/exports.dart",
    "content": "export 'appearance.dart';\n"
  },
  {
    "path": "lib/ui/pages/settings/components/tiles/choice.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../../exports.dart';\n\nclass MultiChoiceListTile<T> extends StatefulWidget {\n  const MultiChoiceListTile({\n    required this.title,\n    required this.value,\n    required this.items,\n    required this.onChanged,\n    this.secondary,\n    super.key,\n  });\n\n  final Widget? secondary;\n  final Widget title;\n  final T value;\n  final Map<T, Widget> items;\n  final void Function(T) onChanged;\n\n  @override\n  State<MultiChoiceListTile<T>> createState() => _MultiChoiceListTileState<T>();\n}\n\nclass _MultiChoiceListTileState<T> extends State<MultiChoiceListTile<T>> {\n  final GlobalKey _initActiveOptionKey = GlobalKey();\n\n  @override\n  Widget build(final BuildContext context) => ListTile(\n        leading: SizedBox(\n          height: double.infinity,\n          child: widget.secondary,\n        ),\n        title: widget.title,\n        subtitle: widget.items[widget.value],\n        onTap: () async {\n          WidgetsBinding.instance.addPostFrameCallback((final _) {\n            Scrollable.ensureVisible(\n              _initActiveOptionKey.currentContext!,\n              duration: AnimationDurations.defaultNormalAnimation,\n            );\n          });\n          final T? value = await showModalBottomSheet<T>(\n            context: context,\n            shape: RoundedRectangleBorder(\n              borderRadius: BorderRadius.vertical(\n                top: Radius.circular(context.r.scale(1)),\n              ),\n            ),\n            builder: (final BuildContext context) => SingleChildScrollView(\n              child: Column(\n                crossAxisAlignment: CrossAxisAlignment.start,\n                children: <Widget>[\n                  Padding(\n                    padding: EdgeInsets.only(\n                      left: context.r.scale(1),\n                      right: context.r.scale(1),\n                      top: context.r.scale(1),\n                      bottom: context.r.scale(0.5),\n                    ),\n                    child: DefaultTextStyle(\n                      style: Theme.of(context).textTheme.titleLarge!,\n                      child: widget.title,\n                    ),\n                  ),\n                  const Divider(),\n                  ...widget.items\n                      .map(\n                        (final T key, final Widget value) =>\n                            MapEntry<T, Widget>(\n                          key,\n                          RadioListTile<T>(\n                            key: key == widget.value\n                                ? _initActiveOptionKey\n                                : null,\n                            value: key,\n                            groupValue: widget.value,\n                            title: value,\n                            onChanged: (final T? value) {\n                              if (value == null) return;\n                              Navigator.of(context).pop(value);\n                            },\n                          ),\n                        ),\n                      )\n                      .values,\n                ],\n              ),\n            ),\n          );\n          if (value != null && value != widget.value) {\n            widget.onChanged(value);\n          }\n        },\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/settings/components/tiles/exports.dart",
    "content": "export 'choice.dart';\nexport 'wrapper.dart';\n"
  },
  {
    "path": "lib/ui/pages/settings/components/tiles/wrapper.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass SettingsBodyWrapper extends StatelessWidget {\n  const SettingsBodyWrapper({\n    required this.child,\n    super.key,\n  });\n\n  final Widget child;\n\n  @override\n  Widget build(final BuildContext context) => IconTheme(\n        data: IconThemeData(color: Theme.of(context).colorScheme.primary),\n        child: child,\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/settings/route.dart",
    "content": "import 'package:flutter/material.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass SettingsPageRoute extends RoutePage {\n  @override\n  bool matches(final RouteInfo route) => route.name == routeName;\n\n  @override\n  Widget build(final RouteInfo route) => const SettingsPage();\n\n  static const String routeName = '/settings';\n}\n\nextension SettingsPageRouteUtils on RoutePusher {\n  Future<void> pushToSettingsPage() =>\n      navigator.pushNamed(SettingsPageRoute.routeName);\n}\n"
  },
  {
    "path": "lib/ui/pages/settings/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'components/exports.dart';\n\nclass SettingsPage extends StatefulWidget {\n  const SettingsPage({\n    super.key,\n  });\n\n  @override\n  State<SettingsPage> createState() => _SettingsPageState();\n}\n\nenum _SettingsCategory {\n  appearance,\n}\n\nextension on _SettingsCategory {\n  String getTitleCase(final Translation translation) => switch (this) {\n        _SettingsCategory.appearance => translation.appearance,\n      };\n}\n\nclass _SettingsPageState extends State<SettingsPage> {\n  _SettingsCategory category = _SettingsCategory.appearance;\n\n  PreferredSizeWidget buildAppBar(final BuildContext context) {\n    final AppBar appBar = AppBar(\n      leading: const RoundedBackButton(),\n      title: Text(context.t.settings),\n    );\n    final double appBarHeight = appBar.preferredSize.height;\n    final double height = (appBarHeight * 2) + 1;\n\n    return PreferredSize(\n      preferredSize: Size.fromHeight(height),\n      child: Column(\n        children: <Widget>[\n          appBar,\n          const Divider(height: 1, thickness: 1),\n          Container(\n            color: Theme.of(context).bottomAppBarTheme.color,\n            height: appBarHeight,\n            width: double.infinity,\n            padding: EdgeInsets.symmetric(horizontal: context.r.scale(0.5)),\n            child: DropdownButtonHideUnderline(\n              child: ButtonTheme(\n                alignedDropdown: true,\n                child: Container(\n                  color: Theme.of(context).bottomAppBarTheme.color,\n                  child: DropdownButton<_SettingsCategory>(\n                    isExpanded: true,\n                    value: category,\n                    icon: const Icon(Icons.arrow_drop_down_rounded),\n                    items: _SettingsCategory.values\n                        .map(\n                          (final _SettingsCategory x) =>\n                              DropdownMenuItem<_SettingsCategory>(\n                            value: x,\n                            child: Text(x.getTitleCase(context.t)),\n                          ),\n                        )\n                        .toList(),\n                    onChanged: (final _SettingsCategory? value) {\n                      if (value == null) return;\n                      setState(() {\n                        category = value;\n                      });\n                    },\n                  ),\n                ),\n              ),\n            ),\n          ),\n        ],\n      ),\n    );\n  }\n\n  Widget buildBody(final BuildContext context) => switch (category) {\n        _SettingsCategory.appearance => const ApperanceSettings(),\n      };\n\n  @override\n  Widget build(final BuildContext context) => Scaffold(\n        appBar: buildAppBar(context),\n        body: SafeArea(\n          child: AnimatedSwitcher(\n            duration: AnimationDurations.defaultNormalAnimation,\n            child: SingleChildScrollView(\n              key: ValueKey<_SettingsCategory>(category),\n              child: buildBody(context),\n            ),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/appbar.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport '../provider.dart';\n\nclass ViewPageAppBar extends StatelessWidget implements PreferredSizeWidget {\n  const ViewPageAppBar({\n    super.key,\n  });\n\n  Widget buildAppBarButton({\n    required final BuildContext context,\n    required final Widget icon,\n    required final VoidCallback onPressed,\n  }) {\n    final ViewPageViewProvider provider = context.watch<ViewPageViewProvider>();\n\n    return AnimatedSwitcher(\n      duration: AnimationDurations.defaultQuickAnimation,\n      transitionBuilder:\n          (final Widget child, final Animation<double> animation) =>\n              FadeTransition(opacity: animation, child: child),\n      child: provider.showFloatingAppBar\n          ? SizedBox.square(\n              dimension: context.r.scale(2),\n              child: DecoratedBox(\n                decoration: BoxDecoration(\n                  color: Theme.of(context)\n                      .colorScheme\n                      .background\n                      .withOpacity(0.25),\n                  shape: BoxShape.circle,\n                ),\n                child: InkWell(\n                  borderRadius: BorderRadius.circular(context.r.scale(2)),\n                  onTap: onPressed,\n                  child: Center(\n                    child: IconTheme(\n                      data: IconThemeData(\n                        color: Theme.of(context).colorScheme.onBackground,\n                      ),\n                      child: icon,\n                    ),\n                  ),\n                ),\n              ),\n            )\n          : Container(),\n    );\n  }\n\n  @override\n  Widget build(final BuildContext context) {\n    final ViewPageProvider provider = context.watch<ViewPageProvider>();\n\n    return SafeArea(\n      child: SizedBox(\n        height: preferredHeight,\n        child: Row(\n          children: <Widget>[\n            SizedBox(width: context.r.scale(0.75)),\n            buildAppBarButton(\n              context: context,\n              icon: const Icon(Icons.close_rounded),\n              onPressed: () {\n                Navigator.of(context).maybePop();\n              },\n            ),\n            const Spacer(),\n            if (provider.media.hasFinishedOrFailed)\n              buildAppBarButton(\n                context: context,\n                icon: const Icon(Icons.refresh_rounded),\n                onPressed: () {\n                  provider.fetch();\n                },\n              ),\n            SizedBox(width: context.r.scale(0.75)),\n          ],\n        ),\n      ),\n    );\n  }\n\n  double get preferredHeight =>\n      RelativeScaleData.fromSettingsNoResponsive().scale(3.5);\n\n  @override\n  Size get preferredSize => Size.fromHeight(preferredHeight);\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/body.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\nimport '../provider.dart';\nimport 'content/content.dart';\nimport 'hero.dart';\nimport 'overview.dart';\n\nenum _ViewPageTabs {\n  overview,\n  content,\n}\n\nextension on _ViewPageTabs {\n  String getTitleCase(final Translation translation, final TenkaType type) =>\n      switch (this) {\n        _ViewPageTabs.overview => translation.overview,\n        _ViewPageTabs.content => switch (type) {\n            TenkaType.anime => translation.episodes,\n            TenkaType.manga => translation.chapters,\n          }\n      };\n}\n\nclass ViewPageBody extends StatefulWidget {\n  const ViewPageBody({\n    super.key,\n  });\n\n  @override\n  State<ViewPageBody> createState() => _ViewPageBodyState();\n}\n\nclass _ViewPageBodyState extends State<ViewPageBody>\n    with SingleTickerProviderStateMixin {\n  final List<_ViewPageTabs> tabs = <_ViewPageTabs>[\n    _ViewPageTabs.overview,\n    _ViewPageTabs.content,\n  ];\n\n  late final TabController tabController;\n  late final ScrollController scrollController;\n\n  @override\n  void initState() {\n    super.initState();\n    tabController = TabController(length: tabs.length, vsync: this);\n    scrollController = ScrollController()\n      ..addListener(() {\n        if (!mounted || !scrollController.hasClients) return;\n        final ViewPageViewProvider provider =\n            context.read<ViewPageViewProvider>();\n        provider.setFloatingAppBarVisibility(\n          visible: scrollController.position.pixels < 50,\n        );\n      });\n  }\n\n  @override\n  void dispose() {\n    super.dispose();\n    tabController.dispose();\n    scrollController.dispose();\n  }\n\n  Widget buildTabBarViewPage({\n    required final BuildContext context,\n    required final WidgetBuilder builder,\n  }) =>\n      Builder(\n        builder: (final BuildContext context) => CustomScrollView(\n          slivers: <Widget>[\n            SliverOverlapInjector(\n              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),\n            ),\n            SliverToBoxAdapter(child: builder(context)),\n          ],\n        ),\n      );\n\n  @override\n  Widget build(final BuildContext context) {\n    final ViewPageProvider provider = context.watch<ViewPageProvider>();\n    final AnilistMedia media = provider.media.value;\n\n    return NestedScrollView(\n      controller: scrollController,\n      floatHeaderSlivers: true,\n      headerSliverBuilder:\n          (final BuildContext context, final bool innerBoxIsScrolled) =>\n              <Widget>[\n        SliverList(\n          delegate: SliverChildListDelegate.fixed(\n            <Widget>[\n              ViewPageHero(media),\n              SizedBox(height: context.r.scale(0.75)),\n              const Divider(height: 0, thickness: 0),\n            ],\n          ),\n        ),\n        SliverOverlapAbsorber(\n          handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),\n          sliver: SliverPersistentHeader(\n            pinned: true,\n            floating: true,\n            delegate: _SliverTabBarHeaderDelegate(\n              TabBar(\n                indicatorColor: Theme.of(context).colorScheme.primary,\n                labelStyle: Theme.of(context).textTheme.bodyLarge,\n                controller: tabController,\n                tabs: tabs\n                    .asMap()\n                    .map(\n                      (final int i, final _ViewPageTabs x) =>\n                          MapEntry<int, Widget>(\n                        i,\n                        Tab(\n                          text: x.getTitleCase(\n                            context.t,\n                            media.type.asTenkaType,\n                          ),\n                        ),\n                      ),\n                    )\n                    .values\n                    .toList(),\n              ),\n            ),\n          ),\n        ),\n      ],\n      body: MediaQuery.removePadding(\n        removeTop: true,\n        context: context,\n        child: TabBarView(\n          controller: tabController,\n          children: <Widget>[\n            buildTabBarViewPage(\n              context: context,\n              builder: (final _) => ViewPageOverview(media),\n            ),\n            buildTabBarViewPage(\n              context: context,\n              builder: (final _) => ViewPageContent(media),\n            ),\n          ],\n        ),\n      ),\n    );\n  }\n}\n\nclass _SliverTabBarHeaderDelegate extends SliverPersistentHeaderDelegate {\n  const _SliverTabBarHeaderDelegate(this.tabBar);\n\n  final TabBar tabBar;\n\n  @override\n  Widget build(final BuildContext context, final _, final __) => DecoratedBox(\n        decoration:\n            BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor),\n        child: tabBar,\n      );\n\n  @override\n  bool shouldRebuild(final _SliverTabBarHeaderDelegate oldDelegate) => false;\n\n  @override\n  double get minExtent => tabBar.preferredSize.height;\n\n  @override\n  double get maxExtent => tabBar.preferredSize.height;\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/content/content.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport 'package:kazahana/core/player/video_player.dart';\nimport 'provider.dart';\n\nList<String> entries = <String>['A', 'B', 'C'];\n\nclass ViewPageContent extends StatelessWidget {\n  const ViewPageContent(\n    this.media, {\n    super.key,\n  });\n\n  final AnilistMedia media;\n\n  @override\n  // TODO: Implement a return function to call the episodes from the provider selected and then open the video player widget after an episode is selected\n  Widget build(final BuildContext context) =>\n      ChangeNotifierProvider<ViewPageContentProvider>(\n        create: (final _) => ViewPageContentProvider(media)..initialize(),\n        builder: (final BuildContext context, final _) =>\n            Consumer<ViewPageContentProvider>(\n          builder: (\n            final BuildContext context,\n            final ViewPageContentProvider provider,\n            final _,\n          ) =>\n              SafeArea(\n            child: SingleChildScrollView(\n              child: Column(\n                mainAxisSize: MainAxisSize.min,\n                crossAxisAlignment: CrossAxisAlignment.start,\n                children: <Widget>[\n                  SizedBox(\n                    width: MediaQuery.of(context).size.width,\n                    height: 60,\n                    child: InputDecorator(\n                      decoration: const InputDecoration(\n                        border: OutlineInputBorder(),\n                      ),\n                      child: DropdownButtonHideUnderline(\n                        child: DropdownButton<TenkaMetadata>(\n                          hint: const Text('Select provider:'),\n                          items: provider.extensions\n                              .map(\n                                (final TenkaMetadata x) =>\n                                    DropdownMenuItem<TenkaMetadata>(\n                                  value: x,\n                                  child: Text(x.name),\n                                ),\n                              )\n                              .toList(),\n                          onChanged: (final TenkaMetadata? value) {\n                            if (value == null) {\n                              return;\n                            } else {\n                              entries = <String>[\n                                'Episode one',\n                                'Episode two',\n                                'Episode three',\n                              ]; //placeholder values\n                            }\n                          },\n                        ),\n                      ),\n                    ),\n                  ),\n                  const EpisodeList(),\n                ],\n              ),\n            ),\n          ),\n        ),\n      );\n}\n\nclass EpisodeList extends StatefulWidget {\n  const EpisodeList({super.key});\n\n  @override\n  _EpisodeListState createState() => _EpisodeListState();\n}\n\nclass _EpisodeListState extends State<EpisodeList> {\n  late String selectedEntry;\n\n  @override\n  Widget build(final BuildContext context) => ListView.builder(\n        shrinkWrap: true,\n        itemCount: entries.length,\n        itemBuilder: (final BuildContext context, final int index) => ListTile(\n          title: Text(entries[index]),\n          onTap: () {\n            setState(() {\n              selectedEntry = entries[index];\n              Navigator.push(\n                context,\n                MaterialPageRoute<Builder>(\n                  builder: (final BuildContext context) => const PlayerPage(),\n                ),\n              );\n            });\n          },\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/content/exports.dart",
    "content": "export 'content.dart';\n"
  },
  {
    "path": "lib/ui/pages/view/components/content/provider.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass ViewPageContentProvider extends StatedChangeNotifier {\n  ViewPageContentProvider(this.media);\n\n  final AnilistMedia media;\n\n  TenkaMetadata? metadata;\n  dynamic extractor;\n\n  final StatedValue<TwinTuple<SearchInfo, AnimeInfo>?> computed =\n      StatedValue<TwinTuple<SearchInfo, AnimeInfo>?>();\n  final StatedValue<List<SearchInfo>> searches =\n      StatedValue<List<SearchInfo>>();\n\n  Future<void> initialize() async {\n    final String? lastUsedExtractorId = await getLastUsedExtractor(type);\n    final TenkaMetadata? lastUsedExtractor =\n        TenkaManager.repository.installed[lastUsedExtractorId];\n    if (lastUsedExtractor == null) return;\n    await change(lastUsedExtractor);\n  }\n\n  Future<void> change(final TenkaMetadata nMetadata) async {\n    metadata = nMetadata;\n    extractor = await TenkaManager.getExtractor(metadata!);\n    notifyListeners();\n\n    await setLastUsedExtractor(type, id: metadata!.id);\n    await fetch();\n  }\n\n  Future<List<SearchInfo>> search(final String terms) async {\n    switch (type) {\n      case TenkaType.anime:\n        final AnimeExtractor extractor = await getCastedExtractor();\n        return extractor.search(terms, extractor.defaultLocale);\n\n      case TenkaType.manga:\n        final MangaExtractor extractor = await getCastedExtractor();\n        return extractor.search(terms, extractor.defaultLocale);\n    }\n  }\n\n  Future<void> fetch() async {\n    //  switch (type) {\n    //    case TenkaType.anime:\n    //      fetchAnime();\n    //      break;\n    //    case TenkaType.manga:\n    //      //fetchManga();\n    //      break;\n    //  }\n  }\n\n  Future<void> fetchAnime() async {\n    searches.waiting();\n    computed.waiting();\n    notifyListeners();\n\n    final AnimeExtractor extractor = await getCastedExtractor();\n    try {\n      searches.finish(\n        await extractor.search(\n          media.titleRomaji,\n          extractor.defaultLocale,\n        ),\n      );\n    } catch (error, stackTrace) {\n      searches.fail(error, stackTrace);\n      computed.fail('Failed to fetch search results');\n    }\n    notifyListeners();\n    if (searches.hasFailed) return;\n\n    final String? lastComputedUrl = await getLastComputed(\n      type: type,\n      id: metadata!.id,\n      mediaId: media.id,\n    );\n    final dynamic computedSearchInfo = (lastComputedUrl != null\n            ? searches.value.firstWhereOrNull(\n                (final SearchInfo x) => x.url == lastComputedUrl,\n              )\n            : null) ??\n        IterableExtension(searches.value).firstOrNull;\n    if (computedSearchInfo == null) {\n      computed.fail('Failed to find valid result');\n    }\n\n    try {\n      searches.finish(\n        await extractor.search(\n          media.titleRomaji,\n          extractor.defaultLocale,\n        ),\n      );\n    } catch (error) {\n      computed.fail('Failed to fetch search results');\n    }\n    notifyListeners();\n  }\n\n  T getCastedExtractor<T>() => extractor as T;\n\n  TenkaType get type => media.type.asTenkaType;\n\n  List<TenkaMetadata> get extensions => TenkaManager.repository.installed.values\n      .where((final TenkaMetadata x) => x.type == media.type.asTenkaType)\n      .toList();\n\n  static String getLastUsedExtractorKey(final TenkaType type) =>\n      'view_last_used_${type.name}_extractor';\n\n  static Future<String?> getLastUsedExtractor(final TenkaType type) async {\n    final String? value =\n        await CacheDatabase.get<String?>(getLastUsedExtractorKey(type));\n    return TenkaManager.repository.installed.containsKey(value) ? value : null;\n  }\n\n  static Future<void> setLastUsedExtractor(\n    final TenkaType type, {\n    required final String id,\n  }) async {\n    await CacheDatabase.set(getLastUsedExtractorKey(type), id);\n  }\n\n  static String getLastComputedKey({\n    required final TenkaType type,\n    required final String id,\n    required final int mediaId,\n  }) =>\n      'view_last_computed_${type.name}_${id}_$mediaId';\n\n  static Future<String?> getLastComputed({\n    required final TenkaType type,\n    required final String id,\n    required final int mediaId,\n  }) async =>\n      CacheDatabase.get<String?>(\n        getLastComputedKey(\n          type: type,\n          id: id,\n          mediaId: mediaId,\n        ),\n      );\n\n  static Future<void> setLastComputed({\n    required final TenkaType type,\n    required final String id,\n    required final int mediaId,\n    required final int url,\n  }) async {\n    await CacheDatabase.set(\n      getLastComputedKey(\n        type: type,\n        id: id,\n        mediaId: mediaId,\n      ),\n      url,\n    );\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/exports.dart",
    "content": "export 'appbar.dart';\nexport 'body.dart';\nexport 'content/exports.dart';\nexport 'hero.dart';\nexport 'overview.dart';\n"
  },
  {
    "path": "lib/ui/pages/view/components/hero.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\n\nclass ViewPageHero extends StatelessWidget {\n  const ViewPageHero(\n    this.media, {\n    super.key,\n  });\n\n  final AnilistMedia media;\n\n  @override\n  Widget build(final BuildContext context) {\n    final Color chipBackgroundColor =\n        Theme.of(context).colorScheme.secondaryContainer;\n    final Color chipTextColor =\n        Theme.of(context).colorScheme.onSecondaryContainer;\n    final double bannerHeight = context.r.scale(10, md: 15);\n\n    return Column(\n      mainAxisSize: MainAxisSize.min,\n      children: <Widget>[\n        SizedBox(\n          height: context.r.scale(15, md: 20),\n          child: Stack(\n            children: <Widget>[\n              SizedBox(\n                height: bannerHeight,\n                width: double.infinity,\n                child: FadeInImage(\n                  fit: BoxFit.cover,\n                  placeholder: MemoryImage(Placeholders.transparent1x1Image),\n                  image: NetworkImage(\n                    media.bannerImage ?? media.coverImageExtraLarge,\n                  ),\n                ),\n              ),\n              SizedBox(\n                height: bannerHeight,\n                child: DecoratedBox(\n                  decoration: BoxDecoration(\n                    gradient: LinearGradient(\n                      begin: Alignment.topCenter,\n                      end: Alignment.bottomCenter,\n                      colors: <Color>[\n                        Colors.transparent,\n                        Theme.of(context)\n                            .bottomAppBarTheme\n                            .color!\n                            .withOpacity(0.75),\n                      ],\n                    ),\n                  ),\n                  child: const SizedBox.expand(),\n                ),\n              ),\n              if (media.bannerImage == null)\n                SizedBox(\n                  height: bannerHeight,\n                  child: ClipRRect(\n                    child: BackdropFilter(\n                      filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),\n                      child: const SizedBox.expand(),\n                    ),\n                  ),\n                ),\n              Align(\n                alignment: Alignment.bottomCenter,\n                child: ClipRRect(\n                  borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n                  child: Image.network(\n                    media.coverImageExtraLarge,\n                    height: context.r.scale(10, md: 15),\n                  ),\n                ),\n              ),\n            ],\n          ),\n        ),\n        SizedBox(height: context.r.scale(1)),\n        HorizontalBodyPadding(\n          Column(\n            mainAxisSize: MainAxisSize.min,\n            children: <Widget>[\n              Text(\n                media.titleUserPreferred,\n                style: Theme.of(context).textTheme.headlineMedium!.copyWith(\n                      fontWeight: FontWeight.bold,\n                      color: Theme.of(context).textTheme.bodyLarge!.color,\n                    ),\n                textAlign: TextAlign.center,\n              ),\n              SizedBox(height: context.r.scale(0.2)),\n              Text(\n                <String>[\n                  media.format.getTitleCase(context.t),\n                  media.getWatchtime(context.t),\n                  if (media.season != null || media.seasonYear != null)\n                    '${media.season?.getTitleCase(context.t) ?? Translation.unk} ${media.seasonYear ?? Translation.unk}',\n                  media.status.getTitleCase(context.t),\n                ].join(' | '),\n                style: Theme.of(context).textTheme.bodyLarge!.copyWith(\n                      color: Theme.of(context).textTheme.bodySmall!.color,\n                    ),\n              ),\n              SizedBox(height: context.r.scale(0.75)),\n              Wrap(\n                spacing: context.r.scale(0.4),\n                runSpacing: context.r.scale(0.2),\n                children: <Widget>[\n                  if (media.averageScore != null)\n                    AnilistMediaTile.buildRatingChip(\n                      context: context,\n                      media: media,\n                      backgroundColor: chipBackgroundColor,\n                      textColor: chipTextColor,\n                    ),\n                  if (media.startDate != null || media.endDate != null)\n                    AnilistMediaTile.buildAirdateChip(\n                      context: context,\n                      media: media,\n                      backgroundColor: chipBackgroundColor,\n                      textColor: chipTextColor,\n                    ),\n                  if (media.isAdult)\n                    AnilistMediaTile.buildNSFWChip(\n                      context: context,\n                      media: media,\n                    ),\n                ],\n              ),\n              SizedBox(height: context.r.scale(0.4)),\n              Wrap(\n                spacing: context.r.scale(0.4),\n                runSpacing: context.r.scale(0.2),\n                children: media.genres\n                    .map(\n                      (final String x) => AnilistMediaTile.buildChip(\n                        context: context,\n                        child: Text(x),\n                        backgroundColor: chipBackgroundColor,\n                        textColor: chipTextColor,\n                      ),\n                    )\n                    .toList(),\n              ),\n            ],\n          ),\n        ),\n        SizedBox(height: context.r.scale(0.5)),\n      ],\n    );\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/view/components/overview.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../../exports.dart';\n\nclass ViewPageOverview extends StatelessWidget {\n  const ViewPageOverview(\n    this.media, {\n    super.key,\n  });\n\n  final AnilistMedia media;\n\n  Widget buildCharacterTile({\n    required final BuildContext context,\n    required final AnilistCharacterEdge character,\n  }) =>\n      SizedBox(\n        width: AnilistMediaRow.getTileWidth(context.r),\n        child: Column(\n          mainAxisSize: MainAxisSize.min,\n          children: <Widget>[\n            ClipRRect(\n              borderRadius: BorderRadius.circular(context.r.scale(0.5)),\n              child: AspectRatio(\n                aspectRatio: AnilistMediaTile.coverRatio,\n                child: Stack(\n                  children: <Widget>[\n                    Positioned.fill(\n                      child: Image.network(\n                        character.node.imageLarge,\n                        fit: BoxFit.cover,\n                      ),\n                    ),\n                    Align(\n                      alignment: Alignment.bottomRight,\n                      child: Padding(\n                        padding: EdgeInsets.all(context.r.scale(0.5)),\n                        child: Column(\n                          mainAxisAlignment: MainAxisAlignment.end,\n                          crossAxisAlignment: CrossAxisAlignment.end,\n                          children: ListUtils.insertBetween(\n                            <Widget>[\n                              AnilistMediaTile.buildChip(\n                                context: context,\n                                backgroundColor: Theme.of(context)\n                                    .colorScheme\n                                    .inverseSurface,\n                                textColor: Theme.of(context)\n                                    .colorScheme\n                                    .onInverseSurface,\n                                child: Text(\n                                  character.role.getTitleCase(context.t),\n                                ),\n                              ),\n                            ],\n                            SizedBox(height: context.r.scale(0.2)),\n                          ),\n                        ),\n                      ),\n                    ),\n                  ],\n                ),\n              ),\n            ),\n            SizedBox(height: context.r.scale(0.25)),\n            Flexible(\n              child: Text(\n                character.node.nameUserPreferred,\n                style: Theme.of(context).textTheme.bodyLarge,\n                textAlign: TextAlign.center,\n              ),\n            ),\n          ],\n        ),\n      );\n\n  @override\n  Widget build(final BuildContext context) => SafeArea(\n        child: SingleChildScrollView(\n          child: Column(\n            mainAxisSize: MainAxisSize.min,\n            crossAxisAlignment: CrossAxisAlignment.start,\n            children: <Widget>[\n              if (media.description != null) ...<Widget>[\n                SizedBox(height: context.r.scale(1)),\n                HorizontalBodyPadding(Text(media.description!)),\n              ],\n              SizedBox(height: context.r.scale(1.5)),\n              HorizontalBodyPadding(\n                Text(\n                  context.t.characters,\n                  style: Theme.of(context).textTheme.titleMedium,\n                ),\n              ),\n              SizedBox(height: context.r.scale(0.75, md: 1)),\n              ScrollableRow(\n                media.characters\n                    .map(\n                      (final AnilistCharacterEdge x) =>\n                          buildCharacterTile(context: context, character: x),\n                    )\n                    .toList(),\n              ),\n              if (media.relations?.isNotEmpty ?? false) ...<Widget>[\n                SizedBox(height: context.r.scale(1.5)),\n                HorizontalBodyPadding(\n                  Text(\n                    context.t.relations,\n                    style: Theme.of(context).textTheme.titleMedium,\n                  ),\n                ),\n                SizedBox(height: context.r.scale(0.75, md: 1)),\n                ScrollableRow(\n                  media.relations!\n                      .map(\n                        (final AnilistRelationEdge x) => SizedBox(\n                          width: AnilistMediaRow.getTileWidth(context.r),\n                          child: AnilistMediaTile(\n                            x.node,\n                            additionalBottomChips: <Widget>[\n                              AnilistMediaTile.buildChip(\n                                context: context,\n                                backgroundColor: Theme.of(context)\n                                    .colorScheme\n                                    .inverseSurface,\n                                textColor: Theme.of(context)\n                                    .colorScheme\n                                    .onInverseSurface,\n                                child: Text(\n                                  x.relationType.getTitleCase(context.t),\n                                ),\n                              ),\n                            ],\n                          ),\n                        ),\n                      )\n                      .toList(),\n                ),\n              ],\n              SizedBox(height: context.r.scale(2)),\n            ],\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/pages/view/provider.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass ViewPageViewProvider extends ChangeNotifier {\n  bool showFloatingAppBar = true;\n\n  void setFloatingAppBarVisibility({\n    required final bool visible,\n  }) {\n    if (showFloatingAppBar != visible) {\n      showFloatingAppBar = visible;\n      notifyListeners();\n    }\n  }\n}\n\nclass ViewPageProvider extends StatedChangeNotifier {\n  late final int mediaId;\n  final StatedValue<AnilistMedia> media = StatedValue<AnilistMedia>();\n\n  Future<void> initialize({\n    required final int id,\n    final AnilistMedia? media,\n  }) async {\n    mediaId = id;\n    if (media != null) {\n      this.media.finish(media);\n      await this.media.value.fetchAll();\n      if (!mounted) return;\n      notifyListeners();\n      return;\n    }\n\n    await fetch();\n  }\n\n  Future<void> fetch() async {\n    media.loading();\n    notifyListeners();\n\n    try {\n      media.finish(await AnilistMediaEndpoints.fetchId(mediaId));\n      await media.value.fetchAll();\n    } catch (err, trace) {\n      media.fail(err, trace);\n    }\n    if (!mounted) return;\n    notifyListeners();\n  }\n}\n"
  },
  {
    "path": "lib/ui/pages/view/route.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'view.dart';\n\nclass ViewPageRoute extends RoutePage {\n  final RegExp pattern = RegExp(r'^\\/view\\/(\\d+)$');\n\n  @override\n  bool matches(final RouteInfo route) => pattern.hasMatch(route.name);\n\n  int parseId(final String name) =>\n      int.parse(pattern.firstMatch(name)!.group(1)!);\n\n  @override\n  Widget build(final RouteInfo route) {\n    final int id = parseId(route.name);\n    final AnilistMedia? media = route.data as AnilistMedia?;\n    return ViewPage(mediaId: id, media: media);\n  }\n}\n\nextension ViewPageRouteUtils on RoutePusher {\n  Future<void> pushToViewPage({\n    required final int id,\n    final AnilistMedia? media,\n  }) =>\n      navigator.pushNamed('/view/$id', arguments: media);\n\n  Future<void> pushToViewPageFromMedia(final AnilistMedia media) =>\n      pushToViewPage(id: media.id, media: media);\n}\n"
  },
  {
    "path": "lib/ui/pages/view/view.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\nimport 'components/exports.dart';\nimport 'provider.dart';\n\nclass ViewPage extends StatelessWidget {\n  const ViewPage({\n    required this.mediaId,\n    this.media,\n    super.key,\n  });\n\n  final int mediaId;\n  final AnilistMedia? media;\n\n  @override\n  Widget build(final BuildContext context) => MultiProvider(\n        providers: <SingleChildWidget>[\n          ChangeNotifierProvider<ViewPageViewProvider>(\n            create: (final _) => ViewPageViewProvider(),\n          ),\n          ChangeNotifierProvider<ViewPageProvider>(\n            create: (final _) =>\n                ViewPageProvider()..initialize(id: mediaId, media: media),\n          ),\n        ],\n        child: Consumer<ViewPageProvider>(\n          builder: (\n            final BuildContext context,\n            final ViewPageProvider provider,\n            final _,\n          ) =>\n              Scaffold(\n            appBar: const ViewPageAppBar(),\n            extendBodyBehindAppBar: true,\n            extendBody: true,\n            body: StatedBuilder(\n              provider.media.state,\n              waiting: (final _) => const SizedBox.shrink(),\n              processing: (final _) => const SizedBox.shrink(),\n              finished: (final _) => const ViewPageBody(),\n              failed: (final _) => const SizedBox.shrink(),\n            ),\n          ),\n        ),\n      );\n}\n"
  },
  {
    "path": "lib/ui/router/exports.dart",
    "content": "export 'navigator.dart';\nexport 'route/exports.dart';\n"
  },
  {
    "path": "lib/ui/router/navigator.dart",
    "content": "import 'package:flutter/material.dart';\n\nexport '../pages/anilist/route.dart';\nexport '../pages/home/route.dart';\nexport '../pages/modules/route.dart';\nexport '../pages/search/route.dart';\nexport '../pages/settings/route.dart';\nexport '../pages/view/route.dart';\n\nclass RoutePusher {\n  const RoutePusher(this.navigator);\n\n  final NavigatorState navigator;\n}\n\nextension NavigatorStateUtils on NavigatorState {\n  RoutePusher get pusher => RoutePusher(this);\n}\n"
  },
  {
    "path": "lib/ui/router/route/exports.dart",
    "content": "export 'info.dart';\nexport 'page.dart';\nexport 'pages.dart';\n"
  },
  {
    "path": "lib/ui/router/route/info.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass RouteInfo {\n  const RouteInfo(this.settings);\n\n  final RouteSettings settings;\n\n  String get name => settings.name!;\n  Object? get data => settings.arguments;\n}\n"
  },
  {
    "path": "lib/ui/router/route/page.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../exports.dart';\n\nabstract class RoutePage {\n  RouteTransitionsBuilder transitionBuilder = defaultTransitionBuilder;\n\n  bool matches(final RouteInfo route);\n  Widget build(final RouteInfo route);\n\n  Route<dynamic> buildRoutePage(final RouteInfo route) =>\n      defaultRoutePageBuilder(route: route, page: this);\n\n  static Widget defaultTransitionBuilder(\n    final BuildContext context,\n    final Animation<double> animation,\n    final Animation<double> secondaryAnimation,\n    final Widget child,\n  ) =>\n      SharedAxisTransition(\n        fillColor: Theme.of(context).scaffoldBackgroundColor,\n        animation: animation,\n        secondaryAnimation: secondaryAnimation,\n        transitionType: SharedAxisTransitionType.scaled,\n        child: child,\n      );\n\n  static Route<dynamic> defaultRoutePageBuilder({\n    required final RouteInfo route,\n    required final RoutePage page,\n  }) =>\n      PageRouteBuilder<dynamic>(\n        settings: route.settings,\n        pageBuilder: (final _, final __, final ___) => page.build(route),\n        transitionDuration: AnimationDurations.defaultNormalAnimation,\n        reverseTransitionDuration: AnimationDurations.defaultNormalAnimation,\n        transitionsBuilder: RoutePage.defaultTransitionBuilder,\n      );\n}\n"
  },
  {
    "path": "lib/ui/router/route/pages.dart",
    "content": "import 'package:kazahana/core/exports.dart';\nimport '../../pages/anilist/route.dart';\nimport '../../pages/home/route.dart';\nimport '../../pages/modules/route.dart';\nimport '../../pages/search/route.dart';\nimport '../../pages/settings/route.dart';\nimport '../../pages/view/route.dart';\nimport 'info.dart';\nimport 'page.dart';\n\nabstract class RoutePages {\n  static final HomePageRoute home = HomePageRoute();\n  static final SearchPageRoute search = SearchPageRoute();\n  static final ViewPageRoute view = ViewPageRoute();\n  static final SettingsPageRoute settings = SettingsPageRoute();\n  static final ModulesPageRoute modules = ModulesPageRoute();\n  static final AnilistPageRoute anilist = AnilistPageRoute();\n\n  static RoutePage? findMatch(final RouteInfo route) =>\n      all.firstWhereOrNull((final RoutePage x) => x.matches(route));\n\n  static List<RoutePage> get all => <RoutePage>[\n        home,\n        search,\n        view,\n        settings,\n        modules,\n        anilist,\n      ];\n}\n"
  },
  {
    "path": "lib/ui/utils/animations.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nabstract class AnimationDurations {\n  static const Duration _defaultQuickAnimation = Duration(milliseconds: 100);\n  static const Duration _defaultNormalAnimation = Duration(milliseconds: 300);\n  static const Duration _defaultLongAnimation = Duration(milliseconds: 500);\n\n  static Duration onlyIfEnabled(final Duration duration) =>\n      disabled ? Duration.zero : duration;\n\n  static bool get disabled =>\n      SettingsDatabase.ready && SettingsDatabase.settings.disableAnimations;\n\n  static Duration get defaultQuickAnimation =>\n      onlyIfEnabled(_defaultQuickAnimation);\n\n  static Duration get defaultNormalAnimation =>\n      onlyIfEnabled(_defaultNormalAnimation);\n\n  static Duration get defaultLongAnimation =>\n      onlyIfEnabled(_defaultLongAnimation);\n}\n"
  },
  {
    "path": "lib/ui/utils/exports.dart",
    "content": "export 'animations.dart';\nexport 'placeholders.dart';\nexport 'relative_scale.dart';\nexport 'themer.dart';\nexport 'translations.dart';\n"
  },
  {
    "path": "lib/ui/utils/placeholders.dart",
    "content": "import 'dart:convert';\nimport 'dart:typed_data';\n\nabstract class Placeholders {\n  static const String transparent1x1ImageBase64 =\n      'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n\n  static final Uint8List transparent1x1Image =\n      base64.decode(transparent1x1ImageBase64);\n}\n"
  },
  {
    "path": "lib/ui/utils/relative_scale.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass RelativeScaler extends InheritedWidget {\n  const RelativeScaler({\n    required this.data,\n    required super.child,\n    super.key,\n  });\n\n  factory RelativeScaler.of(final BuildContext context) =>\n      context.dependOnInheritedWidgetOfExactType<RelativeScaler>()!;\n\n  final RelativeScaleData data;\n\n  @override\n  bool updateShouldNotify(final RelativeScaler oldWidget) =>\n      oldWidget.data != data && oldWidget.data != data;\n\n  double scale(\n    final double any, {\n    final double? sm,\n    final double? md,\n    final double? lg,\n    final double? xl,\n  }) =>\n      data.scale(any, sm: sm, md: md, lg: lg, xl: xl);\n\n  T responsive<T>(\n    final T any, {\n    final T? sm,\n    final T? md,\n    final T? lg,\n    final T? xl,\n  }) =>\n      data.responsive(any, sm: sm, md: md, lg: lg, xl: xl);\n\n  T responsiveBuilder<T>(\n    final T Function() any, {\n    final T Function()? sm,\n    final T Function()? md,\n    final T Function()? lg,\n    final T Function()? xl,\n  }) =>\n      data.responsiveBuilder(any, sm: sm, md: md, lg: lg, xl: xl);\n}\n\nclass RelativeScaleData {\n  const RelativeScaleData({\n    required this.multiplier,\n    required this.screen,\n  });\n\n  factory RelativeScaleData.fromSettingsNoResponsive() =>\n      RelativeScaleData(multiplier: getScaleMultiplier(), screen: Size.zero);\n\n  final double multiplier;\n  final Size screen;\n\n  double scale(\n    final double any, {\n    final double? sm,\n    final double? md,\n    final double? lg,\n    final double? xl,\n  }) =>\n      scaleRatio * responsive(any, sm: sm, md: md, lg: lg, xl: xl);\n\n  T responsive<T>(\n    final T any, {\n    final T? sm,\n    final T? md,\n    final T? lg,\n    final T? xl,\n  }) =>\n      switch (screen.width) {\n        > xlWidth when xl != null => xl,\n        > lgWidth when lg != null => lg,\n        > mdWidth when md != null => md,\n        > smWidth when sm != null => sm,\n        _ => any,\n      };\n\n  T responsiveBuilder<T>(\n    final T Function() any, {\n    final T Function()? sm,\n    final T Function()? md,\n    final T Function()? lg,\n    final T Function()? xl,\n  }) =>\n      switch (screen.width) {\n        > xlWidth when xl != null => xl(),\n        > lgWidth when lg != null => lg(),\n        > mdWidth when md != null => md(),\n        > smWidth when sm != null => sm(),\n        _ => any(),\n      };\n\n  RelativeScaleData copyWith({\n    final double? multiplier,\n    final Size? screen,\n  }) =>\n      RelativeScaleData(\n        multiplier: multiplier ?? this.multiplier,\n        screen: screen ?? this.screen,\n      );\n\n  static const double scaleRatio = 14;\n  static const double defaultScaleMultiplier = 1;\n\n  static const double smWidth = 640;\n  static const double mdWidth = 768;\n  static const double lgWidth = 1024;\n  static const double xlWidth = 1280;\n\n  static double getScaleMultiplier() => SettingsDatabase.ready\n      ? SettingsDatabase.settings.scaleMultiplier\n      : defaultScaleMultiplier;\n\n  static Size getScreenSize(final BuildContext context) =>\n      MediaQuery.of(context).size;\n}\n\nextension RelativeScalerUtils on BuildContext {\n  RelativeScaler get r => RelativeScaler.of(this);\n}\n"
  },
  {
    "path": "lib/ui/utils/themer.dart",
    "content": "import 'package:flutter/scheduler.dart';\nimport 'package:kazahana/core/exports.dart';\nimport 'relative_scale.dart';\n\nabstract class Themer {\n  static Color _findColor(final String? color, final Color fallback) {\n    if (color == null) return fallback;\n    return ForegroundColors.find(color) ?? fallback;\n  }\n\n  static ThemerThemeData getCurrentTheme() {\n    final Color foreground = _findColor(\n      SettingsDatabase.settings.primaryColor,\n      ThemerThemeData.defaultForeground,\n    );\n    final Brightness brightness =\n        SettingsDatabase.settings.useSystemPreferredTheme\n            ? SchedulerBinding.instance.platformDispatcher.platformBrightness\n            : SettingsDatabase.settings.darkMode\n                ? Brightness.dark\n                : Brightness.light;\n    return ThemerThemeData(foreground: foreground, brightness: brightness);\n  }\n\n  static ThemerThemeData defaultTheme() => const ThemerThemeData();\n}\n\nclass ThemerThemeData {\n  const ThemerThemeData({\n    this.foreground = defaultForeground,\n    this.brightness = defaultBrightness,\n    this.fontFamily = defaultFontFamily,\n  });\n\n  final Color foreground;\n  final Brightness brightness;\n  final String fontFamily;\n\n  ThemeData getThemeData(final BuildContext context) {\n    final ColorScheme colorScheme = ColorScheme.fromSeed(\n      seedColor: foreground,\n      brightness: brightness,\n    );\n\n    final Typography defaultTypography =\n        Typography.material2021(colorScheme: colorScheme);\n    final TextTheme defaultTextTheme = brightness == Brightness.light\n        ? defaultTypography.black\n        : defaultTypography.white;\n    final TextTheme textTheme = defaultTextTheme\n        .merge(\n          TextTheme(\n            displayLarge: TextStyle(fontSize: context.r.scale(3.2)),\n            displayMedium: TextStyle(fontSize: context.r.scale(3)),\n            displaySmall: TextStyle(fontSize: context.r.scale(2.8)),\n            headlineLarge: TextStyle(fontSize: context.r.scale(2.6)),\n            headlineMedium: TextStyle(fontSize: context.r.scale(2.4)),\n            headlineSmall: TextStyle(fontSize: context.r.scale(2.2)),\n            titleLarge: TextStyle(fontSize: context.r.scale(1.8)),\n            titleMedium: TextStyle(fontSize: context.r.scale(1.6)),\n            titleSmall: TextStyle(fontSize: context.r.scale(1.4)),\n            bodyLarge: TextStyle(fontSize: context.r.scale(1.2)),\n            bodyMedium: TextStyle(fontSize: context.r.scale(1.1)),\n            bodySmall: TextStyle(fontSize: context.r.scale(1)),\n            labelLarge: TextStyle(fontSize: context.r.scale(0.9)),\n            labelMedium: TextStyle(fontSize: context.r.scale(0.8)),\n            labelSmall: TextStyle(fontSize: context.r.scale(0.7)),\n          ),\n        )\n        .apply(fontFamily: fontFamily);\n\n    return ThemeData(\n      brightness: brightness,\n      colorScheme: colorScheme,\n      textTheme: textTheme,\n      useMaterial3: true,\n      // ? Below properties are workarounds until\n      // ? https://github.com/flutter/flutter/issues/91772 is resolved.\n      // appBarTheme: AppBarTheme(backgroundColor: backgroundColorLevel1),\n      bottomAppBarTheme: BottomAppBarTheme(color: colorScheme.background),\n      // scaffoldBackgroundColor: backgroundColorLevel0,\n      // TODO: https://docs.flutter.dev/release/breaking-changes/toggleable-active-color#migration-guide\n      // toggleableActiveColor: foreground.c500,\n      // canvasColor: backgroundColorLevel2,\n      // dialogBackgroundColor: backgroundColorLevel1,\n    );\n  }\n\n  static const String defaultForegroundName = 'indigo';\n  static const Color defaultForeground = ForegroundColors.indigo;\n  static const Brightness defaultBrightness = Brightness.dark;\n  static const String defaultFontFamily = Fonts.inter;\n}\n"
  },
  {
    "path": "lib/ui/utils/translations.dart",
    "content": "import 'package:kazahana/core/exports.dart';\n\nclass TranslationWrapper extends InheritedWidget {\n  const TranslationWrapper({\n    required this.id,\n    required super.child,\n    super.key,\n  });\n\n  final String id;\n\n  @override\n  bool updateShouldNotify(final TranslationWrapper oldWidget) =>\n      oldWidget.id != id;\n\n  Translation get t => Translator.currentTranslation;\n\n  static TranslationWrapper of(final BuildContext context) =>\n      context.dependOnInheritedWidgetOfExactType<TranslationWrapper>()!;\n}\n\nextension TranslationWrapperUtils on BuildContext {\n  Translation get t => TranslationWrapper.of(this).t;\n}\n"
  },
  {
    "path": "linux/.gitignore",
    "content": "flutter/ephemeral\n"
  },
  {
    "path": "linux/CMakeLists.txt",
    "content": "# Project-level configuration.\ncmake_minimum_required(VERSION 3.10)\nproject(runner LANGUAGES CXX)\n\n# The name of the executable created for the application. Change this to change\n# the on-disk name of your application.\nset(BINARY_NAME \"kazahana\")\n# The unique GTK application identifier for this application. See:\n# https://wiki.gnome.org/HowDoI/ChooseApplicationID\nset(APPLICATION_ID \"io.github.yukino_org.kazahana\")\n\n# Explicitly opt in to modern CMake behaviors to avoid warnings with recent\n# versions of CMake.\ncmake_policy(SET CMP0063 NEW)\n\n# Load bundled libraries from the lib/ directory relative to the binary.\nset(CMAKE_INSTALL_RPATH \"$ORIGIN/lib\")\n\n# Root filesystem for cross-building.\nif(FLUTTER_TARGET_PLATFORM_SYSROOT)\n  set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})\n  set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})\n  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n  set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)\n  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\nendif()\n\n# Define build configuration options.\nif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)\n  set(CMAKE_BUILD_TYPE \"Debug\" CACHE\n    STRING \"Flutter build mode\" FORCE)\n  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS\n    \"Debug\" \"Profile\" \"Release\")\nendif()\n\n# Compilation settings that should be applied to most targets.\n#\n# Be cautious about adding new options here, as plugins use this function by\n# default. In most cases, you should add new options to specific targets instead\n# of modifying this function.\nfunction(APPLY_STANDARD_SETTINGS TARGET)\n  target_compile_features(${TARGET} PUBLIC cxx_std_14)\n  target_compile_options(${TARGET} PRIVATE -Wall -Werror)\n  target_compile_options(${TARGET} PRIVATE \"$<$<NOT:$<CONFIG:Debug>>:-O3>\")\n  target_compile_definitions(${TARGET} PRIVATE \"$<$<NOT:$<CONFIG:Debug>>:NDEBUG>\")\nendfunction()\n\n# Flutter library and tool build rules.\nset(FLUTTER_MANAGED_DIR \"${CMAKE_CURRENT_SOURCE_DIR}/flutter\")\nadd_subdirectory(${FLUTTER_MANAGED_DIR})\n\n# System-level dependencies.\nfind_package(PkgConfig REQUIRED)\npkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)\n\nadd_definitions(-DAPPLICATION_ID=\"${APPLICATION_ID}\")\n\n# Define the application target. To change its name, change BINARY_NAME above,\n# not the value here, or `flutter run` will no longer work.\n#\n# Any new source files that you add to the application should be added here.\nadd_executable(${BINARY_NAME}\n  \"main.cc\"\n  \"my_application.cc\"\n  \"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc\"\n)\n\n# Apply the standard set of build settings. This can be removed for applications\n# that need different build settings.\napply_standard_settings(${BINARY_NAME})\n\n# Add dependency libraries. Add any application-specific dependencies here.\ntarget_link_libraries(${BINARY_NAME} PRIVATE flutter)\ntarget_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)\n\n# Run the Flutter tool portions of the build. This must not be removed.\nadd_dependencies(${BINARY_NAME} flutter_assemble)\n\n# Only the install-generated bundle's copy of the executable will launch\n# correctly, since the resources must in the right relative locations. To avoid\n# people trying to run the unbundled copy, put it in a subdirectory instead of\n# the default top-level location.\nset_target_properties(${BINARY_NAME}\n  PROPERTIES\n  RUNTIME_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/intermediates_do_not_run\"\n)\n\n\n# Generated plugin build rules, which manage building the plugins and adding\n# them to the application.\ninclude(flutter/generated_plugins.cmake)\n\n\n# === Installation ===\n# By default, \"installing\" just makes a relocatable bundle in the build\n# directory.\nset(BUILD_BUNDLE_DIR \"${PROJECT_BINARY_DIR}/bundle\")\nif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)\n  set(CMAKE_INSTALL_PREFIX \"${BUILD_BUNDLE_DIR}\" CACHE PATH \"...\" FORCE)\nendif()\n\n# Start with a clean build bundle directory every time.\ninstall(CODE \"\n  file(REMOVE_RECURSE \\\"${BUILD_BUNDLE_DIR}/\\\")\n  \" COMPONENT Runtime)\n\nset(INSTALL_BUNDLE_DATA_DIR \"${CMAKE_INSTALL_PREFIX}/data\")\nset(INSTALL_BUNDLE_LIB_DIR \"${CMAKE_INSTALL_PREFIX}/lib\")\n\ninstall(TARGETS ${BINARY_NAME} RUNTIME DESTINATION \"${CMAKE_INSTALL_PREFIX}\"\n  COMPONENT Runtime)\n\ninstall(FILES \"${FLUTTER_ICU_DATA_FILE}\" DESTINATION \"${INSTALL_BUNDLE_DATA_DIR}\"\n  COMPONENT Runtime)\n\ninstall(FILES \"${FLUTTER_LIBRARY}\" DESTINATION \"${INSTALL_BUNDLE_LIB_DIR}\"\n  COMPONENT Runtime)\n\nforeach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})\n  install(FILES \"${bundled_library}\"\n    DESTINATION \"${INSTALL_BUNDLE_LIB_DIR}\"\n    COMPONENT Runtime)\nendforeach(bundled_library)\n\n# Copy the native assets provided by the build.dart from all packages.\nset(NATIVE_ASSETS_DIR \"${PROJECT_BUILD_DIR}native_assets/linux/\")\ninstall(DIRECTORY \"${NATIVE_ASSETS_DIR}\"\n   DESTINATION \"${INSTALL_BUNDLE_LIB_DIR}\"\n   COMPONENT Runtime)\n\n# Fully re-copy the assets directory on each build to avoid having stale files\n# from a previous install.\nset(FLUTTER_ASSET_DIR_NAME \"flutter_assets\")\ninstall(CODE \"\n  file(REMOVE_RECURSE \\\"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\\\")\n  \" COMPONENT Runtime)\ninstall(DIRECTORY \"${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}\"\n  DESTINATION \"${INSTALL_BUNDLE_DATA_DIR}\" COMPONENT Runtime)\n\n# Install the AOT library on non-Debug builds only.\nif(NOT CMAKE_BUILD_TYPE MATCHES \"Debug\")\n  install(FILES \"${AOT_LIBRARY}\" DESTINATION \"${INSTALL_BUNDLE_LIB_DIR}\"\n    COMPONENT Runtime)\nendif()\n"
  },
  {
    "path": "linux/flutter/CMakeLists.txt",
    "content": "# This file controls Flutter-level build steps. It should not be edited.\ncmake_minimum_required(VERSION 3.10)\n\nset(EPHEMERAL_DIR \"${CMAKE_CURRENT_SOURCE_DIR}/ephemeral\")\n\n# Configuration provided via flutter tool.\ninclude(${EPHEMERAL_DIR}/generated_config.cmake)\n\n# TODO: Move the rest of this into files in ephemeral. See\n# https://github.com/flutter/flutter/issues/57146.\n\n# Serves the same purpose as list(TRANSFORM ... PREPEND ...),\n# which isn't available in 3.10.\nfunction(list_prepend LIST_NAME PREFIX)\n    set(NEW_LIST \"\")\n    foreach(element ${${LIST_NAME}})\n        list(APPEND NEW_LIST \"${PREFIX}${element}\")\n    endforeach(element)\n    set(${LIST_NAME} \"${NEW_LIST}\" PARENT_SCOPE)\nendfunction()\n\n# === Flutter Library ===\n# System-level dependencies.\nfind_package(PkgConfig REQUIRED)\npkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)\npkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)\npkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)\n\nset(FLUTTER_LIBRARY \"${EPHEMERAL_DIR}/libflutter_linux_gtk.so\")\n\n# Published to parent scope for install step.\nset(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)\nset(FLUTTER_ICU_DATA_FILE \"${EPHEMERAL_DIR}/icudtl.dat\" PARENT_SCOPE)\nset(PROJECT_BUILD_DIR \"${PROJECT_DIR}/build/\" PARENT_SCOPE)\nset(AOT_LIBRARY \"${PROJECT_DIR}/build/lib/libapp.so\" PARENT_SCOPE)\n\nlist(APPEND FLUTTER_LIBRARY_HEADERS\n  \"fl_basic_message_channel.h\"\n  \"fl_binary_codec.h\"\n  \"fl_binary_messenger.h\"\n  \"fl_dart_project.h\"\n  \"fl_engine.h\"\n  \"fl_json_message_codec.h\"\n  \"fl_json_method_codec.h\"\n  \"fl_message_codec.h\"\n  \"fl_method_call.h\"\n  \"fl_method_channel.h\"\n  \"fl_method_codec.h\"\n  \"fl_method_response.h\"\n  \"fl_plugin_registrar.h\"\n  \"fl_plugin_registry.h\"\n  \"fl_standard_message_codec.h\"\n  \"fl_standard_method_codec.h\"\n  \"fl_string_codec.h\"\n  \"fl_value.h\"\n  \"fl_view.h\"\n  \"flutter_linux.h\"\n)\nlist_prepend(FLUTTER_LIBRARY_HEADERS \"${EPHEMERAL_DIR}/flutter_linux/\")\nadd_library(flutter INTERFACE)\ntarget_include_directories(flutter INTERFACE\n  \"${EPHEMERAL_DIR}\"\n)\ntarget_link_libraries(flutter INTERFACE \"${FLUTTER_LIBRARY}\")\ntarget_link_libraries(flutter INTERFACE\n  PkgConfig::GTK\n  PkgConfig::GLIB\n  PkgConfig::GIO\n)\nadd_dependencies(flutter flutter_assemble)\n\n# === Flutter tool backend ===\n# _phony_ is a non-existent file to force this command to run every time,\n# since currently there's no way to get a full input/output list from the\n# flutter tool.\nadd_custom_command(\n  OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}\n    ${CMAKE_CURRENT_BINARY_DIR}/_phony_\n  COMMAND ${CMAKE_COMMAND} -E env\n    ${FLUTTER_TOOL_ENVIRONMENT}\n    \"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh\"\n      ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}\n  VERBATIM\n)\nadd_custom_target(flutter_assemble DEPENDS\n  \"${FLUTTER_LIBRARY}\"\n  ${FLUTTER_LIBRARY_HEADERS}\n)\n"
  },
  {
    "path": "linux/flutter/generated_plugin_registrant.cc",
    "content": "//\n//  Generated file. Do not edit.\n//\n\n// clang-format off\n\n#include \"generated_plugin_registrant.h\"\n\n#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>\n#include <media_kit_video/media_kit_video_plugin.h>\n#include <url_launcher_linux/url_launcher_plugin.h>\n\nvoid fl_register_plugins(FlPluginRegistry* registry) {\n  g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =\n      fl_plugin_registry_get_registrar_for_plugin(registry, \"MediaKitLibsLinuxPlugin\");\n  media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);\n  g_autoptr(FlPluginRegistrar) media_kit_video_registrar =\n      fl_plugin_registry_get_registrar_for_plugin(registry, \"MediaKitVideoPlugin\");\n  media_kit_video_plugin_register_with_registrar(media_kit_video_registrar);\n  g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =\n      fl_plugin_registry_get_registrar_for_plugin(registry, \"UrlLauncherPlugin\");\n  url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);\n}\n"
  },
  {
    "path": "linux/flutter/generated_plugin_registrant.h",
    "content": "//\n//  Generated file. Do not edit.\n//\n\n// clang-format off\n\n#ifndef GENERATED_PLUGIN_REGISTRANT_\n#define GENERATED_PLUGIN_REGISTRANT_\n\n#include <flutter_linux/flutter_linux.h>\n\n// Registers Flutter plugins.\nvoid fl_register_plugins(FlPluginRegistry* registry);\n\n#endif  // GENERATED_PLUGIN_REGISTRANT_\n"
  },
  {
    "path": "linux/flutter/generated_plugins.cmake",
    "content": "#\n# Generated file, do not edit.\n#\n\nlist(APPEND FLUTTER_PLUGIN_LIST\n  media_kit_libs_linux\n  media_kit_video\n  url_launcher_linux\n)\n\nlist(APPEND FLUTTER_FFI_PLUGIN_LIST\n  media_kit_native_event_loop\n)\n\nset(PLUGIN_BUNDLED_LIBRARIES)\n\nforeach(plugin ${FLUTTER_PLUGIN_LIST})\n  add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})\n  target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)\n  list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)\n  list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})\nendforeach(plugin)\n\nforeach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})\n  add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})\n  list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})\nendforeach(ffi_plugin)\n"
  },
  {
    "path": "linux/main.cc",
    "content": "#include \"my_application.h\"\n\nint main(int argc, char** argv) {\n  g_autoptr(MyApplication) app = my_application_new();\n  return g_application_run(G_APPLICATION(app), argc, argv);\n}\n"
  },
  {
    "path": "linux/my_application.cc",
    "content": "#include \"my_application.h\"\n\n#include <flutter_linux/flutter_linux.h>\n#ifdef GDK_WINDOWING_X11\n#include <gdk/gdkx.h>\n#endif\n\n#include \"flutter/generated_plugin_registrant.h\"\n\nstruct _MyApplication {\n  GtkApplication parent_instance;\n  char** dart_entrypoint_arguments;\n};\n\nG_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)\n\n// Implements GApplication::activate.\nstatic void my_application_activate(GApplication* application) {\n  MyApplication* self = MY_APPLICATION(application);\n  GtkWindow* window =\n      GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));\n\n  // Use a header bar when running in GNOME as this is the common style used\n  // by applications and is the setup most users will be using (e.g. Ubuntu\n  // desktop).\n  // If running on X and not using GNOME then just use a traditional title bar\n  // in case the window manager does more exotic layout, e.g. tiling.\n  // If running on Wayland assume the header bar will work (may need changing\n  // if future cases occur).\n  gboolean use_header_bar = TRUE;\n#ifdef GDK_WINDOWING_X11\n  GdkScreen* screen = gtk_window_get_screen(window);\n  if (GDK_IS_X11_SCREEN(screen)) {\n    const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);\n    if (g_strcmp0(wm_name, \"GNOME Shell\") != 0) {\n      use_header_bar = FALSE;\n    }\n  }\n#endif\n  if (use_header_bar) {\n    GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());\n    gtk_widget_show(GTK_WIDGET(header_bar));\n    gtk_header_bar_set_title(header_bar, \"kazahana\");\n    gtk_header_bar_set_show_close_button(header_bar, TRUE);\n    gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));\n  } else {\n    gtk_window_set_title(window, \"kazahana\");\n  }\n\n  gtk_window_set_default_size(window, 1280, 720);\n  gtk_widget_show(GTK_WIDGET(window));\n\n  g_autoptr(FlDartProject) project = fl_dart_project_new();\n  fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);\n\n  FlView* view = fl_view_new(project);\n  gtk_widget_show(GTK_WIDGET(view));\n  gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));\n\n  fl_register_plugins(FL_PLUGIN_REGISTRY(view));\n\n  gtk_widget_grab_focus(GTK_WIDGET(view));\n}\n\n// Implements GApplication::local_command_line.\nstatic gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {\n  MyApplication* self = MY_APPLICATION(application);\n  // Strip out the first argument as it is the binary name.\n  self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);\n\n  g_autoptr(GError) error = nullptr;\n  if (!g_application_register(application, nullptr, &error)) {\n     g_warning(\"Failed to register: %s\", error->message);\n     *exit_status = 1;\n     return TRUE;\n  }\n\n  g_application_activate(application);\n  *exit_status = 0;\n\n  return TRUE;\n}\n\n// Implements GObject::dispose.\nstatic void my_application_dispose(GObject* object) {\n  MyApplication* self = MY_APPLICATION(object);\n  g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);\n  G_OBJECT_CLASS(my_application_parent_class)->dispose(object);\n}\n\nstatic void my_application_class_init(MyApplicationClass* klass) {\n  G_APPLICATION_CLASS(klass)->activate = my_application_activate;\n  G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;\n  G_OBJECT_CLASS(klass)->dispose = my_application_dispose;\n}\n\nstatic void my_application_init(MyApplication* self) {}\n\nMyApplication* my_application_new() {\n  return MY_APPLICATION(g_object_new(my_application_get_type(),\n                                     \"application-id\", APPLICATION_ID,\n                                     \"flags\", G_APPLICATION_NON_UNIQUE,\n                                     nullptr));\n}\n"
  },
  {
    "path": "linux/my_application.h",
    "content": "#ifndef FLUTTER_MY_APPLICATION_H_\n#define FLUTTER_MY_APPLICATION_H_\n\n#include <gtk/gtk.h>\n\nG_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,\n                     GtkApplication)\n\n/**\n * my_application_new:\n *\n * Creates a new Flutter-based application.\n *\n * Returns: a new #MyApplication.\n */\nMyApplication* my_application_new();\n\n#endif  // FLUTTER_MY_APPLICATION_H_\n"
  },
  {
    "path": "package.json",
    "content": "{\n    \"name\": \"@yukino-org/kazahana\",\n    \"description\": \"\",\n    \"private\": true,\n    \"version\": \"0.0.0\",\n    \"author\": \"Zyrouge\",\n    \"license\": \"GPL-3.0\",\n    \"scripts\": {\n        \"i18n:build\": \"phrasey build -p ./.phrasey/config.toml -f toml\"\n    },\n    \"dependencies\": {\n        \"@zyrouge/phrasey-json\": \"^1.0.3\",\n        \"@zyrouge/phrasey-locales\": \"^1.1.9\",\n        \"@zyrouge/phrasey-toml\": \"^1.0.3\",\n        \"fs-extra\": \"^11.1.1\",\n        \"phrasey\": \"^2.0.25\"\n    }\n}\n"
  },
  {
    "path": "packages/anilist/.gitignore",
    "content": "# Files and directories created by pub.\n.dart_tool/\n.packages\n\n# Conventional directory for build output.\nbuild/\n"
  },
  {
    "path": "packages/anilist/.vscode/settings.json",
    "content": "{\n    \"editor.formatOnSave\": true\n}"
  },
  {
    "path": "packages/anilist/README.md",
    "content": "A sample command-line application with an entrypoint in `bin/`, library code\nin `lib/`, and example unit test in `test/`.\n"
  },
  {
    "path": "packages/anilist/analysis_options.yaml",
    "content": "include: package:devx/analysis_options.yaml\n"
  },
  {
    "path": "packages/anilist/lib/anilist.dart",
    "content": "export 'endpoints/exports.dart';\nexport 'models/exports.dart';\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/exports.dart",
    "content": "export 'graphql.dart';\nexport 'media.dart';\nexport 'media_list.dart';\nexport 'relation.dart';\nexport 'user.dart';\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/graphql.dart",
    "content": "import 'dart:convert';\nimport 'package:shared/http.dart' as http;\nimport 'package:utilx/utilx.dart';\nimport '../models/exports.dart';\n\nclass AnilistGraphQLRequest {\n  const AnilistGraphQLRequest({\n    required this.query,\n    this.variables = const <String, dynamic>{},\n  });\n\n  final String query;\n  final Map<String, dynamic> variables;\n\n  String get body => json.encode(<dynamic, dynamic>{\n        'query': query,\n        'variables': variables,\n      });\n}\n\nclass AnilistGraphQLResponse {\n  const AnilistGraphQLResponse(this.response);\n\n  final http.Response response;\n\n  JsonMap get body => json.decode(response.body) as JsonMap;\n  JsonMap? get data => body['data'] as JsonMap?;\n  List<String>? get errors => hasErrors\n      ? castList<JsonMap>(body['errors'])\n          .map((final JsonMap x) => x['message'] as String)\n          .toList()\n      : null;\n\n  bool get hasErrors => body['errors'] != null;\n  Exception get asException => throw Exception(\n        'Request failed with status code ${response.statusCode} and errors: ${errors?.map((final String x) => '\"$x\"').join(', ') ?? '?'}',\n      );\n}\n\nabstract class AnilistGraphQL {\n  static final Uri baseURL = Uri.parse('https://graphql.anilist.co');\n  static const Map<String, String> defaultHeaders = <String, String>{\n    'Content-Type': 'application/json',\n    'Accept': 'application/json',\n  };\n\n  static AnilistToken? token;\n  static void Function()? onTokenExpired;\n  static final Map<String, String> additionalHeaders = <String, String>{};\n\n  static void updateClient({\n    required final AnilistToken? token,\n    required final void Function()? onTokenExpired,\n    required final Map<String, String>? additionalHeaders,\n  }) {\n    AnilistGraphQL.token = token;\n    AnilistGraphQL.onTokenExpired = onTokenExpired;\n    if (additionalHeaders != null) {\n      AnilistGraphQL.additionalHeaders.addAll(additionalHeaders);\n    }\n  }\n\n  static Future<AnilistGraphQLResponse> request(\n    final AnilistGraphQLRequest request, {\n    final bool retryOnExpiredSession = true,\n  }) async {\n    final http.Response resp = await http.client.post(\n      baseURL,\n      headers: <String, String>{\n        ...defaultHeaders,\n        ...additionalHeaders,\n        if (token != null)\n          'Authorization': '${token!.tokenType} ${token!.accessToken}',\n      },\n      body: request.body,\n    );\n    final AnilistGraphQLResponse parsed = AnilistGraphQLResponse(resp);\n    if (parsed.hasErrors &&\n        retryOnExpiredSession &&\n        parsed.errors!.contains('Invalid token')) {\n      token = null;\n      return AnilistGraphQL.request(request);\n    }\n    return parsed;\n  }\n\n  static bool get isAuthenticated => token != null;\n}\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/media.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../models/exports.dart';\nimport 'graphql.dart';\n\nabstract class AnilistMediaEndpoints {\n  static Future<AnilistMedia> fetchId(\n    final int id, {\n    final int page = 1,\n    final int perPage = 20,\n  }) async {\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      AnilistGraphQLRequest(\n        query: '''\nquery (\\$id: Int) {\n  Media (id: \\$id) ${AnilistMedia.query}\n}\n''',\n        variables: <String, dynamic>{\n          'id': id,\n        },\n      ),\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return AnilistMedia(data['Media'] as JsonMap);\n  }\n\n  static Future<List<AnilistMedia>> search(\n    final String terms, {\n    final int page = 1,\n    final int perPage = 20,\n  }) async =>\n      fetchBulk(\n        <TripleTuple<String, String, dynamic>>[\n          TripleTuple<String, String, dynamic>('search', 'String', terms),\n        ],\n        page: page,\n        perPage: perPage,\n      );\n\n  static Future<List<AnilistMedia>> trendingAnimes() async {\n    final DateTime now = DateTime.now();\n    return fetchBulk(<TripleTuple<String, String, dynamic>>[\n      TripleTuple<String, String, dynamic>(\n        'type',\n        'MediaType',\n        AnilistMediaType.anime.stringify,\n      ),\n      TripleTuple<String, String, dynamic>(\n        'sort',\n        '[MediaSort]',\n        <String>[\n          AnilistMediaSort.trendingDesc.stringify,\n          AnilistMediaSort.popularityDesc.stringify,\n        ],\n      ),\n      TripleTuple<String, String, dynamic>(\n        'season',\n        'MediaSeason',\n        getAnimeSeasonFromMonth(now.month).stringify,\n      ),\n      TripleTuple<String, String, dynamic>(\n        'seasonYear',\n        'Int',\n        now.year,\n      ),\n    ]);\n  }\n\n  static Future<List<AnilistMedia>> topOngoingAnimes() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.anime.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n        TripleTuple<String, String, dynamic>(\n          'status',\n          'MediaStatus',\n          AnilistMediaStatus.releasing.stringify,\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> mostPopularAnimes() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.anime.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> trendingMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> topOngoingMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n        TripleTuple<String, String, dynamic>(\n          'status',\n          'MediaStatus',\n          AnilistMediaStatus.releasing.stringify,\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> mostPopularMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> fetchBulk(\n    final List<TripleTuple<String, String, dynamic>> queries, {\n    final int page = 1,\n    final int perPage = 20,\n  }) async {\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      AnilistGraphQLRequest(\n        query: '''\nquery (\n  \\$page: Int,\n  \\$perPage: Int,\n  ${queries.map((final TripleTuple<String, String, dynamic> x) => '\\$${x.first}: ${x.middle}').join(',\\n')}\n) {\n  Page (page: \\$page, perPage: \\$perPage) {\n    media (\n      ${queries.map((final TripleTuple<String, String, dynamic> x) => '${x.first}: \\$${x.first}').join(',\\n')}\n    ) ${AnilistMedia.query}\n  }\n}\n''',\n        variables: <String, dynamic>{\n          'page': page,\n          'perPage': perPage,\n          ...queries.asMap().map(\n                (final _, final TripleTuple<String, String, dynamic> x) =>\n                    MapEntry<String, dynamic>(x.first, x.last),\n              ),\n        },\n      ),\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return MapUtils.get<List<dynamic>>(data, <String>['Page', 'media'])\n        .map((final dynamic x) => AnilistMedia(x as JsonMap))\n        .toList();\n  }\n}\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/media_list.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../models/exports.dart';\nimport 'graphql.dart';\n\nabstract class AnilistMediaListEndpoints {\n  static Future<List<AnilistMedia>> fetch({\n    required final int userId,\n    required final AnilistMediaType type,\n    required final AnilistMediaListStatus status,\n    required final AnilistMediaListSort sort,\n    final int page = 1,\n    final int perPage = 20,\n  }) async {\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      AnilistGraphQLRequest(\n        query: '''\nquery (\n  \\$page: Int\n  \\$perPage: Int\n  \\$userId: Int\n  \\$type: MediaType\n  \\$status: MediaListStatus\n  \\$sort: [MediaListSort]\n) {\n  Page (page: \\$page, perPage: \\$perPage) {\n    mediaList (\n      userId: \\$userId\n      type: \\$type\n      status: \\$status\n      sort: \\$sort\n    ) {\n      media ${AnilistMedia.query}\n    }\n  }\n}\n''',\n        variables: <String, dynamic>{\n          'page': page,\n          'perPage': perPage,\n          'userId': userId,\n          'type': type.stringify,\n          'status': status.stringify,\n          'sort': sort.stringify,\n        },\n      ),\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return MapUtils.get<List<dynamic>>(data, <String>['Page', 'mediaList'])\n        .cast<JsonMap>()\n        .map((final JsonMap x) => AnilistMedia(x['media'] as JsonMap))\n        .toList();\n  }\n}\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/relation.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../models/exports.dart';\nimport 'graphql.dart';\n\nabstract class AnilistMediaRelationEndpoints {\n  static Future<List<AnilistRelationEdge>> fetchRelations(\n    final int mediaId,\n  ) async {\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      AnilistGraphQLRequest(\n        query: '''\nquery (\\$id: Int) {\n  Media (id: \\$id) {\n    relations {\n      edges {\n        id\n        relationType\n        node ${AnilistMedia.query}\n      }\n    }\n  }\n}\n''',\n        variables: <String, dynamic>{\n          'id': mediaId,\n        },\n      ),\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return MapUtils.get<List<dynamic>>(\n      data,\n      <String>['Media', 'relations', 'edges'],\n    ).map((final dynamic x) => AnilistRelationEdge(x as JsonMap)).toList();\n  }\n}\n"
  },
  {
    "path": "packages/anilist/lib/endpoints/user.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../models/exports.dart';\nimport 'graphql.dart';\n\nabstract class AnilistUserEndpoints {\n  static Future<AnilistUser> getAuthenticatedUser() async {\n    if (!AnilistGraphQL.isAuthenticated) {\n      throw Exception('Authenticated required to perform this operation');\n    }\n\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      const AnilistGraphQLRequest(\n        query: '''\nquery {\n  Viewer ${AnilistUser.query}\n}\n''',\n      ),\n      retryOnExpiredSession: false,\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return AnilistUser(data['Viewer'] as JsonMap);\n  }\n\n  static Future<List<AnilistMedia>> search(\n    final String terms, {\n    final int page = 1,\n    final int perPage = 20,\n  }) async =>\n      fetchBulk(\n        <TripleTuple<String, String, dynamic>>[\n          TripleTuple<String, String, dynamic>('search', 'String', terms),\n        ],\n        page: page,\n        perPage: perPage,\n      );\n\n  static Future<List<AnilistMedia>> trendingAnimes() async {\n    final DateTime now = DateTime.now();\n    return fetchBulk(<TripleTuple<String, String, dynamic>>[\n      TripleTuple<String, String, dynamic>(\n        'type',\n        'MediaType',\n        AnilistMediaType.anime.stringify,\n      ),\n      TripleTuple<String, String, dynamic>(\n        'sort',\n        '[MediaSort]',\n        <String>[\n          AnilistMediaSort.trendingDesc.stringify,\n          AnilistMediaSort.popularityDesc.stringify,\n        ],\n      ),\n      TripleTuple<String, String, dynamic>(\n        'season',\n        'MediaSeason',\n        getAnimeSeasonFromMonth(now.month).stringify,\n      ),\n      TripleTuple<String, String, dynamic>(\n        'seasonYear',\n        'Int',\n        now.year,\n      ),\n    ]);\n  }\n\n  static Future<List<AnilistMedia>> topOngoingAnimes() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.anime.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n        TripleTuple<String, String, dynamic>(\n          'status',\n          'MediaStatus',\n          AnilistMediaStatus.releasing.stringify,\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> mostPopularAnimes() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.anime.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> trendingMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> topOngoingMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.trendingDesc.stringify,\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n        TripleTuple<String, String, dynamic>(\n          'status',\n          'MediaStatus',\n          AnilistMediaStatus.releasing.stringify,\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> mostPopularMangas() async =>\n      fetchBulk(<TripleTuple<String, String, dynamic>>[\n        TripleTuple<String, String, dynamic>(\n          'type',\n          'MediaType',\n          AnilistMediaType.manga.stringify,\n        ),\n        TripleTuple<String, String, dynamic>(\n          'sort',\n          '[MediaSort]',\n          <String>[\n            AnilistMediaSort.popularityDesc.stringify,\n          ],\n        ),\n      ]);\n\n  static Future<List<AnilistMedia>> fetchBulk(\n    final List<TripleTuple<String, String, dynamic>> queries, {\n    final int page = 1,\n    final int perPage = 20,\n  }) async {\n    final AnilistGraphQLResponse resp = await AnilistGraphQL.request(\n      AnilistGraphQLRequest(\n        query: '''\nquery (\n  \\$page: Int,\n  \\$perPage: Int,\n  ${queries.map((final TripleTuple<String, String, dynamic> x) => '\\$${x.first}: ${x.middle}').join(',\\n')}\n) {\n  Page (page: \\$page, perPage: \\$perPage) {\n    media (\n      ${queries.map((final TripleTuple<String, String, dynamic> x) => '${x.first}: \\$${x.first}').join(',\\n')}\n    ) ${AnilistMedia.query}\n  }\n}\n''',\n        variables: <String, dynamic>{\n          'page': page,\n          'perPage': perPage,\n          ...queries.asMap().map(\n                (final _, final TripleTuple<String, String, dynamic> x) =>\n                    MapEntry<String, dynamic>(x.first, x.last),\n              ),\n        },\n      ),\n    );\n\n    final JsonMap? data = resp.data;\n    if (data == null) throw resp.asException;\n\n    return MapUtils.get<List<dynamic>>(data, <String>['Page', 'media'])\n        .map((final dynamic x) => AnilistMedia(x as JsonMap))\n        .toList();\n  }\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/character.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../utils.dart';\nimport 'fuzzy_date.dart';\n\nclass AnilistCharacter {\n  const AnilistCharacter(this.json);\n\n  final JsonMap json;\n\n  int get id => json['id'] as int;\n  JsonMap get name => json['name'] as JsonMap;\n  String? get nameFirst => name['first'] as String?;\n  String? get nameMiddle => name['middle'] as String?;\n  String? get nameLast => name['last'] as String?;\n  String get nameFull => name['full'] as String;\n  String? get nameNative => name['native'] as String?;\n  String get nameUserPreferred => name['userPreferred'] as String;\n  JsonMap get image => json['image'] as JsonMap;\n  String get imageLarge => image['large'] as String;\n  String get imageMedium => image['medium'] as String;\n  String? get descriptionRaw => json['description'] as String?;\n  String? get description =>\n      descriptionRaw != null ? cleanHtml(descriptionRaw!) : null;\n  String? get gender => json['gender'] as String?;\n  JsonMap get dateOfBirthRaw => json['dateOfBirth'] as JsonMap;\n  AnilistFuzzyDate get dateOfBirth => AnilistFuzzyDate(dateOfBirthRaw);\n  String? get age => json['age'] as String?;\n  String? get bloodType => json['bloodType'] as String?;\n\n  static const String query = '''\n{\n  id\n  name {\n    first\n    middle\n    last\n    full\n    native\n    userPreferred\n  }\n  image {\n    large\n    medium\n  }\n  description\n  gender\n  dateOfBirth ${AnilistFuzzyDate.query}\n  age\n  bloodType\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/character_edge.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport 'character.dart';\nimport 'character_role.dart';\n\nclass AnilistCharacterEdge {\n  const AnilistCharacterEdge(this.json);\n\n  final JsonMap json;\n\n  int get id => json['id'] as int;\n  AnilistCharacterRole get role =>\n      parseAnilistCharacterRole(json['role'] as String);\n  AnilistCharacter get node => AnilistCharacter(json['node'] as JsonMap);\n\n  static const String query = '''\n{\n  node ${AnilistCharacter.query}\n  id\n  role\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/character_role.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistCharacterRole {\n  main,\n  supporting,\n  background,\n}\n\nextension AnilistCharacterRoleUtils on AnilistCharacterRole {\n  String get stringify => name.toUpperCase();\n}\n\nAnilistCharacterRole parseAnilistCharacterRole(final String value) =>\n    EnumUtils.find(AnilistCharacterRole.values, value.toLowerCase());\n"
  },
  {
    "path": "packages/anilist/lib/models/exports.dart",
    "content": "export 'character.dart';\nexport 'character_edge.dart';\nexport 'character_role.dart';\nexport 'fuzzy_date.dart';\nexport 'media.dart';\nexport 'media_format.dart';\nexport 'media_list_entry.dart';\nexport 'media_list_sort.dart';\nexport 'media_list_status.dart';\nexport 'media_sort.dart';\nexport 'media_status.dart';\nexport 'media_type.dart';\nexport 'relation_edge.dart';\nexport 'relation_type.dart';\nexport 'seasons.dart';\nexport 'token.dart';\nexport 'user.dart';\n"
  },
  {
    "path": "packages/anilist/lib/models/fuzzy_date.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nclass AnilistFuzzyDate {\n  const AnilistFuzzyDate(this.json);\n\n  final JsonMap json;\n\n  int? get year => json['year'] as int?;\n  int? get month => json['month'] as int?;\n  int? get day => json['day'] as int?;\n\n  bool get isValidDateTime => year != null && month != null && day != null;\n  DateTime? get asDateTime =>\n      isValidDateTime ? DateTime(year!, month!, day!) : null;\n\n  static const String query = '''\n{\n  year\n  month\n  day\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/media.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport '../endpoints/exports.dart';\nimport '../utils.dart';\nimport 'character_edge.dart';\nimport 'fuzzy_date.dart';\nimport 'media_format.dart';\nimport 'media_list_entry.dart';\nimport 'media_status.dart';\nimport 'media_type.dart';\nimport 'relation_edge.dart';\nimport 'seasons.dart';\n\nclass AnilistMedia {\n  AnilistMedia(this.json);\n\n  final JsonMap json;\n  List<AnilistRelationEdge>? relations;\n\n  int get id => json['id'] as int;\n  int? get idMal => json['idMal'] as int?;\n  JsonMap get title => json['title'] as JsonMap;\n  String get titleRomaji => title['romaji'] as String;\n  String? get titleEnglish => title['english'] as String?;\n  String get titleNative => title['native'] as String;\n  String get titleUserPreferred => title['userPreferred'] as String;\n  AnilistMediaType get type => parseAnilistMediaType(json['type'] as String);\n  AnilistMediaFormat get format =>\n      parseAnilistMediaFormat(json['format'] as String);\n  String? get descriptionRaw => json['description'] as String?;\n  String? get description =>\n      descriptionRaw != null ? cleanHtml(descriptionRaw!) : null;\n  JsonMap? get startDateRaw => json['startDate'] as JsonMap;\n  AnilistFuzzyDate? get startDate =>\n      startDateRaw != null ? AnilistFuzzyDate(startDateRaw!) : null;\n  JsonMap? get endDateRaw => json['endDate'] as JsonMap;\n  AnilistFuzzyDate? get endDate =>\n      endDateRaw != null ? AnilistFuzzyDate(endDateRaw!) : null;\n  AnimeSeasons? get season => json['season'] != null\n      ? parseAnimeSeason(json['season'] as String)\n      : null;\n  int? get seasonYear => json['seasonYear'] as int?;\n  int? get duration => json['duration'] as int?;\n  int? get chapters => json['chapters'] as int?;\n  int? get volumes => json['volumes'] as int?;\n  int? get episodes => json['episodes'] as int?;\n  JsonMap get coverImage => json['coverImage'] as JsonMap;\n  String get coverImageMedium => coverImage['medium'] as String;\n  String get coverImageLarge => coverImage['large'] as String;\n  String get coverImageExtraLarge => coverImage['extraLarge'] as String;\n  String? get coverImageColor => coverImage['color'] as String?;\n  String? get bannerImage => json['bannerImage'] as String?;\n  List<String> get genres => castList<String>(json['genres']);\n  List<String> get synonyms => castList<String>(json['synonyms']);\n  List<String> get tags => castList<JsonMap>(json['tags'])\n      .map((final JsonMap x) => x['name'] as String)\n      .toList();\n  List<AnilistCharacterEdge> get characters =>\n      castList<JsonMap>((json['characters'] as JsonMap)['edges'])\n          .map((final JsonMap x) => AnilistCharacterEdge(x))\n          .toList();\n  int? get meanScore => json['meanScore'] as int?;\n  bool get isAdult => json['isAdult'] as bool;\n  String get siteUrl => json['siteUrl'] as String;\n  int? get averageScore => json['averageScore'] as int?;\n  int get popularity => json['popularity'] as int;\n  AnilistMediaStatus get status =>\n      parseAnilistMediaStatus(json['status'] as String);\n  AnilistMediaListEntry? get mediaListEntry => json['mediaListEntry'] != null\n      ? AnilistMediaListEntry(json['mediaListEntry'] as JsonMap)\n      : null;\n\n  Future<void> fetchAll() async {\n    relations = await AnilistMediaRelationEndpoints.fetchRelations(id);\n  }\n\n  static const String query = '''\n{\n  id\n  idMal\n  title {\n    romaji\n    english\n    native\n    userPreferred\n  }\n  type\n  format\n  description\n  startDate ${AnilistFuzzyDate.query}\n  endDate ${AnilistFuzzyDate.query}\n  season\n  seasonYear\n  episodes\n  duration\n  chapters\n  volumes\n  coverImage {\n    medium\n    large\n    extraLarge\n    color\n  }\n  bannerImage\n  genres\n  synonyms\n  tags {\n    name\n  }\n  characters (sort: ROLE, page: 0, perPage: 15) {\n    edges ${AnilistCharacterEdge.query}\n  }\n  meanScore\n  isAdult\n  siteUrl\n  averageScore\n  popularity\n  status\n  mediaListEntry ${AnilistMediaListEntry.query}\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/media_format.dart",
    "content": "enum AnilistMediaFormat {\n  tv,\n  tvShort,\n  movie,\n  special,\n  ova,\n  ona,\n  music,\n  manga,\n  novel,\n  oneshot,\n}\n\nconst Map<AnilistMediaFormat, String> _anilistMediaFormatStringifyMap =\n    <AnilistMediaFormat, String>{\n  AnilistMediaFormat.tv: 'TV',\n  AnilistMediaFormat.tvShort: 'TV_SHORT',\n  AnilistMediaFormat.movie: 'MOVIE',\n  AnilistMediaFormat.special: 'SPECIAL',\n  AnilistMediaFormat.ova: 'OVA',\n  AnilistMediaFormat.ona: 'ONA',\n  AnilistMediaFormat.music: 'MUSIC',\n  AnilistMediaFormat.manga: 'MANGA',\n  AnilistMediaFormat.novel: 'NOVEL',\n  AnilistMediaFormat.oneshot: 'ONE_SHOT',\n};\n\nextension AnilistMediaFormatUtils on AnilistMediaFormat {\n  String get stringify => _anilistMediaFormatStringifyMap[this]!;\n}\n\nAnilistMediaFormat parseAnilistMediaFormat(final String value) =>\n    _anilistMediaFormatStringifyMap.entries\n        .firstWhere(\n          (final MapEntry<AnilistMediaFormat, String> x) => x.value == value,\n        )\n        .key;\n"
  },
  {
    "path": "packages/anilist/lib/models/media_list_entry.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport 'fuzzy_date.dart';\nimport 'media_list_status.dart';\n\nclass AnilistMediaListEntry {\n  const AnilistMediaListEntry(this.json);\n\n  final JsonMap json;\n\n  int get id => json['id'] as int;\n  int get userId => json['userId'] as int;\n  int get mediaId => json['mediaId'] as int;\n  AnilistMediaListStatus get status =>\n      parseAnilistMediaListStatus(json['status'] as String);\n  int get progress => json['progress'] as int;\n  int? get progressVolumes => json['progressVolumes'] as int?;\n  int get repeat => json['repeat'] as int;\n  int get score => json['score'] as int;\n  JsonMap? get startedAtRaw => json['startedAt'] as JsonMap?;\n  AnilistFuzzyDate? get startedAt =>\n      startedAtRaw != null ? AnilistFuzzyDate(startedAtRaw!) : null;\n  JsonMap? get completedAtRaw => json['completedAt'] as JsonMap?;\n  AnilistFuzzyDate? get completedAt =>\n      completedAtRaw != null ? AnilistFuzzyDate(completedAtRaw!) : null;\n\n  static const String query = '''\n{\n  id\n  userId\n  mediaId\n  status\n  progress\n  progressVolumes\n  repeat\n  score (format: POINT_100)\n  startedAt ${AnilistFuzzyDate.query}\n  completedAt ${AnilistFuzzyDate.query}\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/media_list_sort.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistMediaListSort {\n  mediaId,\n  mediaIdDesc,\n  score,\n  scoreDesc,\n  status,\n  statusDesc,\n  progress,\n  progressDesc,\n  progressVolumes,\n  progressVolumesDesc,\n  repeat,\n  repeatDesc,\n  priority,\n  priorityDesc,\n  startedOn,\n  startedOnDesc,\n  finishedOn,\n  finishedOnDesc,\n  addedTime,\n  addedTimeDesc,\n  updatedTime,\n  updatedTimeDesc,\n  mediaTitleRomaji,\n  mediaTitleRomajiDesc,\n  mediaTitleEnglish,\n  mediaTitleEnglishDesc,\n  mediaTitleNative,\n  mediaTitleNativeDesc,\n  mediaPopularity,\n  mediaPopularityDesc,\n}\n\nextension AnilistMediaListSortUtils on AnilistMediaListSort {\n  String get stringify => StringCase(name).snakeCase.toUpperCase();\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/media_list_status.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistMediaListStatus {\n  current,\n  planning,\n  completed,\n  dropped,\n  paused,\n  repeating,\n}\n\nextension AnilistMediaListStatusUtils on AnilistMediaListStatus {\n  String get stringify => name.toUpperCase();\n}\n\nAnilistMediaListStatus parseAnilistMediaListStatus(final String value) =>\n    EnumUtils.find(AnilistMediaListStatus.values, value.toLowerCase());\n"
  },
  {
    "path": "packages/anilist/lib/models/media_sort.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistMediaSort {\n  id,\n  idDesc,\n  titleRomaji,\n  titleRomajiDesc,\n  titleEnglish,\n  titleEnglishDesc,\n  titleNative,\n  titleNativeDesc,\n  type,\n  typeDesc,\n  format,\n  formatDesc,\n  startDate,\n  startDateDesc,\n  endDate,\n  endDateDesc,\n  score,\n  scoreDesc,\n  popularity,\n  popularityDesc,\n  trending,\n  trendingDesc,\n  episodes,\n  episodesDesc,\n  duration,\n  durationDesc,\n  status,\n  statusDesc,\n  chapters,\n  chaptersDesc,\n  volumes,\n  volumesDesc,\n  updatedAt,\n  updatedAtDesc,\n  searchMatch,\n  favourites,\n  favouritesDesc,\n}\n\nextension AnilistMediaSortUtils on AnilistMediaSort {\n  String get stringify => StringCase(name).snakeCase.toUpperCase();\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/media_status.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistMediaStatus {\n  finished,\n  releasing,\n  notYetReleased,\n  cancelled,\n  hiatus,\n}\n\nfinal Map<AnilistMediaStatus, String> _anilistMediaStatusStringifyMap =\n    AnilistMediaStatus.values.asMap().map(\n          (final _, final AnilistMediaStatus x) =>\n              MapEntry<AnilistMediaStatus, String>(\n            x,\n            StringCase(x.name).snakeCase.toUpperCase(),\n          ),\n        );\n\nextension AnilistMediaStatusUtils on AnilistMediaStatus {\n  String get stringify => _anilistMediaStatusStringifyMap[this]!;\n}\n\nAnilistMediaStatus parseAnilistMediaStatus(final String value) =>\n    _anilistMediaStatusStringifyMap.entries\n        .firstWhere(\n          (final MapEntry<AnilistMediaStatus, String> x) => x.value == value,\n        )\n        .key;\n"
  },
  {
    "path": "packages/anilist/lib/models/media_type.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistMediaType {\n  anime,\n  manga,\n}\n\nextension AnilistMediaTypeUtils on AnilistMediaType {\n  String get stringify => name.toUpperCase();\n}\n\nAnilistMediaType parseAnilistMediaType(final String value) =>\n    EnumUtils.find(AnilistMediaType.values, value.toLowerCase());\n"
  },
  {
    "path": "packages/anilist/lib/models/relation_edge.dart",
    "content": "import 'package:utilx/utilx.dart';\nimport 'media.dart';\nimport 'relation_type.dart';\n\nclass AnilistRelationEdge {\n  const AnilistRelationEdge(this.json);\n\n  final JsonMap json;\n\n  int get id => json['id'] as int;\n  AnilistRelationType get relationType =>\n      parseAnilistRelationType(json['relationType'] as String);\n  AnilistMedia get node => AnilistMedia(json['node'] as JsonMap);\n\n  static const String query = '''\nrelations {\n  edges {\n    id\n    relationType\n    node ${AnilistMedia.query}\n  }\n}\n  ''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/relation_type.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnilistRelationType {\n  adaptation,\n  prequel,\n  sequel,\n  parent,\n  sideStory,\n  character,\n  summary,\n  alternative,\n  spinOff,\n  other,\n  source,\n  compilation,\n  contains,\n}\n\nfinal Map<AnilistRelationType, String> _anilistMediaStatusStringifyMap =\n    AnilistRelationType.values.asMap().map(\n          (final _, final AnilistRelationType x) =>\n              MapEntry<AnilistRelationType, String>(\n            x,\n            StringCase(x.name).snakeCase.toUpperCase(),\n          ),\n        );\n\nextension AnilistRelationTypeUtils on AnilistRelationType {\n  String get stringify => _anilistMediaStatusStringifyMap[this]!;\n}\n\nAnilistRelationType parseAnilistRelationType(final String value) =>\n    _anilistMediaStatusStringifyMap.entries\n        .firstWhere(\n          (final MapEntry<AnilistRelationType, String> x) => x.value == value,\n        )\n        .key;\n"
  },
  {
    "path": "packages/anilist/lib/models/seasons.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nenum AnimeSeasons {\n  winter,\n  spring,\n  summer,\n  fall,\n}\n\nextension AnimeSeasonsUtils on AnimeSeasons {\n  String get stringify => name.toUpperCase();\n}\n\nAnimeSeasons parseAnimeSeason(final String code) =>\n    EnumUtils.find(AnimeSeasons.values, code.toLowerCase());\n\nAnimeSeasons getAnimeSeasonFromMonth(final int month) => switch (month) {\n      1 || 2 || 3 => AnimeSeasons.winter,\n      4 || 5 || 6 => AnimeSeasons.spring,\n      7 || 8 || 9 => AnimeSeasons.summer,\n      10 || 11 || 12 => AnimeSeasons.fall,\n      _ => throw Exception('Unexpected anime season month'),\n    };\n"
  },
  {
    "path": "packages/anilist/lib/models/token.dart",
    "content": "class AnilistToken {\n  const AnilistToken(this.json);\n\n  factory AnilistToken.parseURL(final String url) {\n    final Map<String, String> queries = Uri.splitQueryString(url.split('#')[1]);\n    queries['expires_at'] = (DateTime.now().millisecondsSinceEpoch +\n            (int.parse(queries['expires_in']!) * 1000))\n        .toString();\n    return AnilistToken(queries);\n  }\n\n  final Map<String, String> json;\n\n  String get accessToken => json['access_token']!;\n  String get tokenType => json['token_type']!;\n  int get expiresIn => int.parse(json['expires_in']!);\n  int get expiresAtRaw => int.parse(json['expires_at']!);\n  DateTime get expiresAt => DateTime.fromMillisecondsSinceEpoch(expiresAtRaw);\n}\n"
  },
  {
    "path": "packages/anilist/lib/models/user.dart",
    "content": "import 'package:utilx/utilx.dart';\n\nclass AnilistUserStatistics {\n  const AnilistUserStatistics(this.json);\n\n  final JsonMap json;\n\n  int get count => json['count'] as int;\n  double get meanScore => (json['meanScore'] as num).toDouble();\n  double get standardDeviation => (json['standardDeviation'] as num).toDouble();\n  int? get minutesWatched => json['minutesWatched'] as int?;\n  int? get episodesWatched => json['episodesWatched'] as int?;\n  int? get chaptersRead => json['chaptersRead'] as int?;\n  int? get volumesRead => json['volumesRead'] as int?;\n}\n\nclass AnilistUser {\n  const AnilistUser(this.json);\n\n  final JsonMap json;\n\n  int get id => json['id'] as int;\n  String get name => json['name'] as String;\n  String? get about => json['about'] as String?;\n  JsonMap get avatar => json['avatar'] as JsonMap;\n  String? get avatarLarge => avatar['large'] as String?;\n  String? get avatarMedium => avatar['medium'] as String?;\n  String? get bannerImage => json['bannerImage'] as String?;\n  String get siteUrl => json['siteUrl'] as String;\n  JsonMap? get statistics => json['statistics'] as JsonMap?;\n  AnilistUserStatistics? get animeStatistics => statistics?['anime'] != null\n      ? AnilistUserStatistics(statistics!['anime'] as JsonMap)\n      : null;\n  AnilistUserStatistics? get mangaStatistics => statistics?['manga'] != null\n      ? AnilistUserStatistics(statistics!['manga'] as JsonMap)\n      : null;\n\n  static const String query = '''\n{\n  id\n  name\n  about(asHtml: true)\n  avatar {\n    large\n    medium\n  }\n  bannerImage\n  siteUrl\n  statistics {\n    anime {\n      count\n      meanScore\n      standardDeviation\n      minutesWatched\n      episodesWatched\n      chaptersRead\n      volumesRead\n    }\n    manga {\n      count\n      meanScore\n      standardDeviation\n      minutesWatched\n      episodesWatched\n      chaptersRead\n      volumesRead\n    }\n  }\n}\n''';\n}\n"
  },
  {
    "path": "packages/anilist/lib/utils.dart",
    "content": "String stripHtmlTags(final String text) =>\n    text.replaceAll(RegExp('<[^>]+>'), '');\n\nconst Map<String, String> htmlEntities = <String, String>{\n  '&amp;': '&',\n  '&lt;': '<',\n  '&gt;': '>',\n  '&nbsp;': ' ',\n  '&copy;': '©',\n  '&deg;': '°',\n  '&lsquo;': \"'\",\n  '&rsquo;': \"'\",\n  '&sbquo;': ',',\n  '&ldquo;': '\"',\n  '&rdquo;': '\"',\n  '&trade;': '™',\n};\n\nString replaceHtmlEntities(final String text) {\n  String output = text;\n  for (final MapEntry<String, String> x in htmlEntities.entries) {\n    output = output.replaceAll(x.key, x.value);\n  }\n  return output;\n}\n\nString cleanHtml(final String text) => replaceHtmlEntities(stripHtmlTags(text));\n"
  },
  {
    "path": "packages/anilist/pubspec.yaml",
    "content": "name: anilist\ndescription: \"-\"\nversion: 0.0.0\npublish_to: none\n\nenvironment:\n    sdk: \">=3.0.0 <4.0.0\"\n\ndependencies:\n    shared:\n        path: ../shared\n    utilx:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_utilx\n\ndev_dependencies:\n    devx:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_devx\n"
  },
  {
    "path": "packages/anilist/tests/_utils.dart",
    "content": "import 'package:anilist/anilist.dart';\n\nString stringifyAnilistCharacterEdge(final AnilistCharacterEdge edge) => '''\nid: ${edge.id}\nrole: ${edge.role}\nnode: ${padLeftMultilineString(stringifyAnilistCharacter(edge.node))}\n'''\n    .trim();\n\nString stringifyAnilistCharacter(final AnilistCharacter character) => '''\nid: ${character.id}\nname: ${character.name}\nnameFirst: ${character.nameFirst}\nnameMiddle: ${character.nameMiddle}\nnameLast: ${character.nameLast}\nnameFull: ${character.nameFull}\nnameNative: ${character.nameNative}\nnameUserPreferred: ${character.nameUserPreferred}\nimage: ${character.image}\nimageLarge: ${character.imageLarge}\nimageMedium: ${character.imageMedium}\ndescription: ${character.description}\ngender: ${character.gender}\ndateOfBirthRaw: ${character.dateOfBirthRaw}\ndateOfBirth: ${character.dateOfBirth}\nage: ${character.age}\nbloodType: ${character.bloodType}\n'''\n    .trim();\n\nString stringifyAnilistMedia(final AnilistMedia media) => '''\nid: ${media.id}\nidMal: ${media.idMal}\ntitle: ${media.title}\ntitleRomaji: ${media.titleRomaji}\ntitleEnglish: ${media.titleEnglish}\ntitleNative: ${media.titleNative}\ntitleUserPreferred: ${media.titleUserPreferred}\ntype: ${media.type}\nformat: ${media.format}\ndescription: ${media.description}\nstartDateRaw: ${media.startDateRaw}\nstartDate: ${media.startDate}\nendDateRaw: ${media.endDateRaw}\nendDate: ${media.endDate}\nseason: ${media.season}\nduration: ${media.duration}\nchapters: ${media.chapters}\nvolumes: ${media.volumes}\nepisodes: ${media.episodes}\ncoverImage: ${media.coverImage}\ncoverImageMedium: ${media.coverImageMedium}\ncoverImageLarge: ${media.coverImageLarge}\ncoverImageExtraLarge: ${media.coverImageExtraLarge}\ncoverImageColor: ${media.coverImageColor}\nbannerImage: ${media.bannerImage}\ngenres: ${media.genres}\nsynonyms: ${media.synonyms}\ntags: ${media.tags}\ncharacters:\n  ${media.characters.map((final AnilistCharacterEdge x) => '> ${padLeftMultilineString(stringifyAnilistCharacterEdge(x))}').join('\\n')}\nmeanScore: ${media.meanScore}\nisAdult: ${media.isAdult}\nsiteUrl: ${media.siteUrl}\naverageScore: ${media.averageScore}\npopularity: ${media.popularity}\nstatus: ${media.status}\n'''\n    .trim();\n\nString padLeftMultilineString(final String text, [final int spaces = 1]) =>\n    text.split('\\n').map((final String x) => '  ' * spaces + x).join('\\n');\n"
  },
  {
    "path": "packages/anilist/tests/search.dart",
    "content": "import 'package:anilist/anilist.dart';\nimport '../../../cli/utils/exports.dart';\nimport '_utils.dart';\n\nconst Logger _logger = Logger('anilist_search');\n\nFuture<void> main() async {\n  const List<String> terms = <String>[\n    'mayo chiki',\n    'naruto',\n    'masamune kun 2',\n  ];\n\n  for (final String x in terms) {\n    final Stopwatch watch = Stopwatch()..start();\n    final List<AnilistMedia> results = await AnilistMediaEndpoints.search(x);\n    watch.stop();\n    _logger.info('Results for \"$x\" (${watch.elapsedMilliseconds}ms)');\n    if (results.isEmpty) throw Exception('Query results are empty');\n\n    int i = 1;\n    for (final AnilistMedia y in results) {\n      _logger.info('$i.');\n      _logger.info(padLeftMultilineString(stringifyAnilistMedia(y)));\n      i++;\n    }\n    _logger.println();\n  }\n}\n"
  },
  {
    "path": "packages/anilist/tests/trends.dart",
    "content": "import 'package:anilist/anilist.dart';\nimport '../../../cli/utils/exports.dart';\nimport '_utils.dart';\n\nconst Logger _logger = Logger('anilist_trending');\n\ntypedef _TrendingFn = Future<List<AnilistMedia>> Function();\n\nFuture<void> main() async {\n  final Map<String, _TrendingFn> fns = <String, _TrendingFn>{\n    'Trending Animes': () async => AnilistMediaEndpoints.trendingAnimes(),\n    'Top Ongoing Animes': () async => AnilistMediaEndpoints.topOngoingAnimes(),\n    'Most Popular Animes': () async =>\n        AnilistMediaEndpoints.mostPopularAnimes(),\n    'Trending Mangas': () async => AnilistMediaEndpoints.trendingMangas(),\n    'Top Ongoing Mangas': () async => AnilistMediaEndpoints.topOngoingMangas(),\n    'Most Popular Mangas': () async =>\n        AnilistMediaEndpoints.mostPopularMangas(),\n  };\n\n  for (final MapEntry<String, _TrendingFn> x in fns.entries) {\n    final Stopwatch watch = Stopwatch()..start();\n    final List<AnilistMedia> results = await x.value();\n    watch.stop();\n    _logger.info('Results for \"${x.key}\" (${watch.elapsedMilliseconds}ms)');\n    if (results.isEmpty) throw Exception('Query results are empty');\n\n    int i = 1;\n    for (final AnilistMedia y in results) {\n      _logger.info('$i.');\n      _logger.info(padLeftMultilineString(stringifyAnilistMedia(y)));\n      i++;\n    }\n    _logger.println();\n  }\n}\n"
  },
  {
    "path": "packages/shared/.gitignore",
    "content": "# Files and directories created by pub.\n.dart_tool/\n.packages\n\n# Conventional directory for build output.\nbuild/\n"
  },
  {
    "path": "packages/shared/.vscode/settings.json",
    "content": "{\n    \"editor.formatOnSave\": true\n}"
  },
  {
    "path": "packages/shared/README.md",
    "content": "A sample command-line application with an entrypoint in `bin/`, library code\nin `lib/`, and example unit test in `test/`.\n"
  },
  {
    "path": "packages/shared/analysis_options.yaml",
    "content": "include: package:devx/analysis_options.yaml\n"
  },
  {
    "path": "packages/shared/lib/http.dart",
    "content": "import 'package:http/http.dart';\n\nexport 'package:http/http.dart'\n    hide delete, get, head, patch, post, put, read, readBytes;\n\nfinal Client client = Client();\n"
  },
  {
    "path": "packages/shared/pubspec.yaml",
    "content": "name: shared\ndescription: \"-\"\nversion: 0.0.0\npublish_to: none\n\nenvironment:\n    sdk: \">=3.0.0 <4.0.0\"\n\ndependencies:\n    http: ^1.1.0\n\ndev_dependencies:\n    devx:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_devx\n"
  },
  {
    "path": "pubspec.yaml",
    "content": "name: kazahana\ndescription: An extension-based Anime and Manga client.\npublish_to: none\nversion: 3.0.0\n\nenvironment:\n    sdk: \">=3.0.0 <4.0.0\"\n\ndependencies:\n    anilist:\n        path: packages/anilist\n    animations: ^2.0.3\n    collection: ^1.16.0\n    encrypt: ^5.0.1\n    flutter:\n        sdk: flutter\n    json_annotation: ^4.8.1\n    media_kit: ^1.1.10\n    media_kit_libs_video: ^1.0.4\n    media_kit_video: ^1.2.4\n    path: ^1.8.2\n    path_provider: ^2.0.11\n    perks: ^1.0.0\n    provider: ^6.0.3\n    shared:\n        path: packages/shared\n    tenka:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_tenka\n    tenka_runtime:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_tenka_runtime\n    uni_links: ^0.5.1\n    url_launcher: ^6.1.5\n    utilx:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_utilx\n\ndev_dependencies:\n    build_runner: ^2.0.0\n    devx:\n        git:\n            url: https://github.com/yukino-org/packages.git\n            ref: dart_devx\n    image: ^4.1.3\n    json_serializable: ^6.3.1\n\nflutter:\n    uses-material-design: true\n    assets:\n        - assets/images/\n        - assets/translations/\n    fonts:\n        - family: Inter\n          fonts:\n              - asset: ./assets/fonts/Inter-Regular.ttf\n              - asset: ./assets/fonts/Inter-Medium.ttf\n                weight: 600\n              - asset: ./assets/fonts/Inter-Bold.ttf\n                weight: 800\n        - family: GreatVibes\n          fonts:\n              - asset: ./assets/fonts/GreatVibes-Regular.ttf\n"
  }
]