[
  {
    "path": ".devcontainer/devcontainer.json",
    "content": "{\n  \"image\": \"dart:3.4\",\n  \"forwardPorts\": [3000,5000],\n  \"features\": {\n  }\n}\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: [dukefirehawk]\ncustom: [\"https://paypal.me/dukefirehawk?country.x=MY&locale.x=en_US\"]\n"
  },
  {
    "path": ".github/workflows/dart.yml",
    "content": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n# separate terms of service, privacy policy, and support\n# documentation.\n\nname: Angel3 CI\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n\njobs:\n  job_001:\n    name: Validate framework package\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: dart-lang/setup-dart@v1\n        with:\n          sdk: \"3.11.0\"\n          \n      - id: angel3_container_upgrade\n        name: angel3_container; Upgrade depedencies\n        working-directory: packages/container/angel_container\n        run: dart pub upgrade\n\n      - name: angel3_container; Verify formatting\n        working-directory: packages/container/angel_container\n        run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      - name: angel3_container; Analyze source code\n        working-directory: packages/container/angel_container\n        run: dart analyze\n\n      - name: angel3_container; Run tests\n        working-directory: packages/container/angel_container\n        run: dart test\n\n      - id: angel3_framework_upgrade\n        name: angel3_framework; Upgrade depedencies\n        working-directory: packages/framework\n        run: dart pub upgrade\n\n      - name: angel3_framework; Verify formatting\n        working-directory: packages/framework\n        run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      - name: angel3_framework; Analyze source code\n        working-directory: packages/framework\n        run: dart analyze\n\n      - name: angel3_framework; Run tests\n        working-directory: packages/framework\n        run: dart test\n\n  job_002:\n    name: Validate ORM packages\n    runs-on: ubuntu-latest\n\n    # Service containers to run with `runner-job`\n    services:\n      # Label used to access the service container\n      postgres:\n        # Docker Hub image\n        image: postgres\n        # Provide the password for postgres\n        env:\n          POSTGRES_PASSWORD: postgres\n        # Set health checks to wait until postgres has started\n        options: >-\n          --health-cmd pg_isready\n          --health-interval 10s\n          --health-timeout 5s\n          --health-retries 5\n        ports:\n          # Maps tcp port 5432 on service container to the host\n          - 5432:5432    \n\n    steps:\n      - uses: actions/checkout@v2\n\n      - uses: dart-lang/setup-dart@v1\n        with:\n          sdk: \"3.11.0\"\n\n      # Angel3 ORM\n      - id: angel3_orm_upgrade\n        name: angel3_orm; Upgrade depedencies\n        working-directory: packages/orm/angel_orm\n        run: dart pub upgrade\n\n      - name: angel3_orm; Verify formatting\n        working-directory: packages/orm/angel_orm\n        run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      - name: angel3_orm; Analyze source code\n        working-directory: packages/orm/angel_orm\n        run: dart analyze\n\n      # Angel3 ORM Generator\n      - id: angel3_orm_generator_upgrade\n        name: angel3_orm_generator; Upgrade depedencies\n        working-directory: packages/orm/angel_orm_generator\n        run: dart pub upgrade\n\n      - name: angel3_orm_generator; Verify formatting\n        working-directory: packages/orm/angel_orm_generator\n        run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      - name: angel3_orm_generator; Analyze source code\n        working-directory: packages/orm/angel_orm_generator\n        run: dart analyze\n\n      # Angel3 ORM Test\n      #- id: angel3_orm_test_upgrade\n      #  name: angel3_orm_test; Upgrade depedencies\n      #  working-directory: packages/orm/angel_orm_test\n      #  run: dart pub upgrade\n\n      #- name: angel3_orm_test; Run orm code generator\n      #  working-directory: packages/orm/angel_orm_test\n      #  run: dart run build_runner build --delete-conflicting-outputs\n\n      #- name: angel3_orm_test; Verify formatting\n      #  working-directory: packages/orm/angel_orm_test\n      #  run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      #- name: angel3_orm_test; Analyze source code\n      #  working-directory: packages/orm/angel_orm_test\n      #  run: dart analyze\n\n      # Angel3 ORM PostgreSQL\n      - id: angel3_orm_postgres_upgrade\n        name: angel3_orm_postgres; Upgrade depedencies\n        working-directory: packages/orm/angel_orm_postgres\n        run: dart pub upgrade\n\n      - name: angel3_orm_postgres; Verify formatting\n        working-directory: packages/orm/angel_orm_postgres\n        run: dart format --output=none --set-exit-if-changed .\n\n      # Consider passing '--fatal-infos' for slightly stricter analysis.\n      - name: angel3_orm_postgres; Analyze source code\n        working-directory: packages/orm/angel_orm_postgres\n        run: dart analyze\n\n      - name: angel3_orm_postgres; Run tests\n        working-directory: packages/orm/angel_orm_postgres\n        run: dart test\n        env:\n          # The hostname used to communicate with the PostgreSQL service container\n          POSTGRES_HOST: localhost\n          # The default PostgreSQL port\n          POSTGRES_PORT: 5432\n          POSTGRES_PASSWORD: postgres\n          POSTGRES_USERNAME: postgres\n          POSTGRES_DB: postgres\n\n"
  },
  {
    "path": ".gitignore",
    "content": "# Created by .ignore support plugin (hsz.mobi)\n### Dart template\n# See https://www.dartlang.org/tools/private-files.html\n\n# source_gen\n.dart_tool\n\n# Files and directories created by pub\n.buildlog\n.packages\n.project\n.pub/\n.scripts-bin/\n.metals/\nbuild/\n#**/packages/\n\n# Files created by dart2js\n# (Most Dart developers will use pub build to compile Dart, use/modify these\n#  rules if you intend to use dart2js directly\n#  Convention is to use extension '.dart.js' for Dart compiled to Javascript to\n#  differentiate from explicit Javascript files)\n*.dart.js\n*.part.js\n*.js.deps\n*.js.map\n*.info.json\n\n# Directory created by dartdoc\ndoc/api/\n\n# Don't commit pubspec lock file\n# (Library packages only! Remove pattern if developing an application package)\npubspec.lock\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n\n## VsCode\n.vscode/\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n\n# IntelliJ\n.idea/\n/out/\n.idea_modules/\n\n# Gradle:\n.idea/gradle.xml\n.idea/libraries\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n# Others\nlogs/\n.DS_Store\nserver_log.txt\nbackup/\n\n"
  },
  {
    "path": ".pubignore",
    "content": ".DS_Store\ntasks.json"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    \"files.watcherExclude\": {\n      \"**/target\": true\n    },\n    \"[javascript]\": {\n      \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n      \"editor.formatOnSave\": true\n    },\n    \"beautify.language\": {\n      \"html\": [\"html\"],\n      \"css\": [],\n      \"js\": []\n    },\n    \"editor.codeActionsOnSave\": {\n      \"source.fixAll.markdownlint\": \"explicit\"\n    },\n  \"cmake.configureOnOpen\": false\n}"
  },
  {
    "path": "AI_CONTEXT.md",
    "content": "# AI Context for Angel3\n\n## Project Overview\n\n**Angel3** is a production-ready, full-stack backend framework in Dart. It originated as a fork of the original Angel framework to support Dart SDK null-safety and later versions. It aims to streamline development by providing many common backend features out-of-the-box and enables developers to build both frontends and backends in Dart. It is highly modular, designed as a collection of plugins.\n\n## Repository Structure\n\nThis repository is a **monorepo** managed using [Melos](https://pub.dev/packages/melos).\n\n- **Packages**: Located in the `packages/` directory. Each sub-directory represents an individual plugin or module that can be published to `pub.dev` under the `angel3_` prefix.\n\n## Core Architecture and Packages\n\nThe framework is divided into several categories of packages:\n\n1. **Core Framework & Request Handling**:\n   - `framework`: Base HTTP server, contexts, DI container, and middleware pipelines.\n   - `route`: URL matching and route parameters.\n   - `container`: Dependency Injection (DI) system.\n   - `configuration`: Utilities for loading config files (YAML, JSON, .env).\n\n2. **Data Modeling & Persistence (ORM)**:\n   - `model`: Base model abstractions for data entities.\n   - `serialize`: JSON serialization and deserialization using code generation.\n   - `orm`: Main ORM library, code generator, and SQL dialects (MySQL, PostgreSQL)\n   - `mongo`, `rethinkdb`, `sembast`: Specialized NoSQL database drivers.\n\n3. **Authentication & Security**:\n   - `auth`: Core authentication abstractions and strategies.\n   - `auth_oauth2`, `oauth2`: OAuth2 authentication flows.\n   - `security`: Security middleware (rate limiting, standard headers).\n   - `cors`: Cross-Origin Resource Sharing handling.\n\n4. **Frontend & Template Rendering**:\n   - `jael`: Jael template engine built specifically for Angel.\n   - `mustache`, `jinja`, `markdown`: Template integrations.\n   - `html`, `seo`: Utilities for HTML responses and search engine optimization.\n\n5. **Utilities**:\n   - `websocket`: Real-time bidirectional communication.\n   - `client`: Client-side library to interface directly with Angel3 backends.\n   - `cache`, `redis`: Caching interfaces.\n   - `hot`, `production`: Hot-reloading tooling and production load management.\n   - `test`, `mock_request`: Testing utilities.\n\n## Technology Stack & Requirements\n\n- **Language**: Dart\n- **Minimum SDK Version**: `>=3.11.0 <4.0.0`\n- **Monorepo Management**: `melos` (`^7.3.0`)\n\n## Development Workflow\n\n- **Master Branch**: Stable production branch. Use this branch for all standard PR submissions.\n- **feature/v9 Branch**: Early development for major refactoring targeting the `9.0.0` release. Contains breaking changes (e.g., restructure and rename packages).\n- **Tooling**: Uses `melos` for managing dependencies and executing tasks across the monorepo (e.g., `melos exec \"dart pub upgrade\"`).\n\n## Key Technical Debt and Future Roadmap\n\n- Removal of dependency on the `dart:mirrors` library.\n- Performance optimizations to address long-overdue issues.\n- Integration of OpenAPI 3 support.\n- Expanding ORM support for SQLite, multi-tenant architectures, and SQL schema reverse engineering.\n- Out-of-the-box OIDC and SAML2 support.\n"
  },
  {
    "path": "AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the\n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\n## 8.7.0\n\n- Require Dart >= 3.11.0\n\n## 8.6.0\n\n- Require Dart >= 3.8.0\n- Updated `lints` to 6.0.0\n- Updated dependencies to the latest release\n\n## 8.5.0\n\n- Require Dart >= 3.6\n- Updated `lints` to 5.0.0\n- Updated dependencies to the latest release\n\n## 8.0.0\n\n- Require Dart >= 3.0\n- Updated: angel3_http_exception\n- Updated: angel3_route\n- Updated: angel3_model\n- Updated: angel3_container\n- Updated: angel3_container_generator\n- Updated: angel3_mock_request\n- Updated: angel3_framework\n- Updated: angel3_auth\n- Updated: angel3_configuration\n- Updated: angel3_validate\n- Updated: angel3_client\n- Updated: angel3_websocket\n- Updated: angel3_test\n- Updated: jael3\n- Updated: jael3_preprocessor\n- Updated: jael3_language_server\n- Updated: angel3_jael\n- Updated: jael3_web\n- Updated: angel3_production\n- Updated: angel3_hot\n- Updated: angel3_static\n- Updated: angel3_serialize\n- Updated: angel3_serialize_generator\n- Updated: angel3_orm\n- Updated: angel3_orm_generator\n- Updated: angel3_migration\n- Updated: angel3_migration_runner\n- Updated: angel3_orm_postgresql\n- Updated: angel3_orm_mysql\n- Updated: angel3_orm_service\n- Updated: angel3_orm_test\n- Updated: angel3_cache\n- Updated: angel3_cors\n- Updated: angel3_mustache\n- Updated: angel3_proxy\n- Updated: angel3_redis\n- Updated: angel3_jinja\n- Updated: angel3_security\n- Updated: angel3_user_agent\n- Updated: angel3_seo\n- Updated: angel3_sync\n- Updated: angel3_sembast\n- Updated: angel3_markdown\n- Updated: angel3_auth_oauth2\n- Updated: angel3_oauth2 (5 failed test cases)\n- Updated: angel3_auth_twitter (issue: oauth1 don't support http 1.0.0)\n- Updated: angel3_mongo (issue: mongo_dart don't support http 1.0.0)\n- Updated: angel3_shelf (2 failed test cases)\n\n## 7.0.0\n\n- Require Dart >= 2.17\n\n## 6.0.0\n\n- Require Dart >= 2.16\n- Added ORM MySQL\n\n## 5.0.0\n\n- Skipped version\n\n## 4.1.x\n\n- Refactored the framework internal to use [Belatuk Common Utilities](<https://github.com/dart-backend/belatuk-common-utilities>)\n- Updated to use `lints` linter\n- Updated [website](<https://angel3-framework.web.app/>)\n- Updated [examples](<https://github.com/dart-backend/belatuk-examples>)\n- Fixed ORM code generator\n- Fixed Serializer code generator\n- Fixed graphQL code generator\n- Fixed CLI\n- Fixed failed test cases\n\n## 4.0.0 (NNBD)\n\n- Published all packages with `angel3_` prefix\n- Changed Dart SDK requirements for all packages to \">=2.12.0 <3.0.0\" to support NNBD.\n- Migrated pretty_logging to 3.0.0 (0/0 tests passed)\n- Migrated angel_http_exception to 3.0.0 (0/0 tests passed)\n- Moved angel_cli to [CLI Repository](<https://github.com/dukefirehawk/cli>) (Not migrated yet)\n- Added code_buffer and migrated to 2.0.0 (16/16 tests passed)\n- Added combinator and migrated to 2.0.0 (16/16 tests passed)\n- Migrated angel_route to 5.0.0 (35/35 tests passed)\n- Migrated angel_model to 3.0.0 (0/0 tests passed)\n- Migrated angel_container to 3.0.0 (55/55 tests passed)\n- Added merge_map and migrated to 2.0.0 (6/6 tests passed)\n- Added mock_request and migrated to 2.0.0 (5/5 tests)\n- Migrated angel_framework to 4.0.0 (149/150 tests passed)\n- Migrated angel_auth to 4.0.0 (31/31 tests passed)\n- Migrated angel_configuration to 4.0.0 (8/8 testspassed)\n- Migrated angel_validate to 4.0.0 (7/7 tests passed)\n- Migrated json_god to 4.0.0 (13/13 tests passed)\n- Migrated angel_client to 4.0.0 (13/13 tests passed)\n- Migrated angel_websocket to 4.0.0 (3/3 tests passed)\n- Migrated angel_test to 4.0.0 (1/1 test passed)\n- Added symbol_table and migrated to 2.0.0 (16/16 tests passed)\n- Migrated jael to 4.0.0 (20/20 tests passed)\n- Migrated jael_preprocessor to 3.0.0 (5/5 tests passed)\n- Migrated angel_jael to 4.0.0 (1/1 test passed)\n- Migrated pub_sub to 4.0.0 (16/16 tests passed)\n- Migrated production to 3.0.0 (0/0 tests passed)\n- Added html_builder and migrated to 2.0.0 (1/1 tests passed)\n- Migrated hot to 4.0.0 (0/0 tests passed)\n- Added range_header and migrated to 3.0.0 (12/12 tests passed)\n- Migrated angel_static to 4.0.0 (12/12 test passed)\n- Created basic-sdk-2.12.x_nnbd template (1/1 test passed) <= Milestone 1\n- Migrated angel_serialize to 4.0.0 (0/0 test passed)\n- Migrated angel_serialize_generator to 4.0.0 (33/33 tests passed)\n- Migrated angel_orm to 3.0.0 (0/0 tests passed)\n- Migrated angel_migration to 3.0.0 (0/0 tests passed)\n- Added inflection2 and migrated to 1.0.0 (28/32 tests passed)\n- Migrated angel_orm_generator to 4.0.0 (0/0 tests passed)\n- Migrated angel_migration_runner to 3.0.0 (0/0 tests passed)\n- Migrated angel_orm_test to 3.0.0 (0/0 tests passed)\n- Migrated angel_orm_postgres to 3.0.0 (51/54 tests passed)\n- Create orm-sdk-2.12.x boilerplate (in progress) <= Milestone 2\n- Migrated angel_auth_oauth2 to 4.0.0 (0/0 tests passed)\n- Migrated angel_auth_cache to 4.0.0 (7/7 tests passed)\n- Migrated angel_auth_cors to 4.0.0  (15/15 tests passed)\n- Migrated angel_oauth2 to 4.0.0 (17/25 tests passed)\n- Migrated angel_proxy to 4.0.0 (6/7 tests passed)\n- Migrated angel_file_service to 4.0.0 (6/6 tests passed)\n- Migrated graphql_parser to 2.0.0 (55/55 tests passed)\n- Migrated graphql_schema to 2.0.0 (34/35 tests passed)\n- Migrated graphql_server to 2.0.0 (9/10 tests passed)\n- Migrated graphql_generator to 2.0.0 (0/0 tests passed)\n- Migrated data_loader to 2.0.0 (7/7 tests passed)\n- Migrated angel_graphql to 2.0.0 (0/0 tests passed)\n- Migrated angel_mongo to 3.0.0 (0/0 tests passed)\n- Migrated angel_orm_mysql to 2.0.0 (0/0 tests passed)\n- Migrated angel_orm_service to 2.0.0 (0/0 tests passed)\n- Migrated body_parser to 2.0.0 (11/11 tests passed)\n- Migrated angel_markdown to 3.0.0 (0/0 tests passed)\n- Migrated angel_jinja to 2.0.0 (0/0 tests passed)\n- Migrated angel_html to 3.0.0 (1/3 tests passed)\n- Migrated angel_mustache to 2.0.0 (3/3 tests passed)\n- Migrated angel_paginate to 3.0.0 (18/18 tests passed)\n- Migrated angel_poll to 2.0.0 (0/5 tests passed)\n- Migrated angel_redis to 2.0.0 (0/8 tests passed)\n- Migrated angel_seeder to 2.0.0 (0/0 tests passed)\n- Migrated angel_relations to 2.0.0 (0/0 tests passed)\n- Migrated angel_rethink to 2.0.0 (0/0 tests passed)\n- Migrated angel_security to 2.0.0 (0/1 tests passed)\n- Migrated angel_sembast to 2.0.0 (10/10 tests passed)\n- Migrated angel_sync to 3.0.0 (0/1 tests passed)\n- Migrated angel_typed_service to 3.0.0 (4/4 tests passed)\n- Migrated angel_shelf to 2.0.0 (0/1 tests passed)\n- Migrated user_agent to 2.0.0 (0/0 tests passed)\n- Migrated angel_user_agent to 2.0.0 (0/0 tests passed)\n\n## 3.0.0 (Non NNBD)\n\n- Changed Dart SDK requirements for all packages to \">=2.10.0 <3.0.0\"\n- Updated pretty_logging to 2.0.0 (0/0 tests passed)\n- Updated angel_http_exception to 2.0.0 (0/0 tests passed)\n- Updated angel_cli to 3.0.0. (Rename not working)\n- Updated angel_route to 4.0.0 (35/35 tests passed)\n- Updated angel_model to 2.0.0 (0/0 tests passed)\n- Updated angel_container to 2.0.0 (55/55 tests passed)\n- Updated angel_framework to 3.0.0 (150/151 tests passed)\n- Updated angel_auth to 3.0.0 (28/32 tests passed)\n- Updated angel_configuration to 3.0.0 (6/8 tests passed)\n- Updated angel_validate to 3.0.0 (7/7 tests passed)\n- Added and updated json_god to 3.0.0 (7/7 tests passed)\n- Updated angel_client to 3.0.0 (10/13 tests passed)\n- Updated angel_websocket to 3.0.0 (3/3 tests passed)\n- Updated jael to 3.0.0 (20/20 tests passed)\n- Updated jael_preprocessor to 3.0.0 (5/5 tests passed)\n- Updated test to 3.0.0 (1/1 tests passed)\n- Updated angel_jael to 3.0.0 (1/1 tests passed, Issue with 2 dependencies)\n- Added pub_sub and updated to 3.0.0 (16/16 tests passed)\n- Updated production to 2.0.0 (0/0 tests passed)\n- Updated hot to 3.0.0 (0/0 tests passed)\n- Updated static to 3.0.0 (12/12 tests passed)\n- Update basic-sdk-2.12.x boilerplate (1/1 tests passed)\n- Updated angel_serialize to 3.0.0 (0/0 tests passed)\n- Updated angel_serialize_generator to 3.0.0 (33/33 tests passed)\n- Updated angel_orm to 3.0.0 (0/0 tests passed)\n- Updated angel_migration to 3.0.0 (0/0 tests passed)\n- Updated angel_orm_generator to 3.0.0 (0/0 tests passed, use a fork of postgres)\n- Updated angel_migration_runner to 3.0.0 (0/0 tests passed)\n- Updated angel_orm_test to 1.0.0 (0/0 tests passed)\n- Updated angel_orm_postgres to 2.0.0 (52/54 tests passed)\n- Update orm-sdk-2.12.x boilerplate\n- Updated angel_auth_oauth2 to 3.0.0 (0/0 tests passed)\n- Updated angel_auth_cache to 3.0.0 (0/7 tests passed)\n- Updated angel_auth_cors to 3.0.0 (15/15 tests passed)\n- Updated angel_oauth2 to 3.0.0 (17/25 tests passed)\n- Updated angel_container_generator to 2.0.0\n- Updated angel_file_service to 3.0.0\n- Updated angel_eventsource to 2.0.0 (use a fork of eventsource)\n- Updated angel_auth_twitter to 3.0.0 (use a fork of twitter and oauth)\n\n## 2.2.0\n\n- Changed Dart SDK requirements for all packages to \">=2.10.0 <2.12.0\"\n- Upgraded 3rd party libraries to the latest version prior to dart 2.12\n- Fixed broken code due to 3rd party libraries update\n- Revert packages/validate from version 3.0 to version 2.2\n\n## 2.1.x and below\n\n- Refer to the orginal repo before the fork\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "\n# Contribution\n\nAny help from the open-source community is always welcome and needed:\n\n1. Found an issue?\n    - Please [fill a bug report][tracker] with error message and steps to reproduce it.\n2. Wish a feature?\n    - Open a feature request with use cases.\n3. Are you using and liking the project?\n    - Create an article about your use case\n    - Do a post on your likes and dislikes\n    - Make a donation.\n4. Are you a developer?\n    - Fix a bug and send a [pull request][pull_request]\n    - Implement a new feature\n    - Improve the Unit Tests\n    - Improve the [User Guide][doc] and send a [document pull request][doc_repo]\n5. Have you already helped in any way?\n    - **Many thanks to the contributors and everybody that uses this project!**\n\n[tracker]: https://github.com/dart-backend/angel/issues\n[pull_request]: https://github.com/dart-backend/angel/pulls\n[doc]: https://angel3-docs.dukefirehawk.com\n[doc_repo]: https://github.com/dart-backend/angel3-guide/pulls\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2024, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "# Angel3 Framework\n\n[![Angel3 Framework](angel3_logo.png)](https://github.com/dart-backend/angel)\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_framework?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/LICENSE)\n[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos)\n\n**A production-ready dart backend framework.**\n\n-----\n\n## About\n\nAngel3 originated from a fork of the archived Angel framework in support of Dart SDK 2.12.x or later. It is a full-stack backend framework in Dart that aims to streamline development by providing many common features out-of-the-box in a consistent manner. The codebase has been completely migrated and refactored to support null safety. One of the main goal is to enable developers to build both frontend and backend in dart language. Angel3 is designed as a collection of plugins that enable developers to pick and choose the parts needed for their projects. A series of starter templates are also provided for quick start and trial run with Angel3. Visit our [website](<https://angel3-framework.web.app/>) to learn more.\n\nThe available features in Angel3 includes:\n\n* OAuth2 Authentication\n* WebSocket\n* HTTP/2\n* HTTP Streaming\n* GraphQL\n* Markdown, Mustache, Jinja and JAEL as Server-Side HTML Rendering\n* ORM support for PostgreSQL and MySQL\n* MongoDB, Sembast and RethinkDB as storage\n* Redis as cache\n\n## The Core Framework\n\nThe `packages` directory contains specialized sub-packages that act as individual plugins or modules. Depending on the needs of a project, a developer can plug in specific packages.\n\nThey can broadly be categorized as follows:\n\n1. Core Framework & Request Handling\n   * framework: The foundational package (angel3_framework). It provides the base HTTP server, request/response contexts, dependency injection container, and middleware pipelines.\n   * route: The routing engine handling URL matching and route parameters.\n   * container: Dependency Injection (DI) system for resolving services.\n   * configuration: Utilities for loading configuration files (YAML, JSON, .env).\n2. Data Modeling & Persistence (ORM)\n   The framework provides an extensive ORM (angel3_orm) ecosystem with generators and database drivers:\n\n   * orm: Houses the main ORM library, code generator (angel_orm_generator), and SQL dialects for MySQL and PostgreSQL.\n   * model: Base model abstractions for data entities.\n   * serialize: Libraries to serialize/deserialize data to and from JSON using code generation (angel_serialize_generator).\n   * mongo, rethinkdb, sembast: Specialized drivers for interacting with MongoDB, RethinkDB, and Sembast (a NoSQL local database).\n3. Authentication & Security\n   * auth: Core authentication abstractions and strategies (local, token-based).\n   * auth_oauth2 & oauth2: Out-of-the-box support for OAuth2 authentication flows.\n   * security: Security middleware (rate limiting, standard headers, etc.).\n   * cors: Middleware to handle Cross-Origin Resource Sharing effortlessly.\n4. Frontend & Template Rendering\n   Support for processing and returning HTML views to the client:\n\n   * jael: The Jael template engine specifically built for Angel, capable of HTML manipulation. It is split into language servers, preprocessors, and web renderers.\n   * mustache, jinja, markdown: Wrappers/integrations for rendering Mustache templates, Jinja templates, or parsing Markdown into HTML.\n   * html & seo: Utilities for building out HTML responses and optimizing for search engines.\n5. Additional Utilities and APIs\n   * websocket: Integration for real-time bidirectional communication.\n   * client: A client-side library designed to interface seamlessly with Angel3 backends directly from Dart/Flutter.\n   * cache & redis: Caching interfaces with Redis integration to improve response times.\n   * hot & production: Tooling for hot-reloading the server during development, and managing clustering/multi-threading under production loads.\n   * test & mock_request: Testing utilities for mocking HTTP requests without spinning up a real server.\n   * file_service & static: For serving static assets (images, CSS, JS) efficiently.\n\n## Important Notes\n\nAngel3 packages are published under `angel3_` prefix on pub.dev. These packages have passed all of their respective test suites before going live. The development work are currently focused on:\n\n* Keeping the packages with `angel3_` prefix in sync with Dart SDK releases\n  * Remove and replace deprecated classes and methods while keeping it backward compatible\n  * Refactor the code to use new language features\n* Fix and resolve reported issues\n* Performance optimization\n* Improve on existing features, unit test, user guide and examples\n* Add new features\n\n## Status\n\n### Latest Release Notes (Version: 8.6.0)\n\n* Updated `angel3_` packages to require dart >= 3.11.0\n* Updated to `melos:7.3`\n* Updated code generator to use `analyzer` 8.4.x\n* Removed `angel3_orm_test`\n\n### Latest development work\n\nBranch: `feature/v9`\n\n* Dart version : 3.11.0 or later.\n* Status       : Early Development\n* Notes        : Major refactoring on going with breaking changes targeting `9.0.0` release\n  * Restructre and rename packages\n  * Removal of dependency on `Mirror`\n  * Fix long overdued performance issues\n\nBranch: `master`\n\n* Dart version : 3.11.0 or later.\n* Publish      : Refer to all packages with`angel3_` prefix on [pub.dev](https://pub.dev/publishers/dukefirehawk.com/packages).\n* Status       : Production\n* Notes        : Use this branch for all PR submission\n\n### Archieved releases\n\nStarting with release 8.5.0. All subsequence releases published to `pub.dev` will be available on a release branch. The branch name will adopt the following naming conventions, `release/<version>`. For example: `release/8.5` branch is for release version 8.5 on `pub.dev`.\n\n### What is in the pipeline?\n\n* Remove the use of Mirror\n* Performance optimsation\n* Out of the box OIDC and SAML2 support\n* Integrated Open API 3 support\n* Expand ORM to support\n  * SQLite\n  * Multi tenant\n  * Reverse Engineering\n\n## Installation and Setup\n\n### (Option 1) Create a new project by cloning from boilerplate templates\n\n1. Download and install [Dart](https://dart.dev/get-dart). Minimum 3.11.0.\n\n2. Clone one of the following starter projects:\n   * [Angel3 Basic Template](https://github.com/dukefirehawk/boilerplates/tree/angel3-basic)\n   * [Angel3 ORM Template](https://github.com/dukefirehawk/boilerplates/tree/angel3-orm)\n   * [Angel3 ORM MySQL Template](https://github.com/dukefirehawk/boilerplates/tree/angel3-orm-mysql)\n   * [Angel3 Graphql Template](https://github.com/dukefirehawk/boilerplates/tree/angel3-graphql)\n\n3. Run the project in development mode (*hot-reloaded* is enabled on file changes).\n\n   ```bash\n   dart --observe bin/dev.dart\n   ```\n\n4. Run the project in production mode (*hot-reloaded* is disabled).\n\n   ```bash\n   dart bin/prod.dart\n   ```\n\n5. Run as docker. Edit and build the image with the provided `Dockerfile` file.\n\n6. Next, refer to the [developer guide](https://angel3-docs.dukefirehawk.com/) to learn more about Angel3 framework.\n\n### (Option 2) Create a new project with Angel3 CLI\n\n1. Download and install [Dart](https://dart.dev/get-dart)\n\n2. Install the [Angel3 CLI](https://pub.dev/packages/angel3_cli):\n\n   ```bash\n   dart pub global activate angel3_cli\n   ```\n\n3. On terminal, create a new project:\n\n   ```bash\n   angel3 init hello\n   ```\n\n4. Run the project in development mode (*hot-reloaded* is enabled on file changes).\n\n   ```bash\n   dart --observe bin/dev.dart\n   ```\n\n5. Run the project in production mode (*hot-reloaded* is disabled).\n\n   ```bash\n   dart bin/prod.dart\n   ```\n\n6. Run as docker. Edit and build the image with the provided `Dockerfile` file.\n\n7. Next, refer to the [User Guide](https://angel3-docs.dukefirehawk.com/) to learn more about Angel3 framework.\n\n## Performance Testing\n\nRefer to [Angel3 Performance Test Suite](https://github.com/dart-backend/angel3-perf-test) for more information. It is still in early stage, but eventually will contain test cases for running load testing with [Locust](https://locust.io/) on various key features of Angel3 framework. These test cases can serve as a foundation for building performance tests for any applications developed with Angel3 framework.\n\n## Performance Benchmark\n\nAn offical performance benchmark can be found at [TechEmpower Framework Benchmarks](https://www.techempower.com/benchmarks/#section=data-r23)\n\nThe test cases are build using standard `Angel3 ORM` template for PostgreSQL and MySQL databases. The result are used for improving Angel3 framework with respect to other frameworks. The following test cases will be added in the subsequent update to this benchmark.\n\n1. Cache with Redis\n2. Angel3 with MongoDB\n\n## Documentation\n\nRefer to [User Guide](https://angel3-docs.dukefirehawk.com/) for more detailed information on the available features of Angel3 framework.\n\n## Examples\n\nTake various applications at [Examples](https://github.com/dart-backend/angel3-examples) for a spin to get a feel of what Angel3 framework can do.\n\n## Community\n\nJoin us on [Discord](https://discord.gg/3X6bxTUdCM).\n\n## Contributing\n\nIf you are interested in contributing to Angel3 framework please check out the [Contribution Guide](CONTRIBUTING.md).\n\n### Development Setup\n\n1. Fork [angel](https://github.com/dart-backend/angel) repository\n\n2. Clone the project to local and create a new branch\n\n   ```bash\n   git clone https://github.com/<your_repo_name>/angel.git\n   git checkout -b feature/<your_branch_name>\n   ```\n\n3. Download and install [Dart 3](https://dart.dev/get-dart)\n\n4. Install `melos:7.3`\n\n   ```bash\n   dart pub global activate melos\n   ```\n\n5. Run `melos exec \"dart pub upgrade\"` to update all the packages\n\n6. Contribute changes to the desired packages\n\n## Donation & Support\n\nIf you like this project and interested in supporting its development work, you are welcome to make a donation via the following links.\n\n* [![GitHub Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/dukefirehawk)\n* [Paypal Donation](https://paypal.me/dukefirehawk?country.x=MY&locale.x=en_US)\n\n### Paid Support\n\nWe offer professional paid support for teams and developers using `Angel3` framework. Our support services are designed to help you build faster, deploy with confidence, and scale reliably, whether you’re just getting started or running the framework in production. The fund collected will go into continued improvements of the framework.\n\n#### What we can help with\n\n* Architecture and best-practice guidance\n* Framework setup, configuration, and upgrades\n* Debugging runtime, performance, or build issues\n* Production readiness (scaling, monitoring, deployment)\n* Code reviews and design feedback\n* Custom feature guidance and extensions\n\n#### Who this is for\n\n* Teams using or planning to use `Angel3` in production\n* Developers who want expert guidance from people who maintain the framework\n* Migration from other dart or none dart framework\n\n#### Support options\n\nWe offer flexible plans depending on your needs:\n\n* Hourly support for one-off issues\n* Monthly retainers for ongoing help\n* Consulting sessions for architecture and planning\n\nSupport is available via email, chat, and scheduled calls.\n\n#### Why paid support?\n\nPaid support ensures you get reliable, professional assistance when it matters most.\n\n#### Get in touch\n\nIf you’re interested in paid support, contact us at [dukefirehawk.apps@gmail.com] with your contact and use cases. We will get back within 24 hours.\n"
  },
  {
    "path": "TODO.md",
    "content": "# TODO\n\n* `angel3_container_generator` upgrade blocked by `reflectable` not supporting `analyzer` > 7.7.0\n* Improve HTTP and ORM performance\n* Add cache support in ORM (using Redis)\n* Upgrade and release angel3_oauth2 8.0.0 (5 failed test cases)\n* Upgrade and release angel3_auth_twitter 8.0.0 (Migrate to OAuth2)\n* Upgrade and release angel3_shelf 8.0.0 (2 failed test cases)\n* [ORM] custom column name is not working. i.e  @Column(name: \"randomNumber\")\n"
  },
  {
    "path": "archived/tool/archived/move_repos",
    "content": "#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport os\nfrom github import Github\n\ngithub_token = os.getenv(\"GITHUB_TOKEN\")\npackages_dir = \"./packages\"\n\nif not github_token:\n    print(\"$GITHUB_TOKEN environment variable missing.\")\n    quit()\n\ngh = Github(github_token)\n\nfor basename in os.listdir(packages_dir):\n    path = os.path.join(packages_dir, basename)\n    if os.path.isdir(path):\n        print(\"===Entering repo `\" + basename + \"`\")\n        repo = gh.get_repo(\"angel-dart/\" + basename)\n        if repo.owner.login != \"angel-dart-archive\":\n            # Manually do the transfer...\n            params = {\"new_owner\": \"angel-dart-archive\"}\n            repo._requester.requestJsonAndCheck(\n                    \"POST\", repo.url + \"/transfer\", input=params,\n            )\n            print(\"======Transferred `\" + basename + \"` to angel-dart-archive\")\n        if repo.archived:\n            print(\"======SKIPPED ARCHIVED REPO\")\n            continue\n        new_desc = \"moved to angel-dart/angel/packages/\" + basename\n        new_homepage = \"https://github.com/angel-dart/angel/tree/master/packages/\" + basename\n        if (repo.description != new_desc) or (repo.homepage != new_homepage):\n            repo.edit(description=new_desc, homepage=new_homepage)\n            print(\"======Changed description+homepage\")\n\n        open_issues = repo.get_issues(state=\"open\")\n        for issue in open_issues:\n            label_name = \"package:\" + basename\n            label_found = False\n            for label in issue.labels:\n                if label.name == label_name:\n                    label_found = True\n                    break\n            if not label_found:\n                issue.edit(labels=[label_name])\n                print(\"======Labeled issue \\\"\" + issue.title + \"\\\"\")\n\n            # Duplicate the issue in angel-dart/angel...\n            angel = gh.get_repo(\"angel-dart/angel\")\n            body = \"*This issue was originally created by @\" + issue.user.login\n            body += \" here, before being automatically moved: \"\n            body += \"\\n\" + issue.html_url\n            body += \"*\\n\\n---\\n\" + issue.body\n            new_issue = angel.create_issue(title=issue.title, labels=[label_name], body=body)\n            for comment in issue.get_comments():\n                comment_body = \"@\" + comment.user.login + \" commented:\\n\\n\" + comment.body\n                new_issue.create_comment(comment_body)\n            new_body = \"*This issue was automatically moved to: \" + new_issue.html_url + \".\"\n            issue.edit(state='closed', body=new_body)\n            print(\"======Moved issue \\\"\" + issue.title + \"\\\"\")\n        \n        open_pulls = repo.get_pulls(state=\"open\")\n        for pull in open_pulls:\n            msg = \"Hi, @\" + pull.user.login + \"! Thanks again for this PR.\"\n            msg += \"\\n\\nAll Angel subprojects have been consolidated into a single monorepo: \"\n            msg += \"https://github.com/angel-dart/angel.\"\n            msg += \"\\n\\nPlease fork the monorepo, and open a new PR there instead.\"\n            pull.create_issue_comment(msg)\n            pull.edit(state='closed')\n            print(\"======Commented on + closed PR \\\"\" + pull.title + \"\\\"\")\n\n        # Archive the repository!\n        repo.edit(archived=True)\n        print(\"======Archived `\" + basename + \"`. Rest in Peace!\")\n"
  },
  {
    "path": "archived/tool/archived/pull_subproject",
    "content": "#!/usr/bin/env bash\n#\n# Simple tool script that pulls an angel-dart/<name> project into ./packages/<name>.\n\nif [ \"$#\" == \"0\" ]; then\n  echo \"usage: pull_subproject <names...>\"\n  exit 1\nfi\n\nset -ex\n\nfor project in $*; do\n  git subtree add --prefix=\"packages/$project\" \"https://github.com/angel-dart/$project.git\" master\ndone\n"
  },
  {
    "path": "belatuk.session.sql",
    "content": ""
  },
  {
    "path": "doc/deployment/docker/README.md",
    "content": "# Running as Container Services using Docker\n\nThe required applications by the framework can be run using the Docker compose files provided in this folder.\n\n## Installation\n\n### PostreSQL\n\n* Starting the PostreSQL container\n\n    ```bash\n    docker compose -f docker-compose-pg.yml -p pg up -d\n    ```\n\n* Stopping the PostreSQL container\n\n    ```bash\n    docker compose -f docker-compose-pg.yml -p pg stop\n    docker compose -f docker-compose-pg.yml -p pg down\n    ```\n\n* Checking the PostreSQL container log\n\n    ```bash\n    docker logs docker-pg-1 -f\n    ```\n\n* Running psql\n\n    ```bash\n    docker exec -it <container id> /bin/bash\n    psql --username postgres\n    ```\n\n* Create PostgreSQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    create user test with encrypted password 'test123';\n    grant all privileges on database orm_test to test;\n    ```\n\n### MariaDB\n\n* Starting the MariaDB container\n\n    ```bash\n    docker compose -f docker-compose-mariadb.yml -p maria up -d\n    ```\n\n* Stopping the MariaDB container\n\n    ```bash\n    docker compose -f docker-compose-mariadb.yml -p maria stop\n    docker compose -f docker-compose-mariadb.yml -p maria down\n    ```\n\n* Checking the MariaDB container log\n\n    ```bash\n    docker logs maria-mariadb-1 -f\n    ```\n\n* Create MariaDB database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MySQL\n\n* Starting the MySQL container\n\n    ```bash\n    docker compose -f docker-compose-mysql.yml -p mysql up -d\n    ```\n\n* Stopping the MySQL container\n\n    ```bash\n    docker compose -f docker-compose-mysql.yml -p mysql stop\n    docker compose -f docker-compose-mysql.yml -p mysql down\n    ```\n\n* Checking the MySQL container log\n\n    ```bash\n    docker logs mysql-mysql-1 -f\n    ```\n\n* Create MySQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MongoDB\n\n* Starting the MongoDB container\n\n    ```bash\n    docker compose -f docker-compose-mongo.yml -p mongo up -d\n    ```\n\n* Stopping the MongoDB container\n\n    ```bash\n    docker compose -f docker-compose-mongo.yml -p mongo stop\n    docker compose -f docker-compose-mongo.yml -p mongo down\n    ```\n\n* Checking the MongoDB container log\n\n    ```bash\n    docker logs mongo-mongo-1 -f\n    ```\n\n### rethinkDB\n\n* Starting the rethinkDB container\n\n    ```bash\n    docker compose -f docker-compose-rethinkdb.yml -p rethink up -d\n    ```\n\n* Stopping the rethinkDB container\n\n    ```bash\n    docker compose -f docker-compose-rethinkdb.yml -p rethink stop\n    docker compose -f docker-compose-rethinkdb.yml -p rethink down\n    ```\n\n* Checking the rethinkDB container log\n\n    ```bash\n    docker logs rethink-rethinkdb-1 -f\n    ```\n\n### Redis\n\n* Starting the Redis container\n\n    ```bash\n    docker compose -f docker-compose-redis.yml -p redis up -d\n    ```\n\n* Stopping the Redis container\n\n    ```bash\n    docker compose -f docker-compose-redis.yml -p redis stop\n    docker compose -f docker-compose-redis.yml -p redis down\n    ```\n\n* Checking the Redis container log\n\n    ```bash\n    docker logs redis-redis-1 -f\n    ```\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-mariadb.yml",
    "content": "services:\n  mariadb:\n    image: mariadb:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MARIADB_ROOT_PASSWORD=Qwerty\n      - MARIADB_DATABASE=orm_test\n      - MARIADB_USER=test\n      - MARIADB_PASSWORD=Test123\n    networks:\n      - appnet\n\n  adminer:\n    image: adminer:latest\n    restart: \"no\"\n    ports:\n      - 8080:8080\n    networks:\n      - appnet\n     \nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-mongo.yml",
    "content": "services:\n\n  mongo:\n    image: mongo:latest\n    restart: no\n    ports:\n      - 27017:27017\n    environment:\n      MONGO_INITDB_ROOT_USERNAME: root\n      MONGO_INITDB_ROOT_PASSWORD: Qwerty\n      MONGO_INITDB_DATABASE: local\n    networks:\n      - appnet\n\n  mongo-express:\n    image: mongo-express:latest\n    restart: no\n    depends_on:\n      - mongo\n    ports:\n      - 8081:8081\n    environment:\n      ME_CONFIG_MONGODB_ADMINUSERNAME: root\n      ME_CONFIG_MONGODB_ADMINPASSWORD: Qwerty\n      ME_CONFIG_MONGODB_URL: mongodb://root:Qwerty@mongo:27017/\n      ME_CONFIG_BASICAUTH: false\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-mysql.yml",
    "content": "services:\n  mysql:\n    image: mysql:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MYSQL_ROOT_PASSWORD=Qwerty\n      - MYSQL_DATABASE=orm_test\n      - MYSQL_USER=test\n      - MYSQL_PASSWORD=Test123\n#    volumes:\n#      - C://storage/mysql:/var/lib/mysql:ro\n    networks:\n      - appnet\n\n#volumes:\n#  mysql-data-external:\n#    driver: local\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-pg.yml",
    "content": "services:\n  pgdb:\n    image: postgres:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\n  pgadmin4:\n    image: dpage/pgadmin4:latest\n    restart: \"no\"\n    ports:\n      - \"5050:80\"\n    environment:\n      - PGADMIN_DEFAULT_EMAIL=admin@mydomain.com\n      - PGADMIN_DEFAULT_PASSWORD=Qwerty\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-redis.yml",
    "content": "services:\n  redis:\n    image: redis:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/docker/docker-compose-rethinkdb.yml",
    "content": "services:\n  rethinkdb:\n    image: rethinkdb:latest\n    restart: \"no\"\n    ports:\n      - \"8080:8080\"\n      - \"28015:28015\"\n      - \"29015:29015\"\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/helm_chart/README.md",
    "content": "# Running as Container Services using Helm Chart\n\nTo be available soon\n"
  },
  {
    "path": "doc/deployment/podman/README.md",
    "content": "# Running as Container Services using Podman\n\nThe required applications by the framework can be run using the Docker compose files provided in this folder.\n\n## Installation\n\n### PostreSQL\n\n* Starting the PostreSQL container\n\n    ```bash\n    podman-compose -f podman-compose-pg.yml -p pg up -d\n    ```\n\n* Stopping the PostreSQL container\n\n    ```bash\n    podman-compose -f podman-compose-pg.yml -p pg stop\n    podman-compose -f podman-compose-pg.yml -p pg down\n    ```\n\n* Checking the PostreSQL container log\n\n    ```bash\n    podman logs -f podman-pg-1\n    ```\n\n* Running psql\n\n    ```bash\n    podman exec -it <container id> /bin/bash\n    psql --username postgres\n    ```\n\n* Create PostgreSQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    create user test with encrypted password 'test123';\n    grant all privileges on database orm_test to test;\n    ```\n\n### MariaDB\n\n* Starting the MariaDB container\n\n    ```bash\n    podman-compose -f podman-compose-mariadb.yml -p maria up -d\n    ```\n\n* Stopping the MariaDB container\n\n    ```bash\n    podman-compose -f podman-compose-mariadb.yml -p maria stop\n    podman-compose -f podman-compose-mariadb.yml -p maria down\n    ```\n\n* Checking the MariaDB container log\n\n    ```bash\n    podman logs -f maria-mariadb-1\n    ```\n\n* Create MariaDB database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MySQL\n\n* Starting the MySQL container\n\n    ```bash\n    podman-compose -f podman-compose-mysql.yml -p mysql up -d\n    ```\n\n* Stopping the MySQL container\n\n    ```bash\n    podman-compose -f podman-compose-mysql.yml -p mysql stop\n    podman-compose -f podman-compose-mysql.yml -p mysql down\n    ```\n\n* Checking the MySQL container log\n\n    ```bash\n    podman logs -f mysql-mysql-1\n    ```\n\n* Create MySQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MongoDB\n\n* Starting the MongoDB container\n\n    ```bash\n    podman-compose -f podman-compose-mongo.yml -p mongo up -d\n    ```\n\n* Stopping the MongoDB container\n\n    ```bash\n    podman-compose -f podman-compose-mongo.yml -p mongo stop\n    podman-compose -f podman-compose-mongo.yml -p mongo down\n    ```\n\n* Checking the MongoDB container log\n\n    ```bash\n    podman logs -f mongo-mongo-1\n    ```\n\n### rethinkDB\n\n* Starting the rethinkDB container\n\n    ```bash\n    podman-compose -f podman-compose-rethinkdb.yml -p rethink up -d\n    ```\n\n* Stopping the rethinkDB container\n\n    ```bash\n    podman-compose -f podman-compose-rethinkdb.yml -p rethink stop\n    podman-compose -f podman-compose-rethinkdb.yml -p rethink down\n    ```\n\n* Checking the rethinkDB container log\n\n    ```bash\n    podman logs -f rethink-rethinkdb-1\n    ```\n\n### Redis\n\n* Starting the Redis container\n\n    ```bash\n    podman-compose -f podman-compose-redis.yml -p redis up -d\n    ```\n\n* Stopping the Redis container\n\n    ```bash\n    podman-compose -f podman-compose-redis.yml -p redis stop\n    podman-compose -f podman-compose-redis.yml -p redis down\n    ```\n\n* Checking the Redis container log\n\n    ```bash\n    podman logs -f redis-redis-1\n    ```\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-mariadb.yml",
    "content": "services:\n  mariadb:\n    image: docker.io/mariadb:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MARIADB_ROOT_PASSWORD=Qwerty\n      - MARIADB_DATABASE=orm_test\n      - MARIADB_USER=test\n      - MARIADB_PASSWORD=Test123\n    networks:\n      - appnet\n\n  adminer:\n    image: docker.io/adminer:latest\n    restart: \"no\"\n    ports:\n      - 8080:8080\n    networks:\n      - appnet\n     \nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-mongo.yml",
    "content": "services:\n\n  mongo:\n    image: docker.io/mongo:latest\n    restart: no\n    ports:\n      - 27017:27017\n    environment:\n      MONGO_INITDB_ROOT_USERNAME: root\n      MONGO_INITDB_ROOT_PASSWORD: Qwerty\n      MONGO_INITDB_DATABASE: local\n    networks:\n      - appnet\n\n  mongo-express:\n    image: docker.io/mongo-express:latest\n    restart: no\n    depends_on:\n      - mongo\n    ports:\n      - 8081:8081\n    environment:\n      ME_CONFIG_MONGODB_ADMINUSERNAME: root\n      ME_CONFIG_MONGODB_ADMINPASSWORD: Qwerty\n      ME_CONFIG_MONGODB_URL: mongodb://root:Qwerty@mongo:27017/\n      ME_CONFIG_BASICAUTH: false\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-mysql.yml",
    "content": "services:\n  mysql:\n    image: docker.io/mysql:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MYSQL_ROOT_PASSWORD=Qwerty\n      - MYSQL_DATABASE=orm_test\n      - MYSQL_USER=test\n      - MYSQL_PASSWORD=Test123\n#    volumes:\n#      - C://storage/mysql:/var/lib/mysql:ro\n    networks:\n      - appnet\n\n#volumes:\n#  mysql-data-external:\n#    driver: local\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-pg.yml",
    "content": "services:\n  pgdb:\n    image: docker.io/postgres:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\n  pgadmin4:\n    image: docker.io/dpage/pgadmin4:latest\n    restart: \"no\"\n    ports:\n      - \"5050:80\"\n    environment:\n      - PGADMIN_DEFAULT_EMAIL=admin@mydomain.com\n      - PGADMIN_DEFAULT_PASSWORD=Qwerty\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-redis.yml",
    "content": "services:\n  redis:\n    image: docker.io/redis:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/podman/podman-compose-rethinkdb.yml",
    "content": "services:\n  rethinkdb:\n    image: docker.io/rethinkdb:latest\n    restart: \"no\"\n    ports:\n      - \"8080:8080\"\n      - \"28015:28015\"\n      - \"29015:29015\"\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/README.md",
    "content": "# Running as Container Services using Rancher\n\nThe required applications by the framework can be run using the Docker compose files provided in this folder.\n\n## Installation\n\n### PostreSQL\n\n* Starting the PostreSQL container\n\n    ```bash\n    nerdctl compose -f rancher-compose-pg.yml -p pg up -d\n    ```\n\n* Stopping the PostreSQL container\n\n    ```bash\n    nerdctl compose -f rancher-compose-pg.yml -p pg stop\n    nerdctl compose -f rancher-compose-pg.yml -p pg down\n    ```\n\n* Checking the PostreSQL container log\n\n    ```bash\n    nerdctl logs rancher-pg-1 -f\n    ```\n\n* Running psql\n\n    ```bash\n    nerdctl exec -it <container id> /bin/bash\n    psql --username postgres\n    ```\n\n* Create PostgreSQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    create user test with encrypted password 'test123';\n    grant all privileges on database orm_test to test;\n    ```\n\n### MariaDB\n\n* Starting the MariaDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mariadb.yml -p maria up -d\n    ```\n\n* Stopping the MariaDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mariadb.yml -p maria stop\n    nerdctl compose -f rancher-compose-mariadb.yml -p maria down\n    ```\n\n* Checking the MariaDB container log\n\n    ```bash\n    nerdctl logs maria-mariadb-1 -f\n    ```\n\n* Create MariaDB database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MySQL\n\n* Starting the MySQL container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mysql.yml -p mysql up -d\n    ```\n\n* Stopping the MySQL container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mysql.yml -p mysql stop\n    nerdctl compose -f rancher-compose-mysql.yml -p mysql down\n    ```\n\n* Checking the MySQL container log\n\n    ```bash\n    nerdctl logs mysql-mysql-1 -f\n    ```\n\n* Create MySQL database, user and grant access\n\n    ```sql\n    create database orm_test;\n    \n    -- Granting localhost access only\n    create user 'test'@'localhost' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'localhost';\n\n    -- Granting localhost and remote access\n    create user 'test'@'%' identified by 'test123';\n    grant all privileges on orm_test.* to 'test'@'%';\n    ```\n\n### MongoDB\n\n* Starting the MongoDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mongo.yml -p mongo up -d\n    ```\n\n* Stopping the MongoDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-mongo.yml -p mongo stop\n    nerdctl compose -f rancher-compose-mongo.yml -p mongo down\n    ```\n\n* Checking the MongoDB container log\n\n    ```bash\n    nerdctl logs mongo-mongo-1 -f\n    ```\n\n### rethinkDB\n\n* Starting the rethinkDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-rethinkdb.yml -p rethink up -d\n    ```\n\n* Stopping the rethinkDB container\n\n    ```bash\n    nerdctl compose -f rancher-compose-rethinkdb.yml -p rethink stop\n    nerdctl compose -f rancher-compose-rethinkdb.yml -p rethink down\n    ```\n\n* Checking the rethinkDB container log\n\n    ```bash\n    nerdctl logs rethink-rethinkdb-1 -f\n    ```\n\n### Redis\n\n* Starting the Redis container\n\n    ```bash\n    nerdctl compose -f rancher-compose-redis.yml -p redis up -d\n    ```\n\n* Stopping the Redis container\n\n    ```bash\n    nerdctl compose -f rancher-compose-redis.yml -p redis stop\n    nerdctl compose -f rancher-compose-redis.yml -p redis down\n    ```\n\n* Checking the Redis container log\n\n    ```bash\n    nerdctl logs redis-redis-1 -f\n    ```\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-mariadb.yml",
    "content": "services:\n  mariadb:\n    image: mariadb:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MARIADB_ROOT_PASSWORD=Qwerty\n      - MARIADB_DATABASE=orm_test\n      - MARIADB_USER=test\n      - MARIADB_PASSWORD=Test123\n    networks:\n      - appnet\n\n  adminer:\n    image: adminer:latest\n    restart: \"no\"\n    ports:\n      - 8080:8080\n    networks:\n      - appnet\n     \nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-mongo.yml",
    "content": "services:\n\n  mongo:\n    image: mongo:latest\n    restart: no\n    ports:\n      - 27017:27017\n    environment:\n      MONGO_INITDB_ROOT_USERNAME: root\n      MONGO_INITDB_ROOT_PASSWORD: Qwerty\n      MONGO_INITDB_DATABASE: local\n    networks:\n      - appnet\n\n  mongo-express:\n    image: mongo-express:latest\n    restart: no\n    depends_on:\n      - mongo\n    ports:\n      - 8081:8081\n    environment:\n      ME_CONFIG_MONGODB_ADMINUSERNAME: root\n      ME_CONFIG_MONGODB_ADMINPASSWORD: Qwerty\n      ME_CONFIG_MONGODB_URL: mongodb://root:Qwerty@mongo:27017/\n      ME_CONFIG_BASICAUTH: false\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-mysql.yml",
    "content": "services:\n  mysql:\n    image: mysql:latest\n    restart: \"no\"\n    ports:\n      - \"3306:3306\"\n    environment:\n      - MYSQL_ROOT_PASSWORD=Qwerty\n      - MYSQL_DATABASE=orm_test\n      - MYSQL_USER=test\n      - MYSQL_PASSWORD=Test123\n#    volumes:\n#      - C://storage/mysql:/var/lib/mysql:ro\n    networks:\n      - appnet\n\n#volumes:\n#  mysql-data-external:\n#    driver: local\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-pg.yml",
    "content": "services:\n  pgdb:\n    image: postgres:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\n  pgadmin4:\n    image: dpage/pgadmin4:latest\n    restart: \"no\"\n    ports:\n      - \"5050:80\"\n    environment:\n      - PGADMIN_DEFAULT_EMAIL=admin@mydomain.com\n      - PGADMIN_DEFAULT_PASSWORD=Qwerty\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-redis.yml",
    "content": "services:\n  redis:\n    image: redis:latest\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n    environment:\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "doc/deployment/rancher/rancher-compose-rethinkdb.yml",
    "content": "services:\n  rethinkdb:\n    image: rethinkdb:latest\n    restart: \"no\"\n    ports:\n      - \"8080:8080\"\n      - \"28015:28015\"\n      - \"29015:29015\"\n    networks:\n      - appnet\n\nnetworks:\n  appnet:\n"
  },
  {
    "path": "melos.yaml",
    "content": "name: angel3\n\npackages:\n  - packages/http_exception\n  - packages/route\n  - packages/model\n  - packages/serialize/angel_serialize\n  - packages/serialize/angel_serialize_generator\n  - packages/container/angel_container\n  - packages/container/angel_container_generator\n  - packages/mock_request\n  - packages/framework\n  - packages/user_agent/angel_user_agent\n  - packages/validate\n  - packages/redis\n  - packages/cache\n  - packages/configuration\n  - packages/cors\n  - packages/auth\n  - packages/auth_oauth2\n#  - packages/auth_twitter\n  - packages/file_service\n  - packages/html\n  - packages/client\n  - packages/websocket\n  - packages/hot\n  - packages/production\n  - packages/test\n  - packages/sync\n  - packages/oauth2\n  - packages/security\n  - packages/proxy\n  - packages/paginate\n  - packages/static\n  - packages/jael/jael\n  - packages/jael/jael_preprocessor\n  - packages/jael/angel_jael\n  - packages/jael/jael_language_server\n  - packages/jael/jael_web\n  - packages/jinja\n  - packages/markdown\n  - packages/mustache\n  - packages/seo\n  - packages/mongo\n  - packages/rethinkdb\n  - packages/sembast\n  - packages/orm/angel_migration\n  - packages/orm/angel_migration_runner\n  - packages/orm/angel_orm\n  - packages/orm/angel_orm_generator\n  - packages/orm/angel_orm_postgres\n  - packages/orm/angel_orm_mysql\n  - packages/orm/angel_orm_service\n  - packages/shelf\n\n#scripts:\n#  analyze: melos exec -- \"dart analyze .\""
  },
  {
    "path": "melos_angel3.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>\n"
  },
  {
    "path": "packages/cache/.gitignore",
    "content": "# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# CMake\ncmake-build-debug/\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\nout/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Cursive Clojure plugin\n.idea/replstate.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n.dart_tool"
  },
  {
    "path": "packages/cache/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/cache/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.3\n\n* Updated linter to `package:lints`\n\n## 4.0.2\n\n* Updated README\n* Added home page link\n* All 7 unit tests passed\n\n## 4.0.1\n\n* Updated pubspec description\n* Fixed: Return `200` with cached data instead of `403`\n* Updated broken unit tests\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.0.1\n\n* Add `ignoreQueryAndFragment` to `ResponseCache`.\n* Rename `CacheService.ignoreQuery` to `ignoreParams`.\n\n## 1.0.0\n\n* First version\n"
  },
  {
    "path": "packages/cache/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/cache/README.md",
    "content": "# Angel3 HTTP Cache\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_cache?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/cache/LICENSE)\n\nA service that provides HTTP caching to the response data for [Angel3 framework](https://pub.dev/packages/angel3).\n\n## `CacheService`\n\nA `Service` class that caches data from one service, storing it in another. An imaginable use case is storing results from MongoDB or another database in Memcache/Redis.\n\n## `cacheSerializationResults`\n\nA middleware that enables the caching of response serialization.\n\nThis can improve the performance of sending objects that are complex to serialize. You can pass a [shouldCache] callback to determine which values should be cached.\n\n```dart\nvoid main() async {\n    var app = Angel()..lazyParseBodies = true;\n    \n    app.use(\n      '/api/todos',\n      CacheService(\n        database: AnonymousService(\n          index: ([params]) {\n            print('Fetched directly from the underlying service at ${DateTime.now()}!');\n            return ['foo', 'bar', 'baz'];\n          },\n          read: (id, [params]) {\n            return {id: '$id at ${DateTime.now()}'};\n          }\n        ),\n      ),\n    );\n}\n```\n\n## `ResponseCache`\n\nA flexible response cache for Angel3.\n\nUse this to improve real and perceived response of Web applications, as well as to memorize expensive responses.\n\nSupports the `If-Modified-Since` header, as well as storing the contents of response buffers in memory.\n\nTo initialize a simple cache:\n\n```dart\nFuture configureServer(Angel app) async {\n  // Simple instance.\n  var cache = ResponseCache();\n  \n  // You can also pass an invalidation timeout.\n  var cache = ResponseCache(timeout: const Duration(days: 2));\n  \n  // Close the cache when the application closes.\n  app.shutdownHooks.add((_) => cache.close());\n  \n  // Use `patterns` to specify which resources should be cached.\n  cache.patterns.addAll([\n    'robots.txt',\n    RegExp(r'\\.(png|jpg|gif|txt)$'),\n    Glob('public/**/*'),\n  ]);\n  \n  // REQUIRED: The middleware that serves cached responses\n  app.use(cache.handleRequest);\n  \n  // REQUIRED: The response finalizer that saves responses to the cache\n  app.responseFinalizers.add(cache.responseFinalizer);\n}\n```\n\n### Purging the Cache\n\nCall `invalidate` to remove a resource from a `ResponseCache`.\n\nSome servers expect a reverse proxy or caching layer to support `PURGE` requests. If this is your case, make sure to include some sort of validation (maybe IP-based) to ensure no arbitrary attacker can hack your cache:\n\n```dart\nFuture configureServer(Angel app) async {\n  app.addRoute('PURGE', '*', (req, res) {\n    if (req.ip != '127.0.0.1')\n      throw AngelHttpException.forbidden();\n    return cache.purge(req.uri.path);\n  });\n}\n```\n"
  },
  {
    "path": "packages/cache/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/cache/example/cache_service.dart",
    "content": "import 'package:angel3_cache/angel3_cache.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var app = Angel();\n\n  app.use(\n    '/api/todos',\n    CacheService(\n      cache: MapService(),\n      database: AnonymousService(\n        index: ([params]) {\n          print(\n            'Fetched directly from the underlying service at ${DateTime.now()}!',\n          );\n          return ['foo', 'bar', 'baz'];\n        },\n        read: (dynamic id, [params]) {\n          return {id: '$id at ${DateTime.now()}'};\n        },\n      ),\n    ),\n  );\n\n  var http = AngelHttp(app);\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/cache/example/main.dart",
    "content": "import 'package:angel3_cache/angel3_cache.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var app = Angel();\n\n  // Cache a glob\n  var cache = ResponseCache()..patterns.addAll([RegExp('^/?\\\\w+\\\\.txt')]);\n\n  // Handle `if-modified-since` header, and also send cached content\n  app.fallback(cache.handleRequest);\n\n  // A simple handler that returns a different result every time.\n  app.get(\n    '/date.txt',\n    (req, res) => res.write(DateTime.now().toIso8601String()),\n  );\n\n  // Support purging the cache.\n  app.addRoute('PURGE', '*', (req, res) {\n    if (req.ip != '127.0.0.1') {\n      throw AngelHttpException.forbidden();\n    }\n\n    cache.purge(req.uri!.path);\n    print('Purged ${req.uri!.path}');\n  });\n\n  // The response finalizer that actually saves the content\n  app.responseFinalizers.add(cache.responseFinalizer);\n\n  var http = AngelHttp(app);\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/cache/lib/angel3_cache.dart",
    "content": "export 'src/cache.dart';\nexport 'src/cache_service.dart';\nexport 'src/serializer.dart';\n"
  },
  {
    "path": "packages/cache/lib/src/cache.dart",
    "content": "import 'dart:async';\nimport 'dart:io' show HttpDate;\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:pool/pool.dart';\nimport 'package:logging/logging.dart';\n\n/// A flexible response cache for Angel.\n///\n/// Use this to improve real and perceived response of Web applications,\n/// as well as to memorize expensive responses.\nclass ResponseCache {\n  /// A set of [Patterns] for which responses will be cached.\n  ///\n  /// For example, you can pass a `Glob` matching `**/*.png` files to catch all PNG images.\n  final List<Pattern> patterns = [];\n\n  /// An optional timeout, after which a given response will be removed from the cache, and the contents refreshed.\n  final Duration timeout;\n\n  final Map<String, _CachedResponse> _cache = {};\n  final Map<String, Pool> _writeLocks = {};\n\n  /// If `true` (default: `false`), then caching of results will discard URI query parameters and fragments.\n  final bool ignoreQueryAndFragment;\n\n  final log = Logger('ResponseCache');\n\n  ResponseCache({\n    this.timeout = const Duration(minutes: 10),\n    this.ignoreQueryAndFragment = false,\n  });\n\n  /// Closes all internal write-locks, and closes the cache.\n  Future close() async {\n    _writeLocks.forEach((_, p) => p.close());\n  }\n\n  /// Removes an entry from the response cache.\n  void purge(String path) => _cache.remove(path);\n\n  /// A middleware that handles requests with an `If-Modified-Since` header.\n  ///\n  /// This prevents the server from even having to access the cache, and plays very well with static assets.\n  Future<bool> ifModifiedSince(RequestContext req, ResponseContext res) async {\n    if (req.method != 'GET' && req.method != 'HEAD') {\n      return true;\n    }\n\n    var modifiedSince = req.headers?.ifModifiedSince;\n    if (modifiedSince != null) {\n      // Check if there is a cache entry.\n      for (var pattern in patterns) {\n        var reqPath = _getEffectivePath(req);\n\n        if (pattern.allMatches(reqPath).isNotEmpty &&\n            _cache.containsKey(reqPath)) {\n          var response = _cache[reqPath];\n\n          //log.info('timestamp ${response?.timestamp} vs since $modifiedSince');\n\n          if (response != null &&\n              response.timestamp.compareTo(modifiedSince) <= 0) {\n            // If the cache timeout has been met, don't send the cached response.\n            var timeDiff = DateTime.now().toUtc().difference(\n              response.timestamp,\n            );\n\n            //log.info(\n            //    'Time Diff: ${timeDiff.inMilliseconds} >=  ${timeout.inMilliseconds}');\n            if (timeDiff.inMilliseconds >= timeout.inMilliseconds) {\n              return true;\n            }\n\n            // Old code: res.statusCode = 304;\n            // Return the response stored in the cache\n            _setCachedHeaders(response.timestamp, req, res);\n            res\n              ..headers.addAll(response.headers)\n              ..add(response.body);\n            await res.close();\n            return false;\n          }\n        }\n      }\n    }\n\n    return true;\n  }\n\n  String _getEffectivePath(RequestContext req) {\n    if (req.uri == null) {\n      log.severe('Request URI is null');\n      throw ArgumentError('Request URI is null');\n    }\n    return ignoreQueryAndFragment == true ? req.uri!.path : req.uri.toString();\n  }\n\n  /// Serves content from the cache, if applicable.\n  Future<bool> handleRequest(RequestContext req, ResponseContext res) async {\n    if (!await ifModifiedSince(req, res)) return false;\n    if (req.method != 'GET' && req.method != 'HEAD') return true;\n    if (!res.isOpen) return true;\n\n    // Check if there is a cache entry.\n    //\n    // If `if-modified-since` is present, this check has already been performed.\n    if (req.headers?.ifModifiedSince == null) {\n      for (var pattern in patterns) {\n        if (pattern.allMatches(_getEffectivePath(req)).isNotEmpty) {\n          var now = DateTime.now().toUtc();\n\n          if (_cache.containsKey(_getEffectivePath(req))) {\n            var response = _cache[_getEffectivePath(req)];\n\n            if (response == null ||\n                now.difference(response.timestamp) >= timeout) {\n              return true;\n            }\n\n            _setCachedHeaders(response.timestamp, req, res);\n            res\n              ..headers.addAll(response.headers)\n              ..add(response.body);\n            await res.close();\n            return false;\n          } else {\n            _setCachedHeaders(now, req, res);\n          }\n        }\n      }\n    }\n\n    return true;\n  }\n\n  /// A response finalizer that saves responses to the cache.\n  Future<bool> responseFinalizer(\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    if (res.statusCode == 304) {\n      return true;\n    }\n\n    if (req.method != 'GET' && req.method != 'HEAD') {\n      return true;\n    }\n\n    // Check if there is a cache entry.\n    for (var pattern in patterns) {\n      var reqPath = _getEffectivePath(req);\n\n      if (pattern.allMatches(reqPath).isNotEmpty) {\n        var now = DateTime.now().toUtc();\n\n        // Invalidate the response, if need be.\n        if (_cache.containsKey(reqPath)) {\n          // If there is no timeout, don't invalidate.\n          //if (timeout == null) return true;\n\n          // Otherwise, don't invalidate unless the timeout has been exceeded.\n          var response = _cache[reqPath];\n          if (response == null ||\n              now.difference(response.timestamp) < timeout) {\n            return true;\n          }\n\n          // If the cache entry should be invalidated, then invalidate it.\n          purge(reqPath);\n        }\n\n        // Save the response.\n        var writeLock = _writeLocks.putIfAbsent(reqPath, () => Pool(1));\n        await writeLock.withResource(() {\n          if (res.buffer != null) {\n            _cache[reqPath] = _CachedResponse(\n              Map.from(res.headers),\n              res.buffer!.toBytes(),\n              now,\n            );\n          }\n        });\n\n        _setCachedHeaders(now, req, res);\n      }\n    }\n\n    return true;\n  }\n\n  void _setCachedHeaders(\n    DateTime modified,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    var privacy = 'public';\n\n    res.headers\n      ..['cache-control'] = '$privacy, max-age=${timeout.inSeconds}'\n      ..['last-modified'] = HttpDate.format(modified);\n\n    var expiry = DateTime.now().add(timeout);\n    res.headers['expires'] = HttpDate.format(expiry);\n  }\n}\n\nclass _CachedResponse {\n  final Map<String, String> headers;\n  final List<int> body;\n  final DateTime timestamp;\n\n  _CachedResponse(this.headers, this.body, this.timestamp);\n}\n"
  },
  {
    "path": "packages/cache/lib/src/cache_service.dart",
    "content": "import 'dart:async';\nimport 'package:collection/collection.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\n\n/// An Angel [Service] that caches data from another service.\n///\n/// This is useful for applications of scale, where network latency\n/// can have real implications on application performance.\nclass CacheService<Id, Data> extends Service<Id, Data> {\n  /// The underlying [Service] that represents the original data store.\n  final Service<Id, Data> database;\n\n  /// The [Service] used to interface with a caching layer.\n  ///\n  /// If not provided, this defaults to a [MapService].\n  final Service<Id, Data> cache;\n\n  /// If `true` (default: `false`), then result caching will discard parameters passed to service methods.\n  ///\n  /// If you want to return a cached result more-often-than-not, you may want to enable this.\n  final bool ignoreParams;\n\n  final Duration timeout;\n\n  final Map<Id, _CachedItem<Data>> _cache = {};\n  _CachedItem<List<Data>>? _indexed;\n\n  CacheService({\n    required this.database,\n    required this.cache,\n    this.timeout = const Duration(minutes: 10),\n    this.ignoreParams = false,\n  });\n\n  Future<T> _getCached<T>(\n    Map<String, dynamic> params,\n    _CachedItem? Function() get,\n    FutureOr<T> Function() getFresh,\n    FutureOr<T> Function() getCached,\n    FutureOr<T> Function(T data, DateTime now) save,\n  ) async {\n    var cached = get();\n    var now = DateTime.now().toUtc();\n\n    if (cached != null) {\n      // If the entry has expired, don't send from the cache\n      var expired = now.difference(cached.timestamp) >= timeout;\n\n      if (!expired) {\n        // Read from the cache if necessary\n        var queryEqual =\n            ignoreParams == true ||\n            (cached.params != null &&\n                const MapEquality().equals(\n                  params['query'] as Map,\n                  cached.params['query'] as Map,\n                ));\n        if (queryEqual) {\n          return await getCached();\n        }\n      }\n    }\n\n    // If we haven't fetched from the cache by this point,\n    // let's fetch from the database.\n    var data = await getFresh();\n    await save(data, now);\n    return data;\n  }\n\n  @override\n  Future<List<Data>> index([Map<String, dynamic>? params]) {\n    return _getCached(\n      params ?? {},\n      () => _indexed,\n      () => database.index(params),\n      () => _indexed?.data ?? [],\n      (data, now) async {\n        _indexed = _CachedItem(params, now, data);\n        return data;\n      },\n    );\n  }\n\n  @override\n  Future<Data> read(Id id, [Map<String, dynamic>? params]) async {\n    return _getCached<Data>(\n      params ?? {},\n      () => _cache[id],\n      () => database.read(id, params),\n      () => cache.read(id),\n      (data, now) async {\n        _cache[id] = _CachedItem(params, now, data);\n        return await cache.modify(id, data);\n      },\n    );\n  }\n\n  @override\n  Future<Data> create(data, [Map<String, dynamic>? params]) {\n    _indexed = null;\n    return database.create(data, params);\n  }\n\n  @override\n  Future<Data> modify(Id id, Data data, [Map<String, dynamic>? params]) {\n    _indexed = null;\n    _cache.remove(id);\n    return database.modify(id, data, params);\n  }\n\n  @override\n  Future<Data> update(Id id, Data data, [Map<String, dynamic>? params]) {\n    _indexed = null;\n    _cache.remove(id);\n    return database.modify(id, data, params);\n  }\n\n  @override\n  Future<Data> remove(Id id, [Map<String, dynamic>? params]) {\n    _indexed = null;\n    _cache.remove(id);\n    return database.remove(id, params);\n  }\n}\n\nclass _CachedItem<Data> {\n  final dynamic params;\n  final DateTime timestamp;\n  final Data? data;\n\n  _CachedItem(this.params, this.timestamp, [this.data]);\n\n  @override\n  String toString() {\n    return '$timestamp:$params:$data';\n  }\n}\n"
  },
  {
    "path": "packages/cache/lib/src/serializer.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\n\n/// A middleware that enables the caching of response serialization.\n///\n/// This can improve the performance of sending objects that are complex to serialize.\n///\n/// You can pass a [shouldCache] callback to determine which values should be cached.\nRequestHandler cacheSerializationResults({\n  Duration? timeout,\n  FutureOr<bool> Function(RequestContext, ResponseContext, Object)? shouldCache,\n}) {\n  return (RequestContext req, ResponseContext res) async {\n    var oldSerializer = res.serializer;\n\n    // TODO: Commented out as it is not doing anything useful\n    var cache = <dynamic, String>{};\n\n    res.serializer = (value) {\n      if (shouldCache == null) {\n        return cache.putIfAbsent(value, () => oldSerializer(value) as String);\n      }\n\n      return oldSerializer(value);\n    };\n\n    return true;\n  };\n}\n"
  },
  {
    "path": "packages/cache/melos_angel3_cache.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/cache/pubspec.yaml",
    "content": "name: angel3_cache\nversion: 8.5.0\ndescription: A service that provides HTTP caching to the response data for Angel3\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/cache\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  collection: ^1.17.0\n  meta: ^1.9.0\n  pool: ^1.5.0\n  logging: ^1.2.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  glob: ^2.0.1\n  http: ^1.0.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/cache/test/cache_test.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_cache/angel3_cache.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:http/http.dart' as http;\n//import 'package:glob/glob.dart';\nimport 'package:test/test.dart';\nimport 'package:logging/logging.dart';\n\nFuture<void> main() async {\n  Logger.root.level = Level.ALL;\n  Logger.root.onRecord.listen((record) {\n    print(\n      '${record.time}: ${record.level.name}: ${record.loggerName}: ${record.message}',\n    );\n  });\n\n  group('no timeout', () {\n    late TestClient client;\n    DateTime? lastModified;\n    late http.Response response1, response2;\n\n    setUp(() async {\n      var app = Angel();\n      var cache = ResponseCache()\n        ..patterns.addAll([\n          //Glob('/*.txt'), // Requires to create folders and files for testing\n          RegExp('^/?\\\\w+\\\\.txt'),\n        ]);\n\n      app.fallback(cache.handleRequest);\n\n      app.get('/date.txt', (req, res) {\n        var data = DateTime.now().toIso8601String();\n        print('Res data: $data');\n        res\n          ..useBuffer()\n          ..write(data);\n        print('Generate results...');\n      });\n\n      app.addRoute('PURGE', '*', (req, res) {\n        if (req.uri != null) {\n          cache.purge(req.uri!.path);\n          print('Purged ${req.uri!.path}');\n        } else {\n          print('req.uri is null');\n        }\n      });\n\n      app.responseFinalizers.add(cache.responseFinalizer);\n\n      var oldHandler = app.errorHandler;\n      app.errorHandler = (e, req, res) {\n        if (e.error == null) {\n          oldHandler(e, req, res);\n        }\n        return Zone.current.handleUncaughtError(\n          e.error as Object,\n          e.stackTrace!,\n        );\n      };\n\n      client = await connectTo(app);\n      response1 = await client.get(Uri.parse('/date.txt'));\n      print('Response 1 status: ${response1.statusCode}');\n      print('Response 1 headers: ${response1.headers}');\n      print('Response 1 body: ${response1.body}');\n\n      response2 = await client.get(Uri.parse('/date.txt'));\n      print('Response 2 status: ${response2.statusCode}');\n      print('Response 2 headers: ${response2.headers}');\n      print('Response 2 body: ${response2.body}');\n      if (response2.headers['last-modified'] == null) {\n        print('last-modified is null');\n      } else {\n        lastModified = HttpDate.parse(response2.headers['last-modified']!);\n      }\n    });\n\n    tearDown(() => client.close());\n\n    test('saves content', () async {\n      expect(response2.body, response1.body);\n    });\n\n    test('saves headers', () async {\n      response1.headers.forEach((k, v) {\n        expect(response2.headers, containsPair(k, v));\n      });\n    });\n\n    test('first response is normal', () {\n      expect(response1.statusCode, 200);\n    });\n\n    test('sends last-modified', () {\n      expect(response2.headers.keys, contains('last-modified'));\n    });\n\n    test('invalidate', () async {\n      await client.sendUnstreamed('PURGE', '/date.txt', {});\n      var response = await client.get(Uri.parse('/date.txt'));\n      print('Response after invalidation: ${response.body}');\n      expect(response.body, isNot(response1.body));\n    });\n\n    test('sends 304 on if-modified-since', () async {\n      lastModified ??= DateTime.now();\n      var headers = {\n        'if-modified-since': HttpDate.format(\n          lastModified!.add(const Duration(days: 1)),\n        ),\n      };\n      var response = await client.get(Uri.parse('/date.txt'), headers: headers);\n      print('Sending headers: $headers');\n      print('Response status: ${response.statusCode})');\n      print('Response headers: ${response.headers}');\n      print('Response body: ${response.body}');\n      //expect(response.statusCode, 304);\n      expect(response.statusCode, 200);\n    });\n\n    test('last-modified in the past', () async {\n      lastModified ??= DateTime.now();\n      var response = await client.get(\n        Uri.parse('/date.txt'),\n        headers: {\n          'if-modified-since': HttpDate.format(\n            lastModified!.subtract(const Duration(days: 10)),\n          ),\n        },\n      );\n      print('Response: ${response.body}');\n      expect(response.statusCode, 200);\n      expect(response.body, isNot(response1.body));\n    });\n  });\n\n  group('with timeout', () {});\n}\n"
  },
  {
    "path": "packages/cache/test/files/date.txt",
    "content": ""
  },
  {
    "path": "packages/container/angel_container_generator/.gitignore",
    "content": "# See https://www.dartlang.org/guides/libraries/private-files\n\n# Files and directories created by pub\n.dart_tool/\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n"
  },
  {
    "path": "packages/container/angel_container_generator/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.9\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed analyser warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.1.0-beta.1\n\n* Require Dart >= 2.19\n* Upgraded `relectable` to 4.x.x\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.1\n\n* Updated `package:angel3_container`\n\n## 3.0.0\n\n* Fixed NNBD issues\n* All 9 test cases passed\n\n## 3.0.0-beta.1\n\n* Migrated to support Dart >= 2.12 NNBD\n* Updated linter to `package:lints`\n* Updated to use `angel3_` packages\n\n## 2.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 1.0.1\n\n* Update for `pkg:angel_container@1.0.3`.\n"
  },
  {
    "path": "packages/container/angel_container_generator/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/container/angel_container_generator/README.md",
    "content": "# Angel3 Container Generator\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_container_generator?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/container/angel3_container_generator/LICENSE)\n\nAn alternative container for Angel3 that uses `reflectable` package instead of `dart:mirrors` for reflection. However, `reflectable` has more limited relfection capabilities when compared to `dart:mirrors`.\n\n## Usage\n\n* Annotable the class with `@contained`.\n* Run `dart run build_runner build <Your class directory>`\n* Alternatively create a `build.xml` file with the following content\n\n    ```yaml\n    targets:\n    $default:\n        builders:\n        reflectable:\n            generate_for:\n            - bin/**_controller.dart\n            options:\n            formatted: true\n    ```\n\n## Known limitation\n\n* Reflection on functions/closures is not supported\n* Reflection on private declarations is not supported\n* Reflection on generic type is not supported\n"
  },
  {
    "path": "packages/container/angel_container_generator/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/container/angel_container_generator/example/main.dart",
    "content": "import 'dart:async';\n\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_container_generator/angel3_container_generator.dart';\n\nFuture<void> main() async {\n  // Create a container instance.\n  Container container = Container(GeneratedReflector());\n\n  // Register a singleton.\n  container.registerSingleton<Engine>(Engine(40));\n\n  // You can also omit the type annotation, in which the object's runtime type will be used.\n  // If you're injecting an abstract class, prefer the type annotation.\n  //\n  // container.registerSingleton(Engine(40));\n\n  // Register a factory that creates a truck.\n  container.registerFactory<Truck>((container) {\n    return _TruckImpl(container.make<Engine>());\n  });\n\n  // Use `make` to create an instance.\n  var truck = container.make<Truck>();\n\n  // You can also resolve injections asynchronously.\n  container.registerFactory<Future<int>>((_) async => 24);\n  print(await container.makeAsync<int>());\n\n  // Asynchronous resolution also works for plain objects.\n  await container.makeAsync<Truck>().then((t) => t.drive());\n\n  // Register a named singleton.\n  container.registerNamedSingleton('the_truck', truck);\n\n  // Should print: 'Vroom! I have 40 horsepower in my engine.'\n  truck.drive();\n\n  // Should print the same.\n  container.findByName<Truck>('the_truck').drive();\n\n  // We can make a child container with its own factory.\n  var childContainer = container.createChild();\n\n  childContainer.registerFactory<Truck>((container) {\n    return _TruckImpl(Engine(5666));\n  });\n\n  // Make a truck with 5666 HP.\n  childContainer.make<Truck>().drive();\n\n  // However, calling `make<Engine>` will return the Engine singleton we created above.\n  print(childContainer.make<Engine>().horsePower);\n}\n\nabstract class Truck {\n  void drive();\n}\n\nclass Engine {\n  final int horsePower;\n\n  Engine(this.horsePower);\n}\n\nclass _TruckImpl implements Truck {\n  final Engine engine;\n\n  _TruckImpl(this.engine);\n\n  @override\n  void drive() {\n    print('Vroom! I have ${engine.horsePower} horsepower in my engine.');\n  }\n}\n"
  },
  {
    "path": "packages/container/angel_container_generator/example/main.reflectable.dart",
    "content": "// This file has been generated by the reflectable package.\n// https://github.com/dart-lang/reflectable.\n\nimport 'dart:core';\nimport 'dart:math' as prefix6;\nimport 'package:angel3_container_generator/angel3_container_generator.dart'\n    as prefix0;\nimport 'package:reflectable/capability.dart' as prefix5;\nimport 'package:reflectable/mirrors.dart' as prefix4;\nimport 'package:reflectable/reflectable.dart' as prefix1;\nimport 'package:reflectable/src/reflectable_base.dart' as prefix3;\nimport 'package:reflectable/src/reflectable_builder_based.dart' as prefix2;\n\n// ignore_for_file: camel_case_types\n// ignore_for_file: implementation_imports\n// ignore_for_file: prefer_adjacent_string_concatenation\n// ignore_for_file: prefer_collection_literals\n// ignore_for_file: unnecessary_const\n\n// ignore:unused_import\nimport 'package:reflectable/mirrors.dart' as m;\n// ignore:unused_import\nimport 'package:reflectable/src/reflectable_builder_based.dart' as r;\n// ignore:unused_import\nimport 'package:reflectable/reflectable.dart' as r show Reflectable;\n\nfinal _data = <r.Reflectable, r.ReflectorData>{\n  const prefix0.ContainedReflectable(): r.ReflectorData(\n    <m.TypeMirror>[\n      r.NonGenericClassMirrorImpl(\n        r'ContainedReflectable',\n        r'.ContainedReflectable',\n        134217735,\n        0,\n        const prefix0.ContainedReflectable(),\n        const <int>[67],\n        const <int>[68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80],\n        const <int>[],\n        1,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? prefix0.ContainedReflectable() : null,\n        },\n        0,\n        0,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Reflectable',\n        r'reflectable.reflectable.Reflectable',\n        134218247,\n        1,\n        const prefix0.ContainedReflectable(),\n        const <int>[27, 28, 81, 84, 85],\n        const <int>[68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80],\n        const <int>[81, 82, 83],\n        2,\n        {\n          r'getInstance': () => prefix1.Reflectable.getInstance,\n          r'thisClassName': () => prefix1.Reflectable.thisClassName,\n          r'thisClassId': () => prefix1.Reflectable.thisClassId,\n        },\n        {},\n        {},\n        1,\n        1,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectableImpl',\n        r'reflectable.src.reflectable_builder_based.ReflectableImpl',\n        134218247,\n        2,\n        const prefix0.ContainedReflectable(),\n        const <int>[74, 75, 76, 77, 78, 79, 80, 86, 87],\n        const <int>[68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80],\n        const <int>[],\n        3,\n        {},\n        {},\n        {},\n        2,\n        2,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectableBase',\n        r'reflectable.src.reflectable_base.ReflectableBase',\n        134217735,\n        3,\n        const prefix0.ContainedReflectable(),\n        const <int>[73, 88, 89],\n        const <int>[68, 69, 70, 71, 72, 73],\n        const <int>[],\n        4,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              ([\n                _cap0,\n                _cap1,\n                _cap2,\n                _cap3,\n                _cap4,\n                _cap5,\n                _cap6,\n                _cap7,\n                _cap8,\n                _cap9,\n              ]) => b\n              ? prefix3.ReflectableBase(\n                  _cap0,\n                  _cap1,\n                  _cap2,\n                  _cap3,\n                  _cap4,\n                  _cap5,\n                  _cap6,\n                  _cap7,\n                  _cap8,\n                  _cap9,\n                )\n              : null,\n          r'fromList': (bool b) =>\n              (_capabilities) =>\n                  b ? prefix3.ReflectableBase.fromList(_capabilities) : null,\n        },\n        3,\n        3,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Object',\n        r'dart.core.Object',\n        134217735,\n        4,\n        const prefix0.ContainedReflectable(),\n        const <int>[68, 69, 70, 90, 91, 92, 71, 72, 93],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[90, 91, 92],\n        null,\n        {\n          r'hash': () => Object.hash,\n          r'hashAll': () => Object.hashAll,\n          r'hashAllUnordered': () => Object.hashAllUnordered,\n        },\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? Object() : null,\n        },\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Invocation',\n        r'dart.core.Invocation',\n        134218247,\n        5,\n        const prefix0.ContainedReflectable(),\n        const <int>[94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106],\n        const <int>[68, 69, 70, 71, 72, 95, 101],\n        const <int>[],\n        4,\n        {},\n        {},\n        {\n          r'method': (bool b) =>\n              (memberName, positionalArguments, [namedArguments]) => b\n              ? Invocation.method(\n                  memberName,\n                  positionalArguments,\n                  namedArguments,\n                )\n              : null,\n          r'genericMethod': (bool b) =>\n              (\n                memberName,\n                typeArguments,\n                positionalArguments, [\n                namedArguments,\n              ]) => b\n              ? Invocation.genericMethod(\n                  memberName,\n                  typeArguments,\n                  positionalArguments,\n                  namedArguments,\n                )\n              : null,\n          r'getter': (bool b) =>\n              (name) => b ? Invocation.getter(name) : null,\n          r'setter': (bool b) =>\n              (memberName, argument) =>\n                  b ? Invocation.setter(memberName, argument) : null,\n        },\n        4,\n        5,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Type',\n        r'dart.core.Type',\n        134218247,\n        6,\n        const prefix0.ContainedReflectable(),\n        const <int>[107, 108, 109, 110],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {},\n        4,\n        6,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'String',\n        r'dart.core.String',\n        134218247,\n        7,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          111,\n          112,\n          113,\n          114,\n          115,\n          116,\n          117,\n          118,\n          119,\n          120,\n          121,\n          122,\n          123,\n          124,\n          125,\n          126,\n          127,\n          128,\n          129,\n          130,\n          131,\n          132,\n          133,\n          134,\n          135,\n          136,\n          137,\n          138,\n          139,\n          140,\n          141,\n          142,\n          143,\n          144,\n          145,\n        ],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {\n          r'fromCharCodes': (bool b) =>\n              (charCodes, [start, end]) =>\n                  b ? String.fromCharCodes(charCodes, start, end) : null,\n          r'fromCharCode': (bool b) =>\n              (charCode) => b ? String.fromCharCode(charCode) : null,\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? String.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n        },\n        4,\n        7,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'bool',\n        r'dart.core.bool',\n        134217735,\n        8,\n        const prefix0.ContainedReflectable(),\n        const <int>[146, 147, 148, 149, 150, 151, 152, 153, 154],\n        const <int>[68, 151, 70, 152, 72, 148, 149, 150],\n        const <int>[146, 147],\n        4,\n        {r'parse': () => bool.parse, r'tryParse': () => bool.tryParse},\n        {},\n        {\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? bool.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n          r'hasEnvironment': (bool b) =>\n              (name) => b ? bool.hasEnvironment(name) : null,\n        },\n        4,\n        8,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'int',\n        r'dart.core.int',\n        134218247,\n        9,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          155,\n          156,\n          157,\n          158,\n          159,\n          160,\n          161,\n          162,\n          163,\n          164,\n          165,\n          166,\n          167,\n          168,\n          169,\n          170,\n          171,\n          172,\n          173,\n          174,\n          175,\n          176,\n          177,\n          178,\n          179,\n          180,\n          181,\n          182,\n          183,\n          184,\n          185,\n        ],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[179, 180],\n        -1,\n        {r'parse': () => int.parse, r'tryParse': () => int.tryParse},\n        {},\n        {\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? int.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n        },\n        4,\n        9,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.GenericClassMirrorImpl(\n        r'List',\n        r'dart.core.List',\n        134218247,\n        10,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          186,\n          187,\n          188,\n          189,\n          190,\n          191,\n          192,\n          193,\n          194,\n          195,\n          196,\n          197,\n          198,\n          199,\n          200,\n          201,\n          202,\n          203,\n          204,\n          205,\n          206,\n          207,\n          208,\n          209,\n          210,\n          211,\n          212,\n          213,\n          214,\n          215,\n          216,\n          217,\n          218,\n          219,\n          220,\n          221,\n          222,\n          223,\n          224,\n          225,\n          226,\n          227,\n          228,\n        ],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[186, 187, 188],\n        4,\n        {\n          r'castFrom': () => List.castFrom,\n          r'copyRange': () => List.copyRange,\n          r'writeIterable': () => List.writeIterable,\n        },\n        {},\n        {\n          r'filled': (bool b) =>\n              (length, fill, {growable}) =>\n                  b ? List.filled(length, fill, growable: growable) : null,\n          r'empty': (bool b) =>\n              ({growable}) => b ? List.empty(growable: growable) : null,\n          r'from': (bool b) =>\n              (elements, {growable}) =>\n                  b ? List.from(elements, growable: growable) : null,\n          r'of': (bool b) =>\n              (elements, {growable}) =>\n                  b ? List.of(elements, growable: growable) : null,\n          r'generate': (bool b) =>\n              (length, generator, {growable}) => b\n              ? List.generate(length, generator, growable: growable)\n              : null,\n          r'unmodifiable': (bool b) =>\n              (elements) => b ? List.unmodifiable(elements) : null,\n        },\n        4,\n        10,\n        const <int>[15],\n        const [],\n        null,\n        (o) => false,\n        const <int>[17],\n        10,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'InstanceMirror',\n        r'reflectable.mirrors.InstanceMirror',\n        134218247,\n        11,\n        const prefix0.ContainedReflectable(),\n        const <int>[229, 230, 231, 232, 233, 234, 235],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {},\n        5,\n        11,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'TypeMirror',\n        r'reflectable.mirrors.TypeMirror',\n        134218247,\n        12,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          236,\n          237,\n          238,\n          239,\n          240,\n          241,\n          242,\n          243,\n          244,\n          245,\n          246,\n          247,\n          248,\n          249,\n        ],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {},\n        5,\n        12,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'LibraryMirror',\n        r'reflectable.mirrors.LibraryMirror',\n        134218247,\n        13,\n        const prefix0.ContainedReflectable(),\n        const <int>[250, 251, 252, 253, 254, 255, 256],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {},\n        5,\n        13,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.GenericClassMirrorImpl(\n        r'Map',\n        r'dart.core.Map',\n        134218247,\n        14,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          257,\n          258,\n          259,\n          260,\n          261,\n          262,\n          263,\n          264,\n          265,\n          266,\n          267,\n          268,\n          269,\n          270,\n          271,\n          272,\n          273,\n          274,\n          275,\n          276,\n          277,\n          278,\n          279,\n          280,\n          281,\n          282,\n          283,\n          284,\n          285,\n          286,\n        ],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[257],\n        4,\n        {r'castFrom': () => Map.castFrom},\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? Map() : null,\n          r'from': (bool b) =>\n              (other) => b ? Map.from(other) : null,\n          r'of': (bool b) =>\n              (other) => b ? Map.of(other) : null,\n          r'unmodifiable': (bool b) =>\n              (other) => b ? Map.unmodifiable(other) : null,\n          r'identity': (bool b) =>\n              () => b ? Map.identity() : null,\n          r'fromIterable': (bool b) =>\n              (iterable, {key, value}) =>\n                  b ? Map.fromIterable(iterable, key: key, value: value) : null,\n          r'fromIterables': (bool b) =>\n              (keys, values) => b ? Map.fromIterables(keys, values) : null,\n          r'fromEntries': (bool b) =>\n              (entries) => b ? Map.fromEntries(entries) : null,\n        },\n        4,\n        14,\n        const <int>[],\n        const [],\n        null,\n        (o) => false,\n        const <int>[18, 19],\n        14,\n      ),\n      r.GenericClassMirrorImpl(\n        r'Iterable',\n        r'dart.core.Iterable',\n        134218247,\n        15,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          287,\n          288,\n          289,\n          290,\n          291,\n          292,\n          293,\n          294,\n          295,\n          296,\n          297,\n          298,\n          299,\n          300,\n          301,\n          302,\n          303,\n          304,\n          305,\n          306,\n          307,\n          308,\n          309,\n          310,\n          311,\n          312,\n          313,\n          314,\n          315,\n          316,\n          317,\n          318,\n          319,\n          320,\n          321,\n          322,\n          323,\n        ],\n        const <int>[\n          68,\n          311,\n          70,\n          71,\n          72,\n          288,\n          289,\n          290,\n          291,\n          292,\n          293,\n          294,\n          295,\n          296,\n          297,\n          298,\n          299,\n          300,\n          301,\n          302,\n          303,\n          304,\n          305,\n          306,\n          307,\n          308,\n          309,\n          310,\n          315,\n          316,\n          317,\n          318,\n          319,\n          320,\n        ],\n        const <int>[287, 312, 313],\n        4,\n        {\n          r'castFrom': () => Iterable.castFrom,\n          r'iterableToShortString': () => Iterable.iterableToShortString,\n          r'iterableToFullString': () => Iterable.iterableToFullString,\n        },\n        {},\n        {\n          r'generate': (bool b) =>\n              (count, [generator]) =>\n                  b ? Iterable.generate(count, generator) : null,\n          r'empty': (bool b) =>\n              () => b ? Iterable.empty() : null,\n        },\n        4,\n        15,\n        const <int>[],\n        const [],\n        null,\n        (o) => false,\n        const <int>[20],\n        15,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectCapability',\n        r'reflectable.capability.ReflectCapability',\n        134218247,\n        16,\n        const prefix0.ContainedReflectable(),\n        const <int>[324],\n        const <int>[68, 69, 70, 71, 72],\n        const <int>[],\n        4,\n        {},\n        {},\n        {},\n        6,\n        16,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.TypeVariableMirrorImpl(\n        r'E',\n        r'dart.core.List.E',\n        const prefix0.ContainedReflectable(),\n        4,\n        10,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'K',\n        r'dart.core.Map.K',\n        const prefix0.ContainedReflectable(),\n        4,\n        14,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'V',\n        r'dart.core.Map.V',\n        const prefix0.ContainedReflectable(),\n        4,\n        14,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'E',\n        r'dart.core.Iterable.E',\n        const prefix0.ContainedReflectable(),\n        4,\n        15,\n        <Object>[],\n      ),\n    ],\n    <m.DeclarationMirror>[\n      r.VariableMirrorImpl(\n        r'contained',\n        142738581,\n        0,\n        const prefix0.ContainedReflectable(),\n        1,\n        1,\n        1,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'pleaseInitializeMessage',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'data',\n        142737429,\n        -1,\n        const prefix0.ContainedReflectable(),\n        14,\n        17,\n        14,\n        const <int>[1, 18],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'memberSymbolMap',\n        75628565,\n        -1,\n        const prefix0.ContainedReflectable(),\n        14,\n        19,\n        14,\n        const <int>[20, 7],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'deprecated',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        21,\n        21,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'override',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'instanceInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        22,\n        22,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'staticInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        23,\n        23,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'topLevelInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        24,\n        24,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'newInstanceCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        25,\n        25,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'metadataCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        26,\n        26,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        27,\n        27,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeRelationsCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        28,\n        28,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'reflectedTypeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        29,\n        29,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'libraryCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        30,\n        30,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'declarationsCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        31,\n        31,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'uriCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        32,\n        32,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'libraryDependenciesCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        33,\n        33,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'invokingCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        34,\n        34,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typingCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        35,\n        35,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'delegateCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        36,\n        36,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'subtypeQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        37,\n        37,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'superclassQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        38,\n        38,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeAnnotationQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        39,\n        39,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeAnnotationDeepQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        39,\n        39,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'correspondingSetterQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        40,\n        40,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'admitSubtypeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        41,\n        41,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'thisClassName',\n        134349973,\n        1,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'thisClassId',\n        134349973,\n        1,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 0, 2),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 1, 3),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 2, 4),\n      r.ImplicitSetterMirrorImpl(const prefix0.ContainedReflectable(), 2, 5),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 3, 6),\n      r.ImplicitSetterMirrorImpl(const prefix0.ContainedReflectable(), 3, 7),\n      r.MethodMirrorImpl(\n        r'reflectors',\n        44040211,\n        -1,\n        -1,\n        42,\n        43,\n        const <int>[1],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'identical',\n        10485784,\n        -1,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[2, 3],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'identityHashCode',\n        10485784,\n        -1,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[4],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'print',\n        9699352,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[5],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 4, 12),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 5, 13),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchInvokableError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[6, 7, 8, 9, 10],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchMethodError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[11, 12, 13, 14],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchGetterError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[15, 16, 17, 18],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchSetterError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[19, 20, 21, 22],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchConstructorError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[23, 24, 25, 26],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 6, 19),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 7, 20),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 8, 21),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 9, 22),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 10, 23),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 11, 24),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 12, 25),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 13, 26),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 14, 27),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 15, 28),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 16, 29),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 17, 30),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 18, 31),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 19, 32),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 20, 33),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 21, 34),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 22, 35),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 23, 36),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 24, 37),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 25, 38),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 26, 39),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        0,\n        -1,\n        0,\n        0,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097154,\n        4,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[27],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        4,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'noSuchMethod',\n        524290,\n        4,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[28],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097155,\n        4,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'runtimeType',\n        2097155,\n        4,\n        6,\n        6,\n        6,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'capabilities',\n        35651587,\n        3,\n        10,\n        44,\n        10,\n        const <int>[16],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'canReflect',\n        2097154,\n        2,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[29],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'reflect',\n        2097154,\n        2,\n        11,\n        11,\n        11,\n        const <int>[],\n        const <int>[30],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'canReflectType',\n        2097154,\n        2,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[31],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectType',\n        2097154,\n        2,\n        12,\n        12,\n        12,\n        const <int>[],\n        const <int>[32],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'findLibrary',\n        2097154,\n        2,\n        13,\n        13,\n        13,\n        const <int>[],\n        const <int>[33],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'libraries',\n        35651587,\n        2,\n        14,\n        46,\n        14,\n        const <int>[45, 13],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'annotatedClasses',\n        35651587,\n        2,\n        15,\n        48,\n        15,\n        const <int>[47],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'getInstance',\n        2097170,\n        1,\n        1,\n        1,\n        1,\n        const <int>[],\n        const <int>[34],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 0, 55),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 1, 56),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        1,\n        -1,\n        1,\n        1,\n        const <int>[],\n        const <int>[35, 36, 37, 38, 39, 40, 41, 42, 43, 44],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        1,\n        -1,\n        1,\n        1,\n        const <int>[],\n        const <int>[45],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        2,\n        -1,\n        2,\n        2,\n        const <int>[],\n        const <int>[46, 47, 48, 49, 50, 51, 52, 53, 54, 55],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        2,\n        -1,\n        2,\n        2,\n        const <int>[],\n        const <int>[56],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        3,\n        -1,\n        3,\n        3,\n        const <int>[],\n        const <int>[57, 58, 59, 60, 61, 62, 63, 64, 65, 66],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        3,\n        -1,\n        3,\n        3,\n        const <int>[],\n        const <int>[67],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hash',\n        2097170,\n        4,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[\n          68,\n          69,\n          70,\n          71,\n          72,\n          73,\n          74,\n          75,\n          76,\n          77,\n          78,\n          79,\n          80,\n          81,\n          82,\n          83,\n          84,\n          85,\n          86,\n          87,\n        ],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashAll',\n        2097170,\n        4,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[88],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashAllUnordered',\n        2097170,\n        4,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[89],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        4,\n        -1,\n        4,\n        4,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'memberName',\n        2097667,\n        5,\n        -1,\n        20,\n        20,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeArguments',\n        35651587,\n        5,\n        10,\n        49,\n        10,\n        const <int>[6],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'positionalArguments',\n        35652099,\n        5,\n        10,\n        50,\n        10,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'namedArguments',\n        35652099,\n        5,\n        14,\n        51,\n        14,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isMethod',\n        2097667,\n        5,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isGetter',\n        2097667,\n        5,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isSetter',\n        2097667,\n        5,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isAccessor',\n        2097155,\n        5,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'method',\n        1,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[90, 91, 92],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'genericMethod',\n        1,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[93, 94, 95, 96],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'getter',\n        257,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[97],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setter',\n        257,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[98, 99],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        6,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[100],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097666,\n        6,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        6,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        6,\n        -1,\n        6,\n        6,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[101],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'codeUnitAt',\n        2097666,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[102],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[103],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'compareTo',\n        2097666,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[104],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'endsWith',\n        2097666,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[105],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'startsWith',\n        2097666,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[106, 107],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexOf',\n        2097666,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[108, 109],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexOf',\n        2097666,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[110, 111],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'+',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[112],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'substring',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[113, 114],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trim',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trimLeft',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trimRight',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'*',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[115],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'padLeft',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[116, 117],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'padRight',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[118, 119],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'contains',\n        2097666,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[120, 121],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceFirst',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[122, 123, 124],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceFirstMapped',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[125, 126, 127],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceAll',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[128, 129],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceAllMapped',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[130, 131],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceRange',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[132, 133, 134],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'split',\n        35652098,\n        7,\n        10,\n        52,\n        10,\n        const <int>[7],\n        const <int>[135],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'splitMapJoin',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[136, 137, 138],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toLowerCase',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toUpperCase',\n        2097666,\n        7,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        7,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097667,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097667,\n        7,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'codeUnits',\n        35652099,\n        7,\n        10,\n        53,\n        10,\n        const <int>[9],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'runes',\n        2097667,\n        7,\n        -1,\n        54,\n        54,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromCharCodes',\n        1,\n        7,\n        -1,\n        7,\n        7,\n        const <int>[],\n        const <int>[139, 140, 141],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromCharCode',\n        1,\n        7,\n        -1,\n        7,\n        7,\n        const <int>[],\n        const <int>[142],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        7,\n        -1,\n        7,\n        7,\n        const <int>[],\n        const <int>[143, 144],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'parse',\n        2097170,\n        8,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[145, 146],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'tryParse',\n        2097170,\n        8,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[147, 148],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'&',\n        2097154,\n        8,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[149],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'|',\n        2097154,\n        8,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[150],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'^',\n        2097154,\n        8,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[151],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        8,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097155,\n        8,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        8,\n        -1,\n        8,\n        8,\n        const <int>[],\n        const <int>[152, 153],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasEnvironment',\n        129,\n        8,\n        -1,\n        8,\n        8,\n        const <int>[],\n        const <int>[154],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'&',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[155],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'|',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[156],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'^',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[157],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'~',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'<<',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[158],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'>>',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[159],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'>>>',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[160],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'modPow',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[161, 162],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'modInverse',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[163],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'gcd',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[164],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toUnsigned',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[165],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toSigned',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[166],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unary-',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'abs',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'round',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'floor',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'ceil',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'truncate',\n        2097666,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'roundToDouble',\n        2097666,\n        9,\n        -1,\n        55,\n        55,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'floorToDouble',\n        2097666,\n        9,\n        -1,\n        55,\n        55,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'ceilToDouble',\n        2097666,\n        9,\n        -1,\n        55,\n        55,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'truncateToDouble',\n        2097666,\n        9,\n        -1,\n        55,\n        55,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097666,\n        9,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toRadixString',\n        2097666,\n        9,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[167],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'parse',\n        2097170,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[168, 169],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'tryParse',\n        2097170,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[170, 171],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEven',\n        2097667,\n        9,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isOdd',\n        2097667,\n        9,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'bitLength',\n        2097667,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sign',\n        2097667,\n        9,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        9,\n        -1,\n        9,\n        9,\n        const <int>[],\n        const <int>[172, 173],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        10,\n        10,\n        56,\n        10,\n        null,\n        const <int>[174],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'copyRange',\n        1310738,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[175, 176, 177, 178, 179],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'writeIterable',\n        1310738,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[180, 181, 182],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35652098,\n        10,\n        10,\n        57,\n        10,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        514,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[183],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]=',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[184, 185],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'add',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[186],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addAll',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[187],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sort',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[188],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'shuffle',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[189],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexOf',\n        2097666,\n        10,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[190, 191],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexWhere',\n        2097666,\n        10,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[192, 193],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexWhere',\n        2097666,\n        10,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[194, 195],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexOf',\n        2097666,\n        10,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[196, 197],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'clear',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'insert',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[198, 199],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'insertAll',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[200, 201],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setAll',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[202, 203],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'remove',\n        2097666,\n        10,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[204],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeAt',\n        514,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[205],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeLast',\n        514,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeWhere',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[206],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'retainWhere',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[207],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'+',\n        35652098,\n        10,\n        10,\n        58,\n        10,\n        null,\n        const <int>[208],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sublist',\n        35652098,\n        10,\n        10,\n        58,\n        10,\n        null,\n        const <int>[209, 210],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'getRange',\n        35652098,\n        10,\n        15,\n        59,\n        15,\n        null,\n        const <int>[211, 212],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setRange',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[213, 214, 215, 216],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeRange',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[217, 218],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fillRange',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[219, 220, 221],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceRange',\n        1311234,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[222, 223, 224],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'asMap',\n        35652098,\n        10,\n        14,\n        60,\n        14,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        10,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[225],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'first=',\n        1311236,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[238],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'last=',\n        1311236,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[239],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        10,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length=',\n        1311236,\n        10,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[240],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reversed',\n        35652099,\n        10,\n        15,\n        59,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'filled',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[226, 227, 228],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'empty',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[229],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'from',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[230, 231],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'of',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[232, 233],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'generate',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[234, 235, 236],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unmodifiable',\n        1,\n        10,\n        -1,\n        58,\n        10,\n        null,\n        const <int>[237],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        11,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[241],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'delegate',\n        2097666,\n        11,\n        4,\n        4,\n        4,\n        const <int>[],\n        const <int>[242],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'type',\n        2097667,\n        11,\n        -1,\n        47,\n        47,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasReflectee',\n        2097667,\n        11,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectee',\n        2097667,\n        11,\n        4,\n        4,\n        4,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        11,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        11,\n        -1,\n        11,\n        11,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isSubtypeOf',\n        2097666,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[243],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isAssignableTo',\n        2097666,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[244],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasReflectedType',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectedType',\n        2097667,\n        12,\n        6,\n        6,\n        6,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeVariables',\n        35652099,\n        12,\n        10,\n        62,\n        10,\n        const <int>[61],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeArguments',\n        35652099,\n        12,\n        10,\n        63,\n        10,\n        const <int>[12],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectedTypeArguments',\n        35652099,\n        12,\n        10,\n        49,\n        10,\n        const <int>[6],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isOriginalDeclaration',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'originalDeclaration',\n        2097667,\n        12,\n        12,\n        12,\n        12,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNullable',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNonNullable',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isPotentiallyNullable',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isPotentiallyNonNullable',\n        2097667,\n        12,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        12,\n        -1,\n        12,\n        12,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        13,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[245],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'uri',\n        2097667,\n        13,\n        -1,\n        45,\n        45,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'declarations',\n        35652099,\n        13,\n        14,\n        65,\n        14,\n        const <int>[7, 64],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        13,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'libraryDependencies',\n        35652099,\n        13,\n        10,\n        67,\n        10,\n        const <int>[66],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'owner',\n        2097667,\n        13,\n        -1,\n        68,\n        68,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        14,\n        14,\n        69,\n        14,\n        null,\n        const <int>[246],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35652098,\n        14,\n        14,\n        70,\n        14,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'containsValue',\n        2097666,\n        14,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[247],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'containsKey',\n        2097666,\n        14,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[248],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        514,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[249],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]=',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[250, 251],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'map',\n        35652098,\n        14,\n        14,\n        71,\n        14,\n        null,\n        const <int>[252],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addEntries',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[253],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'update',\n        514,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[254, 255, 256],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'updateAll',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[257],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeWhere',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[258],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'putIfAbsent',\n        514,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[259, 260],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addAll',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[261],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'remove',\n        514,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[262],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'clear',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'forEach',\n        1311234,\n        14,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[263],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'entries',\n        35652099,\n        14,\n        15,\n        72,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'keys',\n        35652099,\n        14,\n        15,\n        73,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'values',\n        35652099,\n        14,\n        15,\n        74,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        14,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097667,\n        14,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097667,\n        14,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        1,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'from',\n        257,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[264],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'of',\n        257,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[265],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unmodifiable',\n        1,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[266],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'identity',\n        257,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromIterable',\n        257,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[267, 268, 269],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromIterables',\n        257,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[270, 271],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEntries',\n        1,\n        14,\n        -1,\n        75,\n        14,\n        null,\n        const <int>[272],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        15,\n        15,\n        76,\n        15,\n        null,\n        const <int>[273],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35651586,\n        15,\n        15,\n        77,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'followedBy',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[274],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'map',\n        35651586,\n        15,\n        15,\n        79,\n        15,\n        null,\n        const <int>[275],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'where',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[276],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'whereType',\n        35651586,\n        15,\n        15,\n        80,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'expand',\n        35651586,\n        15,\n        15,\n        81,\n        15,\n        null,\n        const <int>[277],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'contains',\n        2097154,\n        15,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[278],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'forEach',\n        1310722,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[279],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reduce',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[280],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fold',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[281, 282],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'every',\n        2097154,\n        15,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[283],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'join',\n        2097154,\n        15,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[284],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'any',\n        2097154,\n        15,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[285],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toList',\n        35651586,\n        15,\n        10,\n        82,\n        10,\n        null,\n        const <int>[286],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toSet',\n        35651586,\n        15,\n        -1,\n        83,\n        84,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'take',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[287],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'takeWhile',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[288],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'skip',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[289],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'skipWhile',\n        35651586,\n        15,\n        15,\n        78,\n        15,\n        null,\n        const <int>[290],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'firstWhere',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[291, 292],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastWhere',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[293, 294],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'singleWhere',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[295, 296],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'elementAt',\n        2,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[297],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        15,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterableToShortString',\n        2097170,\n        15,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[298, 299, 300],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterableToFullString',\n        2097170,\n        15,\n        7,\n        7,\n        7,\n        const <int>[],\n        const <int>[301, 302, 303],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterator',\n        35652099,\n        15,\n        -1,\n        85,\n        86,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097155,\n        15,\n        9,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097155,\n        15,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097155,\n        15,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'first',\n        3,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'last',\n        3,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'single',\n        3,\n        15,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        15,\n        -1,\n        78,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'generate',\n        1,\n        15,\n        -1,\n        78,\n        15,\n        null,\n        const <int>[304, 305],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'empty',\n        385,\n        15,\n        -1,\n        78,\n        15,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        16,\n        -1,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n    ],\n    <m.ParameterMirror>[\n      r.ParameterMirrorImpl(\n        r'_data',\n        151126118,\n        5,\n        const prefix0.ContainedReflectable(),\n        14,\n        17,\n        14,\n        const <int>[1, 18],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_memberSymbolMap',\n        84017254,\n        7,\n        const prefix0.ContainedReflectable(),\n        14,\n        19,\n        14,\n        const <int>[20, 7],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'a',\n        67239942,\n        9,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'b',\n        67239942,\n        9,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object',\n        67239942,\n        10,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object',\n        67239942,\n        11,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        14,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        14,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        14,\n        const prefix0.ContainedReflectable(),\n        10,\n        50,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        14,\n        const prefix0.ContainedReflectable(),\n        14,\n        87,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'kind',\n        134348806,\n        14,\n        const prefix0.ContainedReflectable(),\n        -1,\n        88,\n        88,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        15,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        15,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        15,\n        const prefix0.ContainedReflectable(),\n        10,\n        50,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        15,\n        const prefix0.ContainedReflectable(),\n        14,\n        87,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        16,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        16,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        16,\n        const prefix0.ContainedReflectable(),\n        10,\n        50,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        16,\n        const prefix0.ContainedReflectable(),\n        14,\n        87,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        17,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        17,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        17,\n        const prefix0.ContainedReflectable(),\n        10,\n        50,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        17,\n        const prefix0.ContainedReflectable(),\n        14,\n        87,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        18,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'constructorName',\n        134348806,\n        18,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        18,\n        const prefix0.ContainedReflectable(),\n        10,\n        50,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        18,\n        const prefix0.ContainedReflectable(),\n        14,\n        87,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        41,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'invocation',\n        134348806,\n        43,\n        const prefix0.ContainedReflectable(),\n        5,\n        5,\n        5,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'reflectee',\n        134348806,\n        47,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'reflectee',\n        134348806,\n        48,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        49,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        50,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'libraryName',\n        134348806,\n        51,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        54,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap0',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap1',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap2',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap3',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap4',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap5',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap6',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap7',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap8',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap9',\n        67244038,\n        57,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'capabilities',\n        151126022,\n        58,\n        const prefix0.ContainedReflectable(),\n        10,\n        44,\n        10,\n        const <int>[16],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap0',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap1',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap2',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap3',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap4',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap5',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap6',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap7',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap8',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap9',\n        67244038,\n        59,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'capabilities',\n        151126022,\n        60,\n        const prefix0.ContainedReflectable(),\n        10,\n        44,\n        10,\n        const <int>[16],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap0',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap1',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap2',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap3',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap4',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap5',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap6',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap7',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap8',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap9',\n        67245094,\n        61,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_capabilities',\n        84018214,\n        62,\n        const prefix0.ContainedReflectable(),\n        10,\n        89,\n        10,\n        const <int>[16],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object1',\n        67239942,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object2',\n        67239942,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object3',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object4',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object5',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object6',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object7',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object8',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object9',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object10',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object11',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object12',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object13',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object14',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object15',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object16',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object17',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object18',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object19',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object20',\n        67246086,\n        63,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'objects',\n        151126022,\n        64,\n        const prefix0.ContainedReflectable(),\n        15,\n        90,\n        15,\n        const <int>[4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'objects',\n        151126022,\n        65,\n        const prefix0.ContainedReflectable(),\n        15,\n        90,\n        15,\n        const <int>[4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        76,\n        const prefix0.ContainedReflectable(),\n        -1,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        84017158,\n        76,\n        const prefix0.ContainedReflectable(),\n        15,\n        91,\n        15,\n        const <int>[4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84021254,\n        76,\n        const prefix0.ContainedReflectable(),\n        14,\n        92,\n        14,\n        const <int>[20, 4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        77,\n        const prefix0.ContainedReflectable(),\n        -1,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'typeArguments',\n        84017158,\n        77,\n        const prefix0.ContainedReflectable(),\n        15,\n        93,\n        15,\n        const <int>[6],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        84017158,\n        77,\n        const prefix0.ContainedReflectable(),\n        15,\n        91,\n        15,\n        const <int>[4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84021254,\n        77,\n        const prefix0.ContainedReflectable(),\n        14,\n        92,\n        14,\n        const <int>[20, 4],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        78,\n        const prefix0.ContainedReflectable(),\n        -1,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        79,\n        const prefix0.ContainedReflectable(),\n        -1,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'argument',\n        67239942,\n        79,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        80,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        84,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        85,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        86,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        87,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        88,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        89,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134354950,\n        89,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        90,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        90,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        91,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        91,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        92,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        93,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        93,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'times',\n        134348806,\n        97,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        98,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'padding',\n        134354950,\n        98,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        99,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'padding',\n        134354950,\n        99,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        100,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        100,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        101,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'to',\n        134348806,\n        101,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        101,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        102,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134217734,\n        102,\n        const prefix0.ContainedReflectable(),\n        -1,\n        95,\n        95,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        102,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        103,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134348806,\n        103,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        104,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134217734,\n        104,\n        const prefix0.ContainedReflectable(),\n        -1,\n        95,\n        95,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        105,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67239942,\n        105,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replacement',\n        134348806,\n        105,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        106,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        107,\n        const prefix0.ContainedReflectable(),\n        -1,\n        94,\n        94,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'onMatch',\n        67121158,\n        107,\n        const prefix0.ContainedReflectable(),\n        -1,\n        96,\n        96,\n        const <int>[],\n        const [],\n        null,\n        #onMatch,\n      ),\n      r.ParameterMirrorImpl(\n        r'onNonMatch',\n        67121158,\n        107,\n        const prefix0.ContainedReflectable(),\n        -1,\n        97,\n        97,\n        const <int>[],\n        const [],\n        null,\n        #onNonMatch,\n      ),\n      r.ParameterMirrorImpl(\n        r'charCodes',\n        151126022,\n        116,\n        const prefix0.ContainedReflectable(),\n        15,\n        98,\n        15,\n        const <int>[9],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        116,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        116,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'charCode',\n        134348806,\n        117,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        118,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        118,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        119,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'caseSensitive',\n        134363142,\n        119,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #caseSensitive,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        120,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'caseSensitive',\n        134363142,\n        120,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #caseSensitive,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        121,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        122,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        123,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        126,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        126,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        127,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        128,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        129,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        130,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        132,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        133,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        134,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'exponent',\n        134348806,\n        135,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'modulus',\n        134348806,\n        135,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'modulus',\n        134348806,\n        136,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        137,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        138,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        139,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        134348806,\n        151,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        152,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        67252230,\n        152,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        #radix,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        153,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        67252230,\n        153,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        #radix,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        158,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        158,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        159,\n        const prefix0.ContainedReflectable(),\n        10,\n        99,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'target',\n        151126022,\n        160,\n        const prefix0.ContainedReflectable(),\n        10,\n        100,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'at',\n        134348806,\n        160,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        160,\n        const prefix0.ContainedReflectable(),\n        10,\n        100,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        160,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        160,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'target',\n        151126022,\n        161,\n        const prefix0.ContainedReflectable(),\n        10,\n        101,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'at',\n        134348806,\n        161,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        161,\n        const prefix0.ContainedReflectable(),\n        15,\n        102,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        163,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        164,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        164,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        165,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        166,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'compare',\n        67112966,\n        167,\n        const prefix0.ContainedReflectable(),\n        -1,\n        103,\n        103,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'random',\n        67244038,\n        168,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        169,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        169,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        170,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        170,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        171,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        171,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        172,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        172,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        174,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        174,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        175,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        175,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        176,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        176,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67239942,\n        177,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        178,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        180,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        181,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        182,\n        const prefix0.ContainedReflectable(),\n        10,\n        58,\n        10,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        183,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        183,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        184,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        184,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        185,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        185,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        185,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'skipCount',\n        134354950,\n        185,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        186,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        186,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        187,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        187,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'fillValue',\n        67112966,\n        187,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        188,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        188,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replacements',\n        151126022,\n        188,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        190,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'length',\n        134348806,\n        196,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'fill',\n        6,\n        196,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        196,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        197,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        198,\n        const prefix0.ContainedReflectable(),\n        15,\n        106,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        198,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        199,\n        const prefix0.ContainedReflectable(),\n        15,\n        59,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        199,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'length',\n        134348806,\n        200,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'generator',\n        134217734,\n        200,\n        const prefix0.ContainedReflectable(),\n        -1,\n        107,\n        107,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        200,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        201,\n        const prefix0.ContainedReflectable(),\n        15,\n        106,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        191,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        192,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'newLength',\n        134348806,\n        194,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        202,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'invocation',\n        134348806,\n        203,\n        const prefix0.ContainedReflectable(),\n        5,\n        5,\n        5,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        209,\n        const prefix0.ContainedReflectable(),\n        12,\n        12,\n        12,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        210,\n        const prefix0.ContainedReflectable(),\n        12,\n        12,\n        12,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        223,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        230,\n        const prefix0.ContainedReflectable(),\n        14,\n        108,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67239942,\n        232,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        233,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        234,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        235,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        235,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'convert',\n        134217734,\n        236,\n        const prefix0.ContainedReflectable(),\n        -1,\n        109,\n        109,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'newEntries',\n        151126022,\n        237,\n        const prefix0.ContainedReflectable(),\n        15,\n        72,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        238,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'update',\n        134217734,\n        238,\n        const prefix0.ContainedReflectable(),\n        -1,\n        110,\n        110,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'ifAbsent',\n        67121158,\n        238,\n        const prefix0.ContainedReflectable(),\n        -1,\n        111,\n        111,\n        const <int>[],\n        const [],\n        null,\n        #ifAbsent,\n      ),\n      r.ParameterMirrorImpl(\n        r'update',\n        134217734,\n        239,\n        const prefix0.ContainedReflectable(),\n        -1,\n        112,\n        112,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        240,\n        const prefix0.ContainedReflectable(),\n        -1,\n        113,\n        113,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        241,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'ifAbsent',\n        134217734,\n        241,\n        const prefix0.ContainedReflectable(),\n        -1,\n        114,\n        114,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        242,\n        const prefix0.ContainedReflectable(),\n        14,\n        75,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        243,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'action',\n        134217734,\n        245,\n        const prefix0.ContainedReflectable(),\n        -1,\n        115,\n        115,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        253,\n        const prefix0.ContainedReflectable(),\n        14,\n        116,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        254,\n        const prefix0.ContainedReflectable(),\n        14,\n        75,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        255,\n        const prefix0.ContainedReflectable(),\n        14,\n        116,\n        14,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        257,\n        const prefix0.ContainedReflectable(),\n        15,\n        106,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67121158,\n        257,\n        const prefix0.ContainedReflectable(),\n        -1,\n        117,\n        117,\n        const <int>[],\n        const [],\n        null,\n        #key,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67121158,\n        257,\n        const prefix0.ContainedReflectable(),\n        -1,\n        118,\n        118,\n        const <int>[],\n        const [],\n        null,\n        #value,\n      ),\n      r.ParameterMirrorImpl(\n        r'keys',\n        151126022,\n        258,\n        const prefix0.ContainedReflectable(),\n        15,\n        73,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'values',\n        151126022,\n        258,\n        const prefix0.ContainedReflectable(),\n        15,\n        74,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'entries',\n        151126022,\n        259,\n        const prefix0.ContainedReflectable(),\n        15,\n        72,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        260,\n        const prefix0.ContainedReflectable(),\n        15,\n        119,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        262,\n        const prefix0.ContainedReflectable(),\n        15,\n        78,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'toElement',\n        134217734,\n        263,\n        const prefix0.ContainedReflectable(),\n        -1,\n        120,\n        120,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        264,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'toElements',\n        134217734,\n        266,\n        const prefix0.ContainedReflectable(),\n        -1,\n        122,\n        122,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        67239942,\n        267,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'action',\n        134217734,\n        268,\n        const prefix0.ContainedReflectable(),\n        -1,\n        123,\n        123,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'combine',\n        134217734,\n        269,\n        const prefix0.ContainedReflectable(),\n        -1,\n        124,\n        124,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'initialValue',\n        6,\n        270,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'combine',\n        134217734,\n        270,\n        const prefix0.ContainedReflectable(),\n        -1,\n        125,\n        125,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        271,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'separator',\n        134354950,\n        272,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        273,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        274,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        276,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        277,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        278,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        279,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        280,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        280,\n        const prefix0.ContainedReflectable(),\n        -1,\n        126,\n        126,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        281,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        281,\n        const prefix0.ContainedReflectable(),\n        -1,\n        126,\n        126,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        282,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        282,\n        const prefix0.ContainedReflectable(),\n        -1,\n        126,\n        126,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        283,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        285,\n        const prefix0.ContainedReflectable(),\n        15,\n        106,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'leftDelimiter',\n        134354950,\n        285,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'rightDelimiter',\n        134354950,\n        285,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        286,\n        const prefix0.ContainedReflectable(),\n        15,\n        106,\n        15,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'leftDelimiter',\n        134354950,\n        286,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'rightDelimiter',\n        134354950,\n        286,\n        const prefix0.ContainedReflectable(),\n        7,\n        7,\n        7,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        295,\n        const prefix0.ContainedReflectable(),\n        9,\n        9,\n        9,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'generator',\n        67112966,\n        295,\n        const prefix0.ContainedReflectable(),\n        -1,\n        127,\n        127,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n    ],\n    <Type>[\n      prefix0.ContainedReflectable,\n      prefix1.Reflectable,\n      prefix2.ReflectableImpl,\n      prefix3.ReflectableBase,\n      Object,\n      Invocation,\n      Type,\n      String,\n      bool,\n      int,\n      List,\n      prefix4.InstanceMirror,\n      prefix4.TypeMirror,\n      prefix4.LibraryMirror,\n      Map,\n      Iterable,\n      prefix5.ReflectCapability,\n      const m.TypeValue<Map<prefix1.Reflectable, prefix2.ReflectorData>>().type,\n      prefix2.ReflectorData,\n      const m.TypeValue<Map<Symbol, String>>().type,\n      Symbol,\n      Deprecated,\n      prefix5.InstanceInvokeCapability,\n      prefix5.StaticInvokeCapability,\n      prefix5.TopLevelInvokeCapability,\n      prefix5.NewInstanceCapability,\n      prefix5.MetadataCapability,\n      prefix5.TypeCapability,\n      prefix5.TypeRelationsCapability,\n      const r.FakeType(r'reflectable.capability._ReflectedTypeCapability'),\n      prefix5.LibraryCapability,\n      prefix5.DeclarationsCapability,\n      prefix5.UriCapability,\n      prefix5.LibraryDependenciesCapability,\n      prefix5.InvokingCapability,\n      prefix5.TypingCapability,\n      const r.FakeType(r'reflectable.capability._DelegateCapability'),\n      const r.FakeType(r'reflectable.capability._SubtypeQuantifyCapability'),\n      prefix5.SuperclassQuantifyCapability,\n      prefix5.TypeAnnotationQuantifyCapability,\n      const r.FakeType(\n        r'reflectable.capability._CorrespondingSetterQuantifyCapability',\n      ),\n      const r.FakeType(r'reflectable.capability._AdmitSubtypeCapability'),\n      const m.TypeValue<Set<prefix1.Reflectable>>().type,\n      Set,\n      const m.TypeValue<List<prefix5.ReflectCapability>>().type,\n      Uri,\n      const m.TypeValue<Map<Uri, prefix4.LibraryMirror>>().type,\n      prefix4.ClassMirror,\n      const m.TypeValue<Iterable<prefix4.ClassMirror>>().type,\n      const m.TypeValue<List<Type>>().type,\n      const m.TypeValue<List<dynamic>>().type,\n      const m.TypeValue<Map<Symbol, dynamic>>().type,\n      const m.TypeValue<List<String>>().type,\n      const m.TypeValue<List<int>>().type,\n      Runes,\n      double,\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.List<R>'),\n      const r.FakeType(r'dart.core.List<E>'),\n      const r.FakeType(r'dart.core.Iterable<E>'),\n      const r.FakeType(r'dart.core.Map<int, E>'),\n      prefix4.TypeVariableMirror,\n      const m.TypeValue<List<prefix4.TypeVariableMirror>>().type,\n      const m.TypeValue<List<prefix4.TypeMirror>>().type,\n      prefix4.DeclarationMirror,\n      const m.TypeValue<Map<String, prefix4.DeclarationMirror>>().type,\n      prefix4.LibraryDependencyMirror,\n      const m.TypeValue<List<prefix4.LibraryDependencyMirror>>().type,\n      Null,\n      const r.FakeType(r'dart.core.Map<K2, V2>'),\n      const r.FakeType(r'dart.core.Map<RK, RV>'),\n      const r.FakeType(r'dart.core.Map<K2, V2>'),\n      const r.FakeType(r'dart.core.Iterable<MapEntry<K, V>>'),\n      const r.FakeType(r'dart.core.Iterable<K>'),\n      const r.FakeType(r'dart.core.Iterable<V>'),\n      const r.FakeType(r'dart.core.Map<K, V>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<R>'),\n      const r.FakeType(r'dart.core.Iterable<E>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.List<E>'),\n      const r.FakeType(r'dart.core.Set<E>'),\n      Set,\n      const r.FakeType(r'dart.core.Iterator<E>'),\n      Iterator,\n      const m.TypeValue<Map<Symbol, dynamic>>().type,\n      prefix5.StringInvocationKind,\n      const m.TypeValue<List<prefix5.ReflectCapability>>().type,\n      const m.TypeValue<Iterable<Object>>().type,\n      const m.TypeValue<Iterable<Object>>().type,\n      const m.TypeValue<Map<Symbol, Object>>().type,\n      const m.TypeValue<Iterable<Type>>().type,\n      Pattern,\n      const m.TypeValue<String Function(Match)>().type,\n      const m.TypeValue<String Function(Match)>().type,\n      const m.TypeValue<String Function(String)>().type,\n      const m.TypeValue<Iterable<int>>().type,\n      const r.FakeType(r'dart.core.List<S>'),\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const m.TypeValue<int Function(dynamic, dynamic)>().type,\n      prefix6.Random,\n      const m.TypeValue<bool Function(dynamic)>().type,\n      const m.TypeValue<Iterable<dynamic>>().type,\n      const m.TypeValue<dynamic Function(int)>().type,\n      const r.FakeType(r'dart.core.Map<K, V>'),\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<bool Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<void Function(dynamic, dynamic)>().type,\n      const m.TypeValue<Map<dynamic, dynamic>>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const r.FakeType(r'dart.core.Iterable<S>'),\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<bool Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<void Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<dynamic Function(int)>().type,\n    ],\n    17,\n    {\n      r'==': (dynamic instance) =>\n          (x) => instance == x,\n      r'toString': (dynamic instance) => instance.toString,\n      r'noSuchMethod': (dynamic instance) => instance.noSuchMethod,\n      r'hashCode': (dynamic instance) => instance.hashCode,\n      r'runtimeType': (dynamic instance) => instance.runtimeType,\n      r'capabilities': (dynamic instance) => instance.capabilities,\n      r'canReflect': (dynamic instance) => instance.canReflect,\n      r'reflect': (dynamic instance) => instance.reflect,\n      r'canReflectType': (dynamic instance) => instance.canReflectType,\n      r'reflectType': (dynamic instance) => instance.reflectType,\n      r'findLibrary': (dynamic instance) => instance.findLibrary,\n      r'libraries': (dynamic instance) => instance.libraries,\n      r'annotatedClasses': (dynamic instance) => instance.annotatedClasses,\n      r'typeArguments': (dynamic instance) => instance.typeArguments,\n      r'isAccessor': (dynamic instance) => instance.isAccessor,\n      r'&': (dynamic instance) =>\n          (x) => instance & x,\n      r'|': (dynamic instance) =>\n          (x) => instance | x,\n      r'^': (dynamic instance) =>\n          (x) => instance ^ x,\n      r'cast': (dynamic instance) => instance.cast,\n      r'followedBy': (dynamic instance) => instance.followedBy,\n      r'map': (dynamic instance) => instance.map,\n      r'where': (dynamic instance) => instance.where,\n      r'whereType': (dynamic instance) => instance.whereType,\n      r'expand': (dynamic instance) => instance.expand,\n      r'contains': (dynamic instance) => instance.contains,\n      r'forEach': (dynamic instance) => instance.forEach,\n      r'reduce': (dynamic instance) => instance.reduce,\n      r'fold': (dynamic instance) => instance.fold,\n      r'every': (dynamic instance) => instance.every,\n      r'join': (dynamic instance) => instance.join,\n      r'any': (dynamic instance) => instance.any,\n      r'toList': (dynamic instance) => instance.toList,\n      r'toSet': (dynamic instance) => instance.toSet,\n      r'take': (dynamic instance) => instance.take,\n      r'takeWhile': (dynamic instance) => instance.takeWhile,\n      r'skip': (dynamic instance) => instance.skip,\n      r'skipWhile': (dynamic instance) => instance.skipWhile,\n      r'firstWhere': (dynamic instance) => instance.firstWhere,\n      r'lastWhere': (dynamic instance) => instance.lastWhere,\n      r'singleWhere': (dynamic instance) => instance.singleWhere,\n      r'elementAt': (dynamic instance) => instance.elementAt,\n      r'length': (dynamic instance) => instance.length,\n      r'isEmpty': (dynamic instance) => instance.isEmpty,\n      r'isNotEmpty': (dynamic instance) => instance.isNotEmpty,\n      r'first': (dynamic instance) => instance.first,\n      r'last': (dynamic instance) => instance.last,\n      r'single': (dynamic instance) => instance.single,\n    },\n    {},\n    <m.LibraryMirror>[\n      r.LibraryMirrorImpl(\n        r'',\n        Uri.parse(\n          'package:angel3_container_generator/angel3_container_generator.dart',\n        ),\n        const prefix0.ContainedReflectable(),\n        const <int>[0],\n        {r'contained': () => prefix0.contained},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.reflectable',\n        Uri.parse('package:reflectable/reflectable.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.src.reflectable_builder_based',\n        Uri.parse('package:reflectable/src/reflectable_builder_based.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[1, 2, 3, 35],\n        {\n          r'pleaseInitializeMessage': () => prefix2.pleaseInitializeMessage,\n          r'data': () => prefix2.data,\n          r'memberSymbolMap': () => prefix2.memberSymbolMap,\n          r'reflectors': () => prefix2.reflectors,\n        },\n        {\n          r'data=': (dynamic value) => prefix2.data = value,\n          r'memberSymbolMap=': (dynamic value) =>\n              prefix2.memberSymbolMap = value,\n        },\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.src.reflectable_base',\n        Uri.parse('package:reflectable/src/reflectable_base.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'dart.core',\n        Uri.parse(r'reflectable://4/library dart:core'),\n        const prefix0.ContainedReflectable(),\n        const <int>[4, 5, 36, 37, 38],\n        {\n          r'deprecated': () => deprecated,\n          r'override': () => override,\n          r'identical': () => identical,\n          r'identityHashCode': () => identityHashCode,\n          r'print': () => print,\n        },\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.mirrors',\n        Uri.parse('package:reflectable/mirrors.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.capability',\n        Uri.parse('package:reflectable/capability.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          6,\n          7,\n          8,\n          9,\n          10,\n          11,\n          12,\n          13,\n          14,\n          15,\n          16,\n          17,\n          18,\n          19,\n          20,\n          21,\n          22,\n          23,\n          24,\n          25,\n          26,\n          41,\n          42,\n          43,\n          44,\n          45,\n        ],\n        {\n          r'instanceInvokeCapability': () => prefix5.instanceInvokeCapability,\n          r'staticInvokeCapability': () => prefix5.staticInvokeCapability,\n          r'topLevelInvokeCapability': () => prefix5.topLevelInvokeCapability,\n          r'newInstanceCapability': () => prefix5.newInstanceCapability,\n          r'metadataCapability': () => prefix5.metadataCapability,\n          r'typeCapability': () => prefix5.typeCapability,\n          r'typeRelationsCapability': () => prefix5.typeRelationsCapability,\n          r'reflectedTypeCapability': () => prefix5.reflectedTypeCapability,\n          r'libraryCapability': () => prefix5.libraryCapability,\n          r'declarationsCapability': () => prefix5.declarationsCapability,\n          r'uriCapability': () => prefix5.uriCapability,\n          r'libraryDependenciesCapability': () =>\n              prefix5.libraryDependenciesCapability,\n          r'invokingCapability': () => prefix5.invokingCapability,\n          r'typingCapability': () => prefix5.typingCapability,\n          r'delegateCapability': () => prefix5.delegateCapability,\n          r'subtypeQuantifyCapability': () => prefix5.subtypeQuantifyCapability,\n          r'superclassQuantifyCapability': () =>\n              prefix5.superclassQuantifyCapability,\n          r'typeAnnotationQuantifyCapability': () =>\n              prefix5.typeAnnotationQuantifyCapability,\n          r'typeAnnotationDeepQuantifyCapability': () =>\n              prefix5.typeAnnotationDeepQuantifyCapability,\n          r'correspondingSetterQuantifyCapability': () =>\n              prefix5.correspondingSetterQuantifyCapability,\n          r'admitSubtypeCapability': () => prefix5.admitSubtypeCapability,\n          r'reflectableNoSuchInvokableError': () =>\n              prefix5.reflectableNoSuchInvokableError,\n          r'reflectableNoSuchMethodError': () =>\n              prefix5.reflectableNoSuchMethodError,\n          r'reflectableNoSuchGetterError': () =>\n              prefix5.reflectableNoSuchGetterError,\n          r'reflectableNoSuchSetterError': () =>\n              prefix5.reflectableNoSuchSetterError,\n          r'reflectableNoSuchConstructorError': () =>\n              prefix5.reflectableNoSuchConstructorError,\n        },\n        {},\n        const [],\n        null,\n      ),\n    ],\n    [],\n  ),\n};\n\nfinal _memberSymbolMap = null;\n\nvoid initializeReflectable() {\n  r.data = _data;\n  r.memberSymbolMap = _memberSymbolMap;\n}\n"
  },
  {
    "path": "packages/container/angel_container_generator/lib/angel3_container_generator.dart",
    "content": "import 'package:angel3_container/angel3_container.dart';\nimport 'package:reflectable/reflectable.dart';\n\n/// A [Reflectable] instance that can be used as an annotation on types to generate metadata for them.\nconst Reflectable contained = ContainedReflectable();\n\n@contained\nclass ContainedReflectable extends Reflectable {\n  const ContainedReflectable()\n    : super(\n        topLevelInvokeCapability,\n        typeAnnotationQuantifyCapability,\n        superclassQuantifyCapability,\n        libraryCapability,\n        invokingCapability,\n        metadataCapability,\n        reflectedTypeCapability,\n        typeCapability,\n        typingCapability,\n      );\n}\n\n/// A [Reflector] instance that uses a [Reflectable] to reflect upon data.\nclass GeneratedReflector extends Reflector {\n  final Reflectable reflectable;\n\n  const GeneratedReflector([this.reflectable = contained]);\n\n  @override\n  String getName(Symbol symbol) {\n    return symbol.toString().substring(7);\n  }\n\n  @override\n  ReflectedClass reflectClass(Type clazz) {\n    return reflectType(clazz) as ReflectedClass;\n  }\n\n  @override\n  ReflectedFunction reflectFunction(Function function) {\n    if (!reflectable.canReflect(function)) {\n      throw UnsupportedError('Cannot reflect $function.');\n    }\n\n    var mirror = reflectable.reflect(function);\n\n    if (mirror is ClosureMirror) {\n      return _GeneratedReflectedFunction(mirror.function, this, mirror);\n    } else {\n      throw ArgumentError('$function is not a Function.');\n    }\n  }\n\n  @override\n  ReflectedInstance reflectInstance(Object object) {\n    if (!reflectable.canReflect(object)) {\n      throw UnsupportedError('Cannot reflect $object.');\n    } else {\n      var mirror = reflectable.reflect(object);\n      return _GeneratedReflectedInstance(mirror, this);\n    }\n  }\n\n  @override\n  ReflectedType reflectType(Type type) {\n    if (!reflectable.canReflectType(type)) {\n      throw UnsupportedError('Cannot reflect $type.');\n    } else {\n      var mirror = reflectable.reflectType(type);\n      return mirror is ClassMirror\n          ? _GeneratedReflectedClass(mirror, this)\n          : _GeneratedReflectedType(mirror);\n    }\n  }\n}\n\nclass _GeneratedReflectedInstance extends ReflectedInstance {\n  final InstanceMirror mirror;\n  final GeneratedReflector reflector;\n\n  _GeneratedReflectedInstance(this.mirror, this.reflector)\n    : super(\n        _GeneratedReflectedType(mirror.type),\n        _GeneratedReflectedClass(mirror.type, reflector),\n        mirror.reflectee,\n      );\n\n  @override\n  ReflectedType get type => clazz;\n\n  @override\n  ReflectedInstance getField(String name) {\n    var result = mirror.invokeGetter(name)!;\n    var instance = reflector.reflectable.reflect(result);\n    return _GeneratedReflectedInstance(instance, reflector);\n  }\n}\n\nclass _GeneratedReflectedClass extends ReflectedClass {\n  final ClassMirror mirror;\n  final Reflector reflector;\n\n  _GeneratedReflectedClass(this.mirror, this.reflector)\n    : super(mirror.simpleName, [], [], [], [], mirror.reflectedType);\n\n  @override\n  List<ReflectedTypeParameter> get typeParameters =>\n      mirror.typeVariables.map(_convertTypeVariable).toList();\n\n  @override\n  List<ReflectedFunction> get constructors =>\n      _constructorsOf(mirror.declarations, reflector);\n\n  @override\n  List<ReflectedDeclaration> get declarations =>\n      _declarationsOf(mirror.declarations, reflector);\n\n  @override\n  List<ReflectedInstance> get annotations => mirror.metadata\n      .map(reflector.reflectInstance)\n      .whereType<ReflectedInstance>()\n      .toList();\n\n  @override\n  bool isAssignableTo(ReflectedType? other) {\n    if (other is _GeneratedReflectedClass) {\n      return mirror.isAssignableTo(other.mirror);\n    } else if (other is _GeneratedReflectedType) {\n      return mirror.isAssignableTo(other.mirror);\n    } else {\n      return false;\n    }\n  }\n\n  @override\n  ReflectedInstance newInstance(\n    String constructorName,\n    List positionalArguments, [\n    Map<String, dynamic>? namedArguments,\n    List<Type>? typeArguments,\n  ]) {\n    namedArguments ??= {};\n    var result = mirror.newInstance(\n      constructorName,\n      positionalArguments,\n      namedArguments.map((k, v) => MapEntry(Symbol(k), v)),\n    );\n    return reflector.reflectInstance(result)!;\n  }\n}\n\nclass _GeneratedReflectedType extends ReflectedType {\n  final TypeMirror mirror;\n\n  _GeneratedReflectedType(this.mirror)\n    : super(mirror.simpleName, [], mirror.reflectedType);\n\n  @override\n  List<ReflectedTypeParameter> get typeParameters =>\n      mirror.typeVariables.map(_convertTypeVariable).toList();\n\n  @override\n  bool isAssignableTo(ReflectedType? other) {\n    if (other is _GeneratedReflectedClass) {\n      return mirror.isAssignableTo(other.mirror);\n    } else if (other is _GeneratedReflectedType) {\n      return mirror.isAssignableTo(other.mirror);\n    } else {\n      return false;\n    }\n  }\n\n  @override\n  ReflectedInstance newInstance(\n    String constructorName,\n    List positionalArguments, [\n    Map<String, dynamic> namedArguments = const {},\n    List<Type> typeArguments = const [],\n  ]) {\n    throw UnsupportedError('Cannot create a new instance of $reflectedType.');\n  }\n}\n\nclass _GeneratedReflectedFunction extends ReflectedFunction {\n  final MethodMirror mirror;\n  final Reflector reflector;\n  final ClosureMirror? closure;\n\n  _GeneratedReflectedFunction(this.mirror, this.reflector, [this.closure])\n    : super(\n        mirror.simpleName,\n        [],\n        [],\n        mirror.parameters.map((p) => _convertParameter(p, reflector)).toList(),\n        mirror.isGetter,\n        mirror.isSetter,\n        returnType: !mirror.isRegularMethod\n            ? null\n            : _GeneratedReflectedType(mirror.returnType),\n      );\n\n  @override\n  List<ReflectedInstance> get annotations => mirror.metadata\n      .map(reflector.reflectInstance)\n      .whereType<ReflectedInstance>()\n      .toList();\n\n  @override\n  ReflectedInstance invoke(Invocation invocation) {\n    if (closure != null) {\n      throw UnsupportedError('Only closures can be invoked directly.');\n    } else {\n      var result = closure!.delegate(invocation)!;\n      return reflector.reflectInstance(result)!;\n    }\n  }\n}\n\nList<ReflectedFunction> _constructorsOf(\n  Map<String, DeclarationMirror> map,\n  Reflector reflector,\n) {\n  return map.entries.fold<List<ReflectedFunction>>([], (out, entry) {\n    var v = entry.value;\n\n    if (v is MethodMirror && v.isConstructor) {\n      return out..add(_GeneratedReflectedFunction(v, reflector));\n    } else {\n      return out;\n    }\n  });\n}\n\nList<ReflectedDeclaration> _declarationsOf(\n  Map<String, DeclarationMirror> map,\n  Reflector reflector,\n) {\n  return map.entries.fold<List<ReflectedDeclaration>>([], (out, entry) {\n    var v = entry.value;\n\n    if (v is VariableMirror) {\n      var decl = ReflectedDeclaration(v.simpleName, v.isStatic, null);\n      return out..add(decl);\n    }\n    if (v is MethodMirror) {\n      var decl = ReflectedDeclaration(\n        v.simpleName,\n        v.isStatic,\n        _GeneratedReflectedFunction(v, reflector),\n      );\n      return out..add(decl);\n    } else {\n      return out;\n    }\n  });\n}\n\nReflectedTypeParameter _convertTypeVariable(TypeVariableMirror mirror) {\n  return ReflectedTypeParameter(mirror.simpleName);\n}\n\nReflectedParameter _convertParameter(\n  ParameterMirror mirror,\n  Reflector reflector,\n) {\n  return ReflectedParameter(\n    mirror.simpleName,\n    mirror.metadata\n        .map(reflector.reflectInstance)\n        .whereType<ReflectedInstance>()\n        .toList(),\n    reflector.reflectType(mirror.type.reflectedType)!,\n    !mirror.isOptional,\n    mirror.isNamed,\n  );\n}\n"
  },
  {
    "path": "packages/container/angel_container_generator/melos_angel3_container_generator.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/container/angel_container_generator/pubspec.yaml",
    "content": "name: angel3_container_generator\nversion: 8.5.0\ndescription: Codegen support for using pkg:reflectable with pkg:angel3_container.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/container/angel_container_generator\nresolution: workspace\n\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_container: ^8.4.0\n  reflectable: ^5.0.0\ndev_dependencies:\n  build_runner: ^2.0.0\n  build_test: ^3.5.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/container/angel_container_generator/test/reflector_test.dart",
    "content": "import 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_container_generator/angel3_container_generator.dart';\n\nimport 'package:test/test.dart';\nimport 'reflector_test.reflectable.dart';\n\nvoid main() {\n  initializeReflectable();\n\n  var reflector = const GeneratedReflector();\n  late Container container;\n\n  setUp(() {\n    container = Container(reflector);\n    container.registerSingleton(Artist(name: 'Stevie Wonder'));\n  });\n\n  group('reflectClass', () {\n    var mirror = reflector.reflectClass(Artist);\n\n    test('name', () {\n      expect(mirror.name, 'Artist');\n    });\n  });\n\n  test('inject constructor parameters', () {\n    var album = container.make<Album>();\n    print(album.title);\n    expect(album.title, 'flowers by stevie wonder');\n  });\n\n  // Skip as pkg:reflectable cannot reflect on closures at all (yet)\n  //testReflector(reflector);\n}\n\n@contained\nvoid returnVoidFromAFunction(int x) {}\n\nvoid testReflector(Reflector reflector) {\n  var blaziken = Pokemon('Blaziken', PokemonType.fire);\n  late Container container;\n\n  setUp(() {\n    container = Container(reflector);\n    container.registerSingleton(blaziken);\n  });\n\n  test('get field', () {\n    var blazikenMirror = reflector.reflectInstance(blaziken)!;\n    expect(blazikenMirror.getField('type').reflectee, blaziken.type);\n  });\n\n  group(\n    'reflectFunction',\n    () {\n      var mirror = reflector.reflectFunction(returnVoidFromAFunction);\n\n      test('void return type returns dynamic', () {\n        expect(mirror?.returnType, reflector.reflectType(dynamic));\n      });\n\n      test('counts parameters', () {\n        expect(mirror?.parameters, hasLength(1));\n      });\n\n      test('counts types parameters', () {\n        expect(mirror?.typeParameters, isEmpty);\n      });\n\n      test('correctly reflects parameter types', () {\n        var p = mirror?.parameters[0];\n        expect(p?.name, 'x');\n        expect(p?.isRequired, true);\n        expect(p?.isNamed, false);\n        expect(p?.annotations, isEmpty);\n        expect(p?.type, reflector.reflectType(int));\n      });\n    },\n    skip: 'pkg:reflectable cannot reflect on closures at all (yet)',\n  );\n\n  test('make on singleton type returns singleton', () {\n    expect(container.make(Pokemon), blaziken);\n  });\n\n  test('make with generic returns same as make with explicit type', () {\n    expect(container.make<Pokemon>(), blaziken);\n  });\n\n  test('make on aliased singleton returns singleton', () {\n    container.registerSingleton(blaziken, as: StateError);\n    expect(container.make(StateError), blaziken);\n  });\n\n  test('constructor injects singleton', () {\n    var lower = container.make<LowerPokemon>();\n    expect(lower.lowercaseName, blaziken.name.toLowerCase());\n  });\n\n  test('newInstance works', () {\n    var type = container.reflector.reflectType(Pokemon)!;\n    var instance =\n        type.newInstance('changeName', [blaziken, 'Charizard']).reflectee\n            as Pokemon;\n    print(instance);\n    expect(instance.name, 'Charizard');\n    expect(instance.type, PokemonType.fire);\n  });\n\n  test('isAssignableTo', () {\n    var pokemonType = container.reflector.reflectType(Pokemon);\n    var kantoPokemonType = container.reflector.reflectType(KantoPokemon)!;\n\n    expect(kantoPokemonType.isAssignableTo(pokemonType), true);\n\n    expect(\n      kantoPokemonType.isAssignableTo(container.reflector.reflectType(String)),\n      false,\n    );\n  });\n}\n\n@contained\nclass LowerPokemon {\n  final Pokemon pokemon;\n\n  LowerPokemon(this.pokemon);\n\n  String get lowercaseName => pokemon.name.toLowerCase();\n}\n\n@contained\nclass Pokemon {\n  final String name;\n  final PokemonType type;\n\n  Pokemon(this.name, this.type);\n\n  factory Pokemon.changeName(Pokemon other, String name) {\n    return Pokemon(name, other.type);\n  }\n\n  @override\n  String toString() => 'NAME: $name, TYPE: $type';\n}\n\n@contained\nclass KantoPokemon extends Pokemon {\n  KantoPokemon(super.name, super.type);\n}\n\n@contained\nenum PokemonType { water, fire, grass, ice, poison, flying }\n\n@contained\nclass Artist {\n  final String name;\n\n  Artist({required this.name});\n\n  String get lowerName {\n    return name.toLowerCase();\n  }\n}\n\n@contained\nclass Album {\n  final Artist artist;\n\n  Album(this.artist);\n\n  String get title => 'flowers by ${artist.lowerName}';\n}\n\n@contained\nclass AlbumLength {\n  final Artist artist;\n  final Album album;\n\n  AlbumLength(this.artist, this.album);\n\n  int get totalLength => artist.name.length + album.title.length;\n}\n"
  },
  {
    "path": "packages/container/angel_container_generator/test/reflector_test.reflectable.dart",
    "content": "// This file has been generated by the reflectable package.\n// https://github.com/dart-lang/reflectable.\n\nimport 'dart:core';\nimport 'dart:math' as prefix8;\nimport 'package:angel3_container/src/reflector.dart' as prefix7;\nimport 'package:angel3_container_generator/angel3_container_generator.dart'\n    as prefix0;\nimport 'package:reflectable/capability.dart' as prefix6;\nimport 'package:reflectable/mirrors.dart' as prefix5;\nimport 'package:reflectable/reflectable.dart' as prefix2;\nimport 'package:reflectable/src/reflectable_base.dart' as prefix4;\nimport 'package:reflectable/src/reflectable_builder_based.dart' as prefix3;\nimport 'reflector_test.dart' as prefix1;\n\n// ignore_for_file: camel_case_types\n// ignore_for_file: implementation_imports\n// ignore_for_file: prefer_adjacent_string_concatenation\n// ignore_for_file: prefer_collection_literals\n// ignore_for_file: unnecessary_const\n\n// ignore:unused_import\nimport 'package:reflectable/mirrors.dart' as m;\n// ignore:unused_import\nimport 'package:reflectable/src/reflectable_builder_based.dart' as r;\n// ignore:unused_import\nimport 'package:reflectable/reflectable.dart' as r show Reflectable;\n\nfinal _data = <r.Reflectable, r.ReflectorData>{\n  const prefix0.ContainedReflectable(): r.ReflectorData(\n    <m.TypeMirror>[\n      r.NonGenericClassMirrorImpl(\n        r'LowerPokemon',\n        r'.LowerPokemon',\n        134217735,\n        0,\n        const prefix0.ContainedReflectable(),\n        const <int>[27, 85, 86],\n        const <int>[87, 88, 89, 90, 91, 84, 85],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              (pokemon) => b ? prefix1.LowerPokemon(pokemon) : null,\n        },\n        0,\n        0,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Pokemon',\n        r'.Pokemon',\n        134217735,\n        1,\n        const prefix0.ContainedReflectable(),\n        const <int>[28, 29, 92, 95, 96],\n        const <int>[87, 92, 89, 90, 91, 93, 94],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              (name, type) => b ? prefix1.Pokemon(name, type) : null,\n          r'changeName': (bool b) =>\n              (other, name) =>\n                  b ? prefix1.Pokemon.changeName(other, name) : null,\n        },\n        0,\n        1,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'KantoPokemon',\n        r'.KantoPokemon',\n        134217735,\n        2,\n        const prefix0.ContainedReflectable(),\n        const <int>[97],\n        const <int>[87, 92, 89, 90, 91, 93, 94],\n        const <int>[],\n        1,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              (name, type) => b ? prefix1.KantoPokemon(name, type) : null,\n        },\n        0,\n        2,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Artist',\n        r'.Artist',\n        134217735,\n        3,\n        const prefix0.ContainedReflectable(),\n        const <int>[30, 99, 100],\n        const <int>[87, 88, 89, 90, 91, 98, 99],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              ({name}) => b ? prefix1.Artist(name: name) : null,\n        },\n        0,\n        3,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Album',\n        r'.Album',\n        134217735,\n        4,\n        const prefix0.ContainedReflectable(),\n        const <int>[31, 102, 103],\n        const <int>[87, 88, 89, 90, 91, 101, 102],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              (artist) => b ? prefix1.Album(artist) : null,\n        },\n        0,\n        4,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'AlbumLength',\n        r'.AlbumLength',\n        134217735,\n        5,\n        const prefix0.ContainedReflectable(),\n        const <int>[32, 33, 106, 107],\n        const <int>[87, 88, 89, 90, 91, 104, 105, 106],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              (artist, album) => b ? prefix1.AlbumLength(artist, album) : null,\n        },\n        0,\n        5,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'PokemonType',\n        r'.PokemonType',\n        138412039,\n        6,\n        const prefix0.ContainedReflectable(),\n        const <int>[34, 35, 36, 37, 38, 39, 115],\n        const <int>[87, 88, 89, 90, 91, 116],\n        const <int>[108, 109, 110, 111, 112, 113, 114],\n        9,\n        {\n          r'water': () => prefix1.PokemonType.water,\n          r'fire': () => prefix1.PokemonType.fire,\n          r'grass': () => prefix1.PokemonType.grass,\n          r'ice': () => prefix1.PokemonType.ice,\n          r'poison': () => prefix1.PokemonType.poison,\n          r'flying': () => prefix1.PokemonType.flying,\n          r'values': () => prefix1.PokemonType.values,\n        },\n        {},\n        {},\n        0,\n        6,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ContainedReflectable',\n        r'.ContainedReflectable',\n        134217735,\n        7,\n        const prefix0.ContainedReflectable(),\n        const <int>[117],\n        const <int>[87, 88, 89, 90, 91, 118, 119, 120, 121, 122, 123, 124, 125],\n        const <int>[],\n        10,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? prefix0.ContainedReflectable() : null,\n        },\n        1,\n        7,\n        const <int>[],\n        const <Object>[prefix0.contained],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Object',\n        r'dart.core.Object',\n        134217735,\n        8,\n        const prefix0.ContainedReflectable(),\n        const <int>[87, 88, 89, 126, 127, 128, 90, 91, 129],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[126, 127, 128],\n        null,\n        {\n          r'hash': () => Object.hash,\n          r'hashAll': () => Object.hashAll,\n          r'hashAllUnordered': () => Object.hashAllUnordered,\n        },\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? Object() : null,\n        },\n        2,\n        8,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Enum',\n        r'dart.core.Enum',\n        134218247,\n        9,\n        const prefix0.ContainedReflectable(),\n        const <int>[130, 131, 116, 132],\n        const <int>[87, 88, 89, 90, 91, 116],\n        const <int>[130, 131],\n        8,\n        {\n          r'compareByIndex': () => Enum.compareByIndex,\n          r'compareByName': () => Enum.compareByName,\n        },\n        {},\n        {},\n        2,\n        9,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Reflectable',\n        r'reflectable.reflectable.Reflectable',\n        134218247,\n        10,\n        const prefix0.ContainedReflectable(),\n        const <int>[41, 42, 133, 136, 137],\n        const <int>[87, 88, 89, 90, 91, 118, 119, 120, 121, 122, 123, 124, 125],\n        const <int>[133, 134, 135],\n        11,\n        {\n          r'getInstance': () => prefix2.Reflectable.getInstance,\n          r'thisClassName': () => prefix2.Reflectable.thisClassName,\n          r'thisClassId': () => prefix2.Reflectable.thisClassId,\n        },\n        {},\n        {},\n        3,\n        10,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectableImpl',\n        r'reflectable.src.reflectable_builder_based.ReflectableImpl',\n        134218247,\n        11,\n        const prefix0.ContainedReflectable(),\n        const <int>[119, 120, 121, 122, 123, 124, 125, 138, 139],\n        const <int>[87, 88, 89, 90, 91, 118, 119, 120, 121, 122, 123, 124, 125],\n        const <int>[],\n        12,\n        {},\n        {},\n        {},\n        4,\n        11,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectableBase',\n        r'reflectable.src.reflectable_base.ReflectableBase',\n        134217735,\n        12,\n        const prefix0.ContainedReflectable(),\n        const <int>[118, 140, 141],\n        const <int>[87, 88, 89, 90, 91, 118],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'': (bool b) =>\n              ([\n                _cap0,\n                _cap1,\n                _cap2,\n                _cap3,\n                _cap4,\n                _cap5,\n                _cap6,\n                _cap7,\n                _cap8,\n                _cap9,\n              ]) => b\n              ? prefix4.ReflectableBase(\n                  _cap0,\n                  _cap1,\n                  _cap2,\n                  _cap3,\n                  _cap4,\n                  _cap5,\n                  _cap6,\n                  _cap7,\n                  _cap8,\n                  _cap9,\n                )\n              : null,\n          r'fromList': (bool b) =>\n              (_capabilities) =>\n                  b ? prefix4.ReflectableBase.fromList(_capabilities) : null,\n        },\n        5,\n        12,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Invocation',\n        r'dart.core.Invocation',\n        134218247,\n        13,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          142,\n          143,\n          144,\n          145,\n          146,\n          147,\n          148,\n          149,\n          150,\n          151,\n          152,\n          153,\n          154,\n        ],\n        const <int>[87, 88, 89, 90, 91, 143, 149],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'method': (bool b) =>\n              (memberName, positionalArguments, [namedArguments]) => b\n              ? Invocation.method(\n                  memberName,\n                  positionalArguments,\n                  namedArguments,\n                )\n              : null,\n          r'genericMethod': (bool b) =>\n              (\n                memberName,\n                typeArguments,\n                positionalArguments, [\n                namedArguments,\n              ]) => b\n              ? Invocation.genericMethod(\n                  memberName,\n                  typeArguments,\n                  positionalArguments,\n                  namedArguments,\n                )\n              : null,\n          r'getter': (bool b) =>\n              (name) => b ? Invocation.getter(name) : null,\n          r'setter': (bool b) =>\n              (memberName, argument) =>\n                  b ? Invocation.setter(memberName, argument) : null,\n        },\n        2,\n        13,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'bool',\n        r'dart.core.bool',\n        134217735,\n        14,\n        const prefix0.ContainedReflectable(),\n        const <int>[155, 156, 157, 158, 159, 160, 161, 162, 163],\n        const <int>[87, 160, 89, 161, 91, 157, 158, 159],\n        const <int>[155, 156],\n        8,\n        {r'parse': () => bool.parse, r'tryParse': () => bool.tryParse},\n        {},\n        {\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? bool.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n          r'hasEnvironment': (bool b) =>\n              (name) => b ? bool.hasEnvironment(name) : null,\n        },\n        2,\n        14,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'String',\n        r'dart.core.String',\n        134218247,\n        15,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          164,\n          165,\n          166,\n          167,\n          168,\n          169,\n          170,\n          171,\n          172,\n          173,\n          174,\n          175,\n          176,\n          177,\n          178,\n          179,\n          180,\n          181,\n          182,\n          183,\n          184,\n          185,\n          186,\n          187,\n          188,\n          189,\n          190,\n          191,\n          192,\n          193,\n          194,\n          195,\n          196,\n          197,\n          198,\n        ],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {\n          r'fromCharCodes': (bool b) =>\n              (charCodes, [start, end]) =>\n                  b ? String.fromCharCodes(charCodes, start, end) : null,\n          r'fromCharCode': (bool b) =>\n              (charCode) => b ? String.fromCharCode(charCode) : null,\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? String.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n        },\n        2,\n        15,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'int',\n        r'dart.core.int',\n        134218247,\n        16,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          199,\n          200,\n          201,\n          202,\n          203,\n          204,\n          205,\n          206,\n          207,\n          208,\n          209,\n          210,\n          211,\n          212,\n          213,\n          214,\n          215,\n          216,\n          217,\n          218,\n          219,\n          220,\n          221,\n          222,\n          223,\n          224,\n          225,\n          226,\n          227,\n          228,\n          229,\n        ],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[223, 224],\n        -1,\n        {r'parse': () => int.parse, r'tryParse': () => int.tryParse},\n        {},\n        {\n          r'fromEnvironment': (bool b) =>\n              (name, {defaultValue}) => b\n              ? int.fromEnvironment(name, defaultValue: defaultValue)\n              : null,\n        },\n        2,\n        16,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'Type',\n        r'dart.core.Type',\n        134218247,\n        17,\n        const prefix0.ContainedReflectable(),\n        const <int>[230, 231, 232, 233],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {},\n        2,\n        17,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.GenericClassMirrorImpl(\n        r'List',\n        r'dart.core.List',\n        134218247,\n        18,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          234,\n          235,\n          236,\n          237,\n          238,\n          239,\n          240,\n          241,\n          242,\n          243,\n          244,\n          245,\n          246,\n          247,\n          248,\n          249,\n          250,\n          251,\n          252,\n          253,\n          254,\n          255,\n          256,\n          257,\n          258,\n          259,\n          260,\n          261,\n          262,\n          263,\n          264,\n          265,\n          266,\n          267,\n          268,\n          269,\n          270,\n          271,\n          272,\n          273,\n          274,\n          275,\n          276,\n        ],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[234, 235, 236],\n        8,\n        {\n          r'castFrom': () => List.castFrom,\n          r'copyRange': () => List.copyRange,\n          r'writeIterable': () => List.writeIterable,\n        },\n        {},\n        {\n          r'filled': (bool b) =>\n              (length, fill, {growable}) =>\n                  b ? List.filled(length, fill, growable: growable) : null,\n          r'empty': (bool b) =>\n              ({growable}) => b ? List.empty(growable: growable) : null,\n          r'from': (bool b) =>\n              (elements, {growable}) =>\n                  b ? List.from(elements, growable: growable) : null,\n          r'of': (bool b) =>\n              (elements, {growable}) =>\n                  b ? List.of(elements, growable: growable) : null,\n          r'generate': (bool b) =>\n              (length, generator, {growable}) => b\n              ? List.generate(length, generator, growable: growable)\n              : null,\n          r'unmodifiable': (bool b) =>\n              (elements) => b ? List.unmodifiable(elements) : null,\n        },\n        2,\n        18,\n        const <int>[23],\n        const [],\n        null,\n        (o) => false,\n        const <int>[25],\n        18,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'InstanceMirror',\n        r'reflectable.mirrors.InstanceMirror',\n        134218247,\n        19,\n        const prefix0.ContainedReflectable(),\n        const <int>[277, 278, 279, 280, 281, 282, 283],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {},\n        6,\n        19,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'TypeMirror',\n        r'reflectable.mirrors.TypeMirror',\n        134218247,\n        20,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          284,\n          285,\n          286,\n          287,\n          288,\n          289,\n          290,\n          291,\n          292,\n          293,\n          294,\n          295,\n          296,\n          297,\n        ],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {},\n        6,\n        20,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'LibraryMirror',\n        r'reflectable.mirrors.LibraryMirror',\n        134218247,\n        21,\n        const prefix0.ContainedReflectable(),\n        const <int>[298, 299, 300, 301, 302, 303, 304],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {},\n        6,\n        21,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.GenericClassMirrorImpl(\n        r'Map',\n        r'dart.core.Map',\n        134218247,\n        22,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          305,\n          306,\n          307,\n          308,\n          309,\n          310,\n          311,\n          312,\n          313,\n          314,\n          315,\n          316,\n          317,\n          318,\n          319,\n          320,\n          321,\n          322,\n          323,\n          324,\n          325,\n          326,\n          327,\n          328,\n          329,\n          330,\n          331,\n          332,\n          333,\n          334,\n        ],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[305],\n        8,\n        {r'castFrom': () => Map.castFrom},\n        {},\n        {\n          r'': (bool b) =>\n              () => b ? Map() : null,\n          r'from': (bool b) =>\n              (other) => b ? Map.from(other) : null,\n          r'of': (bool b) =>\n              (other) => b ? Map.of(other) : null,\n          r'unmodifiable': (bool b) =>\n              (other) => b ? Map.unmodifiable(other) : null,\n          r'identity': (bool b) =>\n              () => b ? Map.identity() : null,\n          r'fromIterable': (bool b) =>\n              (iterable, {key, value}) =>\n                  b ? Map.fromIterable(iterable, key: key, value: value) : null,\n          r'fromIterables': (bool b) =>\n              (keys, values) => b ? Map.fromIterables(keys, values) : null,\n          r'fromEntries': (bool b) =>\n              (entries) => b ? Map.fromEntries(entries) : null,\n        },\n        2,\n        22,\n        const <int>[],\n        const [],\n        null,\n        (o) => false,\n        const <int>[26, 27],\n        22,\n      ),\n      r.GenericClassMirrorImpl(\n        r'Iterable',\n        r'dart.core.Iterable',\n        134218247,\n        23,\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          335,\n          336,\n          337,\n          338,\n          339,\n          340,\n          341,\n          342,\n          343,\n          344,\n          345,\n          346,\n          347,\n          348,\n          349,\n          350,\n          351,\n          352,\n          353,\n          354,\n          355,\n          356,\n          357,\n          358,\n          359,\n          360,\n          361,\n          362,\n          363,\n          364,\n          365,\n          366,\n          367,\n          368,\n          369,\n          370,\n          371,\n        ],\n        const <int>[\n          87,\n          359,\n          89,\n          90,\n          91,\n          336,\n          337,\n          338,\n          339,\n          340,\n          341,\n          342,\n          343,\n          344,\n          345,\n          346,\n          347,\n          348,\n          349,\n          350,\n          351,\n          352,\n          353,\n          354,\n          355,\n          356,\n          357,\n          358,\n          363,\n          364,\n          365,\n          366,\n          367,\n          368,\n        ],\n        const <int>[335, 360, 361],\n        8,\n        {\n          r'castFrom': () => Iterable.castFrom,\n          r'iterableToShortString': () => Iterable.iterableToShortString,\n          r'iterableToFullString': () => Iterable.iterableToFullString,\n        },\n        {},\n        {\n          r'generate': (bool b) =>\n              (count, [generator]) =>\n                  b ? Iterable.generate(count, generator) : null,\n          r'empty': (bool b) =>\n              () => b ? Iterable.empty() : null,\n        },\n        2,\n        23,\n        const <int>[],\n        const [],\n        null,\n        (o) => false,\n        const <int>[28],\n        23,\n      ),\n      r.NonGenericClassMirrorImpl(\n        r'ReflectCapability',\n        r'reflectable.capability.ReflectCapability',\n        134218247,\n        24,\n        const prefix0.ContainedReflectable(),\n        const <int>[372],\n        const <int>[87, 88, 89, 90, 91],\n        const <int>[],\n        8,\n        {},\n        {},\n        {},\n        7,\n        24,\n        const <int>[],\n        const [],\n        null,\n      ),\n      r.TypeVariableMirrorImpl(\n        r'E',\n        r'dart.core.List.E',\n        const prefix0.ContainedReflectable(),\n        8,\n        18,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'K',\n        r'dart.core.Map.K',\n        const prefix0.ContainedReflectable(),\n        8,\n        22,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'V',\n        r'dart.core.Map.V',\n        const prefix0.ContainedReflectable(),\n        8,\n        22,\n        <Object>[],\n      ),\n      r.TypeVariableMirrorImpl(\n        r'E',\n        r'dart.core.Iterable.E',\n        const prefix0.ContainedReflectable(),\n        8,\n        23,\n        <Object>[],\n      ),\n    ],\n    <m.DeclarationMirror>[\n      r.VariableMirrorImpl(\n        r'contained',\n        142738581,\n        1,\n        const prefix0.ContainedReflectable(),\n        10,\n        10,\n        10,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'deprecated',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        25,\n        25,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'override',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'pleaseInitializeMessage',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'data',\n        142737429,\n        -1,\n        const prefix0.ContainedReflectable(),\n        22,\n        26,\n        22,\n        const <int>[10, 27],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'memberSymbolMap',\n        75628565,\n        -1,\n        const prefix0.ContainedReflectable(),\n        22,\n        28,\n        22,\n        const <int>[29, 15],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'instanceInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        30,\n        30,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'staticInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        31,\n        31,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'topLevelInvokeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        32,\n        32,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'newInstanceCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        33,\n        33,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'metadataCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        34,\n        34,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        35,\n        35,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeRelationsCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        36,\n        36,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'reflectedTypeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        37,\n        37,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'libraryCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        38,\n        38,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'declarationsCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        39,\n        39,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'uriCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        40,\n        40,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'libraryDependenciesCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        41,\n        41,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'invokingCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        42,\n        42,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typingCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        43,\n        43,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'delegateCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        44,\n        44,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'subtypeQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        45,\n        45,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'superclassQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        46,\n        46,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeAnnotationQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        47,\n        47,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'typeAnnotationDeepQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        47,\n        47,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'correspondingSetterQuantifyCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        48,\n        48,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'admitSubtypeCapability',\n        142738581,\n        -1,\n        const prefix0.ContainedReflectable(),\n        -1,\n        49,\n        49,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'pokemon',\n        134349829,\n        0,\n        const prefix0.ContainedReflectable(),\n        1,\n        1,\n        1,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'name',\n        134349829,\n        1,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'type',\n        134349829,\n        1,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'name',\n        134349829,\n        3,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'artist',\n        134349829,\n        4,\n        const prefix0.ContainedReflectable(),\n        3,\n        3,\n        3,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'artist',\n        134349829,\n        5,\n        const prefix0.ContainedReflectable(),\n        3,\n        3,\n        3,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'album',\n        134349829,\n        5,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'water',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'fire',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'grass',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'ice',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'poison',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'flying',\n        134349973,\n        6,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'values',\n        151127253,\n        6,\n        const prefix0.ContainedReflectable(),\n        18,\n        50,\n        18,\n        const <int>[6],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'thisClassName',\n        134349973,\n        10,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n      ),\n      r.VariableMirrorImpl(\n        r'thisClassId',\n        134349973,\n        10,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'main',\n        9699352,\n        0,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'returnVoidFromAFunction',\n        9699352,\n        0,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[0],\n        const prefix0.ContainedReflectable(),\n        const <Object>[prefix0.contained],\n      ),\n      r.MethodMirrorImpl(\n        r'testReflector',\n        9699352,\n        0,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[1],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 0, 19),\n      r.MethodMirrorImpl(\n        r'identical',\n        10485784,\n        -1,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[2, 3],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'identityHashCode',\n        10485784,\n        -1,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[4],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'print',\n        9699352,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[5],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 1, 23),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 2, 24),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 3, 25),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 4, 26),\n      r.ImplicitSetterMirrorImpl(const prefix0.ContainedReflectable(), 4, 27),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 5, 28),\n      r.ImplicitSetterMirrorImpl(const prefix0.ContainedReflectable(), 5, 29),\n      r.MethodMirrorImpl(\n        r'reflectors',\n        44040211,\n        -1,\n        -1,\n        51,\n        52,\n        const <int>[10],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchInvokableError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[8, 9, 10, 11, 12],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchMethodError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[13, 14, 15, 16],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchGetterError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[17, 18, 19, 20],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchSetterError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[21, 22, 23, 24],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectableNoSuchConstructorError',\n        8912920,\n        -1,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[25, 26, 27, 28],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 6, 36),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 7, 37),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 8, 38),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 9, 39),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 10, 40),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 11, 41),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 12, 42),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 13, 43),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 14, 44),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 15, 45),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 16, 46),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 17, 47),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 18, 48),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 19, 49),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 20, 50),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 21, 51),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 22, 52),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 23, 53),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 24, 54),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 25, 55),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 26, 56),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 0, 57),\n      r.MethodMirrorImpl(\n        r'lowercaseName',\n        2097155,\n        0,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        0,\n        -1,\n        0,\n        0,\n        const <int>[],\n        const <int>[29],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097154,\n        8,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[30],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        8,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'noSuchMethod',\n        524290,\n        8,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[31],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097155,\n        8,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'runtimeType',\n        2097155,\n        8,\n        17,\n        17,\n        17,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        1,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 1, 66),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 2, 67),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        1,\n        -1,\n        1,\n        1,\n        const <int>[],\n        const <int>[32, 33],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'changeName',\n        1,\n        1,\n        -1,\n        1,\n        1,\n        const <int>[],\n        const <int>[34, 35],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        2,\n        -1,\n        2,\n        2,\n        const <int>[],\n        const <int>[36, 37],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 3, 71),\n      r.MethodMirrorImpl(\n        r'lowerName',\n        2097155,\n        3,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        3,\n        -1,\n        3,\n        3,\n        const <int>[],\n        const <int>[38],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 4, 74),\n      r.MethodMirrorImpl(\n        r'title',\n        2097155,\n        4,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        4,\n        -1,\n        4,\n        4,\n        const <int>[],\n        const <int>[39],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 5, 77),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 6, 78),\n      r.MethodMirrorImpl(\n        r'totalLength',\n        2097155,\n        5,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        5,\n        -1,\n        5,\n        5,\n        const <int>[],\n        const <int>[40, 41],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 7, 81),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 8, 82),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 9, 83),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 10, 84),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 11, 85),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 12, 86),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 13, 87),\n      r.MethodMirrorImpl(\n        r'',\n        192,\n        6,\n        -1,\n        6,\n        6,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'index',\n        2097155,\n        9,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        7,\n        -1,\n        7,\n        7,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'capabilities',\n        35651587,\n        12,\n        18,\n        53,\n        18,\n        const <int>[24],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'canReflect',\n        2097154,\n        11,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[42],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'reflect',\n        2097154,\n        11,\n        19,\n        19,\n        19,\n        const <int>[],\n        const <int>[43],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'canReflectType',\n        2097154,\n        11,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[44],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectType',\n        2097154,\n        11,\n        20,\n        20,\n        20,\n        const <int>[],\n        const <int>[45],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'findLibrary',\n        2097154,\n        11,\n        21,\n        21,\n        21,\n        const <int>[],\n        const <int>[46],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'libraries',\n        35651587,\n        11,\n        22,\n        55,\n        22,\n        const <int>[54, 21],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'annotatedClasses',\n        35651587,\n        11,\n        23,\n        57,\n        23,\n        const <int>[56],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'hash',\n        2097170,\n        8,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[\n          47,\n          48,\n          49,\n          50,\n          51,\n          52,\n          53,\n          54,\n          55,\n          56,\n          57,\n          58,\n          59,\n          60,\n          61,\n          62,\n          63,\n          64,\n          65,\n          66,\n        ],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashAll',\n        2097170,\n        8,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[67],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashAllUnordered',\n        2097170,\n        8,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[68],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        8,\n        -1,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'compareByIndex',\n        2097170,\n        9,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[69, 70],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'compareByName',\n        2097170,\n        9,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[71, 72],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        9,\n        -1,\n        9,\n        9,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'getInstance',\n        2097170,\n        10,\n        10,\n        10,\n        10,\n        const <int>[],\n        const <int>[73],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 14, 107),\n      r.ImplicitGetterMirrorImpl(const prefix0.ContainedReflectable(), 15, 108),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        10,\n        -1,\n        10,\n        10,\n        const <int>[],\n        const <int>[74, 75, 76, 77, 78, 79, 80, 81, 82, 83],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        10,\n        -1,\n        10,\n        10,\n        const <int>[],\n        const <int>[84],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        11,\n        -1,\n        11,\n        11,\n        const <int>[],\n        const <int>[85, 86, 87, 88, 89, 90, 91, 92, 93, 94],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        11,\n        -1,\n        11,\n        11,\n        const <int>[],\n        const <int>[95],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        12,\n        -1,\n        12,\n        12,\n        const <int>[],\n        const <int>[96, 97, 98, 99, 100, 101, 102, 103, 104, 105],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromList',\n        128,\n        12,\n        -1,\n        12,\n        12,\n        const <int>[],\n        const <int>[106],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'memberName',\n        2097667,\n        13,\n        -1,\n        29,\n        29,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeArguments',\n        35651587,\n        13,\n        18,\n        58,\n        18,\n        const <int>[17],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'positionalArguments',\n        35652099,\n        13,\n        18,\n        59,\n        18,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'namedArguments',\n        35652099,\n        13,\n        22,\n        60,\n        22,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isMethod',\n        2097667,\n        13,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isGetter',\n        2097667,\n        13,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isSetter',\n        2097667,\n        13,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isAccessor',\n        2097155,\n        13,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        0,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'method',\n        1,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[107, 108, 109],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'genericMethod',\n        1,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[110, 111, 112, 113],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'getter',\n        257,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[114],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setter',\n        257,\n        13,\n        -1,\n        13,\n        13,\n        const <int>[],\n        const <int>[115, 116],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'parse',\n        2097170,\n        14,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[117, 118],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'tryParse',\n        2097170,\n        14,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[119, 120],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'&',\n        2097154,\n        14,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[121],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'|',\n        2097154,\n        14,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[122],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'^',\n        2097154,\n        14,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[123],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        14,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097155,\n        14,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        14,\n        -1,\n        14,\n        14,\n        const <int>[],\n        const <int>[124, 125],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasEnvironment',\n        129,\n        14,\n        -1,\n        14,\n        14,\n        const <int>[],\n        const <int>[126],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[127],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'codeUnitAt',\n        2097666,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[128],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[129],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'compareTo',\n        2097666,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[130],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'endsWith',\n        2097666,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[131],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'startsWith',\n        2097666,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[132, 133],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexOf',\n        2097666,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[134, 135],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexOf',\n        2097666,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[136, 137],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'+',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[138],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'substring',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[139, 140],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trim',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trimLeft',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'trimRight',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'*',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[141],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'padLeft',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[142, 143],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'padRight',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[144, 145],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'contains',\n        2097666,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[146, 147],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceFirst',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[148, 149, 150],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceFirstMapped',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[151, 152, 153],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceAll',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[154, 155],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceAllMapped',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[156, 157],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceRange',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[158, 159, 160],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'split',\n        35652098,\n        15,\n        18,\n        61,\n        18,\n        const <int>[15],\n        const <int>[161],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'splitMapJoin',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[162, 163, 164],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toLowerCase',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toUpperCase',\n        2097666,\n        15,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        15,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097667,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097667,\n        15,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'codeUnits',\n        35652099,\n        15,\n        18,\n        62,\n        18,\n        const <int>[16],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'runes',\n        2097667,\n        15,\n        -1,\n        63,\n        63,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromCharCodes',\n        1,\n        15,\n        -1,\n        15,\n        15,\n        const <int>[],\n        const <int>[165, 166, 167],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromCharCode',\n        1,\n        15,\n        -1,\n        15,\n        15,\n        const <int>[],\n        const <int>[168],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        15,\n        -1,\n        15,\n        15,\n        const <int>[],\n        const <int>[169, 170],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'&',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[171],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'|',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[172],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'^',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[173],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'~',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'<<',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[174],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'>>',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[175],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'>>>',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[176],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'modPow',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[177, 178],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'modInverse',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[179],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'gcd',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[180],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toUnsigned',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[181],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toSigned',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[182],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unary-',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'abs',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'round',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'floor',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'ceil',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'truncate',\n        2097666,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'roundToDouble',\n        2097666,\n        16,\n        -1,\n        64,\n        64,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'floorToDouble',\n        2097666,\n        16,\n        -1,\n        64,\n        64,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'ceilToDouble',\n        2097666,\n        16,\n        -1,\n        64,\n        64,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'truncateToDouble',\n        2097666,\n        16,\n        -1,\n        64,\n        64,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097666,\n        16,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toRadixString',\n        2097666,\n        16,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[183],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'parse',\n        2097170,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[184, 185],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'tryParse',\n        2097170,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[186, 187],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEven',\n        2097667,\n        16,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isOdd',\n        2097667,\n        16,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'bitLength',\n        2097667,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sign',\n        2097667,\n        16,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEnvironment',\n        129,\n        16,\n        -1,\n        16,\n        16,\n        const <int>[],\n        const <int>[188, 189],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        17,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[190],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097666,\n        17,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        17,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        17,\n        -1,\n        17,\n        17,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        18,\n        18,\n        65,\n        18,\n        null,\n        const <int>[191],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'copyRange',\n        1310738,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[192, 193, 194, 195, 196],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'writeIterable',\n        1310738,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[197, 198, 199],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35652098,\n        18,\n        18,\n        66,\n        18,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        514,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[200],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]=',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[201, 202],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'add',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[203],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addAll',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[204],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sort',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[205],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'shuffle',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[206],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexOf',\n        2097666,\n        18,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[207, 208],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'indexWhere',\n        2097666,\n        18,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[209, 210],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexWhere',\n        2097666,\n        18,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[211, 212],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastIndexOf',\n        2097666,\n        18,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[213, 214],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'clear',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'insert',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[215, 216],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'insertAll',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[217, 218],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setAll',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[219, 220],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'remove',\n        2097666,\n        18,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[221],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeAt',\n        514,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[222],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeLast',\n        514,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeWhere',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[223],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'retainWhere',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[224],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'+',\n        35652098,\n        18,\n        18,\n        67,\n        18,\n        null,\n        const <int>[225],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'sublist',\n        35652098,\n        18,\n        18,\n        67,\n        18,\n        null,\n        const <int>[226, 227],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'getRange',\n        35652098,\n        18,\n        23,\n        68,\n        23,\n        null,\n        const <int>[228, 229],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'setRange',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[230, 231, 232, 233],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeRange',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[234, 235],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fillRange',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[236, 237, 238],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'replaceRange',\n        1311234,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[239, 240, 241],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'asMap',\n        35652098,\n        18,\n        22,\n        69,\n        22,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        18,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[242],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'first=',\n        1311236,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[255],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'last=',\n        1311236,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[256],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        18,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length=',\n        1311236,\n        18,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[257],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reversed',\n        35652099,\n        18,\n        23,\n        68,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'filled',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[243, 244, 245],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'empty',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[246],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'from',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[247, 248],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'of',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[249, 250],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'generate',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[251, 252, 253],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unmodifiable',\n        1,\n        18,\n        -1,\n        67,\n        18,\n        null,\n        const <int>[254],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        19,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[258],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'delegate',\n        2097666,\n        19,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[259],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'type',\n        2097667,\n        19,\n        -1,\n        56,\n        56,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasReflectee',\n        2097667,\n        19,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectee',\n        2097667,\n        19,\n        8,\n        8,\n        8,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        19,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        19,\n        -1,\n        19,\n        19,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isSubtypeOf',\n        2097666,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[260],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isAssignableTo',\n        2097666,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[261],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hasReflectedType',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectedType',\n        2097667,\n        20,\n        17,\n        17,\n        17,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeVariables',\n        35652099,\n        20,\n        18,\n        71,\n        18,\n        const <int>[70],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'typeArguments',\n        35652099,\n        20,\n        18,\n        72,\n        18,\n        const <int>[20],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reflectedTypeArguments',\n        35652099,\n        20,\n        18,\n        58,\n        18,\n        const <int>[17],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isOriginalDeclaration',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'originalDeclaration',\n        2097667,\n        20,\n        20,\n        20,\n        20,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNullable',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNonNullable',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isPotentiallyNullable',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isPotentiallyNonNullable',\n        2097667,\n        20,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        20,\n        -1,\n        20,\n        20,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'==',\n        2097666,\n        21,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[262],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'uri',\n        2097667,\n        21,\n        -1,\n        54,\n        54,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'declarations',\n        35652099,\n        21,\n        22,\n        74,\n        22,\n        const <int>[15, 73],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'hashCode',\n        2097667,\n        21,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'libraryDependencies',\n        35652099,\n        21,\n        18,\n        76,\n        18,\n        const <int>[75],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'owner',\n        2097667,\n        21,\n        -1,\n        77,\n        77,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const <Object>[override],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        64,\n        21,\n        -1,\n        21,\n        21,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        22,\n        22,\n        78,\n        22,\n        null,\n        const <int>[263],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35652098,\n        22,\n        22,\n        79,\n        22,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'containsValue',\n        2097666,\n        22,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[264],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'containsKey',\n        2097666,\n        22,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[265],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]',\n        514,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[266],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'[]=',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[267, 268],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'map',\n        35652098,\n        22,\n        22,\n        80,\n        22,\n        null,\n        const <int>[269],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addEntries',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[270],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'update',\n        514,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[271, 272, 273],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'updateAll',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[274],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'removeWhere',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[275],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'putIfAbsent',\n        514,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[276, 277],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'addAll',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[278],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'remove',\n        514,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[279],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'clear',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'forEach',\n        1311234,\n        22,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[280],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'entries',\n        35652099,\n        22,\n        23,\n        81,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'keys',\n        35652099,\n        22,\n        23,\n        82,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'values',\n        35652099,\n        22,\n        23,\n        83,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097667,\n        22,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097667,\n        22,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097667,\n        22,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        1,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'from',\n        257,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[281],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'of',\n        257,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[282],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'unmodifiable',\n        1,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[283],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'identity',\n        257,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromIterable',\n        257,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[284, 285, 286],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromIterables',\n        257,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[287, 288],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fromEntries',\n        1,\n        22,\n        -1,\n        84,\n        22,\n        null,\n        const <int>[289],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'castFrom',\n        35651602,\n        23,\n        23,\n        85,\n        23,\n        null,\n        const <int>[290],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'cast',\n        35651586,\n        23,\n        23,\n        86,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'followedBy',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[291],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'map',\n        35651586,\n        23,\n        23,\n        88,\n        23,\n        null,\n        const <int>[292],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'where',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[293],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'whereType',\n        35651586,\n        23,\n        23,\n        89,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'expand',\n        35651586,\n        23,\n        23,\n        90,\n        23,\n        null,\n        const <int>[294],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'contains',\n        2097154,\n        23,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[295],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'forEach',\n        1310722,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[296],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'reduce',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[297],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'fold',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[298, 299],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'every',\n        2097154,\n        23,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[300],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'join',\n        2097154,\n        23,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[301],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'any',\n        2097154,\n        23,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[302],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toList',\n        35651586,\n        23,\n        18,\n        91,\n        18,\n        null,\n        const <int>[303],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toSet',\n        35651586,\n        23,\n        -1,\n        92,\n        93,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'take',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[304],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'takeWhile',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[305],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'skip',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[306],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'skipWhile',\n        35651586,\n        23,\n        23,\n        87,\n        23,\n        null,\n        const <int>[307],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'firstWhere',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[308, 309],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'lastWhere',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[310, 311],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'singleWhere',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[312, 313],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'elementAt',\n        2,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[314],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'toString',\n        2097154,\n        23,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterableToShortString',\n        2097170,\n        23,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[315, 316, 317],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterableToFullString',\n        2097170,\n        23,\n        15,\n        15,\n        15,\n        const <int>[],\n        const <int>[318, 319, 320],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'iterator',\n        35652099,\n        23,\n        -1,\n        94,\n        95,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'length',\n        2097155,\n        23,\n        16,\n        16,\n        16,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isEmpty',\n        2097155,\n        23,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'isNotEmpty',\n        2097155,\n        23,\n        14,\n        14,\n        14,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'first',\n        3,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'last',\n        3,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'single',\n        3,\n        23,\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        23,\n        -1,\n        87,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'generate',\n        1,\n        23,\n        -1,\n        87,\n        23,\n        null,\n        const <int>[321, 322],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'empty',\n        385,\n        23,\n        -1,\n        87,\n        23,\n        null,\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n      r.MethodMirrorImpl(\n        r'',\n        128,\n        24,\n        -1,\n        24,\n        24,\n        const <int>[],\n        const <int>[],\n        const prefix0.ContainedReflectable(),\n        const [],\n      ),\n    ],\n    <m.ParameterMirror>[\n      r.ParameterMirrorImpl(\n        r'x',\n        134348806,\n        17,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'reflector',\n        134348806,\n        18,\n        const prefix0.ContainedReflectable(),\n        -1,\n        96,\n        96,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'a',\n        67239942,\n        20,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'b',\n        67239942,\n        20,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object',\n        67239942,\n        21,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object',\n        67239942,\n        22,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_data',\n        151126118,\n        27,\n        const prefix0.ContainedReflectable(),\n        22,\n        26,\n        22,\n        const <int>[10, 27],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_memberSymbolMap',\n        84017254,\n        29,\n        const prefix0.ContainedReflectable(),\n        22,\n        28,\n        22,\n        const <int>[29, 15],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        31,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        31,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        31,\n        const prefix0.ContainedReflectable(),\n        18,\n        59,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        31,\n        const prefix0.ContainedReflectable(),\n        22,\n        97,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'kind',\n        134348806,\n        31,\n        const prefix0.ContainedReflectable(),\n        -1,\n        98,\n        98,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        32,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        32,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        32,\n        const prefix0.ContainedReflectable(),\n        18,\n        59,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        32,\n        const prefix0.ContainedReflectable(),\n        22,\n        97,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        33,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        33,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        33,\n        const prefix0.ContainedReflectable(),\n        18,\n        59,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        33,\n        const prefix0.ContainedReflectable(),\n        22,\n        97,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        34,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        34,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        34,\n        const prefix0.ContainedReflectable(),\n        18,\n        59,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        34,\n        const prefix0.ContainedReflectable(),\n        22,\n        97,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'receiver',\n        67239942,\n        35,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'constructorName',\n        134348806,\n        35,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        151126022,\n        35,\n        const prefix0.ContainedReflectable(),\n        18,\n        59,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84017158,\n        35,\n        const prefix0.ContainedReflectable(),\n        22,\n        97,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pokemon',\n        134349830,\n        59,\n        const prefix0.ContainedReflectable(),\n        1,\n        1,\n        1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        60,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'invocation',\n        134348806,\n        62,\n        const prefix0.ContainedReflectable(),\n        13,\n        13,\n        13,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134349830,\n        68,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134349830,\n        68,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        69,\n        const prefix0.ContainedReflectable(),\n        1,\n        1,\n        1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        69,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134349830,\n        70,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134349830,\n        70,\n        const prefix0.ContainedReflectable(),\n        6,\n        6,\n        6,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134358022,\n        73,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        #name,\n      ),\n      r.ParameterMirrorImpl(\n        r'artist',\n        134349830,\n        76,\n        const prefix0.ContainedReflectable(),\n        3,\n        3,\n        3,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'artist',\n        134349830,\n        80,\n        const prefix0.ContainedReflectable(),\n        3,\n        3,\n        3,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'album',\n        134349830,\n        80,\n        const prefix0.ContainedReflectable(),\n        4,\n        4,\n        4,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'reflectee',\n        134348806,\n        92,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'reflectee',\n        134348806,\n        93,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        94,\n        const prefix0.ContainedReflectable(),\n        17,\n        17,\n        17,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        95,\n        const prefix0.ContainedReflectable(),\n        17,\n        17,\n        17,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'libraryName',\n        134348806,\n        96,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object1',\n        67239942,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object2',\n        67239942,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object3',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object4',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object5',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object6',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object7',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object8',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object9',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object10',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object11',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object12',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object13',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object14',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object15',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object16',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object17',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object18',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object19',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'object20',\n        67246086,\n        99,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'objects',\n        151126022,\n        100,\n        const prefix0.ContainedReflectable(),\n        23,\n        99,\n        23,\n        const <int>[8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'objects',\n        151126022,\n        101,\n        const prefix0.ContainedReflectable(),\n        23,\n        99,\n        23,\n        const <int>[8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value1',\n        134217734,\n        103,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value2',\n        134217734,\n        103,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value1',\n        134217734,\n        104,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value2',\n        134217734,\n        104,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'type',\n        134348806,\n        106,\n        const prefix0.ContainedReflectable(),\n        17,\n        17,\n        17,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap0',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap1',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap2',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap3',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap4',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap5',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap6',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap7',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap8',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap9',\n        67244038,\n        109,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'capabilities',\n        151126022,\n        110,\n        const prefix0.ContainedReflectable(),\n        18,\n        53,\n        18,\n        const <int>[24],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap0',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap1',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap2',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap3',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap4',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap5',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap6',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap7',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap8',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'cap9',\n        67244038,\n        111,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'capabilities',\n        151126022,\n        112,\n        const prefix0.ContainedReflectable(),\n        18,\n        53,\n        18,\n        const <int>[24],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap0',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap1',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap2',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap3',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap4',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap5',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap6',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap7',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap8',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_cap9',\n        67245094,\n        113,\n        const prefix0.ContainedReflectable(),\n        24,\n        24,\n        24,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'_capabilities',\n        84018214,\n        114,\n        const prefix0.ContainedReflectable(),\n        18,\n        100,\n        18,\n        const <int>[24],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        124,\n        const prefix0.ContainedReflectable(),\n        -1,\n        29,\n        29,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        84017158,\n        124,\n        const prefix0.ContainedReflectable(),\n        23,\n        101,\n        23,\n        const <int>[8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84021254,\n        124,\n        const prefix0.ContainedReflectable(),\n        22,\n        102,\n        22,\n        const <int>[29, 8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        125,\n        const prefix0.ContainedReflectable(),\n        -1,\n        29,\n        29,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'typeArguments',\n        84017158,\n        125,\n        const prefix0.ContainedReflectable(),\n        23,\n        103,\n        23,\n        const <int>[17],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'positionalArguments',\n        84017158,\n        125,\n        const prefix0.ContainedReflectable(),\n        23,\n        101,\n        23,\n        const <int>[8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'namedArguments',\n        84021254,\n        125,\n        const prefix0.ContainedReflectable(),\n        22,\n        102,\n        22,\n        const <int>[29, 8],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        126,\n        const prefix0.ContainedReflectable(),\n        -1,\n        29,\n        29,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'memberName',\n        134348806,\n        127,\n        const prefix0.ContainedReflectable(),\n        -1,\n        29,\n        29,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'argument',\n        67239942,\n        127,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        128,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'caseSensitive',\n        134363142,\n        128,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #caseSensitive,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        129,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'caseSensitive',\n        134363142,\n        129,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #caseSensitive,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        130,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        131,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        132,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        135,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        135,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        136,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        137,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        138,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        139,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        140,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        141,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        142,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134354950,\n        142,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        143,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        143,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        144,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        144,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        145,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        146,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        146,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'times',\n        134348806,\n        150,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        151,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'padding',\n        134354950,\n        151,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        152,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'padding',\n        134354950,\n        152,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        153,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        153,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        154,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'to',\n        134348806,\n        154,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        154,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        155,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134217734,\n        155,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'startIndex',\n        134354950,\n        155,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        156,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134348806,\n        156,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'from',\n        134348806,\n        157,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replace',\n        134217734,\n        157,\n        const prefix0.ContainedReflectable(),\n        -1,\n        105,\n        105,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        158,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67239942,\n        158,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replacement',\n        134348806,\n        158,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        159,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'pattern',\n        134348806,\n        160,\n        const prefix0.ContainedReflectable(),\n        -1,\n        104,\n        104,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'onMatch',\n        67121158,\n        160,\n        const prefix0.ContainedReflectable(),\n        -1,\n        106,\n        106,\n        const <int>[],\n        const [],\n        null,\n        #onMatch,\n      ),\n      r.ParameterMirrorImpl(\n        r'onNonMatch',\n        67121158,\n        160,\n        const prefix0.ContainedReflectable(),\n        -1,\n        107,\n        107,\n        const <int>[],\n        const [],\n        null,\n        #onNonMatch,\n      ),\n      r.ParameterMirrorImpl(\n        r'charCodes',\n        151126022,\n        169,\n        const prefix0.ContainedReflectable(),\n        23,\n        108,\n        23,\n        const <int>[16],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        169,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        169,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'charCode',\n        134348806,\n        170,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        171,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        171,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        172,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        173,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        174,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        176,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        177,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'shiftAmount',\n        134348806,\n        178,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'exponent',\n        134348806,\n        179,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'modulus',\n        134348806,\n        179,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'modulus',\n        134348806,\n        180,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        181,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        182,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'width',\n        134348806,\n        183,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        134348806,\n        195,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        196,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        67252230,\n        196,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        #radix,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        134348806,\n        197,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'radix',\n        67252230,\n        197,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        #radix,\n      ),\n      r.ParameterMirrorImpl(\n        r'name',\n        134348806,\n        202,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'defaultValue',\n        134363142,\n        202,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        #defaultValue,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        203,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        207,\n        const prefix0.ContainedReflectable(),\n        18,\n        109,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'target',\n        151126022,\n        208,\n        const prefix0.ContainedReflectable(),\n        18,\n        110,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'at',\n        134348806,\n        208,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        208,\n        const prefix0.ContainedReflectable(),\n        18,\n        110,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        208,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        208,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'target',\n        151126022,\n        209,\n        const prefix0.ContainedReflectable(),\n        18,\n        111,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'at',\n        134348806,\n        209,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        209,\n        const prefix0.ContainedReflectable(),\n        23,\n        112,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        211,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        212,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        212,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        213,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        214,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'compare',\n        67112966,\n        215,\n        const prefix0.ContainedReflectable(),\n        -1,\n        113,\n        113,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'random',\n        67244038,\n        216,\n        const prefix0.ContainedReflectable(),\n        -1,\n        114,\n        114,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        217,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        217,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        218,\n        const prefix0.ContainedReflectable(),\n        -1,\n        115,\n        115,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134354950,\n        218,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        219,\n        const prefix0.ContainedReflectable(),\n        -1,\n        115,\n        115,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        219,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        220,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        67244038,\n        220,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        222,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        6,\n        222,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        223,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        223,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        224,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        224,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67239942,\n        225,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        226,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        228,\n        const prefix0.ContainedReflectable(),\n        -1,\n        115,\n        115,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        229,\n        const prefix0.ContainedReflectable(),\n        -1,\n        115,\n        115,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        230,\n        const prefix0.ContainedReflectable(),\n        18,\n        67,\n        18,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        231,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        67244038,\n        231,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        232,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        232,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        233,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        233,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        233,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'skipCount',\n        134354950,\n        233,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        234,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        234,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        235,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        235,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'fillValue',\n        67112966,\n        235,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'start',\n        134348806,\n        236,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'end',\n        134348806,\n        236,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'replacements',\n        151126022,\n        236,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        238,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'length',\n        134348806,\n        244,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'fill',\n        6,\n        244,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        244,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        245,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        246,\n        const prefix0.ContainedReflectable(),\n        23,\n        116,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        246,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        247,\n        const prefix0.ContainedReflectable(),\n        23,\n        68,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        247,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'length',\n        134348806,\n        248,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'generator',\n        134217734,\n        248,\n        const prefix0.ContainedReflectable(),\n        -1,\n        117,\n        117,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        248,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'elements',\n        151126022,\n        249,\n        const prefix0.ContainedReflectable(),\n        23,\n        116,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        239,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        240,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'newLength',\n        134348806,\n        242,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        250,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'invocation',\n        134348806,\n        251,\n        const prefix0.ContainedReflectable(),\n        13,\n        13,\n        13,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        257,\n        const prefix0.ContainedReflectable(),\n        20,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        258,\n        const prefix0.ContainedReflectable(),\n        20,\n        20,\n        20,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        134348806,\n        271,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        278,\n        const prefix0.ContainedReflectable(),\n        22,\n        118,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67239942,\n        280,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        281,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        282,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        283,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        6,\n        283,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'convert',\n        134217734,\n        284,\n        const prefix0.ContainedReflectable(),\n        -1,\n        119,\n        119,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'newEntries',\n        151126022,\n        285,\n        const prefix0.ContainedReflectable(),\n        23,\n        81,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        286,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'update',\n        134217734,\n        286,\n        const prefix0.ContainedReflectable(),\n        -1,\n        120,\n        120,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'ifAbsent',\n        67121158,\n        286,\n        const prefix0.ContainedReflectable(),\n        -1,\n        121,\n        121,\n        const <int>[],\n        const [],\n        null,\n        #ifAbsent,\n      ),\n      r.ParameterMirrorImpl(\n        r'update',\n        134217734,\n        287,\n        const prefix0.ContainedReflectable(),\n        -1,\n        122,\n        122,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        288,\n        const prefix0.ContainedReflectable(),\n        -1,\n        123,\n        123,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        6,\n        289,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'ifAbsent',\n        134217734,\n        289,\n        const prefix0.ContainedReflectable(),\n        -1,\n        124,\n        124,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        290,\n        const prefix0.ContainedReflectable(),\n        22,\n        84,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67239942,\n        291,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'action',\n        134217734,\n        293,\n        const prefix0.ContainedReflectable(),\n        -1,\n        125,\n        125,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        301,\n        const prefix0.ContainedReflectable(),\n        22,\n        126,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        302,\n        const prefix0.ContainedReflectable(),\n        22,\n        84,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        303,\n        const prefix0.ContainedReflectable(),\n        22,\n        126,\n        22,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        305,\n        const prefix0.ContainedReflectable(),\n        23,\n        116,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'key',\n        67121158,\n        305,\n        const prefix0.ContainedReflectable(),\n        -1,\n        127,\n        127,\n        const <int>[],\n        const [],\n        null,\n        #key,\n      ),\n      r.ParameterMirrorImpl(\n        r'value',\n        67121158,\n        305,\n        const prefix0.ContainedReflectable(),\n        -1,\n        128,\n        128,\n        const <int>[],\n        const [],\n        null,\n        #value,\n      ),\n      r.ParameterMirrorImpl(\n        r'keys',\n        151126022,\n        306,\n        const prefix0.ContainedReflectable(),\n        23,\n        82,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'values',\n        151126022,\n        306,\n        const prefix0.ContainedReflectable(),\n        23,\n        83,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'entries',\n        151126022,\n        307,\n        const prefix0.ContainedReflectable(),\n        23,\n        81,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'source',\n        151126022,\n        308,\n        const prefix0.ContainedReflectable(),\n        23,\n        129,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'other',\n        151126022,\n        310,\n        const prefix0.ContainedReflectable(),\n        23,\n        87,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'toElement',\n        134217734,\n        311,\n        const prefix0.ContainedReflectable(),\n        -1,\n        130,\n        130,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        312,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'toElements',\n        134217734,\n        314,\n        const prefix0.ContainedReflectable(),\n        -1,\n        132,\n        132,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'element',\n        67239942,\n        315,\n        const prefix0.ContainedReflectable(),\n        8,\n        8,\n        8,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'action',\n        134217734,\n        316,\n        const prefix0.ContainedReflectable(),\n        -1,\n        133,\n        133,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'combine',\n        134217734,\n        317,\n        const prefix0.ContainedReflectable(),\n        -1,\n        134,\n        134,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'initialValue',\n        6,\n        318,\n        const prefix0.ContainedReflectable(),\n        -1,\n        -1,\n        -1,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'combine',\n        134217734,\n        318,\n        const prefix0.ContainedReflectable(),\n        -1,\n        135,\n        135,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        319,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'separator',\n        134354950,\n        320,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        321,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'growable',\n        134363142,\n        322,\n        const prefix0.ContainedReflectable(),\n        14,\n        14,\n        14,\n        const <int>[],\n        const [],\n        null,\n        #growable,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        324,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        325,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        326,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        327,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        328,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        328,\n        const prefix0.ContainedReflectable(),\n        -1,\n        136,\n        136,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        329,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        329,\n        const prefix0.ContainedReflectable(),\n        -1,\n        136,\n        136,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'test',\n        134217734,\n        330,\n        const prefix0.ContainedReflectable(),\n        -1,\n        131,\n        131,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'orElse',\n        67121158,\n        330,\n        const prefix0.ContainedReflectable(),\n        -1,\n        136,\n        136,\n        const <int>[],\n        const [],\n        null,\n        #orElse,\n      ),\n      r.ParameterMirrorImpl(\n        r'index',\n        134348806,\n        331,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        333,\n        const prefix0.ContainedReflectable(),\n        23,\n        116,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'leftDelimiter',\n        134354950,\n        333,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'rightDelimiter',\n        134354950,\n        333,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'iterable',\n        151126022,\n        334,\n        const prefix0.ContainedReflectable(),\n        23,\n        116,\n        23,\n        null,\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'leftDelimiter',\n        134354950,\n        334,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'rightDelimiter',\n        134354950,\n        334,\n        const prefix0.ContainedReflectable(),\n        15,\n        15,\n        15,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'count',\n        134348806,\n        343,\n        const prefix0.ContainedReflectable(),\n        16,\n        16,\n        16,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n      r.ParameterMirrorImpl(\n        r'generator',\n        67112966,\n        343,\n        const prefix0.ContainedReflectable(),\n        -1,\n        137,\n        137,\n        const <int>[],\n        const [],\n        null,\n        null,\n      ),\n    ],\n    <Type>[\n      prefix1.LowerPokemon,\n      prefix1.Pokemon,\n      prefix1.KantoPokemon,\n      prefix1.Artist,\n      prefix1.Album,\n      prefix1.AlbumLength,\n      prefix1.PokemonType,\n      prefix0.ContainedReflectable,\n      Object,\n      Enum,\n      prefix2.Reflectable,\n      prefix3.ReflectableImpl,\n      prefix4.ReflectableBase,\n      Invocation,\n      bool,\n      String,\n      int,\n      Type,\n      List,\n      prefix5.InstanceMirror,\n      prefix5.TypeMirror,\n      prefix5.LibraryMirror,\n      Map,\n      Iterable,\n      prefix6.ReflectCapability,\n      Deprecated,\n      const m.TypeValue<Map<prefix2.Reflectable, prefix3.ReflectorData>>().type,\n      prefix3.ReflectorData,\n      const m.TypeValue<Map<Symbol, String>>().type,\n      Symbol,\n      prefix6.InstanceInvokeCapability,\n      prefix6.StaticInvokeCapability,\n      prefix6.TopLevelInvokeCapability,\n      prefix6.NewInstanceCapability,\n      prefix6.MetadataCapability,\n      prefix6.TypeCapability,\n      prefix6.TypeRelationsCapability,\n      const r.FakeType(r'reflectable.capability._ReflectedTypeCapability'),\n      prefix6.LibraryCapability,\n      prefix6.DeclarationsCapability,\n      prefix6.UriCapability,\n      prefix6.LibraryDependenciesCapability,\n      prefix6.InvokingCapability,\n      prefix6.TypingCapability,\n      const r.FakeType(r'reflectable.capability._DelegateCapability'),\n      const r.FakeType(r'reflectable.capability._SubtypeQuantifyCapability'),\n      prefix6.SuperclassQuantifyCapability,\n      prefix6.TypeAnnotationQuantifyCapability,\n      const r.FakeType(\n        r'reflectable.capability._CorrespondingSetterQuantifyCapability',\n      ),\n      const r.FakeType(r'reflectable.capability._AdmitSubtypeCapability'),\n      const m.TypeValue<List<prefix1.PokemonType>>().type,\n      const m.TypeValue<Set<prefix2.Reflectable>>().type,\n      Set,\n      const m.TypeValue<List<prefix6.ReflectCapability>>().type,\n      Uri,\n      const m.TypeValue<Map<Uri, prefix5.LibraryMirror>>().type,\n      prefix5.ClassMirror,\n      const m.TypeValue<Iterable<prefix5.ClassMirror>>().type,\n      const m.TypeValue<List<Type>>().type,\n      const m.TypeValue<List<dynamic>>().type,\n      const m.TypeValue<Map<Symbol, dynamic>>().type,\n      const m.TypeValue<List<String>>().type,\n      const m.TypeValue<List<int>>().type,\n      Runes,\n      double,\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.List<R>'),\n      const r.FakeType(r'dart.core.List<E>'),\n      const r.FakeType(r'dart.core.Iterable<E>'),\n      const r.FakeType(r'dart.core.Map<int, E>'),\n      prefix5.TypeVariableMirror,\n      const m.TypeValue<List<prefix5.TypeVariableMirror>>().type,\n      const m.TypeValue<List<prefix5.TypeMirror>>().type,\n      prefix5.DeclarationMirror,\n      const m.TypeValue<Map<String, prefix5.DeclarationMirror>>().type,\n      prefix5.LibraryDependencyMirror,\n      const m.TypeValue<List<prefix5.LibraryDependencyMirror>>().type,\n      Null,\n      const r.FakeType(r'dart.core.Map<K2, V2>'),\n      const r.FakeType(r'dart.core.Map<RK, RV>'),\n      const r.FakeType(r'dart.core.Map<K2, V2>'),\n      const r.FakeType(r'dart.core.Iterable<MapEntry<K, V>>'),\n      const r.FakeType(r'dart.core.Iterable<K>'),\n      const r.FakeType(r'dart.core.Iterable<V>'),\n      const r.FakeType(r'dart.core.Map<K, V>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<R>'),\n      const r.FakeType(r'dart.core.Iterable<E>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const r.FakeType(r'dart.core.List<E>'),\n      const r.FakeType(r'dart.core.Set<E>'),\n      Set,\n      const r.FakeType(r'dart.core.Iterator<E>'),\n      Iterator,\n      prefix7.Reflector,\n      const m.TypeValue<Map<Symbol, dynamic>>().type,\n      prefix6.StringInvocationKind,\n      const m.TypeValue<Iterable<Object>>().type,\n      const m.TypeValue<List<prefix6.ReflectCapability>>().type,\n      const m.TypeValue<Iterable<Object>>().type,\n      const m.TypeValue<Map<Symbol, Object>>().type,\n      const m.TypeValue<Iterable<Type>>().type,\n      Pattern,\n      const m.TypeValue<String Function(Match)>().type,\n      const m.TypeValue<String Function(Match)>().type,\n      const m.TypeValue<String Function(String)>().type,\n      const m.TypeValue<Iterable<int>>().type,\n      const r.FakeType(r'dart.core.List<S>'),\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.List<T>'),\n      const r.FakeType(r'dart.core.Iterable<T>'),\n      const m.TypeValue<int Function(dynamic, dynamic)>().type,\n      prefix8.Random,\n      const m.TypeValue<bool Function(dynamic)>().type,\n      const m.TypeValue<Iterable<dynamic>>().type,\n      const m.TypeValue<dynamic Function(int)>().type,\n      const r.FakeType(r'dart.core.Map<K, V>'),\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<bool Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<void Function(dynamic, dynamic)>().type,\n      const m.TypeValue<Map<dynamic, dynamic>>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const r.FakeType(r'dart.core.Iterable<S>'),\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<bool Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic)>().type,\n      const m.TypeValue<void Function(dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function(dynamic, dynamic)>().type,\n      const m.TypeValue<dynamic Function()>().type,\n      const m.TypeValue<dynamic Function(int)>().type,\n    ],\n    25,\n    {\n      r'==': (dynamic instance) =>\n          (x) => instance == x,\n      r'toString': (dynamic instance) => instance.toString,\n      r'noSuchMethod': (dynamic instance) => instance.noSuchMethod,\n      r'hashCode': (dynamic instance) => instance.hashCode,\n      r'runtimeType': (dynamic instance) => instance.runtimeType,\n      r'pokemon': (dynamic instance) => instance.pokemon,\n      r'lowercaseName': (dynamic instance) => instance.lowercaseName,\n      r'name': (dynamic instance) => instance.name,\n      r'type': (dynamic instance) => instance.type,\n      r'lowerName': (dynamic instance) => instance.lowerName,\n      r'artist': (dynamic instance) => instance.artist,\n      r'title': (dynamic instance) => instance.title,\n      r'album': (dynamic instance) => instance.album,\n      r'totalLength': (dynamic instance) => instance.totalLength,\n      r'index': (dynamic instance) => instance.index,\n      r'capabilities': (dynamic instance) => instance.capabilities,\n      r'canReflect': (dynamic instance) => instance.canReflect,\n      r'reflect': (dynamic instance) => instance.reflect,\n      r'canReflectType': (dynamic instance) => instance.canReflectType,\n      r'reflectType': (dynamic instance) => instance.reflectType,\n      r'findLibrary': (dynamic instance) => instance.findLibrary,\n      r'libraries': (dynamic instance) => instance.libraries,\n      r'annotatedClasses': (dynamic instance) => instance.annotatedClasses,\n      r'typeArguments': (dynamic instance) => instance.typeArguments,\n      r'isAccessor': (dynamic instance) => instance.isAccessor,\n      r'&': (dynamic instance) =>\n          (x) => instance & x,\n      r'|': (dynamic instance) =>\n          (x) => instance | x,\n      r'^': (dynamic instance) =>\n          (x) => instance ^ x,\n      r'cast': (dynamic instance) => instance.cast,\n      r'followedBy': (dynamic instance) => instance.followedBy,\n      r'map': (dynamic instance) => instance.map,\n      r'where': (dynamic instance) => instance.where,\n      r'whereType': (dynamic instance) => instance.whereType,\n      r'expand': (dynamic instance) => instance.expand,\n      r'contains': (dynamic instance) => instance.contains,\n      r'forEach': (dynamic instance) => instance.forEach,\n      r'reduce': (dynamic instance) => instance.reduce,\n      r'fold': (dynamic instance) => instance.fold,\n      r'every': (dynamic instance) => instance.every,\n      r'join': (dynamic instance) => instance.join,\n      r'any': (dynamic instance) => instance.any,\n      r'toList': (dynamic instance) => instance.toList,\n      r'toSet': (dynamic instance) => instance.toSet,\n      r'take': (dynamic instance) => instance.take,\n      r'takeWhile': (dynamic instance) => instance.takeWhile,\n      r'skip': (dynamic instance) => instance.skip,\n      r'skipWhile': (dynamic instance) => instance.skipWhile,\n      r'firstWhere': (dynamic instance) => instance.firstWhere,\n      r'lastWhere': (dynamic instance) => instance.lastWhere,\n      r'singleWhere': (dynamic instance) => instance.singleWhere,\n      r'elementAt': (dynamic instance) => instance.elementAt,\n      r'length': (dynamic instance) => instance.length,\n      r'isEmpty': (dynamic instance) => instance.isEmpty,\n      r'isNotEmpty': (dynamic instance) => instance.isNotEmpty,\n      r'first': (dynamic instance) => instance.first,\n      r'last': (dynamic instance) => instance.last,\n      r'single': (dynamic instance) => instance.single,\n    },\n    {},\n    <m.LibraryMirror>[\n      r.LibraryMirrorImpl(\n        r'',\n        Uri.parse('asset:angel3_container_generator/test/reflector_test.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[43, 44, 45],\n        {\n          r'main': () => prefix1.main,\n          r'returnVoidFromAFunction': () => prefix1.returnVoidFromAFunction,\n          r'testReflector': () => prefix1.testReflector,\n        },\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'',\n        Uri.parse(\n          'package:angel3_container_generator/angel3_container_generator.dart',\n        ),\n        const prefix0.ContainedReflectable(),\n        const <int>[0],\n        {r'contained': () => prefix0.contained},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'dart.core',\n        Uri.parse(r'reflectable://2/library dart:core'),\n        const prefix0.ContainedReflectable(),\n        const <int>[1, 2, 47, 48, 49],\n        {\n          r'deprecated': () => deprecated,\n          r'override': () => override,\n          r'identical': () => identical,\n          r'identityHashCode': () => identityHashCode,\n          r'print': () => print,\n        },\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.reflectable',\n        Uri.parse('package:reflectable/reflectable.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.src.reflectable_builder_based',\n        Uri.parse('package:reflectable/src/reflectable_builder_based.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[3, 4, 5, 57],\n        {\n          r'pleaseInitializeMessage': () => prefix3.pleaseInitializeMessage,\n          r'data': () => prefix3.data,\n          r'memberSymbolMap': () => prefix3.memberSymbolMap,\n          r'reflectors': () => prefix3.reflectors,\n        },\n        {\n          r'data=': (dynamic value) => prefix3.data = value,\n          r'memberSymbolMap=': (dynamic value) =>\n              prefix3.memberSymbolMap = value,\n        },\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.src.reflectable_base',\n        Uri.parse('package:reflectable/src/reflectable_base.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.mirrors',\n        Uri.parse('package:reflectable/mirrors.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[],\n        {},\n        {},\n        const [],\n        null,\n      ),\n      r.LibraryMirrorImpl(\n        r'reflectable.capability',\n        Uri.parse('package:reflectable/capability.dart'),\n        const prefix0.ContainedReflectable(),\n        const <int>[\n          6,\n          7,\n          8,\n          9,\n          10,\n          11,\n          12,\n          13,\n          14,\n          15,\n          16,\n          17,\n          18,\n          19,\n          20,\n          21,\n          22,\n          23,\n          24,\n          25,\n          26,\n          58,\n          59,\n          60,\n          61,\n          62,\n        ],\n        {\n          r'instanceInvokeCapability': () => prefix6.instanceInvokeCapability,\n          r'staticInvokeCapability': () => prefix6.staticInvokeCapability,\n          r'topLevelInvokeCapability': () => prefix6.topLevelInvokeCapability,\n          r'newInstanceCapability': () => prefix6.newInstanceCapability,\n          r'metadataCapability': () => prefix6.metadataCapability,\n          r'typeCapability': () => prefix6.typeCapability,\n          r'typeRelationsCapability': () => prefix6.typeRelationsCapability,\n          r'reflectedTypeCapability': () => prefix6.reflectedTypeCapability,\n          r'libraryCapability': () => prefix6.libraryCapability,\n          r'declarationsCapability': () => prefix6.declarationsCapability,\n          r'uriCapability': () => prefix6.uriCapability,\n          r'libraryDependenciesCapability': () =>\n              prefix6.libraryDependenciesCapability,\n          r'invokingCapability': () => prefix6.invokingCapability,\n          r'typingCapability': () => prefix6.typingCapability,\n          r'delegateCapability': () => prefix6.delegateCapability,\n          r'subtypeQuantifyCapability': () => prefix6.subtypeQuantifyCapability,\n          r'superclassQuantifyCapability': () =>\n              prefix6.superclassQuantifyCapability,\n          r'typeAnnotationQuantifyCapability': () =>\n              prefix6.typeAnnotationQuantifyCapability,\n          r'typeAnnotationDeepQuantifyCapability': () =>\n              prefix6.typeAnnotationDeepQuantifyCapability,\n          r'correspondingSetterQuantifyCapability': () =>\n              prefix6.correspondingSetterQuantifyCapability,\n          r'admitSubtypeCapability': () => prefix6.admitSubtypeCapability,\n          r'reflectableNoSuchInvokableError': () =>\n              prefix6.reflectableNoSuchInvokableError,\n          r'reflectableNoSuchMethodError': () =>\n              prefix6.reflectableNoSuchMethodError,\n          r'reflectableNoSuchGetterError': () =>\n              prefix6.reflectableNoSuchGetterError,\n          r'reflectableNoSuchSetterError': () =>\n              prefix6.reflectableNoSuchSetterError,\n          r'reflectableNoSuchConstructorError': () =>\n              prefix6.reflectableNoSuchConstructorError,\n        },\n        {},\n        const [],\n        null,\n      ),\n    ],\n    [],\n  ),\n};\n\nfinal _memberSymbolMap = null;\n\nvoid initializeReflectable() {\n  r.data = _data;\n  r.memberSymbolMap = _memberSymbolMap;\n}\n"
  },
  {
    "path": "packages/file_service/.gitignore",
    "content": "# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n.dart_tool\n"
  },
  {
    "path": "packages/file_service/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/file_service/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n* Updated repository link\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.0\n\n* Upgraded to `lints` linter\n\n## 4.0.2\n\n* Updated README\n* Removed redundant code\n\n## 4.0.1\n\n* Updated package description\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.0.1\n\n* Pass everything through `_jsonifyToSD` when returning responses.\n\n## 2.0.0\n\n* Dart/Angel 2 update.\n* Remove `package:dart2_constant`\n* Update `package:file` to `^5.0.0`.\n\n## 1.1.2\n\n* Added tests, because tests.\n\n## 1.1.1\n\n* Dart 2 fixes.\n\n## 1.1.0+2\n\n* `create` now uses the underlying store, instead of manually patching\n\n## 1.1.0+1\n\n* Analyzer nitpick for pana\n\n## 1.1.0\n\n* Updated to framework v1.1.x\n* Use `package:file`\n* Allow a custom `store`\n"
  },
  {
    "path": "packages/file_service/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/file_service/README.md",
    "content": "# File Service for Angel3\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_file_service?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/file_service/LICENSE)\n\nAngel service that persists data to a file on disk, stored as a JSON list. It uses a simple mutex to prevent race conditions, and caches contents in memory until changes are made.\n\nThe file will be created on read/write, if it does not already exist.\n\nThis package is useful in development, as it prevents you from having to install an external database to run your server.\n\nWhen running a multi-threaded server, there is no guarantee that file operations will be mutually excluded. Thus, try to only use this one a single-threaded server if possible, or one with very low load.\n\nWhile not necessarily *slow*, this package makes no promises about performance.\n\n## Usage\n\n```dart\nconfigureServer(Angel app) async {\n  // Just like a normal service\n  app.use(\n    '/api/todos',\n    JsonFileService(\n      const LocalFileSystem().file('todos_db.json')\n    ),\n  );\n}\n```\n"
  },
  {
    "path": "packages/file_service/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/file_service/example/main.dart",
    "content": "import 'package:angel3_file_service/angel3_file_service.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:file/local.dart';\n\nvoid configureServer(Angel app) async {\n  // Just like a normal service\n  app.use(\n    '/api/todos',\n    JsonFileService(const LocalFileSystem().file('todos_db.json')),\n  );\n}\n"
  },
  {
    "path": "packages/file_service/lib/angel3_file_service.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:file/file.dart';\nimport 'package:pool/pool.dart';\n\n/// Persists in-memory changes to a file on disk.\nclass JsonFileService extends Service<String, Map<String, dynamic>> {\n  FileStat? _lastStat;\n  final Pool _mutex = Pool(1);\n  late MapService _store;\n  final File file;\n\n  JsonFileService(\n    this.file, {\n    bool allowRemoveAll = false,\n    bool allowQuery = true,\n    MapService? store,\n  }) {\n    _store =\n        store ??\n        MapService(\n          allowRemoveAll: allowRemoveAll == true,\n          allowQuery: allowQuery != false,\n        );\n  }\n\n  Map<String, dynamic> _coerceStringDynamic(Map m) {\n    return m.keys.fold<Map<String, dynamic>>(\n      <String, dynamic>{},\n      (out, k) => out..[k.toString()] = m[k],\n    );\n  }\n\n  Future _load() {\n    return _mutex.withResource(() async {\n      if (!await file.exists()) await file.writeAsString(json.encode([]));\n      var stat = await file.stat();\n      //\n\n      if (_lastStat == null ||\n          stat.modified.millisecondsSinceEpoch >\n              _lastStat!.modified.millisecondsSinceEpoch) {\n        _lastStat = stat;\n\n        var contents = await file.readAsString();\n\n        var list = json.decode(contents) as Iterable;\n        _store.items.clear(); // Clear exist in-memory copy\n        _store.items.addAll(\n          list.map((x) => _coerceStringDynamic(_revive(x) as Map)),\n        ); // Insert all new entries\n      }\n    });\n  }\n\n  Future<File> _save() {\n    return _mutex.withResource(() {\n      return file.writeAsString(\n        json.encode(_store.items.map(_jsonify).toList()),\n      );\n    });\n  }\n\n  @override\n  Future close() async {\n    _store.close();\n  }\n\n  @override\n  Future<List<Map<String, dynamic>>> index([\n    Map<String, dynamic>? params,\n  ]) async => _load()\n      .then((_) => _store.index(params))\n      .then((it) => it.map(_jsonifyToSD).toList());\n\n  @override\n  Future<Map<String, dynamic>> read(id, [Map<String, dynamic>? params]) =>\n      _load().then((_) => _store.read(id, params)).then(_jsonifyToSD);\n\n  @override\n  Future<Map<String, dynamic>> create(\n    data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    await _load();\n    var created = await _store.create(data, params).then(_jsonifyToSD);\n    await _save();\n    return created;\n  }\n\n  @override\n  Future<Map<String, dynamic>> remove(\n    id, [\n    Map<String, dynamic>? params,\n  ]) async {\n    await _load();\n    var r = await _store.remove(id, params).then(_jsonifyToSD);\n    await _save();\n    return r;\n  }\n\n  @override\n  Future<Map<String, dynamic>> update(\n    id,\n    data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    await _load();\n    var r = await _store.update(id, data, params).then(_jsonifyToSD);\n    await _save();\n    return r;\n  }\n\n  @override\n  Future<Map<String, dynamic>> modify(\n    id,\n    data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    await _load();\n    var r = await _store.update(id, data, params).then(_jsonifyToSD);\n    await _save();\n    return r;\n  }\n}\n\ndynamic _safeForJson(dynamic x) {\n  if (x is DateTime) {\n    return x.toIso8601String();\n  } else if (x is Map) {\n    return _jsonify(x);\n  } else if (x is num || x is String || x is bool || x == null) {\n    return x;\n  } else if (x is Iterable) {\n    return x.map(_safeForJson).toList();\n  } else {\n    return x.toString();\n  }\n}\n\nMap _jsonify(Map map) {\n  return map.keys.fold<Map>({}, (out, k) => out..[k] = _safeForJson(map[k]));\n}\n\nMap<String, dynamic> _jsonifyToSD(Map<String, dynamic> map) =>\n    _jsonify(map).cast<String, dynamic>();\n\ndynamic _revive(dynamic x) {\n  if (x is Map) {\n    return x.keys.fold<Map<String, dynamic>>(\n      {},\n      (out, k) => out..[k.toString()] = _revive(x[k]),\n    );\n  } else if (x is Iterable) {\n    return x.map(_revive).toList();\n  } else if (x is String) {\n    try {\n      return DateTime.parse(x);\n    } catch (e) {\n      return x;\n    }\n  } else {\n    return x;\n  }\n}\n"
  },
  {
    "path": "packages/file_service/melos_angel3_file_service.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/file_service/pubspec.yaml",
    "content": "name: angel3_file_service\nversion: 8.5.0\ndescription: Angel service that persists data to a file on disk, stored as a JSON list.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/file_service\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  file: ^7.0.0\n  pool: ^1.5.0\ndev_dependencies:\n  test: ^1.24.0\n  lints: ^6.0.0\n\n"
  },
  {
    "path": "packages/file_service/test/all_test.dart",
    "content": "import 'package:angel3_file_service/angel3_file_service.dart';\nimport 'package:file/file.dart';\nimport 'package:file/memory.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  MemoryFileSystem fs;\n  File dbFile;\n  late JsonFileService service;\n\n  setUp(() async {\n    fs = MemoryFileSystem();\n    dbFile = fs.file('db.json');\n    service = JsonFileService(dbFile);\n\n    await dbFile.writeAsString('''\n    [\n      {\"id\": \"0\", \"foo\": \"bar\"},\n      {\"id\": \"1\", \"foo\": \"baz\"},\n      {\"id\": \"2\", \"foo\": \"quux\"}\n    ]\n    ''');\n  });\n\n  tearDown(() => service.close());\n\n  test('index no params', () async {\n    expect(await service.index(), [\n      {'id': '0', 'foo': 'bar'},\n      {'id': '1', 'foo': 'baz'},\n      {'id': '2', 'foo': 'quux'},\n    ]);\n  });\n\n  test('index with query', () async {\n    expect(\n      await service.index({\n        'query': {'foo': 'bar'},\n      }),\n      [\n        {'id': '0', 'foo': 'bar'},\n      ],\n    );\n  });\n\n  test('read', () async {\n    expect(await service.read('2'), {'id': '2', 'foo': 'quux'});\n  });\n\n  test('modify', () async {\n    await service.modify('2', {'baz': 'quux'});\n    expect(await service.read('2'), containsPair('baz', 'quux'));\n  });\n\n  test('update', () async {\n    await service.update('2', {'baz': 'quux'});\n    expect(await service.read('2'), containsPair('baz', 'quux'));\n    expect(await service.read('2'), isNot(containsPair('foo', 'quux')));\n  });\n\n  test('delete', () async {\n    await service.remove('2');\n    expect(await service.index(), [\n      {'id': '0', 'foo': 'bar'},\n      {'id': '1', 'foo': 'baz'},\n    ]);\n  });\n}\n"
  },
  {
    "path": "packages/framework/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/framework/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.7.0\n\n* Require Dart >= 3.11\n\n## 8.6.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.5.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated `mime` to 2.0.0\n* Fixed res.json() will cause 'Bad state: Cannot modify a closed response.' error.\n\n## 8.4.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.3.2\n\n* Updated README\n\n## 8.3.1\n\n* Updated repository link\n\n## 8.3.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.2.0\n\n* Add `addResponseHeader` to `AngelHttp` to add headers to HTTP default response\n* Add `removeResponseHeader` to `AngelHttp` to remove headers from HTTP default response\n\n## 8.1.1\n\n* Updated broken image on README\n\n## 8.1.0\n\n* Updated `uuid` to 4.0.0\n\n## 8.0.0\n\n* Require Dart >= 3.0\n* Updated `http` to 1.0.0\n\n## 7.0.4\n\n* Updated `Expose` fields to non-nullable\n* Updated `Controller` to use non-nullable field\n\n## 7.0.3\n\n* Fixed issue #83. Allow Http request to return null headers instead of throwing an exception.\n\n## 7.0.2\n\n* Added performance benchmark to README\n\n## 7.0.1\n\n* Fixed `BytesBuilder` warnings\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n* Updated `container` to non nullable\n* Updated `angel` to non nullable\n* Updated `logger` to non nullable\n* Refactored error handler\n\n## 5.0.0\n\n* Skipped release\n\n## 4.2.4\n\n* Fixed issue 48. Log not working in development\n\n## 4.2.3\n\n* Fixed `res.json()` throwing bad state exception\n\n## 4.2.2\n\n* Added `Date` to response header\n* Updated `Server: Angel3` response header\n\n## 4.2.1\n\n* Updated `package:angel3_container`\n\n## 4.2.0\n\n* Updated to `package:belatuk_combinator`\n* Updated to `package:belatuk_merge_map`\n* Updated linter to `package:lints`\n\n## 4.1.3\n\n* Updated README\n\n## 4.1.2\n\n* Updated README\n* Fixed NNBD issues\n  \n## 4.1.1\n\n* Updated link to `Angel3` home page\n* Fixed pedantic warnings\n\n## 4.1.0\n\n* Replaced `http_server` with `belatuk_http_server`\n\n## 4.0.4\n\n* Fixed response returning incorrect status code\n\n## 4.0.3\n\n* Fixed \"Primitive after parsed param injection\" test case\n* Fixed \"Cannot remove all unless explicitly set\" test case\n* Fixed \"null\" test case\n\n## 4.0.2\n\n* Updated README\n\n## 4.0.1\n\n* Updated README\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.1.1\n\n* `AngelHttp.uri` now returns an empty `Uri` if the server is not listening.\n\n## 2.1.0\n\n* This release was originally planned to be `2.0.5`, but it adds several features, and has\ntherefore been bumped to `2.1.0`.\n* Fix a new (did not appear before 2.6/2.7) type error causing compilation to fail.\n<https://github.com/angel-dart/framework/issues/249>\n\n## 2.0.5-beta\n\n* Make `@Expose()` in `Controller` optional. <https://github.com/angel-dart/angel/issues/107>\n* Add `allowHttp1` to `AngelHttp2` constructors. <https://github.com/angel-dart/angel/issues/108>\n* Add `deserializeBody` and `decodeBody` to `RequestContext`. <https://github.com/angel-dart/angel/issues/109>\n* Add `HostnameRouter`, which allows for routing based on hostname. <https://github.com/angel-dart/angel/issues/110>\n* Default to using `ThrowingReflector`, instead of `EmptyReflector`. This will give a more descriptive\nerror when trying to use controllers, etc. without reflection enabled.\n* `mountController` returns the mounted controller.\n\n## 2.0.4+1\n\n* Run `Controller.configureRoutes` before mounting `@Expose` routes.\n* Make `Controller.configureServer` always return a `Future`.\n\n## 2.0.4\n\n* Prepare for Dart SDK change to `Stream<List<int>>` that are now\n  `Stream<Uint8List>`.\n* Accept any content type if accept header is missing. See\n[this PR](https://github.com/angel-dart/framework/pull/239).\n\n## 2.0.3\n\n* Patch up a bug caused by an upstream change to Dart's stream semantics.\nSee more: <https://github.com/angel-dart/angel/issues/106#issuecomment-499564485>\n\n## 2.0.2+1\n\n* Fix a bug in the implementation of `Controller.applyRoutes`.\n\n## 2.0.2\n\n* Make `ResponseContext` *explicitly* implement `StreamConsumer` (though technically it already did???)\n* Split `Controller.configureServer` to create `Controller.applyRoutes`.\n\n## 2.0.1\n\n* Tracked down a bug in `Driver.runPipeline` that allowed fallback\nhandlers to run, even after the response was closed.\n* Add `RequestContext.shutdownHooks`.\n* Call `RequestContext.close` in `Driver.sendResponse`.\n* AngelConfigurer is now `FutureOr<void>`, instead of just `FutureOr`.\n* Use a `Container.has<Stopwatch>` check in `Driver.sendResponse`.\n* Remove unnecessary `new` and `const`.\n\n## 2.0.0\n\n* Angel 2! :angel: :rocket:\n\n## 2.0.0-rc.10\n\n* Fix an error that prevented `AngelHttp2.custom` from working properly.\n* Add `startSharedHttp2`.\n\n## 2.0.0-rc.9\n\n* Fix some bugs in the `HookedService` implementation that skipped\nthe outputs of `before` events.\n\n## 2.0.0-rc.8\n\n* Fix `MapService` flaw where clients could remove all records, even if `allowRemoveAll` were `false`.\n\n## 2.0.0-rc.7\n\n* `AnonymousService` can override `readData`.\n* `Service.map` now overrides `readData`.\n* `HookedService.readData` forwards to `inner`.\n\n## 2.0.0-rc.6\n\n* Make `redirect` and `download` methods asynchronous.\n\n## 2.0.0-rc.5\n\n* Make `serializer` `FutureOr<String> Function(Object)`.\n* Make `ResponseContext.serialize` return `Future<bool>`.\n\n## 2.0.0-rc.4\n\n* Support resolution of asynchronous injections in controllers and `ioc`.\n* Inject `RequestContext` and `ResponseContext` into requests.\n\n## 2.0.0-rc.3\n\n* `MapService.modify` was not actually modifying items.\n\n## 2.0.0-rc.2\n\n* Fixes Pub analyzer lints (see `angel_route@3.0.6`)\n\n## 2.0.0-rc.1\n\n* Fix logic error that allowed content to be written to streaming responses after `close` was closed.\n\n## 2.0.0-rc.0\n\n* Log a warning when no `reflector` is provided.\n* Add `AngelEnvironment` class.\n  * Add `Angel.environment`.\n  * Deprecated `app.isProduction` in favor of `app.environment.isProduction`.\n* Allow setting of `bodyAsObject`, `bodyAsMap`, or `bodyAsList` **exactly once**.\n* Resolve named singletons in `resolveInjection`.\n* Fix a bug where `Service.parseId<double>` would attempt to parse an `int`.\n* Replace as Data cast in Service.dart with a method that throws a 400 on error.\n\n## 2.0.0-alpha.24\n\n* Add `AngelEnv` class to `core`.\n* Deprecate `Angel.isProduction`, in favor of `AngelEnv`.\n\n## 2.0.0-alpha.23\n\n* `ResponseContext.render` sets `charset` to `utf8` in `contentType`.\n\n## 2.0.0-alpha.22\n\n* Update pipeline handling mechanism, and inject a `MiddlewarePipelineIterator`.\n  * This allows routes to know where in the resolution process they exist, at runtime.\n\n## 2.0.0-alpha.21\n\n* Update for `angel_route@3.0.4` compatibility.\n* Add `readAsBytes` and `readAsString` to `UploadedFile`.\n* URI-decode path components in HTTP2.\n\n## 2.0.0-alpha.20\n\n* Inject the `MiddlewarePipeline` into requests.\n\n## 2.0.0-alpha.19\n\n* `parseBody` checks for null content type, and throws a `400` if none was given.\n* Add `ResponseContext.contentLength`.\n* Update `streamFile` to set content length, and also to work on `HEAD` requests.\n\n## 2.0.0-alpha.18\n\n* Upgrade `http2` dependency.\n* Upgrade `uuid` dependency.\n* Fixed a bug that prevented body parsing from ever completing with `http2`.\n* Add `Providers.hashCode`.\n\n## 2.0.0-alpha.17\n\n* Revert the migration to `lumberjack` for now. In the future, when it's more\nstable, there'll be a conversion, perhaps.\n\n## 2.0.0-alpha.16\n\n* Use `package:lumberjack` for logging.\n\n## 2.0.0-alpha.15\n\n* Remove dependency on `body_parser`.\n* `RequestContext` now exposes a `Stream<List<int>> get body` getter.\n  * Calling `RequestContext.parseBody()` parses its contents.\n  * Added `bodyAsMap`, `bodyAsList`, `bodyAsObject`, and `uploadedFiles` to `RequestContext`.\n  * Removed `Angel.keepRawRequestBuffers` and anything that had to do with buffering request bodies.\n\n## 2.0.0-alpha.14\n\n* Patch `HttpResponseContext._openStream` to send content-length.\n\n## 2.0.0-alpha.13\n\n* Fixed a logic error in `HttpResponseContext` that prevented status codes from being sent.\n\n## 2.0.0-alpha.12\n\n* Remove `ResponseContext.sendFile`.\n* Add `Angel.mimeTypeResolver`.\n* Fix a bug where an unknown MIME type on `streamFile` would return a 500.\n\n## 2.0.0-alpha.11\n\n* Add `readMany` to `Service`.\n* Allow `ResponseContext.redirect` to take a `Uri`.\n* Add `Angel.mountController`.\n* Add `Angel.findServiceOf`.\n* Roll in HTTP/2. See `pkg:angel_framework/http2.dart`.\n\n## 2.0.0-alpha.10\n\n* All calls to `Service.parseId` are now affixed with the `<Id>` argument.\n* Added `uri` getter to `AngelHttp`.\n* The default for `parseQuery` now wraps query parameters in `Map<String, dynamic>.from`.\n  This resolves a bug in `package:angel_validate`.\n\n## 2.0.0-alpha.9\n\n* Add `Service.map`.\n\n## 2.0.0-alpha.8\n\n* No longer export HTTP-specific code from `angel_framework.dart`.\n  An import of `import 'package:angel_framework/http.dart';` will be necessary in most cases now.\n\n## 2.0.0-alpha.7\n\n* Force a tigher contract on services. They now must return `Data` on all\n  methods except for `index`, which returns a `List<Data>`.\n\n## 2.0.0-alpha.6\n\n* Allow passing a custom `Container` to `handleContained` and co.\n\n## 2.0.0-alpha.5\n\n* `MapService` methods now explicitly return `Map<String, dynamic>`.\n\n## 2.0.0-alpha.4\n\n* Renamed `waterfall` to `chain`.\n* Renamed `Routable.service` to `Routable.findService`.\n  * Also `Routable.findHookedService`.\n\n## 2.0.0-alpha.3\n\n* Added `<Id, Data>` type parameters to `Service`.\n* `HookedService` now follows suit, and takes a third parameter, pointing to the inner service.\n* `Routable.use` now uses the generic parameters added to `Service`.\n* Added generic usage to `HookedServiceListener`, etc.\n* All service methods take `Map<String, dynamic>` as `params` now.\n\n## 2.0.0-alpha.2\n\n* Added `ResponseContext.detach`.\n\n## 2.0.0-alpha.1\n\n* Removed `Angel.injectEncoders`.\n* Added `Providers.toJson`.\n* Moved `Providers.graphql` to `Providers.graphQL`.\n* `Angel.optimizeForProduction` no longer calls `preInject`,\n  as it does not need to.\n* Rename `ResponseContext.enableBuffer` to `ResponseContext.useBuffer`.\n\n## 2.0.0-alpha\n\n* Removed `random_string` dependency.\n* Moved reflection to `package:angel_container`.\n* Upgraded `package:file` to `5.0.0`.\n* `ResponseContext.sendFile` now uses `package:file`.\n* Abandon `ContentType` in favor of `MediaType`.\n* Changed view engine to use `Map<String, dynamic>`.\n* Remove dependency on `package:json_god` by default.\n* Remove dependency on `package:dart2_constant`.\n* Moved `lib/hooks.dart` into `package:angel_hooks`.\n* Moved `TypedService` into `package:angel_typed_service`.\n* Completely removed the `AngelBase` class.\n* Removed all `@deprecated` symbols.\n* `Service.toId` was renamed to `Service.parseId`; it also now uses its\n  single type argument to determine how to parse a value. \\* In addition, this method was also made `static`.\n* `RequestContext` and `ResponseContext` are now generic, and take a\n  single type argument pointing to the underlying request/response type,\n  respectively.\n* `RequestContext.io` and `ResponseContext.io` are now permanently\n  gone.\n* `HttpRequestContextImpl` and `HttpResponseContextImpl` were renamed to\n  `HttpRequestContext` and `HttpResponseContext`.\n* Lazy-parsing request bodies is now the default; `Angel.lazyParseBodies` was replaced\n  with `Angel.eagerParseRequestBodies`.\n* `Angel.storeOriginalBuffer` -> `Angel.storeRawRequestBuffers`.\n* The methods `lazyBody`, `lazyFiles`, and `lazyOriginalBuffer` on `ResponseContext` were all\n  replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, respectively.\n* Removed the synchronous equivalents of the above methods (`body`, `files`, and `originalBuffer`),\n  as well as `query`.\n* Removed `Angel.injections` and `RequestContext.injections`.\n* Removed `Angel.inject` and `RequestContext.inject`.\n* Removed a dependency on `package:pool`, which also meant removing `AngelHttp.throttle`.\n* Remove the `RequestMiddleware` typedef; from now on, one should use `ResponseContext.end`\n  exclusively to close responses.\n* `waterfall` will now only accept `RequestHandler`.\n* `Routable`, and all of its subclasses, now extend `Router<RequestHandler>`, and therefore only\n  take routes in the form of `FutureOr myFunc(RequestContext, ResponseContext res)`.\n* `@Middleware` now takes an `Iterable` of `RequestHandler`s.\n* `@Expose.path` now *must* be a `String`, not just any `Pattern`.\n* `@Expose.middleware` now takes `Iterable<RequestHandler>`, instead of just `List`.\n* `createDynamicHandler` was renamed to `ioc`, and is now used to run IoC-aware handlers in a\n  type-safe manner.\n* `RequestContext.params` is now a `Map<String, dynamic>`, rather than just a `Map`.\n* Removed `RequestContext.grab`.\n* Removed `RequestContext.properties`.\n* Removed the defunct `debug` property where it still existed.\n* `Routable.use` now only accepts a `Service`.\n* Removed `Angel.createZoneForRequest`.\n* Removed `Angel.defaultZoneCreator`.\n* Added all flags to the `Angel` constructor, ex. `Angel.eagerParseBodies`.\n* Fix a bug where synchronous errors in `handleRequest` would not be caught.\n* `AngelHttp.useZone` now defaults to `false`.\n* `ResponseContext` now starts in streaming mode by default; the response buffer is opt-in,\n  as in many cases it is unnecessary and slows down response time.\n* `ResponseContext.streaming` was replaced by `ResponseContext.isBuffered`.\n* Made `LockableBytesBuilder` public.\n* Removed the now-obsolete `ResponseContext.willCloseItself`.\n* Removed `ResponseContext.dispose`.\n* Removed the now-obsolete `ResponseContext.end`.\n* Removed the now-obsolete `ResponseContext.releaseCorrespondingRequest`.\n* `preInject` now takes a `Reflector` as its second argument.\n* `Angel.reflector` defaults to `const EmptyReflector()`, disabling\n  reflection out-of-the-box.\n"
  },
  {
    "path": "packages/framework/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/framework/README.md",
    "content": "# Angel3 Framework\n\n[![Angel3 Framework](../../angel3_logo.png)](https://github.com/dart-backend/angel)\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_framework?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/framework/LICENSE)\n[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos)\n\nAngel3 framework is a high-powered HTTP server with support for dependency injection, sophisticated routing, authentication, ORM, graphql etc. It is designed to keep the core minimal but extensible through a series of plugin packages. It won't dictate which features, databases or web templating engine to use. This flexibility enable Angel3 framework to grow with your application as new features can be added to handle the new use cases.\n\nThis package is the core package of [Angel3](https://github.com/dart-backend/angel). For more information, visit us at [Angel3 Website](https://angel3-framework.web.app).\n\n## Installation and Setup\n\n### (Option 1) Create a new project by cloning from boilerplate templates\n\n1. Download and install [Dart](https://dart.dev/get-dart)\n\n2. Clone one of the following starter projects:\n   * [Angel3 Basic Template](https://github.com/dukefirehawk/boilerplates/tree/v7/angel3-basic)\n   * [Angel3 ORM Template](https://github.com/dukefirehawk/boilerplates/tree/v7/angel3-orm)\n   * [Angel3 ORM MySQL Template](https://github.com/dukefirehawk/boilerplates/tree/v7/angel3-orm-mysql)\n   * [Angel3 Graphql Template](https://github.com/dukefirehawk/boilerplates/tree/v7/angel3-graphql)\n\n3. Run the project in development mode (*hot-reloaded* is enabled on file changes).\n\n   ```bash\n   dart --observe bin/dev.dart\n   ```\n\n4. Run the project in production mode (*hot-reloaded* is disabled).\n\n   ```bash\n   dart bin/prod.dart\n   ```\n\n5. Run as docker. Edit and build the image with the provided `Dockerfile` file.\n\n### (Option 2) Create a new project with Angel3 CLI\n\n1. Download and install [Dart](https://dart.dev/get-dart)\n\n2. Install the [Angel3 CLI](https://pub.dev/packages/angel3_cli):\n\n   ```bash\n   dart pub global activate angel3_cli\n   ```\n\n3. On terminal, create a new project:\n\n   ```bash\n   angel3 init hello\n   ```\n\n4. Run the project in development mode (*hot-reloaded* is enabled on file changes).\n\n   ```bash\n   dart --observe bin/dev.dart\n   ```\n\n5. Run the project in production mode (*hot-reloaded* is disabled).\n\n   ```bash\n   dart bin/prod.dart\n   ```\n\n6. Run as docker. Edit and build the image with the provided `Dockerfile` file.\n\n## Performance Benchmark\n\nThe performance benchmark can be found at\n\n[TechEmpower Framework Benchmarks Round 21](https://www.techempower.com/benchmarks/#section=data-r21&test=composite)\n\n### Migrating from Angel to Angel3\n\nCheck out [Migrating to Angel3](https://angel3-docs.dukefirehawk.com/migration/angel-2.x.x-to-angel3/migration-guide-3)\n\n## Donation & Support\n\nIf you like this project and interested in supporting its development, you can make a donation using the following services:\n\n* [![GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/dukefirehawk)\n* [paypal](https://paypal.me/dukefirehawk?country.x=MY&locale.x=en_US) service\n"
  },
  {
    "path": "packages/framework/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/framework/dev.key",
    "content": "-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIE5DAcBgoqhkiG9w0BDAEBMA4ECL7L6rj6uEHGAgIIAASCBMLbucyfqAkgCbhP\nxNSHYllPMAv/dsIjtnsBwepCXPGkCBCuOAw/2FaCHjN9hBqL5V7fkrKeaemhm2YE\nycPtlHJYPDf3kEkyMjdZ9rIY6kePGfQizs2uJPcXj4YPyQ4HsfVXpOicKfQrouf5\nMze9bGzeMN065q3iP4dYUMwHAyZYteXCsanQNHlqvsWli0W+H8St8fdsXefZhnv1\nqVatKWdNdWQ9t5MuljgNU2Vv56sHKEYXI0yLxk2QUMk8KlJfnmt8foYUsnPUXHmc\ngIjLKwwVkpdololnEHSNu0cEOUPowjgJru+uMpn7vdNl7TPEQ9jbEgdNg4JwoYzU\n0nao8WzjaSp7kzvZz0VFwKnk5AjstGvvuAWckADdq23QElbn/mF7AG1m/TBpYxzF\ngTt37UdndS/AcvVznWVVrRP5iTSIawdIwvqI4s7rqsoE0GCcak+RhchgAz2gWKkS\noODUo0JL6pPVbJ3l4ebbaO6c99nDVc8dViPtc1EkStJEJ2O4kI4xgLSCr4Y9ahKn\noAaoSkX7Xxq3aQm+BzqSpLjdGL8atsqR/YVOIHYIl3gThvP0NfZGx1xHyvO5mCdZ\nkHxSA7tKWxauZ3eQ2clbnzeRsl4El0WMHy/5K1ovene4v7sunmoXVtghBC8hK6eh\nzMO9orex2PNQ/VQC7HCvtytunOVx1lkSBoNo7hR70igg6rW9H7UyoAoBOwMpT1xa\nJ6V62nqruTKOqFNfur7aHJGpHGtDb5/ickHeYCyPTvmGp67u4wChzKReeg02oECe\nd1E5FKAcIa8s9TVOB6Z+HvTRNQZu2PsI6TJnjQRowvY9DAHiWTlJZBBY/pko3hxX\nTsIeybpvRdEHpDWv86/iqtw1hv9CUxS/8ZTWUgBo+osShHW79FeDASr9FC4/Zn76\nZDERTgV4YWlW/klVWcG2lFo7jix+OPXAB+ZQavLhlN1xdWBcIz1AUWjAM4hdPylW\nHCX4PB9CQIPl2E7F+Y2p6nMcMWSJVBi5UIH7E9LfaBguXSzMmTk2Fw5p1aOQ6wfN\ngoVAMVwi8ppAVs741PfHdZ295xMmK/1LCxz5DeAdD/tsA/SYfT753GotioDuC7im\nEyJ5JyvTr5I6RFFBuqt3NlUb3Hp16wP3B2x9DZiB6jxr0l341/NHgsyeBXkuIy9j\nON2mvpBPCJhS8kgWo3G0UyyKnx64tcgpGuSvZhGwPz843B6AbYyE6pMRfSWRMkMS\nYZYa+VNKhR4ixdj07ocFZEWLVjCH7kxkE8JZXKt8jKYmkWd0lS1QVjgaKlO6lRa3\nq6SPJkhW6pvqobvcqVNXwi1XuzpZeEbuh0B7OTekFTTxx5g9XeDl56M8SVQ1KEhT\nQ1t7H2Nba18WCB7cf+6PN0F0K0Jz1Kq7ZWaqEI/grX1m4RQuvNF5807sB/QKMO/Z\nGz3NXvHg5xTJRd/567lxPGkor0cE7qD1EZfmJ2HrBYXQ91bhgA7LToBuMZo6ZRXH\nQfsanjbP4FPLMiGdQigLjj3A35L/f4sQOOVac/sRaFnm7pzcxsMvyVU/YtvGcjYE\nxaOOVnamg661Wo0wksXoDjeSz/JIyyKO3Gwp1FSm2wGLjjy/Ehmqcqy8rvHuf07w\nAUukhVtTNn4=\n-----END ENCRYPTED PRIVATE KEY-----"
  },
  {
    "path": "packages/framework/dev.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDKTCCAhGgAwIBAgIJAOWmjTS+OnTEMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV\nBAMMDGludGVybWVkaWF0ZTAeFw0xNTA1MTgwOTAwNDBaFw0yMzA4MDQwOTAwNDBa\nMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\nAQoCggEBALlcwQJuzd+xH8QFgfJSn5tRlvhkldSX98cE7NiA602NBbnAVyUrkRXq\nNi75lgt0kwjYfA9z674m8WSVbgpLPintPCla9CYky1TH0keIs8Rz6cGWHryWEHiu\nEDuljQynu2b3sAFuHu9nfWurbJwZnFakBKpdQ9m4EyOZCHC/jHYY7HacKSXg1Cki\nwe2ca0BWDrcqy8kLy0dZ5oC6IZG8O8drAK8f3f44CRYw59D3sOKBrKXaabpvyEcb\nN7Wk2HDBVwHpUJo1reVwtbM8dhqQayYSD8oXnGpP3RQNu/e2rzlXRyq/BfcDY1JI\n7TbC4t/7/N4EcPSpGsTcSOC9A7FpzvECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglg\nhkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0O\nBBYEFCnwiEMMFZh7NhCr+qA8K0w4Q+AOMB8GA1UdIwQYMBaAFB0h1Evsaw2vfrmS\nYuoCTmC4EE6ZMA0GCSqGSIb3DQEBCwUAA4IBAQAcFmHMaXRxyoNaeOowQ6iQWoZd\nAUbvG7SHr7I6Pi2aqdqofsKWts7Ytm5WsS0M2nN+sW504houu0iCPeJJX8RQw2q4\nCCcNOs9IXk+2uMzlpocHpv+yYoUiD5DxgWh7eghQMLyMpf8FX3Gy4VazeuXznHOM\n4gE4L417xkDzYOzqVTp0FTyAPUv6G2euhNCD6TMru9REcRhYul+K9kocjA5tt2KG\nMH6y28LXbLyq4YJUxSUU9gY/xlnbbZS48KDqEcdYC9zjW9nQ0qS+XQuQuFIcwjJ5\nV4kAUYxDu6FoTpyQjgsrmBbZlKNxH7Nj4NDlcdJhp/zeSKHqWa5hSWjjKIxp\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAeqgAwIBAgIJAOWmjTS+OnTDMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV\nBAMMDXJvb3RhdXRob3JpdHkwHhcNMTUwNTE4MDkwMDQwWhcNMjMwODA0MDkwMDQw\nWjAXMRUwEwYDVQQDDAxpbnRlcm1lZGlhdGUwggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDSrAO1CoPvUllgLOzDm5nG0skDF7vh1DUgAIDVGz0ecD0JFbQx\nEF79pju/6MbtpTW2FYvRp11t/G7rGtX923ybOHY/1MNFQrdIvPlO1VV7IGKjoMwP\nDNeb0fIGjHoE9QxaDxR8NX8xQbItpsw+TUtRfc9SLkR+jaYJfVRoM21BOncZbSHE\nYKiZlEbpecB/+EtwVpgvl+8mPD5U07Fi4fp/lza3WXInXQPyiTVllIEJCt4PKmlu\nMocNaJOW38bysL7i0PzDpVZtOxLHOTaW68yF3FckIHNCaA7k1ABEEEegjFMmIao7\nB9w7A0jvr4jZVvNmui5Djjn+oJxwEVVgyf8LAgMBAAGjUDBOMB0GA1UdDgQWBBQd\nIdRL7GsNr365kmLqAk5guBBOmTAfBgNVHSMEGDAWgBRk81s9d0ZbiZhh44KckwPb\noTc0XzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBZQTK0plfdB5PC\ncC5icut4EmrByJa1RbU7ayuEE70e7hla6KVmVjVdCBGltI4jBYwfhKbRItHiAJ/8\nx+XZKBG8DLPFuDb7lAa1ObhAYF7YThUFPQYaBhfzKcWrdmWDBFpvNv6E0Mm364dZ\ne7Yxmbe5S4agkYPoxEzgEYmcUk9jbjdR6eTbs8laG169ljrECXfEU9RiAcqz5iSX\nNLSewqB47hn3B9qgKcQn+PsgO2j7M+rfklhNgeGJeWmy7j6clSOuCsIjWHU0RLQ4\n0W3SB/rpEAJ7fgQbYUPTIUNALSOWi/o1tDX2mXPRjBoxqAv7I+vYk1lZPmSzkyRh\nFKvRDxsW\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAzCCAeugAwIBAgIJAJ0MomS4Ck+8MA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV\nBAMMDXJvb3RhdXRob3JpdHkwHhcNMTUwNTE4MDkwMDQwWhcNMjMwODA0MDkwMDQw\nWjAYMRYwFAYDVQQDDA1yb290YXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAts1ijtBV92S2cOvpUMOSTp9c6A34nIGr0T5Nhz6XiqRVT+gv\ndQgmkdKJQjbvR60y6jzltYFsI2MpGVXY8h/oAL81D/k7PDB2aREgyBfTPAhBHyGw\nsiR+2xYt5b/Zs99q5RdRqQNzNpLPJriIKvUsRyQWy1UiG2s7pRXQeA8qB0XtJdCj\nkFIi+G2bDsaffspGeDOCqt7t+yqvRXfSES0c/l7DIHaiMbbp4//ZNML3RNgAjPz2\nhCezZ+wOYajOIyoSPK8IgICrhYFYxvgWxwbLDBEfC5B3jOQsySe10GoRAKZz1gBV\nDmgReu81tYJmdgkc9zknnQtIFdA0ex+GvZlfWQIDAQABo1AwTjAdBgNVHQ4EFgQU\nZPNbPXdGW4mYYeOCnJMD26E3NF8wHwYDVR0jBBgwFoAUZPNbPXdGW4mYYeOCnJMD\n26E3NF8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEATzkZ97K777uZ\nlQcduNX3ey4IbCiEzFA2zO5Blj+ilfIwNbZXNOgm/lqNvVGDYs6J1apJJe30vL3X\nJ+t2zsZWzzQzb9uIU37zYemt6m0fHrSrx/iy5lGNqt3HMfqEcOqSCOIK3PCTMz2/\nuyGe1iw33PVeWsm1JUybQ9IrU/huJjbgOHU4wab+8SJCM49ipArp68Fr6j4lcEaE\n4rfRg1ZsvxiOyUB3qPn6wyL/JB8kOJ+QCBe498376eaem8AEFk0kQRh6hDaWtq/k\nt6IIXQLjx+EBDVP/veK0UnVhKRP8YTOoV8ZiG1NcdlJmX/Uk7iAfevP7CkBfSN8W\nr6AL284qtw==\n-----END CERTIFICATE-----"
  },
  {
    "path": "packages/framework/example/controller.dart",
    "content": "import 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  // Logging set up/boilerplate\n  Logger.root.onRecord.listen(print);\n\n  // Create our server.\n  var app = Angel(logger: Logger('angel'), reflector: MirrorsReflector());\n  var http = AngelHttp(app);\n\n  await app.mountController<ArtistsController>();\n\n  // Simple fallback to throw a 404 on unknown paths.\n  app.fallback((req, res) {\n    throw AngelHttpException.notFound(\n      message: 'Unknown path: \"${req.uri!.path}\"',\n    );\n  });\n\n  app.errorHandler = (e, req, res) => e.toJson();\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n  app.dumpTree();\n}\n\nclass ArtistsController extends Controller {\n  List index() {\n    return ['Elvis', 'Stevie', 'Van Gogh'];\n  }\n\n  String getById(int id, RequestContext req) {\n    return 'You fetched ID: $id from IP: ${req.ip}';\n  }\n\n  @Expose.post\n  Future<Artist> form(RequestContext req) async {\n    // Deserialize the body into an artist.\n    var artist = await req.deserializeBody((m) {\n      return Artist(name: m!['name'] as String? ?? '(unknown name)');\n    });\n\n    // Return it (it will be serialized to JSON).\n    return artist;\n  }\n}\n\nclass Artist {\n  final String? name;\n\n  Artist({this.name});\n\n  Map<String, dynamic> toJson() {\n    return {'name': name};\n  }\n}\n"
  },
  {
    "path": "packages/framework/example/handle_error.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel(reflector: MirrorsReflector())\n    ..logger = (Logger('angel')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      }))\n    ..encoders.addAll({'gzip': gzip.encoder});\n\n  app.fallback(\n    (req, res) => Future.error('Throwing just because I feel like!'),\n  );\n\n  var http = AngelHttp(app);\n  HttpServer? server = await http.startServer('127.0.0.1', 3000);\n  var url = 'http://${server.address.address}:${server.port}';\n  print('Listening at $url');\n}\n"
  },
  {
    "path": "packages/framework/example/hostname.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\n\nFuture<void> apiConfigurer(Angel app) async {\n  app.get('/', (req, res) => 'Hello, API!');\n  app.fallback((req, res) {\n    return 'fallback on ${req.uri} (within the API)';\n  });\n}\n\nFuture<void> frontendConfigurer(Angel app) async {\n  app.fallback((req, res) => '(usually an index page would be shown here.)');\n}\n\nvoid main() async {\n  // Logging set up/boilerplate\n  hierarchicalLoggingEnabled = true;\n  //Logger.root.onRecord.listen(prettyLog);\n\n  var app = Angel(logger: Logger('angel'));\n  var http = AngelHttp(app);\n  var multiHost = HostnameRouter.configure({\n    'api.localhost:3000': apiConfigurer,\n    'localhost:3000': frontendConfigurer,\n  });\n\n  app\n    ..fallback(multiHost.handleRequest)\n    ..fallback((req, res) {\n      res.write('Uncaught hostname: ${req.hostname}');\n    });\n\n  app.errorHandler = (e, req, res) {\n    print(e.message);\n    print(e.stackTrace);\n    return e.toJson();\n  };\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n  print(\n    'See what happens when you visit http://localhost:3000 instead '\n    'of http://127.0.0.1:3000. Then, try '\n    'http://api.localhost:3000.',\n  );\n}\n"
  },
  {
    "path": "packages/framework/example/http2/body_parsing.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_framework/http2.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel();\n  app.logger = Logger('angel')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  var publicDir = Directory('example/public');\n  var indexHtml = const LocalFileSystem().file(\n    publicDir.uri.resolve('body_parsing.html'),\n  );\n\n  app.get('/', (req, res) => res.streamFile(indexHtml));\n\n  app.post('/', (req, res) => req.parseBody().then((_) => req.bodyAsMap));\n\n  var ctx = SecurityContext()\n    ..useCertificateChain('dev.pem')\n    ..usePrivateKey('dev.key', password: 'dartdart');\n\n  try {\n    ctx.setAlpnProtocols(['h2'], true);\n  } catch (e, st) {\n    app.logger.severe(\n      'Cannot set ALPN protocol on server to `h2`. The server will only serve HTTP/1.x.',\n      e,\n      st,\n    );\n  }\n\n  var http1 = AngelHttp(app);\n  var http2 = AngelHttp2(app, ctx);\n\n  // HTTP/1.x requests will fallback to `AngelHttp`\n  http2.onHttp1.listen(http1.handleRequest);\n\n  var server = await http2.startServer('127.0.0.1', 3000);\n  print('Listening at https://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/framework/example/http2/common.dart",
    "content": "import 'package:logging/logging.dart';\n\nvoid dumpError(LogRecord rec) {\n  print(rec);\n  if (rec.error != null) print(rec.error);\n  if (rec.stackTrace != null) print(rec.stackTrace);\n}\n"
  },
  {
    "path": "packages/framework/example/http2/dev.key",
    "content": "-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIE5DAcBgoqhkiG9w0BDAEBMA4ECL7L6rj6uEHGAgIIAASCBMLbucyfqAkgCbhP\nxNSHYllPMAv/dsIjtnsBwepCXPGkCBCuOAw/2FaCHjN9hBqL5V7fkrKeaemhm2YE\nycPtlHJYPDf3kEkyMjdZ9rIY6kePGfQizs2uJPcXj4YPyQ4HsfVXpOicKfQrouf5\nMze9bGzeMN065q3iP4dYUMwHAyZYteXCsanQNHlqvsWli0W+H8St8fdsXefZhnv1\nqVatKWdNdWQ9t5MuljgNU2Vv56sHKEYXI0yLxk2QUMk8KlJfnmt8foYUsnPUXHmc\ngIjLKwwVkpdololnEHSNu0cEOUPowjgJru+uMpn7vdNl7TPEQ9jbEgdNg4JwoYzU\n0nao8WzjaSp7kzvZz0VFwKnk5AjstGvvuAWckADdq23QElbn/mF7AG1m/TBpYxzF\ngTt37UdndS/AcvVznWVVrRP5iTSIawdIwvqI4s7rqsoE0GCcak+RhchgAz2gWKkS\noODUo0JL6pPVbJ3l4ebbaO6c99nDVc8dViPtc1EkStJEJ2O4kI4xgLSCr4Y9ahKn\noAaoSkX7Xxq3aQm+BzqSpLjdGL8atsqR/YVOIHYIl3gThvP0NfZGx1xHyvO5mCdZ\nkHxSA7tKWxauZ3eQ2clbnzeRsl4El0WMHy/5K1ovene4v7sunmoXVtghBC8hK6eh\nzMO9orex2PNQ/VQC7HCvtytunOVx1lkSBoNo7hR70igg6rW9H7UyoAoBOwMpT1xa\nJ6V62nqruTKOqFNfur7aHJGpHGtDb5/ickHeYCyPTvmGp67u4wChzKReeg02oECe\nd1E5FKAcIa8s9TVOB6Z+HvTRNQZu2PsI6TJnjQRowvY9DAHiWTlJZBBY/pko3hxX\nTsIeybpvRdEHpDWv86/iqtw1hv9CUxS/8ZTWUgBo+osShHW79FeDASr9FC4/Zn76\nZDERTgV4YWlW/klVWcG2lFo7jix+OPXAB+ZQavLhlN1xdWBcIz1AUWjAM4hdPylW\nHCX4PB9CQIPl2E7F+Y2p6nMcMWSJVBi5UIH7E9LfaBguXSzMmTk2Fw5p1aOQ6wfN\ngoVAMVwi8ppAVs741PfHdZ295xMmK/1LCxz5DeAdD/tsA/SYfT753GotioDuC7im\nEyJ5JyvTr5I6RFFBuqt3NlUb3Hp16wP3B2x9DZiB6jxr0l341/NHgsyeBXkuIy9j\nON2mvpBPCJhS8kgWo3G0UyyKnx64tcgpGuSvZhGwPz843B6AbYyE6pMRfSWRMkMS\nYZYa+VNKhR4ixdj07ocFZEWLVjCH7kxkE8JZXKt8jKYmkWd0lS1QVjgaKlO6lRa3\nq6SPJkhW6pvqobvcqVNXwi1XuzpZeEbuh0B7OTekFTTxx5g9XeDl56M8SVQ1KEhT\nQ1t7H2Nba18WCB7cf+6PN0F0K0Jz1Kq7ZWaqEI/grX1m4RQuvNF5807sB/QKMO/Z\nGz3NXvHg5xTJRd/567lxPGkor0cE7qD1EZfmJ2HrBYXQ91bhgA7LToBuMZo6ZRXH\nQfsanjbP4FPLMiGdQigLjj3A35L/f4sQOOVac/sRaFnm7pzcxsMvyVU/YtvGcjYE\nxaOOVnamg661Wo0wksXoDjeSz/JIyyKO3Gwp1FSm2wGLjjy/Ehmqcqy8rvHuf07w\nAUukhVtTNn4=\n-----END ENCRYPTED PRIVATE KEY-----"
  },
  {
    "path": "packages/framework/example/http2/dev.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIDKTCCAhGgAwIBAgIJAOWmjTS+OnTEMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV\nBAMMDGludGVybWVkaWF0ZTAeFw0xNTA1MTgwOTAwNDBaFw0yMzA4MDQwOTAwNDBa\nMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\nAQoCggEBALlcwQJuzd+xH8QFgfJSn5tRlvhkldSX98cE7NiA602NBbnAVyUrkRXq\nNi75lgt0kwjYfA9z674m8WSVbgpLPintPCla9CYky1TH0keIs8Rz6cGWHryWEHiu\nEDuljQynu2b3sAFuHu9nfWurbJwZnFakBKpdQ9m4EyOZCHC/jHYY7HacKSXg1Cki\nwe2ca0BWDrcqy8kLy0dZ5oC6IZG8O8drAK8f3f44CRYw59D3sOKBrKXaabpvyEcb\nN7Wk2HDBVwHpUJo1reVwtbM8dhqQayYSD8oXnGpP3RQNu/e2rzlXRyq/BfcDY1JI\n7TbC4t/7/N4EcPSpGsTcSOC9A7FpzvECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglg\nhkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0O\nBBYEFCnwiEMMFZh7NhCr+qA8K0w4Q+AOMB8GA1UdIwQYMBaAFB0h1Evsaw2vfrmS\nYuoCTmC4EE6ZMA0GCSqGSIb3DQEBCwUAA4IBAQAcFmHMaXRxyoNaeOowQ6iQWoZd\nAUbvG7SHr7I6Pi2aqdqofsKWts7Ytm5WsS0M2nN+sW504houu0iCPeJJX8RQw2q4\nCCcNOs9IXk+2uMzlpocHpv+yYoUiD5DxgWh7eghQMLyMpf8FX3Gy4VazeuXznHOM\n4gE4L417xkDzYOzqVTp0FTyAPUv6G2euhNCD6TMru9REcRhYul+K9kocjA5tt2KG\nMH6y28LXbLyq4YJUxSUU9gY/xlnbbZS48KDqEcdYC9zjW9nQ0qS+XQuQuFIcwjJ5\nV4kAUYxDu6FoTpyQjgsrmBbZlKNxH7Nj4NDlcdJhp/zeSKHqWa5hSWjjKIxp\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAeqgAwIBAgIJAOWmjTS+OnTDMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV\nBAMMDXJvb3RhdXRob3JpdHkwHhcNMTUwNTE4MDkwMDQwWhcNMjMwODA0MDkwMDQw\nWjAXMRUwEwYDVQQDDAxpbnRlcm1lZGlhdGUwggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDSrAO1CoPvUllgLOzDm5nG0skDF7vh1DUgAIDVGz0ecD0JFbQx\nEF79pju/6MbtpTW2FYvRp11t/G7rGtX923ybOHY/1MNFQrdIvPlO1VV7IGKjoMwP\nDNeb0fIGjHoE9QxaDxR8NX8xQbItpsw+TUtRfc9SLkR+jaYJfVRoM21BOncZbSHE\nYKiZlEbpecB/+EtwVpgvl+8mPD5U07Fi4fp/lza3WXInXQPyiTVllIEJCt4PKmlu\nMocNaJOW38bysL7i0PzDpVZtOxLHOTaW68yF3FckIHNCaA7k1ABEEEegjFMmIao7\nB9w7A0jvr4jZVvNmui5Djjn+oJxwEVVgyf8LAgMBAAGjUDBOMB0GA1UdDgQWBBQd\nIdRL7GsNr365kmLqAk5guBBOmTAfBgNVHSMEGDAWgBRk81s9d0ZbiZhh44KckwPb\noTc0XzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBZQTK0plfdB5PC\ncC5icut4EmrByJa1RbU7ayuEE70e7hla6KVmVjVdCBGltI4jBYwfhKbRItHiAJ/8\nx+XZKBG8DLPFuDb7lAa1ObhAYF7YThUFPQYaBhfzKcWrdmWDBFpvNv6E0Mm364dZ\ne7Yxmbe5S4agkYPoxEzgEYmcUk9jbjdR6eTbs8laG169ljrECXfEU9RiAcqz5iSX\nNLSewqB47hn3B9qgKcQn+PsgO2j7M+rfklhNgeGJeWmy7j6clSOuCsIjWHU0RLQ4\n0W3SB/rpEAJ7fgQbYUPTIUNALSOWi/o1tDX2mXPRjBoxqAv7I+vYk1lZPmSzkyRh\nFKvRDxsW\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAzCCAeugAwIBAgIJAJ0MomS4Ck+8MA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV\nBAMMDXJvb3RhdXRob3JpdHkwHhcNMTUwNTE4MDkwMDQwWhcNMjMwODA0MDkwMDQw\nWjAYMRYwFAYDVQQDDA1yb290YXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEAts1ijtBV92S2cOvpUMOSTp9c6A34nIGr0T5Nhz6XiqRVT+gv\ndQgmkdKJQjbvR60y6jzltYFsI2MpGVXY8h/oAL81D/k7PDB2aREgyBfTPAhBHyGw\nsiR+2xYt5b/Zs99q5RdRqQNzNpLPJriIKvUsRyQWy1UiG2s7pRXQeA8qB0XtJdCj\nkFIi+G2bDsaffspGeDOCqt7t+yqvRXfSES0c/l7DIHaiMbbp4//ZNML3RNgAjPz2\nhCezZ+wOYajOIyoSPK8IgICrhYFYxvgWxwbLDBEfC5B3jOQsySe10GoRAKZz1gBV\nDmgReu81tYJmdgkc9zknnQtIFdA0ex+GvZlfWQIDAQABo1AwTjAdBgNVHQ4EFgQU\nZPNbPXdGW4mYYeOCnJMD26E3NF8wHwYDVR0jBBgwFoAUZPNbPXdGW4mYYeOCnJMD\n26E3NF8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEATzkZ97K777uZ\nlQcduNX3ey4IbCiEzFA2zO5Blj+ilfIwNbZXNOgm/lqNvVGDYs6J1apJJe30vL3X\nJ+t2zsZWzzQzb9uIU37zYemt6m0fHrSrx/iy5lGNqt3HMfqEcOqSCOIK3PCTMz2/\nuyGe1iw33PVeWsm1JUybQ9IrU/huJjbgOHU4wab+8SJCM49ipArp68Fr6j4lcEaE\n4rfRg1ZsvxiOyUB3qPn6wyL/JB8kOJ+QCBe498376eaem8AEFk0kQRh6hDaWtq/k\nt6IIXQLjx+EBDVP/veK0UnVhKRP8YTOoV8ZiG1NcdlJmX/Uk7iAfevP7CkBfSN8W\nr6AL284qtw==\n-----END CERTIFICATE-----"
  },
  {
    "path": "packages/framework/example/http2/main.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_framework/http2.dart';\nimport 'package:logging/logging.dart';\nimport 'common.dart';\n\nvoid main() async {\n  var app = Angel()\n    ..encoders.addAll({'gzip': gzip.encoder, 'deflate': zlib.encoder});\n  app.logger = Logger('angel')..onRecord.listen(dumpError);\n\n  app.get('/', (req, res) => 'Hello HTTP/2!!!');\n\n  app.fallback(\n    (req, res) => throw AngelHttpException.notFound(\n      message: 'No file exists at ${req.uri}',\n    ),\n  );\n\n  var ctx = SecurityContext()\n    ..useCertificateChain('dev.pem')\n    ..usePrivateKey('dev.key', password: 'dartdart');\n\n  try {\n    ctx.setAlpnProtocols(['h2'], true);\n  } catch (e, st) {\n    app.logger.severe(\n      'Cannot set ALPN protocol on server to `h2`. The server will only serve HTTP/1.x.',\n      e,\n      st,\n    );\n  }\n\n  var http1 = AngelHttp(app);\n  var http2 = AngelHttp2(app, ctx);\n\n  // HTTP/1.x requests will fallback to `AngelHttp`\n  http2.onHttp1.listen(http1.handleRequest);\n\n  await http2.startServer('127.0.0.1', 3000);\n  print('Listening at ${http2.uri}');\n}\n"
  },
  {
    "path": "packages/framework/example/http2/public/app.js",
    "content": "window.onload = function() {\n  var $app = document.getElementById('app');\n  var $loading = document.getElementById('loading');\n  $app.removeChild($loading);\n  var $button = document.createElement('button');\n  var $h1 = document.createElement('h1');\n  $app.appendChild($h1);\n  $app.appendChild($button);\n\n  $h1.textContent = '~Angel HTTP/2 server push~';\n\n  $button.textContent = 'Change color';\n  $button.onclick = function() {\n    var color = Math.floor(Math.random() * 0xffffff);\n    $h1.style.color = '#' + color.toString(16);\n  };\n\n  $button.onclick();\n\n  window.setInterval($button.onclick, 2000);\n\n  var rotation = 0;\n  window.setInterval(function() {\n    rotation += .6;\n    $button.style.transform = 'rotate(' + rotation + 'deg)';\n  }, 10);\n};"
  },
  {
    "path": "packages/framework/example/http2/public/body_parsing.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Angel HTTP/2</title>\n    <style>\n        input:not([type=\"submit\"]) {\n            margin-bottom: 2em;\n        }\n    </style>\n</head>\n<body>\n<form action=\"/\" method=\"post\">\n    <input name=\"name\" placeholder=\"Your Name\" type=\"text\">\n    <input name=\"password\" placeholder=\"Secret Field\" type=\"password\">\n    <input name=\"age\" placeholder=\"Your Age\" type=\"number\">\n    <input name=\"birthday\" placeholder=\"Your Birthday\" type=\"datetime-local\">\n    <input type=\"submit\" value=\"Submit\">\n</form>\n</body>\n</html>"
  },
  {
    "path": "packages/framework/example/http2/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Angel HTTP/2</title>\n    <link rel=\"stylesheet\" href=\"style.css\">\n</head>\n<body>\n<div id=\"app\"><span id=\"loading\">Loading...</span></div>\n<script src=\"app.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "packages/framework/example/http2/public/style.css",
    "content": "button {\n    margin-top: 2em;\n}\n\nhtml, body {\n    background-color: #000;\n}\n\n#app {\n    text-align: center;\n}\n\n#app h1 {\n    font-style: italic;\n    text-decoration: underline;\n}\n\n#loading {\n    color: red;\n}"
  },
  {
    "path": "packages/framework/example/http2/server_push.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_framework/http2.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel();\n  app.logger = Logger('angel')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  var publicDir = Directory('example/http2/public');\n  var indexHtml = const LocalFileSystem().file(\n    publicDir.uri.resolve('index.html'),\n  );\n  var styleCss = const LocalFileSystem().file(\n    publicDir.uri.resolve('style.css'),\n  );\n  var appJs = const LocalFileSystem().file(publicDir.uri.resolve('app.js'));\n\n  // Send files when requested\n  app\n    ..get('/style.css', (req, res) => res.streamFile(styleCss))\n    ..get('/app.js', (req, res) => res.streamFile(appJs));\n\n  app.get('/', (req, res) async {\n    // Regardless of whether we pushed other resources, let's still send /index.html.\n    await res.streamFile(indexHtml);\n\n    // If the client is HTTP/2 and supports server push, let's\n    // send down /style.css and /app.js as well, to improve initial load time.\n    if (res is Http2ResponseContext && res.canPush) {\n      await res.push('/style.css').streamFile(styleCss);\n      await res.push('/app.js').streamFile(appJs);\n    }\n  });\n\n  var ctx = SecurityContext()\n    ..useCertificateChain('dev.pem')\n    ..usePrivateKey('dev.key', password: 'dartdart');\n\n  try {\n    ctx.setAlpnProtocols(['h2'], true);\n  } catch (e, st) {\n    app.logger.severe(\n      'Cannot set ALPN protocol on server to `h2`. The server will only serve HTTP/1.x.',\n      e,\n      st,\n    );\n  }\n\n  var http1 = AngelHttp(app);\n  var http2 = AngelHttp2(app, ctx);\n\n  // HTTP/1.x requests will fallback to `AngelHttp`\n  http2.onHttp1.listen(http1.handleRequest);\n\n  var server = await http2.startServer('127.0.0.1', 3000);\n  print('Listening at https://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/framework/example/json.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'dart:isolate';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var x = 0;\n  var c = Completer();\n  var exit = ReceivePort();\n  var isolates = <Isolate>[];\n\n  exit.listen((_) {\n    if (++x >= 50) {\n      c.complete();\n    }\n  });\n\n  for (var i = 1; i < Platform.numberOfProcessors; i++) {\n    var isolate = await Isolate.spawn(serverMain, null);\n    isolates.add(isolate);\n    print('Spawned isolate #${i + 1}...');\n\n    isolate.addOnExitListener(exit.sendPort);\n  }\n\n  serverMain(null);\n\n  print('Angel listening at http://localhost:3000');\n  await c.future;\n}\n\nvoid serverMain(_) async {\n  var app = Angel();\n  var http = AngelHttp.custom(\n    app,\n    startShared,\n    useZone: false,\n  ); // Run a cluster\n\n  app.get('/', (req, res) {\n    return res.serialize({\n      'foo': 'bar',\n      'one': [2, 'three'],\n      'bar': {'baz': 'quux'},\n    });\n  });\n\n  app.errorHandler = (e, req, res) {\n    print(e.message);\n    print(e.stackTrace);\n  };\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/framework/example/main.dart",
    "content": "import 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  // Logging set up/boilerplate\n  //Logger.root.onRecord.listen(prettyLog);\n\n  // Create our server.\n  var app = Angel(logger: Logger('angel'), reflector: MirrorsReflector());\n\n  // Index route. Returns JSON.\n  app.get('/', (req, res) => 'Welcome to Angel!');\n\n  // Accepts a URL like /greet/foo or /greet/bob.\n  app.get('/greet/:name', (req, res) {\n    var name = req.params['name'];\n    res\n      ..write('Hello, $name!')\n      ..close();\n  });\n\n  // Pattern matching - only call this handler if the query value of `name` equals 'emoji'.\n  app.get(\n    '/greet',\n    ioc((@Query('name', match: 'emoji') String name) => '😇🔥🔥🔥'),\n  );\n\n  // Handle any other query value of `name`.\n  app.get('/greet', ioc((@Query('name') String name) => 'Hello, $name!'));\n\n  // Simple fallback to throw a 404 on unknown paths.\n  app.fallback((req, res) {\n    throw AngelHttpException.notFound(\n      message: 'Unknown path: \"${req.uri!.path}\"',\n    );\n  });\n\n  var http = AngelHttp(app);\n  var server = await http.startServer('127.0.0.1', 3000);\n  var url = 'http://${server.address.address}:${server.port}';\n  print('Listening at $url');\n  print('Visit these pages to see Angel in action:');\n  print('* $url/greet/bob');\n  print('* $url/greet/?name=emoji');\n  print('* $url/greet/?name=jack');\n  print('* $url/nonexistent_page');\n}\n"
  },
  {
    "path": "packages/framework/example/map_service.dart",
    "content": "import 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  // Logging set up/boilerplate\n  Logger.root.onRecord.listen(print);\n\n  // Create our server.\n  var app = Angel(logger: Logger('angel'), reflector: MirrorsReflector());\n\n  // Create a RESTful service that manages an in-memory collection.\n  app.use('/api/todos', MapService());\n\n  var http = AngelHttp(app);\n  await http.startServer('127.0.0.1', 0);\n  print('Listening at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/framework/example/status.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n\n  app.fallback((req, res) {\n    res.statusCode = 304;\n  });\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/framework/example/view.dart",
    "content": "import 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var app = Angel(reflector: MirrorsReflector());\n\n  app.viewGenerator = (name, [data]) async =>\n      'View generator invoked with name $name and data: $data';\n\n  // Index route. Returns JSON.\n  app.get('/', (req, res) => res.render('index', {'foo': 'bar'}));\n\n  var http = AngelHttp(app);\n  var server = await http.startServer('127.0.0.1', 3000);\n  var url = 'http://${server.address.address}:${server.port}';\n  print('Listening at $url');\n}\n"
  },
  {
    "path": "packages/framework/example/views/index.jl",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <title>Title</title>\n</head>\n<body>\n<h1>Hello!</h1>\n</body>\n</html>"
  },
  {
    "path": "packages/framework/lib/angel3_framework.dart",
    "content": "/// An easily-extensible web server framework in Dart.\nlibrary;\n\nexport 'package:angel3_http_exception/angel3_http_exception.dart';\nexport 'package:angel3_model/angel3_model.dart';\nexport 'package:angel3_route/angel3_route.dart';\nexport 'src/core/core.dart';\n"
  },
  {
    "path": "packages/framework/lib/http.dart",
    "content": "export 'src/http/http.dart';\n"
  },
  {
    "path": "packages/framework/lib/http2.dart",
    "content": "export 'src/http2/angel_http2.dart';\nexport 'src/http2/http2_request_context.dart';\nexport 'src/http2/http2_response_context.dart';\n"
  },
  {
    "path": "packages/framework/lib/src/core/anonymous_service.dart",
    "content": "import 'dart:async';\nimport 'service.dart';\n\n/// An easy helper class to create one-off services without having to create an entire class.\n///\n/// Well-suited for testing.\nclass AnonymousService<Id, Data> extends Service<Id, Data> {\n  FutureOr<List<Data>> Function([Map<String, dynamic>?])? _index;\n  FutureOr<Data> Function(Id, [Map<String, dynamic>?])? _read, _remove;\n  FutureOr<Data> Function(Data, [Map<String, dynamic>?])? _create;\n  FutureOr<Data> Function(Id, Data, [Map<String, dynamic>?])? _modify, _update;\n\n  AnonymousService({\n    FutureOr<List<Data>> Function([Map<String, dynamic>? params])? index,\n    FutureOr<Data> Function(Id id, [Map<String, dynamic>? params])? read,\n    FutureOr<Data> Function(Data data, [Map<String, dynamic>? params])? create,\n    FutureOr<Data> Function(Id id, Data data, [Map<String, dynamic>? params])?\n    modify,\n    FutureOr<Data> Function(Id id, Data data, [Map<String, dynamic>? params])?\n    update,\n    FutureOr<Data> Function(Id id, [Map<String, dynamic>? params])? remove,\n    super.readData,\n  }) {\n    _index = index;\n    _read = read;\n    _create = create;\n    _modify = modify;\n    _update = update;\n    _remove = remove;\n  }\n\n  @override\n  Future<List<Data>> index([Map<String, dynamic>? params]) =>\n      Future.sync(() => _index != null ? _index!(params) : super.index(params));\n\n  @override\n  Future<Data> read(Id id, [Map<String, dynamic>? params]) => Future.sync(\n    () => _read != null ? _read!(id, params) : super.read(id, params),\n  );\n\n  @override\n  Future<Data> create(Data data, [Map<String, dynamic>? params]) => Future.sync(\n    () => _create != null ? _create!(data, params) : super.create(data, params),\n  );\n\n  @override\n  Future<Data> modify(Id id, Data data, [Map<String, dynamic>? params]) =>\n      Future.sync(\n        () => _modify != null\n            ? _modify!(id, data, params)\n            : super.modify(id, data, params),\n      );\n\n  @override\n  Future<Data> update(Id id, Data data, [Map<String, dynamic>? params]) =>\n      Future.sync(\n        () => _update != null\n            ? _update!(id, data, params)\n            : super.update(id, data, params),\n      );\n\n  @override\n  Future<Data> remove(Id id, [Map<String, dynamic>? params]) => Future.sync(\n    () => _remove != null ? _remove!(id, params) : super.remove(id, params),\n  );\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/controller.dart",
    "content": "library;\n\nimport 'dart:async';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_route/angel3_route.dart';\nimport 'package:meta/meta.dart';\nimport 'package:recase/recase.dart';\nimport '../core/core.dart';\n\n/// Supports grouping routes with shared functionality.\nclass Controller {\n  Angel? _app;\n\n  /// The [Angel] application powering this controller.\n  Angel get app {\n    if (_app == null) {\n      throw ArgumentError(\"Angel is not instantiated.\");\n    }\n\n    return _app!;\n  }\n\n  /// If `true` (default), this class will inject itself as a singleton into the [app]'s container when bootstrapped.\n  final bool injectSingleton;\n\n  /// Middleware to run before all handlers in this class.\n  List<RequestHandler> middleware = [];\n\n  /// A mapping of route paths to routes, produced from the [Expose] annotations on this class.\n  Map<String, Route> routeMappings = {};\n\n  SymlinkRoute<RequestHandler>? _mountPoint;\n\n  /// The route at which this controller is mounted on the server.\n  SymlinkRoute<RequestHandler>? get mountPoint => _mountPoint;\n\n  Controller({this.injectSingleton = true});\n\n  /// Applies routes, DI, and other configuration to an [app].\n  @mustCallSuper\n  Future<void> configureServer(Angel app) async {\n    _app = app;\n\n    if (injectSingleton != false) {\n      if (!app.container.has(runtimeType)) {\n        _app!.container.registerSingleton(this, as: runtimeType);\n      }\n    }\n\n    var name = await applyRoutes(app, app.container.reflector);\n    app.controllers[name] = this;\n    //return null;\n  }\n\n  /// Applies the routes from this [Controller] to some [router].\n  Future<String> applyRoutes(\n    Router<RequestHandler> router,\n    Reflector reflector,\n  ) async {\n    // Load global expose decl\n    var classMirror = reflector.reflectClass(runtimeType)!;\n    var exposeDecl = findExpose(reflector);\n\n    if (exposeDecl == null) {\n      throw Exception('All controllers must carry an @Expose() declaration.');\n    }\n\n    var routable = Routable();\n    _mountPoint = router.mount(exposeDecl.path, routable);\n    //_mountPoint = m;\n    var typeMirror = reflector.reflectType(runtimeType);\n\n    // Pre-reflect methods\n    var instanceMirror = reflector.reflectInstance(this);\n    final handlers = <RequestHandler>[...exposeDecl.middleware, ...middleware];\n    final routeBuilder = _routeBuilder(\n      reflector,\n      instanceMirror,\n      routable,\n      handlers,\n    );\n    await configureRoutes(routable);\n    classMirror.declarations.forEach(routeBuilder);\n\n    // Return the name.\n    var result = exposeDecl.as?.isNotEmpty == true\n        ? exposeDecl.as\n        : typeMirror!.name;\n\n    return Future.value(result);\n  }\n\n  void Function(ReflectedDeclaration) _routeBuilder(\n    Reflector reflector,\n    ReflectedInstance? instanceMirror,\n    Routable routable,\n    Iterable<RequestHandler> handlers,\n  ) {\n    return (ReflectedDeclaration decl) {\n      var methodName = decl.name;\n\n      // Ignore built-in methods.\n      if (methodName != 'toString' &&\n          methodName != 'noSuchMethod' &&\n          methodName != 'call' &&\n          methodName != 'equals' &&\n          methodName != '==') {\n        var exposeDecl =\n            decl.function!.annotations\n                    .map((m) => m.reflectee)\n                    .firstWhere((r) => r is Expose, orElse: () => null)\n                as Expose?;\n\n        if (exposeDecl == null) {\n          // If this has a @noExpose, return null.\n          if (decl.function!.annotations.any((m) => m.reflectee is NoExpose)) {\n            return;\n          } else {\n            // Otherwise, create an @Expose.\n            exposeDecl = Expose('');\n          }\n        }\n\n        var reflectedMethod =\n            instanceMirror!.getField(methodName).reflectee as Function?;\n        var middleware = <RequestHandler>[\n          ...handlers,\n          ...exposeDecl.middleware,\n        ];\n        var name = exposeDecl.as?.isNotEmpty == true\n            ? exposeDecl.as\n            : methodName;\n\n        // Check if normal\n        var method = decl.function!;\n        if (method.parameters.length == 2 &&\n            method.parameters[0].type.reflectedType == RequestContext &&\n            method.parameters[1].type.reflectedType == ResponseContext) {\n          // Create a regular route\n          routeMappings[name ?? ''] = routable.addRoute(\n            exposeDecl.method,\n            exposeDecl.path,\n            (RequestContext req, ResponseContext res) {\n              var result = reflectedMethod!(req, res);\n              return result is RequestHandler ? result(req, res) : result;\n            },\n            middleware: middleware,\n          );\n          return;\n        }\n\n        var injection = preInject(reflectedMethod!, reflector);\n\n        if (exposeDecl.allowNull.isNotEmpty == true) {\n          injection.optional.addAll(exposeDecl.allowNull);\n        }\n\n        // If there is no path, reverse-engineer one.\n        var path = exposeDecl.path;\n        var httpMethod = exposeDecl.method;\n        if (path == '') {\n          // Try to build a route path by finding all potential\n          // path segments, and then joining them.\n          var parts = <String>[];\n\n          // If the name starts with get/post/patch, etc., then that\n          // should be the path.\n          var methodMatch = _methods.firstMatch(method.name);\n          if (methodMatch != null) {\n            var rest = method.name.replaceAll(_methods, '');\n            var restPath = ReCase(\n              rest.isEmpty ? 'index' : rest,\n            ).snakeCase.replaceAll(_rgxMultipleUnderscores, '_');\n            httpMethod = methodMatch[1]!.toUpperCase();\n\n            if (['index', 'by_id'].contains(restPath)) {\n              parts.add('/');\n            } else {\n              parts.add(restPath);\n            }\n          }\n          // If the name does NOT start with get/post/patch, etc. then\n          // snake_case-ify the name, and add it to the list of segments.\n          // If the name is index, though, add \"/\".\n          else {\n            if (method.name == 'index') {\n              parts.add('/');\n            } else {\n              parts.add(\n                ReCase(\n                  method.name,\n                ).snakeCase.replaceAll(_rgxMultipleUnderscores, '_'),\n              );\n            }\n          }\n\n          // Try to infer String, int, or double. We called\n          // preInject() earlier, so we can figure out the types\n          // of required parameters, and add those to the path.\n          for (var p in injection.required) {\n            if (p is List && p.length == 2 && p[0] is String && p[1] is Type) {\n              var name = p[0] as String;\n              var type = p[1] as Type;\n              if (type == String) {\n                parts.add(':$name');\n              } else if (type == int) {\n                parts.add('int:$name');\n              } else if (type == double) {\n                parts.add('double:$name');\n              }\n            }\n          }\n\n          path = parts.join('/');\n          if (!path.startsWith('/')) path = '/$path';\n        }\n\n        routeMappings[name ?? ''] = routable.addRoute(\n          httpMethod,\n          path,\n          handleContained(reflectedMethod, injection),\n          middleware: middleware,\n        );\n      }\n    };\n  }\n\n  /// Used to add additional routes or middlewares to the router from within\n  /// a [Controller].\n  ///\n  /// ```dart\n  /// @override\n  /// FutureOr<void> configureRoutes(Routable routable) {\n  ///   routable.all('*', myMiddleware);\n  /// }\n  /// ```\n  FutureOr<void> configureRoutes(Routable routable) {}\n\n  static final RegExp _methods = RegExp(r'^(get|post|patch|delete)');\n  static final RegExp _rgxMultipleUnderscores = RegExp(r'__+');\n\n  /// Finds the [Expose] declaration for this class.\n  ///\n  /// If [concreteOnly] is `false`, then if there is no actual\n  /// [Expose], one will be automatically created.\n  Expose? findExpose(Reflector reflector, {bool concreteOnly = false}) {\n    var existing =\n        reflector\n                .reflectClass(runtimeType)!\n                .annotations\n                .map((m) => m.reflectee)\n                .firstWhere((r) => r is Expose, orElse: () => null)\n            as Expose?;\n    return existing ??\n        (concreteOnly\n            ? null\n            : Expose(\n                ReCase(runtimeType.toString()).snakeCase\n                    .replaceAll('_controller', '')\n                    .replaceAll('_ctrl', '')\n                    .replaceAll(_rgxMultipleUnderscores, '_'),\n              ));\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/core.dart",
    "content": "export 'anonymous_service.dart';\nexport 'controller.dart';\nexport 'driver.dart';\nexport 'env.dart';\nexport 'hooked_service.dart';\nexport 'hostname_parser.dart';\nexport 'hostname_router.dart';\nexport 'map_service.dart';\nexport 'metadata.dart';\nexport 'request_context.dart';\nexport 'response_context.dart';\nexport 'routable.dart';\nexport 'server.dart';\nexport 'service.dart';\n"
  },
  {
    "path": "packages/framework/lib/src/core/driver.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' show Cookie;\nimport 'package:angel3_http_exception/angel3_http_exception.dart';\nimport 'package:angel3_route/angel3_route.dart';\nimport 'package:belatuk_combinator/belatuk_combinator.dart';\nimport 'package:stack_trace/stack_trace.dart';\nimport 'package:tuple/tuple.dart';\nimport 'core.dart';\n\n/// Base driver class for Angel implementations.\n///\n/// Powers both AngelHttp and AngelHttp2.\nabstract class Driver<\n  Request,\n  Response,\n  Server extends Stream<Request>,\n  RequestContextType extends RequestContext,\n  ResponseContextType extends ResponseContext\n> {\n  final Angel app;\n  final bool useZone;\n  bool _closed = false;\n\n  StreamSubscription<Request>? _sub;\n  //final log = Logger('Driver');\n\n  /// The function used to bind this instance to a server..\n  final Future<Server> Function(dynamic, int) serverGenerator;\n\n  Driver(this.app, this.serverGenerator, {this.useZone = true});\n\n  /// The path at which this server is listening for requests.\n  Uri get uri;\n\n  /// The native server running this instance.\n  Server? server;\n\n  Future<Server> generateServer(Object? address, int port) =>\n      serverGenerator(address, port);\n\n  /// Starts, and returns the server.\n  Future<Server> startServer([Object? address, int port = 0]) {\n    var host = address ?? '127.0.0.1';\n    return generateServer(host, port)\n        .then((server) {\n          this.server = server;\n\n          return Future.wait(app.startupHooks.map(app.configure)).then((_) {\n            app.optimizeForProduction();\n            _sub = this.server?.listen((request) {\n              var stream = createResponseStreamFromRawRequest(request);\n              stream.listen((response) {\n                // TODO: To be revisited\n                handleRawRequest(request, response);\n              });\n            });\n            return Future.value(this.server!);\n          });\n        })\n        .catchError((error) {\n          app.logger.severe('Failed to create server', error);\n          throw ArgumentError('[Driver]Failed to create server');\n        });\n  }\n\n  /// Shuts down the underlying server.\n  Future<void> close() {\n    if (_closed) {\n      //return Future.value(_server);\n      return Future.value();\n    }\n    _closed = true;\n\n    _sub?.cancel();\n\n    return app.close().then(\n      (_) => Future.wait(\n        app.shutdownHooks.map(app.configure),\n      ).then((_) => Future.value()),\n    );\n    /*\n    return app.close().then((_) =>\n        Future.wait(app.shutdownHooks.map(app.configure))\n            .then((_) => Future.value(_server)));\n    */\n  }\n\n  Future<RequestContextType> createRequestContext(\n    Request request,\n    Response response,\n  );\n\n  Future<ResponseContextType> createResponseContext(\n    Request request,\n    Response response, [\n    RequestContextType? correspondingRequest,\n  ]);\n\n  void setHeader(Response response, String key, String value);\n\n  void setContentLength(Response response, int length);\n\n  void setChunkedEncoding(Response response, bool value);\n\n  void setStatusCode(Response response, int value);\n\n  void addCookies(Response response, Iterable<Cookie> cookies);\n\n  void writeStringToResponse(Response response, String value);\n\n  void writeToResponse(Response response, List<int> data);\n\n  Future closeResponse(Response response);\n\n  Stream<Response> createResponseStreamFromRawRequest(Request request);\n\n  /// Handles a single request.\n  Future handleRawRequest(Request request, Response response) {\n    app.logger.info('[Server] Called handleRawRequest');\n\n    return createRequestContext(request, response).then((req) {\n      return createResponseContext(request, response, req).then((res) {\n        Future handle() {\n          var path = req.path;\n          if (path == '/') path = '';\n\n          Tuple4<\n            List,\n            Map<String, dynamic>,\n            ParseResult<RouteResult>,\n            MiddlewarePipeline\n          >\n          resolveTuple() {\n            var r = app.optimizedRouter;\n            var resolved = r.resolveAbsolute(\n              path,\n              method: req.method,\n              strip: false,\n            );\n            var pipeline = MiddlewarePipeline<RequestHandler>(resolved);\n            return Tuple4(\n              pipeline.handlers,\n              resolved.fold<Map<String, dynamic>>(\n                <String, dynamic>{},\n                (out, r) => out..addAll(r.allParams),\n              ),\n              //(resolved.isEmpty ? null : resolved.first.parseResult),\n              resolved.first.parseResult,\n              pipeline,\n            );\n          }\n\n          var cacheKey = req.method + path;\n          var tuple = app.environment.isProduction\n              ? app.handlerCache.putIfAbsent(cacheKey, resolveTuple)\n              : resolveTuple();\n          var line = tuple.item4 as MiddlewarePipeline<RequestHandler>;\n          var it = MiddlewarePipelineIterator<RequestHandler>(line);\n\n          req.params.addAll(tuple.item2);\n\n          req.container\n            ?..registerSingleton<RequestContext>(req)\n            ..registerSingleton<ResponseContext>(res)\n            ..registerSingleton<MiddlewarePipeline>(tuple.item4)\n            ..registerSingleton<MiddlewarePipeline<RequestHandler>>(line)\n            ..registerSingleton<MiddlewarePipelineIterator>(it)\n            ..registerSingleton<MiddlewarePipelineIterator<RequestHandler>>(it)\n            ..registerSingleton<ParseResult<RouteResult>?>(tuple.item3)\n            ..registerSingleton<ParseResult?>(tuple.item3);\n\n          if (!app.environment.isProduction) {\n            req.container?.registerSingleton<Stopwatch>(Stopwatch()..start());\n          }\n\n          return runPipeline(\n            it,\n            req,\n            res,\n            app,\n          ).then((_) => sendResponse(request, response, req, res));\n        }\n\n        if (useZone == false) {\n          Future f;\n\n          try {\n            f = handle();\n          } catch (e, st) {\n            f = Future.error(e, st);\n          }\n\n          return f\n              .catchError((e, StackTrace st) {\n                if (e is FormatException) {\n                  throw AngelHttpException.badRequest(message: e.message)\n                    ..stackTrace = st;\n                }\n                throw AngelHttpException(\n                  stackTrace: st,\n                  statusCode: (e is AngelHttpException) ? e.statusCode : 500,\n                  message: e?.toString() ?? '500 Internal Server Error',\n                );\n              }, test: (e) => e is AngelHttpException)\n              .catchError((ee, StackTrace st) {\n                //print(\">>>> Framework error: $ee\");\n                //var t = (st).runtimeType;\n                //print(\">>>> StackTrace: $t\");\n                AngelHttpException e;\n                if (ee is AngelHttpException) {\n                  e = ee;\n                } else {\n                  e = AngelHttpException(\n                    stackTrace: st,\n                    statusCode: 500,\n                    message: ee?.toString() ?? '500 Internal Server Error',\n                  );\n                }\n\n                var error = e.error ?? e;\n                var trace = Trace.from(StackTrace.current).terse;\n                app.logger.severe(e.message, error, trace);\n\n                return handleAngelHttpException(\n                  e,\n                  st,\n                  req,\n                  res,\n                  request,\n                  response,\n                );\n              });\n        } else {\n          var zoneSpec = ZoneSpecification(\n            print: (self, parent, zone, line) {\n              app.logger.info(line);\n            },\n            handleUncaughtError: (self, parent, zone, error, stackTrace) {\n              var trace = Trace.from(stackTrace).terse;\n\n              // TODO: To be revisited\n              Future(() {\n                AngelHttpException e;\n\n                if (error is FormatException) {\n                  e = AngelHttpException.badRequest(message: error.message);\n                } else if (error is AngelHttpException) {\n                  e = error;\n                } else {\n                  e = AngelHttpException(\n                    stackTrace: stackTrace,\n                    message: error.toString(),\n                  );\n                }\n\n                app.logger.severe(e.message, error, trace);\n\n                return handleAngelHttpException(\n                  e,\n                  trace,\n                  req,\n                  res,\n                  request,\n                  response,\n                );\n              }).catchError((e, StackTrace st) {\n                var trace = Trace.from(st).terse;\n                closeResponse(response);\n                // Ideally, we won't be in a position where an absolutely fatal error occurs,\n                // but if so, we'll need to log it.\n                app.logger.severe(\n                  'Fatal error occurred when processing $uri.',\n                  e,\n                  trace,\n                );\n              });\n            },\n          );\n\n          var zone = Zone.current.fork(specification: zoneSpec);\n          req.container?.registerSingleton<Zone>(zone);\n          req.container?.registerSingleton<ZoneSpecification>(zoneSpec);\n\n          // If a synchronous error is thrown, it's not caught by `zone.run`,\n          // so use a try/catch, and recover when need be.\n\n          try {\n            return zone.run(handle);\n          } catch (e, st) {\n            zone.handleUncaughtError(e, st);\n            return Future.value();\n          }\n        }\n      });\n    });\n  }\n\n  /// Handles an [AngelHttpException].\n  Future handleAngelHttpException(\n    AngelHttpException e,\n    StackTrace st,\n    RequestContext? req,\n    ResponseContext? res,\n    Request request,\n    Response response, {\n    bool ignoreFinalizers = false,\n  }) {\n    if (req == null || res == null) {\n      try {\n        app.logger.severe('500 Internal Server Error', e, st);\n        setStatusCode(response, 500);\n        writeStringToResponse(response, '500 Internal Server Error');\n        closeResponse(response);\n      } catch (e) {\n        app.logger.severe('500 Internal Server Error', e);\n      }\n      return Future.value();\n    }\n\n    Future handleError;\n\n    if (!res.isOpen) {\n      handleError = Future.value();\n    } else {\n      res.statusCode = e.statusCode;\n      handleError = Future.sync(() => app.errorHandler(e, req, res)).then((\n        result,\n      ) {\n        return app.executeHandler(result, req, res).then((_) => res.close());\n      });\n    }\n\n    return handleError.then(\n      (_) => sendResponse(\n        request,\n        response,\n        req,\n        res,\n        ignoreFinalizers: ignoreFinalizers == true,\n      ),\n    );\n  }\n\n  /// Sends a response.\n  Future sendResponse(\n    Request request,\n    Response response,\n    RequestContext req,\n    ResponseContext res, {\n    bool ignoreFinalizers = false,\n  }) {\n    //app.logger.fine(\"Calling SendResponse\");\n    Future<void> cleanup(_) {\n      if (!app.environment.isProduction && req.container!.has<Stopwatch>()) {\n        var sw = req.container!.make<Stopwatch>();\n        app.logger.fine(\n          \"${res.statusCode} ${req.method} ${req.uri} (${sw.elapsedMilliseconds} ms)\",\n        );\n      }\n      return req.close();\n    }\n\n    // TODO: Debugging header\n    /*\n    for (var key in res.headers.keys) {\n      app.logger.fine(\"Response header key: $key\");\n    }\n    */\n\n    if (!res.isBuffered) {\n      //if (res.isOpen) {\n      return res.close().then(cleanup);\n      //}\n      //return Future.value();\n    }\n\n    //app.logger.fine(\"Calling finalizers\");\n\n    var finalizers = ignoreFinalizers == true\n        ? Future.value()\n        : Future.forEach(app.responseFinalizers, (dynamic f) => f(req, res));\n\n    return finalizers.then((_) {\n      //if (res.isOpen) res.close();\n\n      for (var key in res.headers.keys) {\n        app.logger.fine(\"Response header key: $key\");\n        setHeader(response, key, res.headers[key] ?? '');\n      }\n\n      setContentLength(response, res.buffer?.length ?? 0);\n      setChunkedEncoding(response, res.chunked ?? true);\n\n      var outputBuffer = res.buffer?.toBytes() ?? <int>[];\n\n      if (res.encoders.isNotEmpty) {\n        var allowedEncodings = req.headers\n            ?.value('accept-encoding')\n            ?.split(',')\n            .map((s) => s.trim())\n            .where((s) => s.isNotEmpty)\n            .map((str) {\n              // Ignore quality specifications in accept-encoding\n              // ex. gzip;q=0.8\n              if (!str.contains(';')) return str;\n              return str.split(';')[0];\n            });\n\n        if (allowedEncodings != null) {\n          for (var encodingName in allowedEncodings) {\n            var key = encodingName;\n\n            Converter<List<int>, List<int>>? encoder;\n            if (res.encoders.containsKey(encodingName)) {\n              encoder = res.encoders[encodingName];\n            } else if (encodingName == '*') {\n              encoder = res.encoders[key = res.encoders.keys.first];\n            }\n\n            if (encoder != null) {\n              setHeader(response, 'content-encoding', key);\n              outputBuffer =\n                  res.encoders[key]?.convert(outputBuffer) ?? <int>[];\n              setContentLength(response, outputBuffer.length);\n              break;\n            }\n          }\n        }\n      }\n\n      setStatusCode(response, res.statusCode);\n      addCookies(response, res.cookies);\n      writeToResponse(response, outputBuffer);\n      return closeResponse(response).then(cleanup);\n    });\n  }\n\n  /// Runs a [MiddlewarePipeline].\n  static Future<void> runPipeline<\n    RequestContextType extends RequestContext,\n    ResponseContextType extends ResponseContext\n  >(\n    MiddlewarePipelineIterator<RequestHandler> it,\n    RequestContextType req,\n    ResponseContextType res,\n    Angel app,\n  ) async {\n    var broken = false;\n    while (it.moveNext()) {\n      var current = it.current.handlers.iterator;\n\n      while (!broken && current.moveNext()) {\n        var result = await app.executeHandler(current.current, req, res);\n        if (result != true) {\n          broken = true;\n          break;\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/env.dart",
    "content": "import 'dart:io';\n\n/// A constant instance of [AngelEnv].\nconst AngelEnvironment angelEnv = AngelEnvironment();\n\n/// Queries the environment's `ANGEL_ENV` value.\nclass AngelEnvironment {\n  final String? _customValue;\n\n  /// You can optionally provide a custom value, in order to override the system's\n  /// value.\n  const AngelEnvironment([this._customValue]);\n\n  /// Returns the value of the `ANGEL_ENV` variable; defaults to `'development'`.\n  String get value =>\n      (_customValue ?? Platform.environment['ANGEL_ENV'] ?? 'development')\n          .toLowerCase();\n\n  /// Returns whether the [value] is `'development'`.\n  bool get isDevelopment => value == 'development';\n\n  /// Returns whether the [value] is `'production'`.\n  bool get isProduction => value == 'production';\n\n  /// Returns whether the [value] is `'staging'`.\n  bool get isStaging => value == 'staging';\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/hooked_service.dart",
    "content": "library;\n\nimport 'dart:async';\n\nimport '../util.dart';\nimport 'metadata.dart';\nimport 'request_context.dart';\nimport 'response_context.dart';\nimport 'routable.dart';\nimport 'server.dart';\nimport 'service.dart';\n\n/// Wraps another service in a service that broadcasts events on actions.\nclass HookedService<Id, Data, T extends Service<Id, Data>>\n    extends Service<Id, Data> {\n  final List<StreamController<HookedServiceEvent>> _ctrl = [];\n\n  /// Tbe service that is proxied by this hooked one.\n  final T inner;\n\n  final HookedServiceEventDispatcher<Id, Data, T> beforeIndexed =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> beforeRead =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> beforeCreated =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> beforeModified =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> beforeUpdated =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> beforeRemoved =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterIndexed =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterRead =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterCreated =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterModified =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterUpdated =\n      HookedServiceEventDispatcher<Id, Data, T>();\n  final HookedServiceEventDispatcher<Id, Data, T> afterRemoved =\n      HookedServiceEventDispatcher<Id, Data, T>();\n\n  HookedService(this.inner) {\n    // Clone app instance\n    if (inner.isAppActive) {\n      app = inner.app;\n    }\n  }\n\n  @override\n  FutureOr<Data> Function(RequestContext, ResponseContext)? get readData =>\n      inner.readData;\n\n  RequestContext? _getRequest(Map? params) {\n    if (params == null) return null;\n    return params['__requestctx'] as RequestContext?;\n  }\n\n  ResponseContext? _getResponse(Map? params) {\n    if (params == null) return null;\n    return params['__responsectx'] as ResponseContext?;\n  }\n\n  Map<String, dynamic> _stripReq(Map<String, dynamic>? params) {\n    if (params == null) {\n      return {};\n    } else {\n      return params.keys\n          .where((key) => key != '__requestctx' && key != '__responsectx')\n          .fold<Map<String, dynamic>>(\n            {},\n            (map, key) => map..[key] = params[key],\n          );\n    }\n  }\n\n  /// Closes any open [StreamController]s on this instance. **Internal use only**.\n  @override\n  Future close() {\n    for (var c in _ctrl) {\n      c.close();\n    }\n    beforeIndexed._close();\n    beforeRead._close();\n    beforeCreated._close();\n    beforeModified._close();\n    beforeUpdated._close();\n    beforeRemoved._close();\n    afterIndexed._close();\n    afterRead._close();\n    afterCreated._close();\n    afterModified._close();\n    afterUpdated._close();\n    afterRemoved._close();\n    inner.close();\n    return Future.value();\n  }\n\n  /// Adds hooks to this instance.\n  void addHooks(Angel app) {\n    var hooks = getAnnotation<Hooks>(inner, app.container.reflector);\n    var before = <HookedServiceEventListener<Id, Data, T>>[];\n    var after = <HookedServiceEventListener<Id, Data, T>>[];\n\n    if (hooks != null) {\n      before.addAll(hooks.before.cast());\n      after.addAll(hooks.after.cast());\n    }\n\n    void applyListeners(\n      Function fn,\n      HookedServiceEventDispatcher<Id, Data, T> dispatcher, [\n      bool? isAfter,\n    ]) {\n      var hooks = getAnnotation<Hooks>(fn, app.container.reflector);\n      final listeners = <HookedServiceEventListener<Id, Data, T>>[\n        ...isAfter == true ? after : before,\n      ];\n\n      if (hooks != null) {\n        listeners.addAll((isAfter == true ? hooks.after : hooks.before).cast());\n      }\n\n      listeners.forEach(dispatcher.listen);\n    }\n\n    applyListeners(inner.index, beforeIndexed);\n    applyListeners(inner.read, beforeRead);\n    applyListeners(inner.create, beforeCreated);\n    applyListeners(inner.modify, beforeModified);\n    applyListeners(inner.update, beforeUpdated);\n    applyListeners(inner.remove, beforeRemoved);\n    applyListeners(inner.index, afterIndexed, true);\n    applyListeners(inner.read, afterRead, true);\n    applyListeners(inner.create, afterCreated, true);\n    applyListeners(inner.modify, afterModified, true);\n    applyListeners(inner.update, afterUpdated, true);\n    applyListeners(inner.remove, afterRemoved, true);\n  }\n\n  @override\n  List<RequestHandler> get bootstrappers =>\n      List<RequestHandler>.from(super.bootstrappers)\n        ..add((RequestContext req, ResponseContext res) {\n          req.serviceParams\n            ..['__requestctx'] = req\n            ..['__responsectx'] = res;\n          return true;\n        });\n\n  @override\n  void addRoutes([Service? service]) {\n    super.addRoutes(service ?? inner);\n  }\n\n  /// Runs the [listener] before every service method specified.\n  void before(\n    Iterable<String> eventNames,\n    HookedServiceEventListener<Id, Data, T> listener,\n  ) {\n    eventNames\n        .map((name) {\n          switch (name) {\n            case HookedServiceEvent.indexed:\n              return beforeIndexed;\n            case HookedServiceEvent.read:\n              return beforeRead;\n            case HookedServiceEvent.created:\n              return beforeCreated;\n            case HookedServiceEvent.modified:\n              return beforeModified;\n            case HookedServiceEvent.updated:\n              return beforeUpdated;\n            case HookedServiceEvent.removed:\n              return beforeRemoved;\n            default:\n              throw ArgumentError('Invalid service method: $name');\n          }\n        })\n        .forEach(\n          (HookedServiceEventDispatcher<Id, Data, T> dispatcher) =>\n              dispatcher.listen(listener),\n        );\n  }\n\n  /// Runs the [listener] after every service method specified.\n  void after(\n    Iterable<String> eventNames,\n    HookedServiceEventListener<Id, Data, T> listener,\n  ) {\n    eventNames\n        .map((name) {\n          switch (name) {\n            case HookedServiceEvent.indexed:\n              return afterIndexed;\n            case HookedServiceEvent.read:\n              return afterRead;\n            case HookedServiceEvent.created:\n              return afterCreated;\n            case HookedServiceEvent.modified:\n              return afterModified;\n            case HookedServiceEvent.updated:\n              return afterUpdated;\n            case HookedServiceEvent.removed:\n              return afterRemoved;\n            default:\n              throw ArgumentError('Invalid service method: $name');\n          }\n        })\n        .forEach(\n          (HookedServiceEventDispatcher<Id, Data, T> dispatcher) =>\n              dispatcher.listen(listener),\n        );\n  }\n\n  /// Runs the [listener] before every service method.\n  void beforeAll(HookedServiceEventListener<Id, Data, T> listener) {\n    beforeIndexed.listen(listener);\n    beforeRead.listen(listener);\n    beforeCreated.listen(listener);\n    beforeModified.listen(listener);\n    beforeUpdated.listen(listener);\n    beforeRemoved.listen(listener);\n  }\n\n  /// Runs the [listener] after every service method.\n  void afterAll(HookedServiceEventListener<Id, Data, T> listener) {\n    afterIndexed.listen(listener);\n    afterRead.listen(listener);\n    afterCreated.listen(listener);\n    afterModified.listen(listener);\n    afterUpdated.listen(listener);\n    afterRemoved.listen(listener);\n  }\n\n  /// Returns a [Stream] of all events fired before every service method.\n  ///\n  /// *NOTE*: Only use this if you do not plan to modify events. There is no guarantee\n  /// that events coming out of this [Stream] will see changes you make within the [Stream]\n  /// callback.\n  Stream<HookedServiceEvent<Id, Data, T>> beforeAllStream() {\n    var ctrl = StreamController<HookedServiceEvent<Id, Data, T>>();\n    _ctrl.add(ctrl);\n    before(HookedServiceEvent.all, ctrl.add);\n    return ctrl.stream;\n  }\n\n  /// Returns a [Stream] of all events fired after every service method.\n  ///\n  /// *NOTE*: Only use this if you do not plan to modify events. There is no guarantee\n  /// that events coming out of this [Stream] will see changes you make within the [Stream]\n  /// callback.\n  Stream<HookedServiceEvent<Id, Data, T>> afterAllStream() {\n    var ctrl = StreamController<HookedServiceEvent<Id, Data, T>>();\n    _ctrl.add(ctrl);\n    before(HookedServiceEvent.all, ctrl.add);\n    return ctrl.stream;\n  }\n\n  /// Returns a [Stream] of all events fired before every service method specified.\n  ///\n  /// *NOTE*: Only use this if you do not plan to modify events. There is no guarantee\n  /// that events coming out of this [Stream] will see changes you make within the [Stream]\n  /// callback.\n  Stream<HookedServiceEvent<Id, Data, T>> beforeStream(\n    Iterable<String> eventNames,\n  ) {\n    var ctrl = StreamController<HookedServiceEvent<Id, Data, T>>();\n    _ctrl.add(ctrl);\n    before(eventNames, ctrl.add);\n    return ctrl.stream;\n  }\n\n  /// Returns a [Stream] of all events fired AFTER every service method specified.\n  ///\n  /// *NOTE*: Only use this if you do not plan to modify events. There is no guarantee\n  /// that events coming out of this [Stream] will see changes you make within the [Stream]\n  /// callback.\n  Stream<HookedServiceEvent<Id, Data, T>> afterStream(\n    Iterable<String> eventNames,\n  ) {\n    var ctrl = StreamController<HookedServiceEvent<Id, Data, T>>();\n    _ctrl.add(ctrl);\n    after(eventNames, ctrl.add);\n    return ctrl.stream;\n  }\n\n  /// Runs the [listener] before [create], [modify] and [update].\n  void beforeModify(HookedServiceEventListener<Id, Data, T> listener) {\n    beforeCreated.listen(listener);\n    beforeModified.listen(listener);\n    beforeUpdated.listen(listener);\n  }\n\n  @override\n  Future<List<Data>> index([Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeIndexed\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.indexed,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterIndexed\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.indexed,\n                    params: localParams,\n                    result: before.result,\n                  ),\n                )\n                .then((after) => after.result as List<Data>);\n          }\n\n          return inner.index(localParams).then((result) {\n            return afterIndexed\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.indexed,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as List<Data>);\n          });\n        });\n  }\n\n  @override\n  Future<Data> read(Id id, [Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeRead\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.read,\n            id: id,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterRead\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.read,\n                    id: id,\n                    params: localParams,\n                    result: before.result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          }\n\n          return inner.read(id, localParams).then((result) {\n            return afterRead\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.read,\n                    id: id,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          });\n        });\n  }\n\n  @override\n  Future<Data> create(Data data, [Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeCreated\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.created,\n            data: data,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterCreated\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.created,\n                    data: before.data,\n                    params: localParams,\n                    result: before.result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          }\n\n          return inner.create(before.data as Data, localParams).then((result) {\n            return afterCreated\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.created,\n                    data: before.data,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          });\n        });\n  }\n\n  @override\n  Future<Data> modify(Id id, Data data, [Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeModified\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.modified,\n            id: id,\n            data: data,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterModified\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.modified,\n                    id: id,\n                    data: before.data,\n                    params: localParams,\n                    result: before.result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          }\n\n          return inner.modify(id, before.data as Data, localParams).then((\n            result,\n          ) {\n            return afterModified\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.created,\n                    id: id,\n                    data: before.data,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          });\n        });\n  }\n\n  @override\n  Future<Data> update(Id id, Data data, [Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeUpdated\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.updated,\n            id: id,\n            data: data,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterUpdated\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.updated,\n                    id: id,\n                    data: before.data,\n                    params: localParams,\n                    result: before.result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          }\n\n          return inner.update(id, before.data as Data, localParams).then((\n            result,\n          ) {\n            return afterUpdated\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.updated,\n                    id: id,\n                    data: before.data,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          });\n        });\n  }\n\n  @override\n  Future<Data> remove(Id id, [Map<String, dynamic>? params]) {\n    var localParams = _stripReq(params);\n    return beforeRemoved\n        ._emit(\n          HookedServiceEvent(\n            false,\n            _getRequest(params),\n            _getResponse(params),\n            inner,\n            HookedServiceEvent.removed,\n            id: id,\n            params: localParams,\n          ),\n        )\n        .then((before) {\n          if (before._canceled) {\n            return afterRemoved\n                    ._emit(\n                      HookedServiceEvent(\n                        true,\n                        _getRequest(params),\n                        _getResponse(params),\n                        inner,\n                        HookedServiceEvent.removed,\n                        id: id,\n                        params: localParams,\n                        result: before.result,\n                      ),\n                    )\n                    .then((after) => after.result)\n                as Data;\n          }\n\n          return inner.remove(id, localParams).then((result) {\n            return afterRemoved\n                ._emit(\n                  HookedServiceEvent(\n                    true,\n                    _getRequest(params),\n                    _getResponse(params),\n                    inner,\n                    HookedServiceEvent.removed,\n                    id: id,\n                    params: localParams,\n                    result: result,\n                  ),\n                )\n                .then((after) => after.result as Data);\n          });\n        });\n  }\n\n  /// Fires an `after` event. This will not be propagated to clients,\n  /// but will be broadcasted to WebSockets, etc.\n  Future<HookedServiceEvent<Id, Data, T>> fire(\n    String eventName,\n    result, [\n    HookedServiceEventListener<Id, Data, T>? callback,\n  ]) {\n    HookedServiceEventDispatcher<Id, Data, T> dispatcher;\n\n    switch (eventName) {\n      case HookedServiceEvent.indexed:\n        dispatcher = afterIndexed;\n        break;\n      case HookedServiceEvent.read:\n        dispatcher = afterRead;\n        break;\n      case HookedServiceEvent.created:\n        dispatcher = afterCreated;\n        break;\n      case HookedServiceEvent.modified:\n        dispatcher = afterModified;\n        break;\n      case HookedServiceEvent.updated:\n        dispatcher = afterUpdated;\n        break;\n      case HookedServiceEvent.removed:\n        dispatcher = afterRemoved;\n        break;\n      default:\n        throw ArgumentError(\"Invalid service event name: '$eventName'\");\n    }\n\n    var ev = HookedServiceEvent<Id, Data, T>(\n      true,\n      null,\n      null,\n      inner,\n      eventName,\n    );\n    return fireEvent(dispatcher, ev, callback);\n  }\n\n  /// Sends an arbitrary event down the hook chain.\n  Future<HookedServiceEvent<Id, Data, T>> fireEvent(\n    HookedServiceEventDispatcher<Id, Data, T> dispatcher,\n    HookedServiceEvent<Id, Data, T> event, [\n    HookedServiceEventListener<Id, Data, T>? callback,\n  ]) {\n    Future? f;\n    if (callback != null && event._canceled != true) {\n      f = Future.sync(() => callback(event));\n    }\n    f ??= Future.value();\n    return f.then((_) => dispatcher._emit(event));\n  }\n}\n\n/// Fired when a hooked service is invoked.\nclass HookedServiceEvent<Id, Data, T extends Service<Id, Data>> {\n  static const String indexed = 'indexed';\n  static const String read = 'read';\n  static const String created = 'created';\n  static const String modified = 'modified';\n  static const String updated = 'updated';\n  static const String removed = 'removed';\n\n  static const List<String> all = [\n    indexed,\n    read,\n    created,\n    modified,\n    updated,\n    removed,\n  ];\n\n  /// Use this to end processing of an event.\n  void cancel([Object? result]) {\n    _canceled = true;\n    this.result = result ?? this.result;\n  }\n\n  /// Resolves a service from the application.\n  ///\n  /// Shorthand for `e.service.app.service(...)`.\n  Service? getService(Pattern path) => service.app.findService(path);\n\n  bool _canceled = false;\n  final String _eventName;\n  Id? _id;\n  final bool _isAfter;\n  Data? data;\n  Map<String, dynamic>? _params;\n  final RequestContext? _request;\n  final ResponseContext? _response;\n  dynamic result;\n\n  String get eventName => _eventName;\n\n  Id? get id => _id;\n\n  bool get isAfter => _isAfter == true;\n\n  bool get isBefore => !isAfter;\n\n  Map get params => _params ?? {};\n\n  RequestContext? get request => _request;\n\n  ResponseContext? get response => _response;\n\n  /// The inner service whose method was hooked.\n  T service;\n\n  HookedServiceEvent(\n    this._isAfter,\n    this._request,\n    this._response,\n    this.service,\n    this._eventName, {\n    Id? id,\n    this.data,\n    Map<String, dynamic>? params,\n    this.result,\n  }) {\n    //_data = data;\n    _id = id;\n    _params = params ?? {};\n  }\n}\n\n/// Triggered on a hooked service event.\ntypedef HookedServiceEventListener<Id, Data, T extends Service<Id, Data>> =\n    FutureOr<dynamic> Function(HookedServiceEvent<Id, Data, T> event);\n\n/// Can be listened to, but events may be canceled.\nclass HookedServiceEventDispatcher<Id, Data, T extends Service<Id, Data>> {\n  final List<StreamController<HookedServiceEvent<Id, Data, T>>> _ctrl = [];\n  final List<HookedServiceEventListener<Id, Data, T>> listeners = [];\n\n  void _close() {\n    for (var c in _ctrl) {\n      c.close();\n    }\n    listeners.clear();\n  }\n\n  /// Fires an event, and returns it once it is either canceled, or all listeners have run.\n  Future<HookedServiceEvent<Id, Data, T>> _emit(\n    HookedServiceEvent<Id, Data, T> event,\n  ) {\n    if (event._canceled == true || listeners.isEmpty) {\n      return Future.value(event);\n    }\n\n    var f = Future<HookedServiceEvent<Id, Data, T>>.value(event);\n\n    for (var listener in listeners) {\n      f = f.then((event) {\n        if (event._canceled) return event;\n        return Future.sync(() => listener(event)).then((_) => event);\n      });\n    }\n\n    return f;\n  }\n\n  /// Returns a [Stream] containing all events fired by this dispatcher.\n  ///\n  /// *NOTE*: Callbacks on the returned [Stream] cannot be guaranteed to run before other [listeners].\n  /// Use this only if you need a read-only stream of events.\n  Stream<HookedServiceEvent<Id, Data, T>> asStream() {\n    var ctrl = StreamController<HookedServiceEvent<Id, Data, T>>();\n    _ctrl.add(ctrl);\n    listen(ctrl.add);\n    return ctrl.stream;\n  }\n\n  /// Registers the listener to be called whenever an event is triggered.\n  void listen(HookedServiceEventListener<Id, Data, T> listener) {\n    listeners.add(listener);\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/hostname_parser.dart",
    "content": "import 'dart:collection';\nimport 'package:string_scanner/string_scanner.dart';\n\n/// Parses a string into a [RegExp] that is matched against hostnames.\nclass HostnameSyntaxParser {\n  final SpanScanner _scanner;\n  final _safe = RegExp(r'[0-9a-zA-Z-_:]+');\n\n  HostnameSyntaxParser(String hostname)\n    : _scanner = SpanScanner(hostname, sourceUrl: hostname);\n\n  FormatException _formatExc(String message) {\n    var span = _scanner.lastSpan ?? _scanner.emptySpan;\n    return FormatException(\n      '${span.start.toolString}: $message\\n${span.highlight(color: true)}',\n    );\n  }\n\n  RegExp parse() {\n    var b = StringBuffer();\n    var parts = Queue<String>();\n\n    while (!_scanner.isDone) {\n      if (_scanner.scan('|')) {\n        if (parts.isEmpty) {\n          throw _formatExc('No hostname parts found before \"|\".');\n        } else {\n          var next = _parseHostnamePart();\n          if (next.isEmpty) {\n            throw _formatExc('No hostname parts found after \"|\".');\n          } else {\n            var prev = parts.removeLast();\n            parts.addLast('(($prev)|($next))');\n          }\n        }\n      } else {\n        var part = _parseHostnamePart();\n        if (part.isNotEmpty) {\n          if (_scanner.scan('.')) {\n            var subPart = _parseHostnamePart(shouldThrow: false);\n            while (subPart.isNotEmpty) {\n              part += '\\\\.$subPart';\n              if (_scanner.scan('.')) {\n                subPart = _parseHostnamePart(shouldThrow: false);\n              } else {\n                break;\n              }\n            }\n          }\n          parts.add(part);\n        }\n      }\n    }\n\n    while (parts.isNotEmpty) {\n      b.write(parts.removeFirst());\n    }\n\n    if (b.isEmpty) {\n      throw _formatExc('Invalid or empty hostname.');\n    } else {\n      return RegExp('^$b\\$', caseSensitive: false);\n    }\n  }\n\n  String _parseHostnamePart({bool shouldThrow = true}) {\n    if (_scanner.scan('*.')) {\n      return r'([^$.]+\\.)?';\n    } else if (_scanner.scan('*')) {\n      return r'[^$]*';\n    } else if (_scanner.scan('+')) {\n      return r'[^$]+';\n    } else if (_scanner.scan(_safe)) {\n      return _scanner.lastMatch?[0] ?? '';\n    } else if (!_scanner.isDone && shouldThrow) {\n      var s = String.fromCharCode(_scanner.peekChar()!);\n      throw _formatExc('Unexpected character \"$s\".');\n    } else {\n      return '';\n    }\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/hostname_router.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_route/angel3_route.dart';\nimport 'package:logging/logging.dart';\nimport 'env.dart';\nimport 'hostname_parser.dart';\nimport 'request_context.dart';\nimport 'response_context.dart';\nimport 'routable.dart';\nimport 'server.dart';\n\n/// A utility that allows requests to be handled based on their\n/// origin's hostname.\n///\n/// For example, an application could handle example.com and api.example.com\n/// separately.\n///\n/// The provided patterns can be any `Pattern`. If a `String` is provided, a simple\n/// grammar (see [HostnameSyntaxParser]) is used to create [RegExp].\n///\n/// For example:\n/// * `example.com` -> `/example\\.com/`\n/// * `*.example.com` -> `/([^$.]\\.)?example\\.com/`\n/// * `example.*` -> `/example\\./[^$]*`\n/// * `example.+` -> `/example\\./[^$]+`\nclass HostnameRouter {\n  final Map<Pattern, Angel> _apps = {};\n  final Map<Pattern, FutureOr<Angel> Function()> _creators = {};\n  final List<Pattern> _patterns = [];\n\n  HostnameRouter({\n    Map<Pattern, Angel> apps = const {},\n    Map<Pattern, FutureOr<Angel> Function()> creators = const {},\n  }) {\n    Map<Pattern, V> parseMap<V>(Map<Pattern, V> map) {\n      return map.map((p, c) {\n        Pattern pp;\n\n        if (p is String) {\n          pp = HostnameSyntaxParser(p).parse();\n        } else {\n          pp = p;\n        }\n\n        return MapEntry(pp, c);\n      });\n    }\n\n    apps = parseMap(apps);\n    creators = parseMap(creators);\n    var patterns = apps.keys.followedBy(creators.keys).toSet().toList();\n    _apps.addAll(apps);\n    _creators.addAll(creators);\n    _patterns.addAll(patterns);\n    // print(_creators);\n  }\n\n  factory HostnameRouter.configure(\n    Map<Pattern, FutureOr<void> Function(Angel)> configurers, {\n    Reflector reflector = const EmptyReflector(),\n    AngelEnvironment environment = angelEnv,\n    Logger? logger,\n    bool allowMethodOverrides = true,\n    FutureOr<String> Function(dynamic)? serializer,\n    ViewGenerator? viewGenerator,\n  }) {\n    var creators = configurers.map((p, c) {\n      return MapEntry(p, () async {\n        var app = Angel(\n          reflector: reflector,\n          environment: environment,\n          logger: logger,\n          allowMethodOverrides: allowMethodOverrides,\n          serializer: serializer,\n          viewGenerator: viewGenerator,\n        );\n        await app.configure(c);\n        return app;\n      });\n    });\n    return HostnameRouter(creators: creators);\n  }\n\n  /// Attempts to handle a request, according to its hostname.\n  ///\n  /// If none is matched, then `true` is returned.\n  /// Also returns `true` if all of the sub-app's handlers returned\n  /// `true`.\n  Future<bool> handleRequest(RequestContext req, ResponseContext res) async {\n    for (var pattern in _patterns) {\n      // print('${req.hostname} vs $_creators');\n      if (pattern.allMatches(req.hostname).isNotEmpty) {\n        // Resolve the entire pipeline within the context of the selected app.\n        var app = _apps[pattern] ??= (await _creators[pattern]!());\n        // print('App for ${req.hostname} = $app from $pattern');\n        // app.dumpTree();\n\n        var r = app.optimizedRouter;\n        var resolved = r.resolveAbsolute(req.path, method: req.method);\n        var pipeline = MiddlewarePipeline<RequestHandler>(resolved);\n        // print('Pipeline: $pipeline');\n        for (var handler in pipeline.handlers) {\n          // print(handler);\n          // Avoid stack overflow.\n          if (handler == handleRequest) {\n            continue;\n          } else if (!await app.executeHandler(handler, req, res)) {\n            // print('$handler TERMINATED');\n            return false;\n          } else {\n            // print('$handler CONTINUED');\n          }\n        }\n      }\n    }\n\n    // Otherwise, return true.\n    return true;\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/injection.dart",
    "content": "part of 'request_context.dart';\n\nconst List<Type> _primitiveTypes = [String, int, num, double, Null];\n\n/// Shortcut for calling [preInject], and then [handleContained].\n///\n/// Use this to instantly create a request handler for a DI-enabled method.\n///\n/// Calling [ioc] also auto-serializes the result of a [handler].\nRequestHandler ioc(Function handler, {Iterable<String> optional = const []}) {\n  return (req, res) {\n    RequestHandler? contained;\n\n    if (req.app?.container != null) {\n      var injection = preInject(handler, req.app!.container.reflector);\n      //if (injection != null) {\n      injection.optional.addAll(optional);\n      contained = handleContained(handler, injection);\n      //}\n    }\n\n    return req.app!.executeHandler(contained, req, res);\n  };\n}\n\nFuture resolveInjection(\n  Object requirement,\n  InjectionRequest injection,\n  RequestContext req,\n  ResponseContext res,\n  bool throwOnUnresolved, [\n  Container? container,\n]) async {\n  dynamic propFromApp;\n  container ??= req.container ?? res.app!.container;\n\n  if (requirement == RequestContext) {\n    return req;\n  } else if (requirement == ResponseContext) {\n    return res;\n  } else if (requirement is String &&\n      injection.parameters.containsKey(requirement)) {\n    var param = injection.parameters[requirement]!;\n    var value = param.getValue(req);\n    if (value == null && param.required != false) throw param.error as Object;\n    return value;\n  } else if (requirement is String) {\n    if (req.container!.hasNamed(requirement)) {\n      return req.container!.findByName(requirement);\n    }\n    if (req.params.containsKey(requirement)) {\n      return req.params[requirement];\n    } else if ((propFromApp = req.app!.findProperty(requirement)) != null) {\n      return propFromApp;\n    } else if (injection.optional.contains(requirement)) {\n      return null;\n    } else if (throwOnUnresolved) {\n      throw ArgumentError(\n        \"Cannot resolve parameter '$requirement' within handler.\",\n      );\n    }\n  } else if (requirement is List &&\n      requirement.length == 2 &&\n      requirement.first is String &&\n      requirement.last is Type) {\n    var key = requirement.first;\n    var type = requirement.last;\n    if (req.params.containsKey(key) ||\n        req.app!.configuration.containsKey(key) ||\n        _primitiveTypes.contains(type)) {\n      return await resolveInjection(\n        key,\n        injection,\n        req,\n        res,\n        throwOnUnresolved,\n        container,\n      );\n    } else {\n      return await resolveInjection(\n        type,\n        injection,\n        req,\n        res,\n        throwOnUnresolved,\n        container,\n      );\n    }\n  } else if (requirement is Type && requirement != dynamic) {\n    try {\n      var futureType = container.reflector.reflectFutureOf(requirement);\n      if (container.has(futureType.reflectedType)) {\n        return await container.make(futureType.reflectedType);\n      }\n    } on UnsupportedError {\n      // Ignore.\n    }\n\n    return await container.make(requirement);\n  } else if (throwOnUnresolved) {\n    throw ArgumentError(\n      '$requirement cannot be injected into a request handler.',\n    );\n  }\n}\n\n/// Checks if an [InjectionRequest] can be sufficiently executed within the current request/response context.\nbool suitableForInjection(\n  RequestContext req,\n  ResponseContext res,\n  InjectionRequest injection,\n) {\n  return injection.parameters.values.any((p) {\n    if (p.match == null) return false;\n    var value = p.getValue(req);\n    return value == p.match;\n  });\n}\n\n/// Handles a request with a DI-enabled handler.\nRequestHandler handleContained(\n  Function handler,\n  InjectionRequest injection, [\n  Container? container,\n]) {\n  return (RequestContext req, ResponseContext res) async {\n    if (injection.parameters.isNotEmpty &&\n        injection.parameters.values.any((p) => p.match != null) &&\n        !suitableForInjection(req, res, injection)) {\n      return Future.value(true);\n    }\n\n    var args = [];\n\n    var named = <Symbol, dynamic>{};\n\n    for (var r in injection.required) {\n      args.add(await resolveInjection(r, injection, req, res, true, container));\n    }\n\n    for (var entry in injection.named.entries) {\n      var name = Symbol(entry.key);\n      named[name] = await resolveInjection(\n        [entry.key, entry.value],\n        injection,\n        req,\n        res,\n        false,\n        container,\n      );\n    }\n\n    return Function.apply(handler, args, named);\n  };\n}\n\n/// Contains a list of the data required for a DI-enabled method to run.\n///\n/// This improves performance by removing the necessity to reflect a method\n/// every time it is requested.\n///\n/// Regular request handlers can also skip DI entirely, lowering response time\n/// and memory use.\nclass InjectionRequest {\n  /// Optional, typed data that can be passed to a DI-enabled method.\n  final Map<String, Type> named;\n\n  /// A list of the arguments required for a DI-enabled method to run.\n  final List required;\n\n  /// A list of the arguments that can be null in a DI-enabled method.\n  final List<String> optional;\n\n  /// Extended parameter definitions.\n  final Map<String, Parameter> parameters;\n\n  const InjectionRequest.constant({\n    this.named = const {},\n    this.required = const [],\n    this.optional = const [],\n    this.parameters = const {},\n  });\n\n  InjectionRequest()\n    : named = {},\n      required = [],\n      optional = [],\n      parameters = {};\n}\n\n/// Predetermines what needs to be injected for a handler to run.\nInjectionRequest preInject(Function handler, Reflector reflector) {\n  var injection = InjectionRequest();\n\n  var closureMirror = reflector.reflectFunction(handler)!;\n\n  if (closureMirror.parameters.isEmpty) return injection;\n\n  // Load parameters\n  for (var parameter in closureMirror.parameters) {\n    var name = parameter.name;\n    var type = parameter.type.reflectedType;\n\n    var p =\n        parameter.annotations\n                .firstWhereOrNull(\n                  (m) =>\n                      m.type.isAssignableTo(reflector.reflectType(Parameter)),\n                )\n                ?.reflectee\n            as Parameter?;\n    //print(p);\n    if (p != null) {\n      injection.parameters[name] = Parameter(\n        cookie: p.cookie,\n        header: p.header,\n        query: p.query,\n        session: p.session,\n        match: p.match,\n        defaultValue: p.defaultValue,\n        required: parameter.isNamed ? false : p.required != false,\n      );\n    }\n\n    if (!parameter.isNamed) {\n      if (!parameter.isRequired) injection.optional.add(name);\n\n      if (type == RequestContext || type == ResponseContext) {\n        injection.required.add(type);\n      } else if (name == 'req') {\n        injection.required.add(RequestContext);\n      } else if (name == 'res') {\n        injection.required.add(ResponseContext);\n      } else if (type == dynamic) {\n        injection.required.add(name);\n      } else {\n        injection.required.add([name, type]);\n      }\n    } else {\n      injection.named[name] = type;\n    }\n  }\n  return injection;\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/map_service.dart",
    "content": "import 'dart:async';\n\nimport 'package:angel3_http_exception/angel3_http_exception.dart';\n\nimport 'service.dart';\n\n/// A basic service that manages an in-memory list of maps.\nclass MapService extends Service<String?, Map<String, dynamic>> {\n  /// If set to `true`, clients can remove all items by passing a `null` `id` to `remove`.\n  ///\n  /// `false` by default.\n  final bool allowRemoveAll;\n\n  /// If set to `true`, parameters in `req.query` are applied to the database query.\n  final bool allowQuery;\n\n  /// If set to `true` (default), then the service will manage an `id` string and `createdAt` and `updatedAt` fields.\n  final bool autoIdAndDateFields;\n\n  /// If set to `true` (default), then the keys `created_at` and `updated_at` will automatically be snake_cased.\n  final bool autoSnakeCaseNames;\n\n  final List<Map<String, dynamic>> items = [];\n\n  MapService({\n    this.allowRemoveAll = false,\n    this.allowQuery = true,\n    this.autoIdAndDateFields = true,\n    this.autoSnakeCaseNames = true,\n  }) : super();\n\n  String get createdAtKey =>\n      autoSnakeCaseNames == false ? 'createdAt' : 'created_at';\n\n  String get updatedAtKey =>\n      autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at';\n\n  bool Function(Map<String, dynamic>) _matchesId(Object? id) {\n    return (Map<String, dynamic> item) {\n      if (item['id'] == null) {\n        return false;\n      } else if (autoIdAndDateFields != false) {\n        return item['id'] == id.toString();\n      } else {\n        return item['id'] == id;\n      }\n    };\n  }\n\n  @override\n  Future<List<Map<String, dynamic>>> index([Map<String, dynamic>? params]) {\n    if (allowQuery == false || params == null || params['query'] is! Map) {\n      return Future.value(items);\n    } else {\n      var query = params['query'] as Map?;\n\n      return Future.value(\n        items.where((item) {\n          for (var key in query!.keys) {\n            if (!item.containsKey(key)) {\n              return false;\n            } else if (item[key] != query[key]) {\n              return false;\n            }\n          }\n\n          return true;\n        }).toList(),\n      );\n    }\n  }\n\n  @override\n  Future<Map<String, dynamic>> read(\n    String? id, [\n    Map<String, dynamic>? params,\n  ]) {\n    return Future.value(\n      items.firstWhere(\n        _matchesId(id),\n        orElse: (() => throw AngelHttpException.notFound(\n          message: 'No record found for ID $id',\n        )),\n      ),\n    );\n  }\n\n  @override\n  Future<Map<String, dynamic>> create(\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) {\n    var now = DateTime.now().toIso8601String();\n    var result = Map<String, dynamic>.from(data);\n\n    if (autoIdAndDateFields == true) {\n      result\n        ..['id'] = items.length.toString()\n        ..[autoSnakeCaseNames == false ? 'createdAt' : 'created_at'] = now\n        ..[autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at'] = now;\n    }\n    items.add(result);\n    return Future.value(result);\n  }\n\n  @override\n  Future<Map<String, dynamic>> modify(\n    String? id,\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) {\n    //if (data is! Map) {\n    //  throw AngelHttpException.badRequest(\n    //      message:\n    //          'MapService does not support `modify` with ${data.runtimeType}.');\n    //}\n    if (!items.any(_matchesId(id))) return create(data, params);\n\n    return read(id).then((item) {\n      var idx = items.indexOf(item);\n      if (idx < 0) return create(data, params);\n      var result = Map<String, dynamic>.from(item)..addAll(data);\n\n      if (autoIdAndDateFields == true) {\n        result[autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at'] =\n            DateTime.now().toIso8601String();\n      }\n      return Future.value(items[idx] = result);\n    });\n  }\n\n  @override\n  Future<Map<String, dynamic>> update(\n    String? id,\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) {\n    //if (data is! Map) {\n    //  throw AngelHttpException.badRequest(\n    //      message:\n    //          'MapService does not support `update` with ${data.runtimeType}.');\n    //}\n    if (!items.any(_matchesId(id))) return create(data, params);\n\n    return read(id).then((old) {\n      if (!items.remove(old)) {\n        throw AngelHttpException.notFound(\n          message: 'No record found for ID $id',\n        );\n      }\n\n      var result = Map<String, dynamic>.from(data);\n      if (autoIdAndDateFields == true) {\n        result\n          ..['id'] = id?.toString()\n          ..[autoSnakeCaseNames == false ? 'createdAt' : 'created_at'] =\n              old[autoSnakeCaseNames == false ? 'createdAt' : 'created_at']\n          ..[autoSnakeCaseNames == false ? 'updatedAt' : 'updated_at'] =\n              DateTime.now().toIso8601String();\n      }\n      items.add(result);\n      return Future.value(result);\n    });\n  }\n\n  @override\n  Future<Map<String, dynamic>> remove(\n    String? id, [\n    Map<String, dynamic>? params,\n  ]) {\n    if (id == null || id == 'null') {\n      // Remove everything...\n      if (!(allowRemoveAll == true ||\n          params?.containsKey('provider') != true)) {\n        throw AngelHttpException.forbidden(\n          message: 'Clients are not allowed to delete all items.',\n        );\n      } else {\n        items.clear();\n        return Future.value({});\n      }\n    }\n\n    return read(id, params).then((result) {\n      if (items.remove(result)) {\n        return result;\n      } else {\n        throw AngelHttpException.notFound(\n          message: 'No record found for ID $id',\n        );\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/metadata.dart",
    "content": "library;\n\nimport 'package:angel3_http_exception/angel3_http_exception.dart';\n\nimport 'hooked_service.dart' show HookedServiceEventListener;\nimport 'request_context.dart';\nimport 'routable.dart';\n\n/// Annotation to map middleware onto a handler.\nclass Middleware {\n  final Iterable<RequestHandler> handlers;\n\n  const Middleware(this.handlers);\n}\n\n/// Attaches hooks to a [HookedService].\nclass Hooks {\n  final List<HookedServiceEventListener> before;\n  final List<HookedServiceEventListener> after;\n\n  const Hooks({this.before = const [], this.after = const []});\n}\n\n/// Specifies to NOT expose a method to the Internet.\nclass NoExpose {\n  const NoExpose();\n}\n\nconst NoExpose noExpose = NoExpose();\n\n/// Exposes a [Controller] or a [Controller] method to the Internet.\n/// Example:\n///\n/// ```dart\n/// @Expose('/elements')\n/// class ElementController extends Controller {\n///\n///   @Expose('/')\n///   List<Element> getList() => someComputationHere();\n///\n///   @Expose('/int:elementId')\n///   getElement(int elementId) => someOtherComputation();\n///\n/// }\n/// ```\nclass Expose {\n  final String method;\n  final String path;\n  final Iterable<RequestHandler> middleware;\n  final String? as;\n  final List<String> allowNull;\n\n  static const Expose get = Expose('', method: 'GET'),\n      post = Expose('', method: 'POST'),\n      patch = Expose('', method: 'PATCH'),\n      put = Expose('', method: 'PUT'),\n      delete = Expose('', method: 'DELETE'),\n      head = Expose('', method: 'HEAD');\n\n  const Expose(\n    this.path, {\n    this.method = 'GET',\n    this.middleware = const [],\n    this.as,\n    this.allowNull = const [],\n  });\n\n  const Expose.method(\n    this.method, {\n    this.middleware = const [],\n    this.as,\n    this.allowNull = const [],\n  }) : path = '';\n}\n\n/// Used to apply special dependency injections or functionality to a function parameter.\nclass Parameter {\n  /// Inject the value of a request cookie.\n  final String? cookie;\n\n  /// Inject the value of a request header.\n  final String? header;\n\n  /// Inject the value of a key from the session.\n  final String? session;\n\n  /// Inject the value of a key from the query.\n  final String? query;\n\n  /// Only execute the handler if the value of this parameter matches the given value.\n  final dynamic match;\n\n  /// Specify a default value.\n  final dynamic defaultValue;\n\n  /// If `true` (default), then an error will be thrown if this parameter is not present.\n  final bool required;\n\n  const Parameter({\n    this.cookie,\n    this.query,\n    this.header,\n    this.session,\n    this.match,\n    this.defaultValue,\n    this.required = true,\n  });\n\n  /// Returns an error that can be thrown when the parameter is not present.\n  Object? get error {\n    if (cookie?.isNotEmpty == true) {\n      return AngelHttpException.badRequest(\n        message: 'Missing required cookie \"$cookie\".',\n      );\n    }\n    if (header?.isNotEmpty == true) {\n      return AngelHttpException.badRequest(\n        message: 'Missing required header \"$header\".',\n      );\n    }\n    if (query?.isNotEmpty == true) {\n      return AngelHttpException.badRequest(\n        message: 'Missing required query parameter \"$query\".',\n      );\n    }\n    if (session?.isNotEmpty == true) {\n      return StateError('Session does not contain required key \"$session\".');\n    }\n\n    return null;\n  }\n\n  /// Obtains a value for this parameter from a [RequestContext].\n  dynamic getValue(RequestContext req) {\n    if (cookie?.isNotEmpty == true) {\n      return req.cookies.firstWhere((c) => c.name == cookie).value;\n    }\n    if (header?.isNotEmpty == true) {\n      return req.headers?.value(header ?? '') ?? defaultValue;\n    }\n    if (session?.isNotEmpty == true) {\n      return req.session?[session] ?? defaultValue;\n    }\n    if (query?.isNotEmpty == true) {\n      return req.uri?.queryParameters[query] ?? defaultValue;\n    }\n    return defaultValue;\n  }\n}\n\n/// Shortcut for declaring a request header [Parameter].\nclass Header extends Parameter {\n  const Header(String header, {super.match, super.defaultValue, super.required})\n    : super(header: header);\n}\n\n/// Shortcut for declaring a request session [Parameter].\nclass Session extends Parameter {\n  const Session(\n    String session, {\n    super.match,\n    super.defaultValue,\n    super.required,\n  }) : super(session: session);\n}\n\n/// Shortcut for declaring a request query [Parameter].\nclass Query extends Parameter {\n  const Query(String query, {super.match, super.defaultValue, super.required})\n    : super(query: query);\n}\n\n/// Shortcut for declaring a request cookie [Parameter].\nclass CookieValue extends Parameter {\n  const CookieValue(\n    String cookie, {\n    super.match,\n    super.defaultValue,\n    super.required,\n  }) : super(cookie: cookie);\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/request_context.dart",
    "content": "library;\n\nimport 'dart:async';\nimport 'dart:convert';\nimport 'dart:typed_data' show BytesBuilder;\nimport 'dart:io'\n    show Cookie, HeaderValue, HttpHeaders, HttpSession, InternetAddress;\n\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:belatuk_http_server/belatuk_http_server.dart';\nimport 'package:meta/meta.dart';\nimport 'package:mime/mime.dart';\nimport 'package:path/path.dart' as p;\nimport 'package:collection/collection.dart';\nimport 'package:logging/logging.dart';\n\nimport 'metadata.dart';\nimport 'response_context.dart';\nimport 'routable.dart';\nimport 'server.dart' show Angel;\n\npart 'injection.dart';\n\n/// A convenience wrapper around an incoming [RawRequest].\nabstract class RequestContext<RawRequest> {\n  /// Similar to [Angel.shutdownHooks], allows for logic to be executed\n  /// when a [RequestContext] is done being processed.\n  final _log = Logger('RequestContext');\n\n  final List<FutureOr<void> Function()> shutdownHooks = [];\n\n  String? _acceptHeaderCache, _extensionCache;\n  bool? _acceptsAllCache;\n  Map<String, dynamic>? _queryParameters;\n  Object? _bodyObject;\n  bool _hasParsedBody = false, _closed = false;\n  Map<String, dynamic> _bodyFields = {};\n  List _bodyList = [];\n  List<UploadedFile> _uploadedFiles = <UploadedFile>[];\n  MediaType _contentType = MediaType('text', 'plain');\n\n  /// The underlying [RawRequest] provided by the driver.\n  RawRequest get rawRequest;\n\n  /// Additional params to be passed to services.\n  final Map<String, dynamic> serviceParams = {};\n\n  /// The [Angel] instance that is responding to this request.\n  Angel? app;\n\n  /// Any cookies sent with this request.\n  List<Cookie> get cookies => <Cookie>[];\n\n  /// All HTTP headers sent with this request.\n  HttpHeaders? get headers;\n\n  /// The requested hostname.\n  String get hostname => 'localhost';\n\n  /// The IoC container that can be used to provide functionality to produce\n  /// objects of a given type.\n  ///\n  /// This is a *child* of the container found in `app`.\n  Container? get container;\n\n  /// The user's IP.\n  String get ip => remoteAddress.address;\n\n  /// This request's HTTP method.\n  ///\n  /// This may have been processed by an override. See [originalMethod] to get the real method.\n  String get method => 'GET';\n\n  /// The original HTTP verb sent to the server.\n  String get originalMethod => 'GET';\n\n  /// The content type of an incoming request.\n  MediaType get contentType {\n    if (headers?.contentType != null) {\n      try {\n        _contentType = MediaType.parse(headers!.contentType.toString());\n      } catch (e) {\n        _log.warning(\n          'Invalid media type [${headers!.contentType.toString()}]',\n          e,\n        );\n      }\n    }\n    return _contentType;\n  }\n\n  /// The URL parameters extracted from the request URI.\n  Map<String, dynamic> params = <String, dynamic>{};\n\n  /// The requested path.\n  String get path => '';\n\n  /// Is this an **XMLHttpRequest**?\n  bool get isXhr {\n    return headers?.value('X-Requested-With')?.trim().toLowerCase() ==\n        'xmlhttprequest';\n  }\n\n  /// The remote address requesting this resource.\n  InternetAddress get remoteAddress;\n\n  /// The user's HTTP session.\n  HttpSession? get session;\n\n  /// The [Uri] instance representing the path this request is responding to.\n  Uri? get uri;\n\n  /// The [Stream] of incoming binary data sent from the client.\n  Stream<List<int>>? get body;\n\n  /// Returns `true` if [parseBody] has been called so far.\n  bool get hasParsedBody => _hasParsedBody;\n\n  /// Returns a *mutable* [Map] of the fields parsed from the request [body].\n  ///\n  /// Note that [parseBody] must be called first.\n  Map<String, dynamic> get bodyAsMap {\n    if (!hasParsedBody) {\n      throw StateError('The request body has not been parsed yet.');\n    }\n    // else if (_bodyFields == null) {\n    //  throw StateError('The request body, $_bodyObject, is not a Map.');\n    //}\n\n    return _bodyFields;\n  }\n\n  /// This setter allows you to explicitly set the request body **exactly once**.\n  ///\n  /// Use this if the format of the body is not natively parsed by Angel.\n  set bodyAsMap(Map<String, dynamic>? value) => bodyAsObject = value;\n\n  /// Returns a *mutable* [List] parsed from the request [body].\n  ///\n  /// Note that [parseBody] must be called first.\n  List? get bodyAsList {\n    if (!hasParsedBody) {\n      throw StateError('The request body has not been parsed yet.');\n      // TODO: Relook at this\n      //} else if (_bodyList == null) {\n    } else if (_bodyList.isEmpty) {\n      throw StateError('The request body, $_bodyObject, is not a List.');\n    }\n\n    return _bodyList;\n  }\n\n  /// This setter allows you to explicitly set the request body **exactly once**.\n  ///\n  /// Use this if the format of the body is not natively parsed by Angel.\n  set bodyAsList(List? value) => bodyAsObject = value;\n\n  /// Returns the parsed request body, whatever it may be (typically a [Map] or [List]).\n  ///\n  /// Note that [parseBody] must be called first.\n  Object? get bodyAsObject {\n    if (!hasParsedBody) {\n      throw StateError('The request body has not been parsed yet.');\n    }\n\n    return _bodyObject;\n  }\n\n  /// This setter allows you to explicitly set the request body **exactly once**.\n  ///\n  /// Use this if the format of the body is not natively parsed by Angel.\n  set bodyAsObject(Object? value) {\n    if (_bodyObject != null) {\n      throw StateError(\n        'The request body has already been parsed/set, and cannot be overwritten.',\n      );\n    } else {\n      if (value is List) _bodyList = value;\n      if (value is Map<String, dynamic>) _bodyFields = value;\n      _bodyObject = value;\n      _hasParsedBody = true;\n    }\n  }\n\n  /// Returns a *mutable* map of the files parsed from the request [body].\n  ///\n  /// Note that [parseBody] must be called first.\n  List<UploadedFile>? get uploadedFiles {\n    if (!hasParsedBody) {\n      throw StateError('The request body has not been parsed yet.');\n    }\n\n    return _uploadedFiles;\n  }\n\n  /// Returns a *mutable* map of the fields contained in the query.\n  Map<String, dynamic> get queryParameters => _queryParameters ??=\n      Map<String, dynamic>.from(uri?.queryParameters ?? {});\n\n  /// Returns the file extension of the requested path, if any.\n  ///\n  /// Includes the leading `.`, if there is one.\n  String get extension => _extensionCache ??= p.extension(uri?.path ?? '');\n\n  /// Returns `true` if the client's `Accept` header indicates that the given [contentType] is considered a valid response.\n  ///\n  /// You cannot provide a `null` [contentType].\n  /// If the `Accept` header's value is `*/*`, this method will always return `true`.\n  /// To ignore the wildcard (`*/*`), pass [strict] as `true`.\n  ///\n  /// [contentType] can be either of the following:\n  /// * A [ContentType], in which case the `Accept` header will be compared against its `mimeType` property.\n  /// * Any other Dart value, in which case the `Accept` header will be compared against the result of a `toString()` call.\n  bool accepts(Object? contentType, {bool strict = false}) {\n    var contentTypeString = contentType is MediaType\n        ? contentType.mimeType\n        : contentType?.toString();\n\n    // Change to assert\n    if (contentTypeString == null) {\n      _log.severe('RequestContext.accepts is null');\n      throw ArgumentError(\n        'RequestContext.accepts expects the `contentType` parameter to NOT be null.',\n      );\n    }\n\n    _acceptHeaderCache ??= headers?.value('accept');\n\n    if (_acceptHeaderCache == null) {\n      return true;\n    } else if (strict != true && _acceptHeaderCache!.contains('*/*')) {\n      return true;\n    } else {\n      return _acceptHeaderCache!.contains(contentTypeString);\n    }\n  }\n\n  /// Returns as `true` if the client's `Accept` header indicates that it will accept any response content type.\n  bool get acceptsAll => _acceptsAllCache ??= accepts('*/*');\n\n  /// Shorthand for deserializing [bodyAsMap], using some transformer function [f].\n  Future<T> deserializeBody<T>(\n    FutureOr<T> Function(Map?) f, {\n    Encoding encoding = utf8,\n  }) async {\n    await parseBody(encoding: encoding);\n    return await f(bodyAsMap);\n  }\n\n  /// Shorthand for decoding [bodyAsMap], using some [codec].\n  Future<T> decodeBody<T>(Codec<T, Map?> codec, {Encoding encoding = utf8}) =>\n      deserializeBody(codec.decode, encoding: encoding);\n\n  /// Manually parses the request body, if it has not already been parsed.\n  Future<void> parseBody({Encoding encoding = utf8}) async {\n    //if (contentType == null) {\n    //  throw FormatException('Missing \"content-type\" header.');\n    //}\n\n    if (!_hasParsedBody) {\n      _hasParsedBody = true;\n\n      var contentBody = body ?? Stream.empty();\n\n      if (contentType.type == 'application' && contentType.subtype == 'json') {\n        _uploadedFiles = [];\n\n        var parsed = (_bodyObject = await encoding.decoder\n            .bind(contentBody)\n            .join()\n            .then(json.decode));\n\n        if (parsed is Map) {\n          _bodyFields = Map<String, dynamic>.from(parsed);\n        } else if (parsed is List) {\n          _bodyList = parsed;\n        }\n      } else if (contentType.type == 'application' &&\n          contentType.subtype == 'x-www-form-urlencoded') {\n        _uploadedFiles = [];\n        var parsed = await encoding.decoder\n            .bind(contentBody)\n            .join()\n            .then((s) => Uri.splitQueryString(s, encoding: encoding));\n        _bodyFields = Map<String, dynamic>.from(parsed);\n      } else if (contentType.type == 'multipart' &&\n          contentType.subtype == 'form-data' &&\n          contentType.parameters.containsKey('boundary')) {\n        var boundary = contentType.parameters['boundary'] ?? '';\n        var transformer = MimeMultipartTransformer(boundary);\n        var parts = transformer\n            .bind(contentBody)\n            .map(\n              (part) =>\n                  HttpMultipartFormData.parse(part, defaultEncoding: encoding),\n            );\n        _bodyFields = {};\n        _uploadedFiles = [];\n\n        await for (var part in parts) {\n          if (part.isBinary) {\n            _uploadedFiles.add(UploadedFile(part));\n          } else if (part.isText &&\n              part.contentDisposition.parameters.containsKey('name')) {\n            // If there is no name, then don't parse it.\n            var key = part.contentDisposition.parameters['name'];\n            if (key != null) {\n              var value = await part.join();\n              _bodyFields[key] = value;\n            }\n          }\n        }\n      } else {\n        _bodyFields = {};\n        _uploadedFiles = [];\n      }\n    }\n  }\n\n  /// Disposes of all resources.\n  @mustCallSuper\n  Future<void> close() async {\n    if (!_closed) {\n      _closed = true;\n      _acceptsAllCache = null;\n      _acceptHeaderCache = null;\n      serviceParams.clear();\n      params.clear();\n      await Future.forEach(shutdownHooks, (dynamic hook) => hook());\n    }\n  }\n}\n\n/// Reads information about a binary chunk uploaded to the server.\nclass UploadedFile {\n  /// The underlying `form-data` item.\n  final HttpMultipartFormData formData;\n  final log = Logger('UploadedFile');\n\n  MediaType _contentType = MediaType('multipart', 'form-data');\n\n  UploadedFile(this.formData);\n\n  /// Returns the binary stream from [formData].\n  Stream<List<int>> get data => formData.cast<List<int>>();\n\n  /// The filename associated with the data on the user's system.\n  /// Returns [:null:] if not present.\n  String? get filename => formData.contentDisposition.parameters['filename'];\n\n  /// The name of the field associated with this data.\n  /// Returns [:null:] if not present.\n  String? get name => formData.contentDisposition.parameters['name'];\n\n  /// The parsed [:Content-Type:] header of the [:HttpMultipartFormData:].\n  /// Returns [:null:] if not present.\n  //MediaType get contentType => _contentType ??= (formData.contentType == null\n  //    ? null\n  //    : MediaType.parse(formData.contentType.toString()));\n\n  MediaType get contentType {\n    if (formData.contentType != null) {\n      try {\n        _contentType = MediaType.parse(formData.contentType.toString());\n      } catch (e) {\n        log.warning(\n          'Invalue media type [${formData.contentType.toString()}]',\n          e,\n        );\n      }\n    }\n\n    return _contentType;\n  }\n\n  /// The parsed [:Content-Transfer-Encoding:] header of the\n  /// [:HttpMultipartFormData:]. This field is used to determine how to decode\n  /// the data. Returns [:null:] if not present.\n  HeaderValue? get contentTransferEncoding => formData.contentTransferEncoding;\n\n  /// Reads the contents of the file into a single linear buffer.\n  ///\n  /// Note that this leads to holding the whole file in memory, which might\n  /// not be ideal for large files.w\n  Future<List<int>> readAsBytes() {\n    return data\n        .fold<BytesBuilder>(BytesBuilder(), (bb, out) => bb..add(out))\n        .then((bb) => bb.takeBytes());\n  }\n\n  /// Reads the contents of the file as [String], using the given [encoding].\n  Future<String> readAsString({Encoding encoding = utf8}) {\n    return encoding.decoder.bind(data).join();\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/response_context.dart",
    "content": "library;\n\nimport 'dart:async';\nimport 'dart:convert';\nimport 'dart:convert' as c show json;\nimport 'dart:io' show BytesBuilder, Cookie;\nimport 'dart:typed_data';\n\nimport 'package:angel3_route/angel3_route.dart';\nimport 'package:file/file.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:mime/mime.dart';\n\nimport 'controller.dart';\nimport 'request_context.dart';\nimport 'server.dart' show Angel;\n\nfinal RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\n/// A convenience wrapper around an outgoing HTTP request.\nabstract class ResponseContext<RawResponse>\n    implements StreamConsumer<List<int>>, StreamSink<List<int>>, StringSink {\n  final Map properties = {};\n  final CaseInsensitiveMap<String> _headers = CaseInsensitiveMap<String>.from({\n    'content-type': 'text/plain',\n    'server': 'Angel3',\n  });\n\n  //final log = Logger('ResponseContext');\n\n  Completer? _done;\n  int _statusCode = 200;\n\n  /// The [Angel] instance that is sending a response.\n  Angel? app;\n\n  /// Is `Transfer-Encoding` chunked?\n  bool? chunked;\n\n  /// Any and all cookies to be sent to the user.\n  final List<Cookie> cookies = [];\n\n  /// A set of [Converter] objects that can be used to encode response data.\n  ///\n  /// At most one encoder will ever be used to convert data.\n  final Map<String, Converter<List<int>, List<int>>> encoders = {};\n\n  /// A [Map] of data to inject when `res.render` is called.\n  ///\n  /// This can be used to reduce boilerplate when using templating engines.\n  final Map<String, dynamic> renderParams = {};\n\n  /// Points to the [RequestContext] corresponding to this response.\n  RequestContext? get correspondingRequest;\n\n  @override\n  Future get done => (_done ?? Completer()).future;\n\n  /// Headers that will be sent to the user.\n  ///\n  /// Note that if you have already started writing to the underlying stream, headers will not persist.\n  CaseInsensitiveMap<String> get headers => _headers;\n\n  /// Serializes response data into a String.\n  ///\n  /// The default is conversion into JSON via `json.encode`.\n  ///\n  /// If you are 100% sure that your response handlers will only\n  /// be JSON-encodable objects (i.e. primitives, `List`s and `Map`s),\n  /// then consider setting [serializer] to `JSON.encode`.\n  ///\n  /// To set it globally for the whole [app], use the following helper:\n  /// ```dart\n  /// app.injectSerializer(JSON.encode);\n  /// ```\n  FutureOr<String> Function(dynamic) serializer = c.json.encode;\n\n  /// This response's status code.\n  int get statusCode => _statusCode;\n\n  set statusCode(int value) {\n    if (!isOpen) {\n      throw closed();\n    } else {\n      _statusCode = value; // ?? 200;\n    }\n  }\n\n  /// Returns `true` if the response is still available for processing by Angel.\n  ///\n  /// If it is `false`, then Angel will stop executing handlers, and will only run\n  /// response finalizers if the response [isBuffered].\n  bool get isOpen;\n\n  /// Returns `true` if response data is being written to a buffer, rather than to the underlying stream.\n  bool get isBuffered;\n\n  /// A set of UTF-8 encoded bytes that will be written to the response.\n  BytesBuilder? get buffer;\n\n  /// The underlying [RawResponse] under this instance.\n  RawResponse get rawResponse;\n\n  /// Signals Angel that the response is being held alive deliberately, and that the framework should not automatically close it.\n  ///\n  /// This is mostly used in situations like WebSocket handlers, where the connection should remain\n  /// open indefinitely.\n  FutureOr<RawResponse> detach();\n\n  /// Gets or sets the content length to send back to a client.\n  ///\n  /// Returns `null` if the header is invalidly formatted.\n  int? get contentLength {\n    return int.tryParse(headers['content-length'] ?? '-1');\n  }\n\n  /// Gets or sets the content length to send back to a client.\n  ///\n  /// If [value] is `null`, then the header will be removed.\n  set contentLength(int? value) {\n    if (value == null || value == -1) {\n      headers.remove('content-length');\n    } else {\n      headers['content-length'] = value.toString();\n    }\n  }\n\n  /// Gets or sets the content type to send back to a client.\n  MediaType get contentType {\n    try {\n      return MediaType.parse(headers['content-type']!);\n    } catch (_) {\n      return MediaType('text', 'plain');\n    }\n  }\n\n  /// Gets or sets the content type to send back to a client.\n  set contentType(MediaType value) {\n    headers['content-type'] = value.toString();\n  }\n\n  static StateError closed() => StateError('Cannot modify a closed response.');\n\n  /// Sends a download as a response.\n  Future<void> download(File file, {String? filename}) async {\n    if (!isOpen) throw closed();\n\n    headers['Content-Disposition'] =\n        'attachment; filename=\"${filename ?? file.path}\"';\n    contentType = MediaType.parse(lookupMimeType(file.path)!);\n    headers['content-length'] = file.lengthSync().toString();\n\n    if (!isBuffered) {\n      await file.openRead().cast<List<int>>().pipe(this);\n    } else {\n      buffer!.add(file.readAsBytesSync());\n      await close();\n    }\n  }\n\n  /// Prevents more data from being written to the response, and locks it entire from further editing.\n  @override\n  Future<void> close() {\n    if (buffer is LockableBytesBuilder) {\n      (buffer as LockableBytesBuilder).lock();\n    }\n\n    if (_done?.isCompleted == false) _done!.complete();\n    return Future.value();\n  }\n\n  /// Serializes JSON to the response.\n  Future<bool> json(Object? value) =>\n      serialize(value, contentType: MediaType('application', 'json'));\n\n  /// Returns a JSONP response.\n  ///\n  /// You can override the [contentType] sent; by default it is `application/javascript`.\n  Future<void> jsonp(\n    Object value, {\n    String callbackName = 'callback',\n    MediaType? contentType,\n  }) {\n    if (!isOpen) throw closed();\n    this.contentType = contentType ?? MediaType('application', 'javascript');\n    write('$callbackName(${serializer(value)})');\n    return close();\n  }\n\n  /// Renders a view to the response stream, and closes the response.\n  Future<void> render(String view, [Map<String, dynamic>? data]) {\n    if (!isOpen) throw closed();\n    contentType = MediaType('text', 'html', {'charset': 'utf-8'});\n    return Future<String>.sync(\n      () => app!.viewGenerator!(\n        view,\n        Map<String, dynamic>.from(renderParams)\n          ..addAll(data ?? <String, dynamic>{}),\n      ),\n    ).then((content) {\n      write(content);\n      return close();\n    });\n  }\n\n  /// Redirects to user to the given URL.\n  ///\n  /// [url] can be a `String`, or a `List`.\n  /// If it is a `List`, a URI will be constructed\n  /// based on the provided params.\n  ///\n  /// See [Router]#navigate for more. :)\n  Future<void> redirect(Object? url, {bool absolute = true, int? code}) {\n    if (!isOpen) throw closed();\n    headers\n      ..['content-type'] = 'text/html'\n      ..['location'] = (url is String || url is Uri)\n          ? url.toString()\n          : app!.navigate(url as Iterable, absolute: absolute);\n    statusCode = code ?? 302;\n    write('''\n    <!DOCTYPE html>\n    <html>\n      <head>\n        <title>Redirecting...</title>\n        <meta http-equiv=\"refresh\" content=\"0; url=$url\">\n      </head>\n      <body>\n        <h1>Currently redirecting you...</h1>\n        <br />\n        Click <a href=\"$url\">here</a> if you are not automatically redirected...\n        <script>\n          window.location = \"$url\";\n        </script>\n      </body>\n    </html>\n    ''');\n    return close();\n  }\n\n  /// Redirects to the given named [Route].\n  Future<void> redirectTo(String name, [Map? params, int? code]) async {\n    if (!isOpen) throw closed();\n    Route? findRoute(Router r) {\n      for (var route in r.routes) {\n        if (route is SymlinkRoute) {\n          final m = findRoute(route.router);\n\n          if (m != null) return m;\n        } else if (route.name == name) {\n          return route;\n        }\n      }\n\n      return null;\n    }\n\n    var matched = findRoute(app!);\n\n    if (matched != null) {\n      await redirect(\n        matched.makeUri(\n          params!.keys.fold<Map<String, dynamic>>({}, (out, k) {\n            return out..[k.toString()] = params[k];\n          }),\n        ),\n        code: code,\n      );\n      return;\n    }\n\n    throw ArgumentError.notNull('Route to redirect to ($name)');\n  }\n\n  /// Redirects to the given [Controller] action.\n  Future<void> redirectToAction(String action, [Map? params, int? code]) {\n    if (!isOpen) throw closed();\n    // UserController@show\n    var split = action.split('@');\n\n    if (split.length < 2) {\n      throw Exception(\n        \"Controller redirects must take the form of 'Controller@action'. You gave: $action\",\n      );\n    }\n\n    var controller = app!.controllers[split[0].replaceAll(_straySlashes, '')];\n\n    if (controller == null) {\n      throw Exception(\"Could not find a controller named '${split[0]}'\");\n    }\n\n    var matched = controller.routeMappings[split[1]];\n\n    if (matched == null) {\n      throw Exception(\n        \"Controller '${split[0]}' does not contain any action named '${split[1]}'\",\n      );\n    }\n\n    final head = controller\n        .findExpose(app!.container.reflector)!\n        .path\n        .toString()\n        .replaceAll(_straySlashes, '');\n    var tail = '';\n    if (params != null) {\n      tail = matched\n          .makeUri(\n            params.keys.fold<Map<String, dynamic>>({}, (out, k) {\n              return out..[k.toString()] = params[k];\n            }),\n          )\n          .replaceAll(_straySlashes, '');\n    }\n    return redirect('$head/$tail'.replaceAll(_straySlashes, ''), code: code);\n  }\n\n  /// Serializes data to the response.\n  Future<bool> serialize(Object? value, {MediaType? contentType}) async {\n    if (!isOpen) {\n      throw closed();\n    }\n    this.contentType = contentType ?? MediaType('application', 'json');\n    var text = await serializer(value);\n    if (text.isEmpty) return true;\n    write(text);\n    await close();\n    return false;\n  }\n\n  /// Streams a file to this response.\n  ///\n  /// `HEAD` responses will not actually write data.\n  Future streamFile(File file) async {\n    if (!isOpen) {\n      throw closed();\n    }\n    var mimeType = app!.mimeTypeResolver.lookup(file.path);\n    contentLength = await file.length();\n    contentType = mimeType == null\n        ? MediaType('application', 'octet-stream')\n        : MediaType.parse(mimeType);\n\n    if (correspondingRequest!.method != 'HEAD') {\n      return addStream(file.openRead().cast<List<int>>()).then((_) => close());\n    }\n  }\n\n  /// Configure the response to write to an intermediate response buffer, rather than to the stream directly.\n  void useBuffer();\n\n  /// Adds a stream directly the underlying response.\n  ///\n  /// If this instance has access to a [correspondingRequest], then it will attempt to transform\n  /// the content using at most one of the response [encoders].\n  @override\n  Future addStream(Stream<List<int>> stream);\n\n  @override\n  void addError(Object error, [StackTrace? stackTrace]) {\n    if (_done?.isCompleted == false) {\n      _done!.completeError(error, stackTrace);\n    } else if (_done == null) {\n      if (stackTrace != null) {\n        Zone.current.handleUncaughtError(error, stackTrace);\n      } else {\n        app?.logger.warning('[ResponseContext] stackTrace is null');\n      }\n    }\n  }\n\n  /// Writes data to the response.\n  @override\n  void write(value, {Encoding? encoding}) {\n    encoding ??= utf8;\n\n    if (!isOpen && isBuffered) {\n      throw closed();\n    } else if (!isBuffered) {\n      add(encoding.encode(value.toString()));\n    } else {\n      buffer!.add(encoding.encode(value.toString()));\n    }\n  }\n\n  @override\n  void writeCharCode(int charCode) {\n    if (!isOpen && isBuffered) {\n      throw closed();\n    } else if (!isBuffered) {\n      add([charCode]);\n    } else {\n      buffer!.addByte(charCode);\n    }\n  }\n\n  @override\n  void writeln([Object? obj = '']) {\n    write(obj.toString());\n    write('\\r\\n');\n  }\n\n  @override\n  void writeAll(Iterable objects, [String separator = '']) {\n    write(objects.join(separator));\n  }\n}\n\nabstract class LockableBytesBuilder implements BytesBuilder {\n  factory LockableBytesBuilder() {\n    return _LockableBytesBuilderImpl();\n  }\n\n  void lock();\n}\n\nclass _LockableBytesBuilderImpl implements LockableBytesBuilder {\n  final BytesBuilder _buf = BytesBuilder(copy: false);\n  bool _closed = false;\n\n  StateError _deny() =>\n      StateError('Cannot modified a closed response\\'s buffer.');\n\n  @override\n  void lock() {\n    _closed = true;\n  }\n\n  @override\n  void add(List<int> bytes) {\n    if (_closed) {\n      throw _deny();\n    } else {\n      _buf.add(bytes);\n    }\n  }\n\n  @override\n  void addByte(int byte) {\n    if (_closed) {\n      throw _deny();\n    } else {\n      _buf.addByte(byte);\n    }\n  }\n\n  @override\n  void clear() {\n    _buf.clear();\n  }\n\n  @override\n  bool get isEmpty => _buf.isEmpty;\n\n  @override\n  bool get isNotEmpty => _buf.isNotEmpty;\n\n  @override\n  int get length => _buf.length;\n\n  @override\n  Uint8List takeBytes() {\n    return _buf.takeBytes();\n  }\n\n  @override\n  Uint8List toBytes() {\n    return _buf.toBytes();\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/routable.dart",
    "content": "library;\n\nimport 'dart:async';\n\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_route/angel3_route.dart';\n\nimport '../util.dart';\nimport 'hooked_service.dart';\nimport 'metadata.dart';\nimport 'request_context.dart';\nimport 'response_context.dart';\nimport 'service.dart';\n\nfinal RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\n/// A function that receives an incoming [RequestContext] and responds to it.\ntypedef RequestHandler =\n    FutureOr<dynamic> Function(\n      RequestContext<dynamic> req,\n      ResponseContext<dynamic> res,\n    );\n\n/// Sequentially runs a list of [handlers] of middleware, and returns early if any does not\n/// return `true`. Works well with [Router].chain.\nRequestHandler chain(Iterable<RequestHandler> handlers) {\n  return (req, res) {\n    Future Function()? runPipeline;\n\n    for (var handler in handlers) {\n      //if (handler == null) break;\n\n      if (runPipeline == null) {\n        runPipeline = () => Future.sync(() => handler(req, res));\n      } else {\n        var current = runPipeline;\n        runPipeline = () => current().then(\n          (result) => !res.isOpen\n              ? Future.value(result)\n              : req.app!.executeHandler(handler, req, res),\n        );\n      }\n    }\n\n    runPipeline ??= () => Future.value();\n    return runPipeline();\n  };\n}\n\n/// A routable server that can handle dynamic requests.\nclass Routable extends Router<RequestHandler> {\n  final Map<Pattern, Service> _services = {};\n  final Map<Pattern, Service?> _serviceLookups = {};\n\n  /// A [Map] of application-specific data that can be accessed.\n  ///\n  /// Packages like `package:angel3_configuration` populate this map\n  /// for you.\n  final Map configuration = {};\n\n  final Container _container;\n\n  Routable([Reflector? reflector])\n    //      : _container = reflector == null ? null : Container(reflector),\n    : _container = Container(reflector ?? ThrowingReflector()),\n      super();\n\n  /// A [Container] used to inject dependencies.\n  Container get container => _container;\n\n  void close() {\n    _services.clear();\n    configuration.clear();\n    _onService.close();\n  }\n\n  /// A set of [Service] objects that have been mapped into routes.\n  Map<Pattern, Service> get services => _services;\n\n  final StreamController<Service> _onService =\n      StreamController<Service>.broadcast();\n\n  /// Fired whenever a service is added to this instance.\n  ///\n  /// **NOTE**: This is a broadcast stream.\n  Stream<Service> get onService => _onService.stream;\n\n  /// Retrieves the service assigned to the given path.\n  T? findService<T extends Service>(Pattern path) {\n    return _serviceLookups.putIfAbsent(path, () {\n          return _services[path] ??\n              _services[path.toString().replaceAll(_straySlashes, '')];\n        })\n        as T?;\n  }\n\n  /// Shorthand for finding a [Service] in a statically-typed manner.\n  Service<Id, Data>? findServiceOf<Id, Data>(Pattern path) {\n    return findService<Service<Id, Data>>(path);\n  }\n\n  /// Shorthand for finding a [HookedService] in a statically-typed manner.\n  HookedService<dynamic, dynamic, T>? findHookedService<T extends Service>(\n    Pattern path,\n  ) {\n    return findService(path) as HookedService<dynamic, dynamic, T>?;\n  }\n\n  @override\n  Route<RequestHandler> addRoute(\n    String method,\n    String path,\n    RequestHandler handler, {\n    Iterable<RequestHandler> middleware = const {},\n  }) {\n    final handlers = <RequestHandler>[];\n    // Merge @Middleware declaration, if any\n    var reflector = _container.reflector;\n    if (reflector is! ThrowingReflector) {\n      var middlewareDeclaration = getAnnotation<Middleware>(\n        handler,\n        _container.reflector,\n      );\n      if (middlewareDeclaration != null) {\n        handlers.addAll(middlewareDeclaration.handlers);\n      }\n    }\n\n    final handlerSequence = <RequestHandler>[];\n    handlerSequence.addAll(middleware);\n    handlerSequence.addAll(handlers);\n\n    return super.addRoute(\n      method,\n      path.toString(),\n      handler,\n      middleware: handlerSequence,\n    );\n  }\n\n  /// Mounts a [service] at the given [path].\n  ///\n  /// Returns a [HookedService] that can be used to hook into\n  /// events dispatched by this service.\n  HookedService<Id, Data, T> use<Id, Data, T extends Service<Id, Data>>(\n    String path,\n    T service,\n  ) {\n    var hooked = HookedService<Id, Data, T>(service);\n    _services[path.toString().trim().replaceAll(RegExp(r'(^/+)|(/+$)'), '')] =\n        hooked;\n    hooked.addRoutes();\n    mount(path.toString(), hooked);\n    service.onHooked(hooked);\n    _onService.add(hooked);\n    return hooked;\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/server.dart",
    "content": "library;\n\nimport 'dart:async';\nimport 'dart:collection' show HashMap;\nimport 'dart:convert';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_http_exception/angel3_http_exception.dart';\nimport 'package:angel3_route/angel3_route.dart';\nimport 'package:belatuk_combinator/belatuk_combinator.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mime/mime.dart';\nimport 'package:tuple/tuple.dart';\nimport 'controller.dart';\nimport 'env.dart';\nimport 'hooked_service.dart';\nimport 'request_context.dart';\nimport 'response_context.dart';\nimport 'routable.dart';\nimport 'service.dart';\n\n//final RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\n/// A function that configures an [Angel] server.\ntypedef AngelConfigurer = FutureOr<void> Function(Angel app);\n\n/// A function that asynchronously generates a view from the given path and data.\ntypedef ViewGenerator =\n    FutureOr<String> Function(String path, [Map<String, dynamic>? data]);\n\n/// A function that handles error\ntypedef AngelErrorHandler =\n    dynamic Function(\n      AngelHttpException e,\n      RequestContext req,\n      ResponseContext res,\n    );\n\n/// The default error handler for [Angel] server\nFuture<bool> _defaultErrorHandler(\n  AngelHttpException e,\n  RequestContext req,\n  ResponseContext res,\n) async {\n  if (!req.accepts('text/html', strict: true) &&\n      (req.accepts('application/json') ||\n          req.accepts('application/javascript'))) {\n    await res.json(e.toJson());\n    return Future.value(false);\n  } else {\n    res.contentType = MediaType('text', 'html', {'charset': 'utf8'});\n    res.statusCode = e.statusCode;\n    res.write('<!DOCTYPE html><html><head><title>${e.message}</title>');\n    res.write('</head><body><h1>${e.message}</h1><ul>');\n\n    for (var error in e.errors) {\n      res.write('<li>$error</li>');\n    }\n\n    res.write('</ul></body></html>');\n    return Future.value(false);\n  }\n}\n\n/// Default ROOT level logger\nLogger _defaultLogger() {\n  Logger logger = Logger('ROOT')\n    ..onRecord.listen((rec) {\n      if (rec.error == null) {\n        print(rec.message);\n      }\n\n      if (rec.error != null) {\n        var err = rec.error;\n        if (err is AngelHttpException && err.statusCode != 500) return;\n        print('${rec.message} \\n');\n        print(rec.error);\n        if (rec.stackTrace != null) {\n          print(rec.stackTrace);\n        }\n      }\n    });\n\n  return logger;\n}\n\n/// A powerful real-time/REST/MVC server class.\nclass Angel extends Routable {\n  static Future<String> _noViewEngineConfigured(String view, [Map? data]) =>\n      Future.value('No view engine has been configured yet.');\n\n  final List<Angel> _children = [];\n  final Map<\n    String,\n    Tuple4<\n      List,\n      Map<String, dynamic>,\n      ParseResult<RouteResult>,\n      MiddlewarePipeline\n    >\n  >\n  handlerCache = HashMap();\n\n  Router<RequestHandler>? _flattened;\n  Angel? _parent;\n\n  /// A global Map of converters that can transform responses bodies.\n  final Map<String, Converter<List<int>, List<int>>> encoders = {};\n\n  final Map<dynamic, InjectionRequest> _preContained = {};\n\n  /// A [MimeTypeResolver] that can be used to specify the MIME types of files not known by `package:mime`.\n  final MimeTypeResolver mimeTypeResolver = MimeTypeResolver();\n\n  /// A middleware to inject a serialize on every request.\n  FutureOr<String> Function(dynamic)? serializer;\n\n  /// A [Map] of dependency data obtained via reflection.\n  ///\n  /// You may modify this [Map] yourself if you intend to avoid reflection entirely.\n  Map<dynamic, InjectionRequest> get preContained => _preContained;\n\n  /// Returns the [flatten]ed version of this router in production.\n  Router<RequestHandler> get optimizedRouter => _flattened ?? this;\n\n  /// Determines whether to allow HTTP request method overrides.\n  bool allowMethodOverrides = true;\n\n  /// All child application mounted on this instance.\n  List<Angel> get children => List<Angel>.unmodifiable(_children);\n\n  final Map<Pattern, Controller> _controllers = {};\n\n  /// A set of [Controller] objects that have been loaded into the application.\n  Map<Pattern, Controller> get controllers => _controllers;\n\n  /// The [AngelEnvironment] in which the application is running.\n  ///\n  /// By default, it is automatically inferred.\n  final AngelEnvironment environment;\n\n  /// Returns the parent instance of this application, if any.\n  Angel? get parent => _parent;\n\n  /// Outputs diagnostics and debug messages.\n  Logger _logger = _defaultLogger();\n\n  Logger get logger => _logger;\n\n  /// Assign a custom logger.\n  /// Passing null will reset to default logger\n  set logger(Logger? log) {\n    _logger.clearListeners();\n\n    _logger = log ?? _defaultLogger();\n  }\n\n  /// Plug-ins to be called right before server startup.\n  ///\n  /// If the server is never started, they will never be called.\n  final List<AngelConfigurer> startupHooks = [];\n\n  /// Plug-ins to be called right before server shutdown.\n  ///\n  /// If the server is never [close]d, they will never be called.\n  final List<AngelConfigurer> shutdownHooks = [];\n\n  /// Always run before responses are sent.\n  ///\n  /// These will only not run if a response's `willCloseItself` is set to `true`.\n  final List<RequestHandler> responseFinalizers = [];\n\n  /// A function that renders views.\n  ///\n  /// Called by [ResponseContext]@`render`.\n  ViewGenerator? viewGenerator = _noViewEngineConfigured;\n\n  /// The handler currently configured to run on [AngelHttpException]s.\n  AngelErrorHandler errorHandler = _defaultErrorHandler;\n\n  @override\n  Route<RequestHandler> addRoute(\n    String method,\n    String path,\n    RequestHandler handler, {\n    Iterable<RequestHandler> middleware = const [],\n  }) {\n    if (_flattened != null) {\n      logger.warning(\n        'WARNING: You added a route ($method $path) to the router, after it had been optimized.',\n      );\n      logger.warning(\n        'This route will be ignored, and no requests will ever reach it.',\n      );\n    }\n\n    return super.addRoute(method, path, handler, middleware: middleware);\n  }\n\n  @override\n  SymlinkRoute<RequestHandler> mount(\n    String path,\n    Router<RequestHandler> router,\n  ) {\n    if (_flattened != null) {\n      logger.warning(\n        'WARNING: You added mounted a child router ($path) on the router, after it had been optimized.',\n      );\n      logger.warning(\n        'This route will be ignored, and no requests will ever reach it.',\n      );\n    }\n\n    if (router is Angel) {\n      router._parent = this;\n      _children.add(router);\n    }\n\n    return super.mount(path.toString(), router);\n  }\n\n  /// Loads some base dependencies into the service container.\n  void bootstrapContainer() {\n    if (runtimeType != Angel) {\n      container.registerSingleton(this);\n    }\n\n    container.registerSingleton<Angel>(this);\n    container.registerSingleton<Routable>(this);\n    container.registerSingleton<Router>(this);\n  }\n\n  /// Shuts down the server, and closes any open [StreamController]s.\n  ///\n  /// The server will be **COMPLETELY DEFUNCT** after this operation!\n  @override\n  Future<void> close() {\n    Future.forEach(services.values, (Service service) {\n      service.close();\n    });\n\n    super.close();\n    viewGenerator = _noViewEngineConfigured;\n    _preContained.clear();\n    handlerCache.clear();\n    encoders.clear();\n    _children.clear();\n    //_parent = null;\n    //logger = null;\n    //_flattened = null;\n    startupHooks.clear();\n    shutdownHooks.clear();\n    responseFinalizers.clear();\n    return Future.value();\n  }\n\n  @override\n  void dumpTree({\n    Function(String tree)? callback,\n    String header = 'Dumping route tree:',\n    String tab = '  ',\n    bool showMatchers = false,\n  }) {\n    if (environment.isProduction) {\n      _flattened ??= flatten(this);\n\n      _flattened!.dumpTree(\n        callback: callback,\n        header: header.isNotEmpty == true\n            ? header\n            : (environment.isProduction\n                  ? 'Dumping flattened route tree:'\n                  : 'Dumping route tree:'),\n        tab: tab,\n      );\n    } else {\n      super.dumpTree(\n        callback: callback,\n        header: header.isNotEmpty == true\n            ? header\n            : (environment.isProduction\n                  ? 'Dumping flattened route tree:'\n                  : 'Dumping route tree:'),\n        tab: tab,\n      );\n    }\n  }\n\n  Future getHandlerResult(\n    dynamic handler,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    if (handler is RequestHandler) {\n      var result = handler(req, res);\n      return getHandlerResult(result, req, res);\n    }\n\n    if (handler is Future) {\n      return handler.then((result) => getHandlerResult(result, req, res));\n    }\n\n    if (handler is Function) {\n      var result = runContained(handler, req, res);\n      return getHandlerResult(result, req, res);\n    }\n\n    if (handler is Stream) {\n      return getHandlerResult(handler.toList(), req, res);\n    }\n\n    return Future.value(handler);\n  }\n\n  /// Runs some [handler]. Returns `true` if request execution should continue.\n  Future<bool> executeHandler(\n    dynamic handler,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    return getHandlerResult(handler, req, res).then((result) {\n      if (result == null) {\n        return false;\n      } else if (result is bool) {\n        return result;\n      } else if (result != null) {\n        return res.serialize(result);\n      } else {\n        return res.isOpen;\n      }\n    });\n  }\n\n  /// Attempts to find a property by the given name within this application.\n  dynamic findProperty(dynamic key) {\n    if (configuration.containsKey(key)) return configuration[key];\n\n    //return parent != null ? parent?.findProperty(key) : null;\n    if (parent != null) {\n      return parent?.findProperty(key);\n    }\n\n    return null;\n  }\n\n  /// Runs several optimizations, *if* [angelEnv.isProduction] is `true`.\n  ///\n  /// * Preprocesses all dependency injection, and eliminates the burden of reflecting handlers\n  /// at run-time.\n  /// * [flatten]s the route tree into a linear one.\n  ///\n  /// You may [force] the optimization to run, if you are not running in production.\n  void optimizeForProduction({bool force = false}) {\n    if (environment.isProduction || force == true) {\n      _flattened ??= flatten(this);\n      logger.info('Angel is running in production mode.');\n    }\n  }\n\n  /// Run a function after injecting from service container.\n  /// If this function has been reflected before, then\n  /// the execution will be faster, as the injection requirements were stored beforehand.\n  Future runContained(\n    Function handler,\n    RequestContext req,\n    ResponseContext res, [\n    Container? container,\n  ]) {\n    container ??= Container(EmptyReflector());\n    return Future.sync(() {\n      if (_preContained.containsKey(handler)) {\n        return handleContained(handler, _preContained[handler]!, container)(\n          req,\n          res,\n        );\n      }\n\n      return runReflected(handler, req, res, container);\n    });\n  }\n\n  /// Runs with DI, and *always* reflects. Prefer [runContained].\n  Future runReflected(\n    Function handler,\n    RequestContext req,\n    ResponseContext res, [\n    Container? container,\n  ]) {\n    container ??=\n        req.container ?? res.app?.container ?? Container(EmptyReflector());\n\n    if (container.reflector is EmptyReflector) {\n      throw ArgumentError(\"No `reflector` passed\");\n    }\n    var h = handleContained(\n      handler,\n      _preContained[handler] = preInject(handler, container.reflector),\n      container,\n    );\n    return Future.sync(() => h(req, res));\n    // return   closureMirror.apply(args).reflectee;\n  }\n\n  /// Applies an [AngelConfigurer] to this instance.\n  Future configure(AngelConfigurer configurer) {\n    return Future.sync(() => configurer(this));\n  }\n\n  /// Shorthand for using the [container] to instantiate, and then mount a [Controller].\n  /// Returns the created controller.\n  ///\n  /// Just like [Container].make, in contexts without properly-reified generics (dev releases of Dart 2),\n  /// provide a [type] argument as well.\n  ///\n  /// If you are on `Dart >=2.0.0`, simply call `mountController<T>()`.\n  Future<T> mountController<T extends Controller>([Type? type]) {\n    var controller = container.make<T>(type);\n    return configure(controller.configureServer).then((_) => controller);\n  }\n\n  /// Shorthand for calling `all('*', handler)`.\n  Route<RequestHandler?> fallback(RequestHandler handler) {\n    return all('*', handler);\n  }\n\n  @override\n  HookedService<Id, Data, T> use<Id, Data, T extends Service<Id, Data>>(\n    String path,\n    T service,\n  ) {\n    service.app = this;\n    return super.use(path, service)..app = this;\n  }\n\n  static const String _reflectionErrorMessage =\n      '${ContainerConst.defaultErrorMessage} $_reflectionInfo';\n\n  static const String _reflectionInfo =\n      'Features like controllers, constructor dependency injection, and `ioc` require reflection, '\n      'and will not work without it.\\n\\n'\n      'For more, see the documentation:\\n'\n      'https://docs.angel-dart.dev/guides/dependency-injection#enabling-dart-mirrors-or-other-reflection';\n\n  Angel({\n    Reflector reflector = const ThrowingReflector(\n      errorMessage: _reflectionErrorMessage,\n    ),\n    this.environment = angelEnv,\n    Logger? logger,\n    this.allowMethodOverrides = true,\n    this.serializer,\n    this.viewGenerator,\n  }) : super(reflector) {\n    // Override default logger\n    if (logger != null) {\n      this.logger = logger;\n    }\n\n    if (reflector is EmptyReflector || reflector is ThrowingReflector) {\n      var msg =\n          'No `reflector` was passed to the Angel constructor, so reflection will not be available.\\n$_reflectionInfo';\n      this.logger.warning(msg);\n    }\n\n    bootstrapContainer();\n    viewGenerator ??= _noViewEngineConfigured;\n    serializer ??= json.encode;\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/core/service.dart",
    "content": "library;\n\nimport 'dart:async';\nimport 'package:angel3_http_exception/angel3_http_exception.dart';\nimport 'package:belatuk_merge_map/belatuk_merge_map.dart';\nimport 'package:quiver/core.dart';\nimport '../util.dart';\nimport 'anonymous_service.dart';\nimport 'hooked_service.dart' show HookedService;\nimport 'metadata.dart';\nimport 'request_context.dart';\nimport 'response_context.dart';\nimport 'routable.dart';\nimport 'server.dart';\n\n/// Indicates how the service was accessed.\n///\n/// This will be passed to the `params` object in a service method.\n/// When requested on the server side, this will be null.\nclass Providers {\n  /// The transport through which the client is accessing this service.\n  final String via;\n\n  const Providers(this.via);\n\n  static const String viaRest = 'rest';\n  static const String viaWebsocket = 'websocket';\n  static const String viaGraphQL = 'graphql';\n\n  /// Represents a request via REST.\n  static const Providers rest = Providers(viaRest);\n\n  /// Represents a request over WebSockets.\n  static const Providers websocket = Providers(viaWebsocket);\n\n  /// Represents a request parsed from GraphQL.\n  static const Providers graphQL = Providers(viaGraphQL);\n\n  @override\n  int get hashCode => hashObjects([via]);\n\n  @override\n  bool operator ==(other) => other is Providers && other.via == via;\n\n  Map<String, String> toJson() {\n    return {'via': via};\n  }\n\n  @override\n  String toString() {\n    return 'via:$via';\n  }\n}\n\n/// A front-facing interface that can present data to and operate on data on behalf of the user.\n///\n/// Heavily inspired by FeathersJS. <3\nclass Service<Id, Data> extends Routable {\n  /// A [List] of keys that services should ignore, should they see them in the query.\n  static const List<String> specialQueryKeys = <String>[\n    r'$limit',\n    r'$sort',\n    'page',\n    'token',\n  ];\n\n  /// Handlers that must run to ensure this service's functionality.\n  List<RequestHandler> get bootstrappers => [];\n\n  /// The [Angel] app powering this service.\n  Angel? _app;\n\n  Angel get app {\n    if (_app == null) {\n      throw ArgumentError(\"Angel is not initialized\");\n    }\n    return _app!;\n  }\n\n  set app(Angel angel) {\n    _app = angel;\n  }\n\n  bool get isAppActive => _app != null;\n\n  /// Closes this service, including any database connections or stream controllers.\n  @override\n  void close() {}\n\n  /// An optional [readData] function can be passed to handle non-map/non-json bodies.\n  Service({\n    FutureOr<Data> Function(RequestContext, ResponseContext)? readData,\n  }) {\n    _readData = readData;\n\n    _readData ??= (req, res) {\n      if (req.bodyAsObject is! Data) {\n        throw AngelHttpException.badRequest(\n          message:\n              'Invalid request body. Expected $Data; found ${req.bodyAsObject} instead.',\n        );\n      } else {\n        return req.bodyAsObject as Data;\n      }\n    };\n  }\n\n  FutureOr<Data> Function(RequestContext, ResponseContext)? _readData;\n\n  /// A [Function] that reads the request body and converts it into [Data].\n  FutureOr<Data> Function(RequestContext, ResponseContext)? get readData =>\n      _readData;\n\n  /// Retrieves the first object from the result of calling [index] with the given [params].\n  ///\n  /// If the result of [index] is `null`, OR an empty [Iterable], a 404 `AngelHttpException` will be thrown.\n  ///\n  /// If the result is both non-null and NOT an [Iterable], it will be returned as-is.\n  ///\n  /// If the result is a non-empty [Iterable], [findOne] will return `it.first`, where `it` is the aforementioned [Iterable].\n  ///\n  /// A custom [errorMessage] may be provided.\n  Future<Data> findOne([\n    Map<String, dynamic>? params,\n    String errorMessage = 'No record was found matching the given query.',\n  ]) {\n    return index(params).then((result) {\n      if (result.isEmpty) {\n        throw AngelHttpException.notFound(message: errorMessage);\n      } else {\n        return result.first;\n      }\n    });\n  }\n\n  /// Retrieves all resources.\n  Future<List<Data>> index([Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Retrieves the desired resource.\n  Future<Data> read(Id id, [Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Reads multiple resources at once.\n  ///\n  /// Service implementations should override this to ensure data is fetched within a\n  /// single round trip.\n  Future<List<Data>> readMany(List<Id> ids, [Map<String, dynamic>? params]) {\n    return Future.wait(ids.map((id) => read(id, params)));\n  }\n\n  /// Creates a resource.\n  Future<Data> create(Data data, [Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Modifies a resource.\n  Future<Data> modify(Id id, Data data, [Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Overwrites a resource.\n  Future<Data> update(Id id, Data data, [Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Removes the given resource.\n  Future<Data> remove(Id id, [Map<String, dynamic>? params]) {\n    throw AngelHttpException.methodNotAllowed();\n  }\n\n  /// Creates an [AnonymousService] that wraps over this one, and maps input and output\n  /// using two converter functions.\n  ///\n  /// Handy utility for handling data in a type-safe manner.\n  Service<Id, U> map<U>(\n    U Function(Data) encoder,\n    Data Function(U) decoder, {\n    FutureOr<U> Function(RequestContext, ResponseContext)? readData,\n  }) {\n    readData ??= (req, res) async {\n      var inner = await this.readData!(req, res)!;\n      return encoder(inner);\n    };\n\n    return AnonymousService<Id, U>(\n      readData: readData,\n      index: ([params]) {\n        return index(params).then((it) => it.map(encoder).toList());\n      },\n      read: (id, [params]) {\n        return read(id, params).then(encoder);\n      },\n      create: (data, [params]) {\n        return create(decoder(data), params).then(encoder);\n      },\n      modify: (id, data, [params]) {\n        return modify(id, decoder(data), params).then(encoder);\n      },\n      update: (id, data, [params]) {\n        return update(id, decoder(data), params).then(encoder);\n      },\n      remove: (id, [params]) {\n        return remove(id, params).then(encoder);\n      },\n    );\n  }\n\n  /// Transforms an [id] (whether it is a String, num, etc.) into one acceptable by a service.\n  ///\n  /// The single type argument, [T], is used to determine how to parse the [id].\n  ///\n  /// For example, `parseId<bool>` attempts to parse the value as a [bool].\n  static T parseId<T>(Object? id) {\n    if (id == null || id == 'null') {\n      return 'null' as T;\n      //throw ArgumentError(\"[Service] Null is not supported\");\n    } else if (T == String) {\n      return id.toString() as T;\n    } else if (T == int) {\n      return int.parse(id.toString()) as T;\n    } else if (T == bool) {\n      return (id == true || id.toString() == 'true') as T;\n    } else if (T == double) {\n      return double.parse(id.toString()) as T;\n    } else if (T == num) {\n      return num.parse(id.toString()) as T;\n    } else {\n      return id as T;\n    }\n  }\n\n  /// Generates RESTful routes pointing to this class's methods.\n  void addRoutes([Service? service]) {\n    _addRoutesInner(service ?? this, bootstrappers);\n  }\n\n  void _addRoutesInner(Service service, Iterable<RequestHandler> handlerss) {\n    var restProvider = {'provider': Providers.rest};\n    var handlers = List<RequestHandler>.from(handlerss);\n\n    // Add global middleware if declared on the instance itself\n    var before = getAnnotation<Middleware>(service, app.container.reflector);\n\n    if (before != null) handlers.addAll(before.handlers);\n\n    var indexMiddleware = getAnnotation<Middleware>(\n      service.index,\n      app.container.reflector,\n    );\n    get(\n      '/',\n      (req, res) {\n        return index(\n          mergeMap([\n            {'query': req.queryParameters},\n            restProvider,\n            req.serviceParams,\n          ]),\n        );\n      },\n      middleware: [\n        ...handlers,\n        ...(indexMiddleware == null) ? [] : indexMiddleware.handlers.toList(),\n      ],\n    );\n\n    var createMiddleware = getAnnotation<Middleware>(\n      service.create,\n      app.container.reflector,\n    );\n    post(\n      '/',\n      (req, ResponseContext res) {\n        return req.parseBody().then((_) async {\n          return await create(\n            (await readData!(req, res))!,\n            mergeMap([\n              {'query': req.queryParameters},\n              restProvider,\n              req.serviceParams,\n            ]),\n          ).then((r) {\n            res.statusCode = 201;\n            return r;\n          });\n        });\n      },\n      middleware: [\n        ...handlers,\n        ...(createMiddleware == null) ? [] : createMiddleware.handlers.toList(),\n      ],\n    );\n\n    var readMiddleware = getAnnotation<Middleware>(\n      service.read,\n      app.container.reflector,\n    );\n\n    get(\n      '/:id',\n      (req, res) {\n        return read(\n          parseId<Id>(req.params['id']),\n          mergeMap([\n            {'query': req.queryParameters},\n            restProvider,\n            req.serviceParams,\n          ]),\n        );\n      },\n      middleware: [\n        ...handlers,\n        ...(readMiddleware == null) ? [] : readMiddleware.handlers.toList(),\n      ],\n    );\n\n    var modifyMiddleware = getAnnotation<Middleware>(\n      service.modify,\n      app.container.reflector,\n    );\n\n    patch(\n      '/:id',\n      (req, res) {\n        return req.parseBody().then((_) async {\n          return await modify(\n            parseId<Id>(req.params['id']),\n            (await readData!(req, res))!,\n            mergeMap([\n              {'query': req.queryParameters},\n              restProvider,\n              req.serviceParams,\n            ]),\n          );\n        });\n      },\n      middleware: [\n        ...handlers,\n        ...(modifyMiddleware == null) ? [] : modifyMiddleware.handlers.toList(),\n      ],\n    );\n\n    var updateMiddleware = getAnnotation<Middleware>(\n      service.update,\n      app.container.reflector,\n    );\n    post(\n      '/:id',\n      (req, res) {\n        return req.parseBody().then((_) async {\n          return await update(\n            parseId<Id>(req.params['id']),\n            (await readData!(req, res))!,\n            mergeMap([\n              {'query': req.queryParameters},\n              restProvider,\n              req.serviceParams,\n            ]),\n          );\n        });\n      },\n      middleware: [\n        ...handlers,\n        ...(updateMiddleware == null) ? [] : updateMiddleware.handlers.toList(),\n      ],\n    );\n\n    put(\n      '/:id',\n      (req, res) {\n        return req.parseBody().then((_) async {\n          return await update(\n            parseId<Id>(req.params['id']),\n            (await readData!(req, res))!,\n            mergeMap([\n              {'query': req.queryParameters},\n              restProvider,\n              req.serviceParams,\n            ]),\n          );\n        });\n      },\n      middleware: [\n        ...handlers,\n        ...(updateMiddleware == null) ? [] : updateMiddleware.handlers.toList(),\n      ],\n    );\n\n    var removeMiddleware = getAnnotation<Middleware>(\n      service.remove,\n      app.container.reflector,\n    );\n    delete(\n      '/',\n      (req, res) {\n        return remove(\n          '' as Id,\n          mergeMap([\n            {'query': req.queryParameters},\n            restProvider,\n            req.serviceParams,\n          ]),\n        );\n      },\n      middleware: [\n        ...handlers,\n        ...(removeMiddleware == null) ? [] : removeMiddleware.handlers.toList(),\n      ],\n    );\n\n    delete(\n      '/:id',\n      (req, res) {\n        return remove(\n          parseId<Id>(req.params['id']),\n          mergeMap([\n            {'query': req.queryParameters},\n            restProvider,\n            req.serviceParams,\n          ]),\n        );\n      },\n      middleware: [\n        ...handlers,\n        ...(removeMiddleware == null) ? [] : removeMiddleware.handlers.toList(),\n      ],\n    );\n\n    // REST compliance\n    put('/', (req, res) => throw AngelHttpException.notFound());\n    patch('/', (req, res) => throw AngelHttpException.notFound());\n  }\n\n  /// Invoked when this service is wrapped within a [HookedService].\n  void onHooked(HookedService hookedService) {}\n}\n"
  },
  {
    "path": "packages/framework/lib/src/fast_name_from_symbol.dart",
    "content": "final Map<Symbol, String> _cache = {};\n\nString fastNameFromSymbol(Symbol s) {\n  return _cache.putIfAbsent(s, () {\n    var str = s.toString();\n    var open = str.indexOf('\"');\n    var close = str.lastIndexOf('\"');\n    return str.substring(open + 1, close);\n  });\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http/angel_http.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io'\n    show\n        Cookie,\n        HttpRequest,\n        HttpResponse,\n        HttpServer,\n        Platform,\n        SecurityContext;\nimport 'package:angel3_framework/angel3_framework.dart';\nimport '../core/core.dart';\nimport 'http_request_context.dart';\nimport 'http_response_context.dart';\n\nfinal RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\ntypedef ServerGeneratorType = Future<HttpServer> Function(dynamic, int);\n\n/// Adapts `dart:io`'s [HttpServer] to serve Angel.\nclass AngelHttp\n    extends\n        Driver<\n          HttpRequest,\n          HttpResponse,\n          HttpServer,\n          HttpRequestContext,\n          HttpResponseContext\n        > {\n  @override\n  Uri get uri {\n    return Uri(\n      scheme: 'http',\n      host: server?.address.address,\n      port: server?.port,\n    );\n  }\n\n  AngelHttp._(super.app, super.serverGenerator, bool useZone)\n    : super(useZone: useZone);\n\n  factory AngelHttp(Angel app, {bool useZone = true}) {\n    return AngelHttp._(app, HttpServer.bind, useZone);\n  }\n\n  /// An instance mounted on a server started by the [serverGenerator].\n  factory AngelHttp.custom(\n    Angel app,\n    ServerGeneratorType serverGenerator, {\n    bool useZone = true,\n    Map<String, String> headers = const {},\n  }) {\n    return AngelHttp._(app, serverGenerator, useZone);\n  }\n\n  factory AngelHttp.fromSecurityContext(\n    Angel app,\n    SecurityContext context, {\n    bool useZone = true,\n  }) {\n    return AngelHttp._(app, (address, int port) {\n      return HttpServer.bindSecure(address, port, context);\n    }, useZone);\n  }\n\n  /// Creates an HTTPS server.\n  ///\n  /// Provide paths to a certificate chain and server key (both .pem).\n  /// If no password is provided, a random one will be generated upon running\n  /// the server.\n  factory AngelHttp.secure(\n    Angel app,\n    String certificateChainPath,\n    String serverKeyPath, {\n    String? password,\n    bool useZone = true,\n  }) {\n    var certificateChain = Platform.script\n        .resolve(certificateChainPath)\n        .toFilePath();\n    var serverKey = Platform.script.resolve(serverKeyPath).toFilePath();\n    var serverContext = SecurityContext();\n    serverContext.useCertificateChain(certificateChain, password: password);\n    serverContext.usePrivateKey(serverKey, password: password);\n\n    return AngelHttp.fromSecurityContext(app, serverContext, useZone: useZone);\n  }\n\n  Future handleRequest(HttpRequest request) =>\n      handleRawRequest(request, request.response);\n\n  @override\n  void addCookies(HttpResponse response, Iterable<Cookie> cookies) =>\n      response.cookies.addAll(cookies);\n\n  @override\n  Future<void> close() async {\n    return await super.close();\n  }\n\n  /// Remove headers from HTTP Response\n  void removeResponseHeader(Map<String, Object> headers) {\n    headers.forEach((key, value) {\n      server?.defaultResponseHeaders.remove(key, value);\n    });\n  }\n\n  /// Add headers to HTTP Response\n  void addResponseHeader(Map<String, Object> headers) {\n    headers.forEach((key, value) {\n      server?.defaultResponseHeaders.add(key, value);\n    });\n  }\n\n  @override\n  Future closeResponse(HttpResponse response) => response.close();\n\n  @override\n  Future<HttpRequestContext> createRequestContext(\n    HttpRequest request,\n    HttpResponse response,\n  ) {\n    var path = request.uri.path.replaceAll(_straySlashes, '');\n    if (path.isEmpty) path = '/';\n    return HttpRequestContext.from(request, app, path);\n  }\n\n  @override\n  Future<HttpResponseContext> createResponseContext(\n    HttpRequest request,\n    HttpResponse response, [\n    HttpRequestContext? correspondingRequest,\n  ]) {\n    var context = HttpResponseContext(response, app, correspondingRequest);\n    context.serializer = (app.serializer ?? json.encode);\n    context.encoders.addAll(app.encoders);\n    return Future<HttpResponseContext>.value(context);\n  }\n\n  @override\n  Stream<HttpResponse> createResponseStreamFromRawRequest(\n    HttpRequest request,\n  ) => Stream.fromIterable([request.response]);\n\n  @override\n  void setChunkedEncoding(HttpResponse response, bool value) =>\n      response.headers.chunkedTransferEncoding = value;\n\n  @override\n  void setContentLength(HttpResponse response, int length) =>\n      response.headers.contentLength = length;\n\n  @override\n  void setHeader(HttpResponse response, String key, String value) =>\n      response.headers.set(key, value);\n\n  @override\n  void setStatusCode(HttpResponse response, int value) =>\n      response.statusCode = value;\n\n  @override\n  void writeStringToResponse(HttpResponse response, String value) =>\n      response.write(value);\n\n  @override\n  void writeToResponse(HttpResponse response, List<int> data) =>\n      response.add(data);\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http/http.dart",
    "content": "/// Various libraries useful for creating highly-extensible servers.\nlibrary;\n\nimport 'dart:async';\nimport 'dart:io';\nexport 'angel_http.dart';\nexport 'http_request_context.dart';\nexport 'http_response_context.dart';\n\n/// Boots a shared server instance. Use this if launching multiple isolates.\nFuture<HttpServer> startShared(Object? address, int port) =>\n    HttpServer.bind(address ?? '127.0.0.1', port, shared: true);\n\nFuture<HttpServer> Function(Object?, int) startSharedSecure(\n  SecurityContext securityContext,\n) {\n  return (address, int port) => HttpServer.bindSecure(\n    address ?? '127.0.0.1',\n    port,\n    securityContext,\n    shared: true,\n  );\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http/http_request_context.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\n\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:http_parser/http_parser.dart';\n\nimport '../core/core.dart';\n\n/// An implementation of [RequestContext] that wraps a [HttpRequest].\nclass HttpRequestContext extends RequestContext<HttpRequest?> {\n  Container? _container;\n  MediaType _contentType = MediaType('text', 'plain');\n  HttpRequest? _io;\n  String? _override;\n  String _path = '';\n\n  @override\n  Container? get container => _container;\n\n  @override\n  MediaType get contentType {\n    return _contentType;\n  }\n\n  @override\n  List<Cookie> get cookies {\n    return rawRequest?.cookies ?? [];\n  }\n\n  @override\n  HttpHeaders? get headers {\n    return rawRequest?.headers;\n  }\n\n  @override\n  String get hostname {\n    return rawRequest?.headers.value('host') ?? 'localhost';\n  }\n\n  /// The underlying [HttpRequest] instance underneath this context.\n  @override\n  HttpRequest? get rawRequest => _io;\n\n  @override\n  Stream<List<int>>? get body => _io;\n\n  @override\n  String get method {\n    return _override ?? originalMethod;\n  }\n\n  @override\n  String get originalMethod {\n    return rawRequest?.method ?? '';\n  }\n\n  @override\n  String get path {\n    return _path;\n  }\n\n  @override\n  InternetAddress get remoteAddress {\n    return rawRequest?.connectionInfo?.remoteAddress ??\n        InternetAddress(\"127.0.0.1\");\n  }\n\n  @override\n  HttpSession? get session {\n    return rawRequest?.session;\n  }\n\n  @override\n  Uri get uri {\n    return rawRequest?.uri ?? Uri();\n  }\n\n  /// Magically transforms an [HttpRequest] into a [RequestContext].\n  static Future<HttpRequestContext> from(\n    HttpRequest request,\n    Angel app,\n    String path,\n  ) {\n    var ctx = HttpRequestContext().._container = app.container.createChild();\n\n    var override = request.method;\n\n    if (app.allowMethodOverrides == true) {\n      override =\n          request.headers.value('x-http-method-override')?.toUpperCase() ??\n          request.method;\n    }\n\n    ctx.app = app;\n    ctx._contentType = request.headers.contentType == null\n        ? MediaType('text', 'plain')\n        : MediaType.parse(request.headers.contentType.toString());\n    ctx._override = override;\n    ctx._path = path;\n    ctx._io = request;\n\n    return Future.value(ctx);\n  }\n\n  @override\n  Future close() {\n    //_contentType = null;\n    _io = null;\n    _override = null;\n    //_path = null;\n    return super.close();\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http/http_response_context.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' hide BytesBuilder;\nimport 'dart:typed_data' show BytesBuilder;\nimport 'package:http_parser/http_parser.dart';\n\nimport '../core/core.dart';\nimport 'http_request_context.dart';\n\n/// An implementation of [ResponseContext] that abstracts over an [HttpResponse].\nclass HttpResponseContext extends ResponseContext<HttpResponse> {\n  /// The underlying [HttpResponse] under this instance.\n  @override\n  final HttpResponse rawResponse;\n\n  LockableBytesBuilder? _buffer;\n\n  final HttpRequestContext? _correspondingRequest;\n  bool _isDetached = false, _isClosed = false, _streamInitialized = false;\n\n  HttpResponseContext(\n    this.rawResponse,\n    Angel? app, [\n    this._correspondingRequest,\n  ]) {\n    this.app = app;\n  }\n\n  @override\n  HttpResponse detach() {\n    _isDetached = true;\n    return rawResponse;\n  }\n\n  @override\n  RequestContext? get correspondingRequest {\n    return _correspondingRequest;\n  }\n\n  @override\n  bool get isOpen {\n    return !_isClosed && !_isDetached;\n  }\n\n  @override\n  bool get isBuffered => _buffer != null;\n\n  @override\n  BytesBuilder? get buffer => _buffer;\n\n  @override\n  void addError(Object error, [StackTrace? stackTrace]) {\n    rawResponse.addError(error, stackTrace);\n    super.addError(error, stackTrace);\n  }\n\n  @override\n  void useBuffer() {\n    _buffer = LockableBytesBuilder();\n  }\n\n  Iterable<String>? __allowedEncodings;\n\n  Iterable<String>? get _allowedEncodings {\n    return __allowedEncodings ??= correspondingRequest?.headers\n        ?.value('accept-encoding')\n        ?.split(',')\n        .map((s) => s.trim())\n        .where((s) => s.isNotEmpty)\n        .map((str) {\n          // Ignore quality specifications in accept-encoding\n          // ex. gzip;q=0.8\n          if (!str.contains(';')) return str;\n          return str.split(';')[0];\n        });\n  }\n\n  @override\n  set contentType(MediaType value) {\n    super.contentType = value;\n    if (!_streamInitialized) {\n      rawResponse.headers.contentType = ContentType(\n        value.type,\n        value.subtype,\n        parameters: value.parameters,\n      );\n    }\n  }\n\n  bool _openStream() {\n    if (!_streamInitialized) {\n      // If this is the first stream added to this response,\n      // then add headers, status code, etc.\n      rawResponse\n        ..statusCode = statusCode\n        ..cookies.addAll(cookies);\n      headers.forEach(rawResponse.headers.set);\n\n      rawResponse.headers.date = DateTime.now();\n\n      if (headers.containsKey('content-length')) {\n        rawResponse.contentLength =\n            int.tryParse(headers['content-length']!) ??\n            rawResponse.contentLength;\n      }\n\n      rawResponse.headers.contentType = ContentType(\n        contentType.type,\n        contentType.subtype,\n        charset: contentType.parameters['charset'],\n        parameters: contentType.parameters,\n      );\n\n      if (encoders.isNotEmpty && correspondingRequest != null) {\n        if (_allowedEncodings != null) {\n          for (var encodingName in _allowedEncodings!) {\n            Converter<List<int>, List<int>>? encoder;\n            var key = encodingName;\n\n            if (encoders.containsKey(encodingName)) {\n              encoder = encoders[encodingName];\n            } else if (encodingName == '*') {\n              encoder = encoders[key = encoders.keys.first];\n            }\n\n            if (encoder != null) {\n              rawResponse.headers.set('content-encoding', key);\n              break;\n            }\n          }\n        }\n      }\n\n      //_isClosed = true;\n      return _streamInitialized = true;\n    }\n\n    return false;\n  }\n\n  @override\n  Future addStream(Stream<List<int>> stream) {\n    if (_isClosed && isBuffered) throw ResponseContext.closed();\n    _openStream();\n\n    var output = stream;\n\n    if (encoders.isNotEmpty && correspondingRequest != null) {\n      if (_allowedEncodings != null) {\n        for (var encodingName in _allowedEncodings!) {\n          Converter<List<int>, List<int>>? encoder;\n          var key = encodingName;\n\n          if (encoders.containsKey(encodingName)) {\n            encoder = encoders[encodingName];\n          } else if (encodingName == '*') {\n            encoder = encoders[key = encoders.keys.first];\n          }\n\n          if (encoder != null) {\n            output = encoders[key]!.bind(output);\n            break;\n          }\n        }\n      }\n    }\n\n    return rawResponse.addStream(output);\n  }\n\n  @override\n  void add(List<int> data) {\n    if (_isClosed && isBuffered) {\n      throw ResponseContext.closed();\n    } else if (!isBuffered) {\n      if (!_isClosed) {\n        _openStream();\n\n        if (encoders.isNotEmpty && correspondingRequest != null) {\n          if (_allowedEncodings != null) {\n            for (var encodingName in _allowedEncodings!) {\n              Converter<List<int>, List<int>>? encoder;\n              var key = encodingName;\n\n              if (encoders.containsKey(encodingName)) {\n                encoder = encoders[encodingName];\n              } else if (encodingName == '*') {\n                encoder = encoders[key = encoders.keys.first];\n              }\n\n              if (encoder != null) {\n                data = encoders[key]!.convert(data);\n                break;\n              }\n            }\n          }\n        }\n\n        rawResponse.add(data);\n      }\n    } else {\n      buffer!.add(data);\n    }\n  }\n\n  @override\n  Future close() {\n    if (!_isDetached) {\n      if (!_isClosed) {\n        if (!isBuffered) {\n          try {\n            _openStream();\n            rawResponse.close();\n          } catch (_) {\n            // This only seems to occur on `MockHttpRequest`, but\n            // this try/catch prevents a crash.\n          }\n        } else {\n          _buffer!.lock();\n        }\n\n        _isClosed = true;\n      }\n\n      super.close();\n    }\n    return Future.value();\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http2/angel_http2.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart' hide Header;\nimport 'package:angel3_framework/http.dart';\nimport 'package:http2/transport.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'http2_request_context.dart';\nimport 'http2_response_context.dart';\nimport 'package:uuid/uuid.dart';\n\n/// Boots a shared server instance. Use this if launching multiple isolates.\nFuture<SecureServerSocket> startSharedHttp2(\n  Object? address,\n  int port,\n  SecurityContext ctx,\n) {\n  return SecureServerSocket.bind(address, port, ctx, shared: true);\n}\n\n/// Adapts `package:http2`'s [ServerTransportConnection] to serve Angel.\nclass AngelHttp2\n    extends\n        Driver<\n          Socket,\n          ServerTransportStream,\n          SecureServerSocket,\n          Http2RequestContext,\n          Http2ResponseContext\n        > {\n  final ServerSettings? settings;\n  late AngelHttp _http;\n  final StreamController<HttpRequest> _onHttp1 = StreamController();\n  final Map<String, MockHttpSession> _sessions = {};\n  final Uuid _uuid = Uuid();\n  _AngelHttp2ServerSocket? _artificial;\n\n  SecureServerSocket? get socket => _artificial;\n\n  AngelHttp2._(\n    Angel app,\n    Future<SecureServerSocket> Function(dynamic, int) serverGenerator,\n    bool useZone,\n    bool allowHttp1,\n    this.settings,\n  ) : super(app, serverGenerator, useZone: useZone) {\n    if (allowHttp1) {\n      _http = AngelHttp(app, useZone: useZone);\n      onHttp1.listen(_http.handleRequest);\n    }\n  }\n\n  factory AngelHttp2(\n    Angel app,\n    SecurityContext securityContext, {\n    bool useZone = true,\n    bool allowHttp1 = false,\n    ServerSettings? settings,\n  }) {\n    return AngelHttp2.custom(\n      app,\n      securityContext,\n      SecureServerSocket.bind,\n      allowHttp1: allowHttp1,\n      settings: settings,\n    );\n  }\n\n  factory AngelHttp2.custom(\n    Angel app,\n    SecurityContext ctx,\n    Future<SecureServerSocket> Function(\n      InternetAddress? address,\n      int port,\n      SecurityContext ctx,\n    )\n    serverGenerator, {\n    bool useZone = true,\n    bool allowHttp1 = false,\n    ServerSettings? settings,\n  }) {\n    return AngelHttp2._(\n      app,\n      (address, port) {\n        var addr = address is InternetAddress\n            ? address\n            : InternetAddress(address.toString());\n        return Future.sync(() => serverGenerator(addr, port, ctx));\n      },\n      useZone,\n      allowHttp1,\n      settings,\n    );\n  }\n\n  /// Fires when an HTTP/1.x request is received.\n  Stream<HttpRequest> get onHttp1 => _onHttp1.stream;\n\n  @override\n  Future<SecureServerSocket> generateServer([\n    Object? address,\n    int? port,\n  ]) async {\n    var s = await serverGenerator(address ?? '127.0.0.1', port ?? 0);\n    return _artificial = _AngelHttp2ServerSocket(s, this);\n  }\n\n  @override\n  Future<void> close() async {\n    await _artificial?.close();\n    await _http.close();\n    return await super.close();\n  }\n\n  @override\n  void addCookies(ServerTransportStream response, Iterable<Cookie> cookies) {\n    var headers = cookies.map(\n      (cookie) => Header.ascii('set-cookie', cookie.toString()),\n    );\n    response.sendHeaders(headers.toList());\n  }\n\n  @override\n  Future closeResponse(ServerTransportStream response) {\n    response.terminate();\n    return Future.value();\n  }\n\n  @override\n  Future<Http2RequestContext> createRequestContext(\n    Socket request,\n    ServerTransportStream response,\n  ) {\n    return Http2RequestContext.from(response, request, app, _sessions, _uuid);\n  }\n\n  @override\n  Future<Http2ResponseContext> createResponseContext(\n    Socket request,\n    ServerTransportStream response, [\n    Http2RequestContext? correspondingRequest,\n  ]) async {\n    return Http2ResponseContext(app, response, correspondingRequest)\n      ..encoders.addAll(app.encoders);\n  }\n\n  @override\n  Stream<ServerTransportStream> createResponseStreamFromRawRequest(\n    Socket request,\n  ) {\n    var connection = ServerTransportConnection.viaSocket(\n      request,\n      settings: settings,\n    );\n    return connection.incomingStreams;\n  }\n\n  @override\n  void setChunkedEncoding(ServerTransportStream response, bool value) {\n    // Do nothing in HTTP/2\n  }\n\n  @override\n  void setContentLength(ServerTransportStream response, int length) {\n    setHeader(response, 'content-length', length.toString());\n  }\n\n  @override\n  void setHeader(ServerTransportStream response, String key, String? value) {\n    response.sendHeaders([Header.ascii(key, value!)]);\n  }\n\n  @override\n  void setStatusCode(ServerTransportStream response, int value) {\n    response.sendHeaders([Header.ascii(':status', value.toString())]);\n  }\n\n  @override\n  Uri get uri => Uri(\n    scheme: 'https',\n    host: server?.address.address,\n    port: server?.port != 443 ? server?.port : null,\n  );\n\n  @override\n  void writeStringToResponse(ServerTransportStream response, String value) {\n    writeToResponse(response, utf8.encode(value));\n  }\n\n  @override\n  void writeToResponse(ServerTransportStream response, List<int> data) {\n    response.sendData(data);\n  }\n}\n\nclass _FakeServerSocket extends Stream<Socket> implements ServerSocket {\n  final _AngelHttp2ServerSocket angel;\n  final _ctrl = StreamController<Socket>();\n\n  _FakeServerSocket(this.angel);\n\n  @override\n  InternetAddress get address => angel.address;\n\n  @override\n  Future<ServerSocket> close() async {\n    await (_ctrl.close());\n    return this;\n  }\n\n  @override\n  int get port => angel.port;\n\n  @override\n  StreamSubscription<Socket> listen(\n    void Function(Socket event)? onData, {\n    Function? onError,\n    void Function()? onDone,\n    bool? cancelOnError,\n  }) {\n    return _ctrl.stream.listen(\n      onData,\n      cancelOnError: cancelOnError,\n      onError: onError,\n      onDone: onDone,\n    );\n  }\n}\n\nclass _AngelHttp2ServerSocket extends Stream<SecureSocket>\n    implements SecureServerSocket {\n  final SecureServerSocket socket;\n  final AngelHttp2 driver;\n  final _ctrl = StreamController<SecureSocket>();\n  late _FakeServerSocket _fake;\n  StreamSubscription? _sub;\n\n  _AngelHttp2ServerSocket(this.socket, this.driver) {\n    _fake = _FakeServerSocket(this);\n    HttpServer.listenOn(_fake).pipe(driver._onHttp1);\n    _sub = socket.listen(\n      (socket) {\n        if (socket.selectedProtocol == null ||\n            socket.selectedProtocol == 'http/1.0' ||\n            socket.selectedProtocol == 'http/1.1') {\n          _fake._ctrl.add(socket);\n        } else if (socket.selectedProtocol == 'h2' ||\n            socket.selectedProtocol == 'h2-14') {\n          _ctrl.add(socket);\n        } else {\n          socket.destroy();\n          throw Exception(\n            'AngelHttp2 does not support ${socket.selectedProtocol} as an ALPN protocol.',\n          );\n        }\n      },\n      onDone: _ctrl.close,\n      onError: (e, st) {\n        driver.app.logger.warning(\n          'HTTP/2 incoming connection failure: ',\n          e,\n          st as StackTrace,\n        );\n      },\n    );\n  }\n\n  @override\n  InternetAddress get address => socket.address;\n\n  @override\n  int get port => socket.port;\n\n  @override\n  Future<SecureServerSocket> close() {\n    _sub?.cancel();\n    _fake.close();\n    _ctrl.close();\n    return socket.close();\n  }\n\n  @override\n  StreamSubscription<SecureSocket> listen(\n    void Function(SecureSocket event)? onData, {\n    Function? onError,\n    void Function()? onDone,\n    bool? cancelOnError,\n  }) {\n    return _ctrl.stream.listen(\n      onData,\n      cancelOnError: cancelOnError,\n      onError: onError,\n      onDone: onDone,\n    );\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http2/http2_request_context.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:http2/transport.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:uuid/uuid.dart';\n\nfinal RegExp _comma = RegExp(r',\\s*');\nfinal RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\nclass Http2RequestContext extends RequestContext<ServerTransportStream?> {\n  final StreamController<List<int>> _body = StreamController();\n  @override\n  final Container container;\n  List<Cookie> _cookies = <Cookie>[];\n  HttpHeaders? _headers;\n  String? _method, _override, _path;\n  late Socket _socket;\n  ServerTransportStream? _stream;\n  Uri? _uri;\n  HttpSession? _session;\n\n  Http2RequestContext._(this.container);\n\n  @override\n  Stream<List<int>> get body => _body.stream;\n\n  static Future<Http2RequestContext> from(\n    ServerTransportStream stream,\n    Socket socket,\n    Angel app,\n    Map<String, MockHttpSession> sessions,\n    Uuid uuid,\n  ) {\n    var c = Completer<Http2RequestContext>();\n    var req = Http2RequestContext._(app.container.createChild())\n      ..app = app\n      .._socket = socket\n      .._stream = stream;\n\n    var headers = req._headers = MockHttpHeaders();\n    // String scheme = 'https', host = socket.address.address, path = '';\n    var uri = Uri(\n      scheme: 'https',\n      host: socket.address.address,\n      port: socket.port,\n    );\n    var cookies = <Cookie>[];\n\n    void finalize() {\n      req\n        .._cookies = List.unmodifiable(cookies)\n        .._uri = uri;\n      if (!c.isCompleted) c.complete(req);\n    }\n\n    void parseHost(String value) {\n      var inUri = Uri.tryParse(value);\n      if (inUri == null) return;\n      // if (uri == null || uri.scheme == 'localhost') return;\n\n      if (inUri.hasScheme) uri = uri.replace(scheme: inUri.scheme);\n\n      if (inUri.hasAuthority) {\n        uri = uri.replace(host: inUri.host, userInfo: inUri.userInfo);\n      }\n\n      if (inUri.hasPort) uri = uri.replace(port: inUri.port);\n    }\n\n    stream.incomingMessages.listen(\n      (msg) {\n        if (msg is DataStreamMessage) {\n          finalize();\n          req._body.add(msg.bytes);\n        } else if (msg is HeadersStreamMessage) {\n          for (var header in msg.headers) {\n            var name = ascii.decode(header.name).toLowerCase();\n            var value = Uri.decodeComponent(ascii.decode(header.value));\n\n            switch (name) {\n              case ':method':\n                req._method = value;\n                break;\n              case ':path':\n                var inUri = Uri.parse(value);\n                uri = uri.replace(path: inUri.path);\n                if (inUri.hasQuery) uri = uri.replace(query: inUri.query);\n                var path = uri.path.replaceAll(_straySlashes, '');\n                req._path = path;\n                if (path.isEmpty) req._path = '/';\n                break;\n              case ':scheme':\n                uri = uri.replace(scheme: value);\n                break;\n              case ':authority':\n                parseHost(value);\n                break;\n              case 'cookie':\n                var cookieStrings = value.split(';').map((s) => s.trim());\n\n                for (var cookieString in cookieStrings) {\n                  try {\n                    cookies.add(Cookie.fromSetCookieValue(cookieString));\n                  } catch (_) {\n                    // Ignore malformed cookies, and just don't add them to the container.\n                  }\n                }\n                break;\n              default:\n                var name = ascii.decode(header.name).toLowerCase();\n\n                if (name == 'host') {\n                  parseHost(value);\n                }\n\n                headers.add(name, value.split(_comma));\n                break;\n            }\n          }\n\n          if (msg.endStream) finalize();\n        }\n      },\n      onDone: () {\n        finalize();\n        req._body.close();\n      },\n      cancelOnError: true,\n      onError: c.completeError,\n    );\n\n    // Apply session\n    var dartSessId = cookies.firstWhereOrNull((c) => c.name == 'DARTSESSID');\n\n    dartSessId ??= Cookie('DARTSESSID', uuid.v4());\n\n    req._session = sessions.putIfAbsent(\n      dartSessId.value,\n      () => MockHttpSession(id: dartSessId!.value),\n    );\n\n    return c.future;\n  }\n\n  @override\n  List<Cookie> get cookies => _cookies;\n\n  /// The underlying HTTP/2 [ServerTransportStream].\n  ServerTransportStream? get stream => _stream;\n\n  @override\n  Uri? get uri => _uri;\n\n  @override\n  HttpSession? get session {\n    return _session;\n  }\n\n  @override\n  InternetAddress get remoteAddress => _socket.remoteAddress;\n\n  @override\n  String get path {\n    return _path ?? '';\n  }\n\n  @override\n  String get originalMethod {\n    return _method ?? 'GET';\n  }\n\n  @override\n  String get method {\n    return _override ?? _method ?? 'GET';\n  }\n\n  @override\n  String get hostname => _headers?.value('host') ?? 'localhost';\n\n  @override\n  HttpHeaders? get headers => _headers;\n\n  @override\n  Future close() {\n    _body.close();\n    return super.close();\n  }\n\n  @override\n  ServerTransportStream? get rawRequest => _stream;\n}\n"
  },
  {
    "path": "packages/framework/lib/src/http2/http2_response_context.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' hide BytesBuilder;\nimport 'dart:typed_data';\nimport 'package:angel3_framework/angel3_framework.dart' hide Header;\nimport 'package:http2/transport.dart';\nimport 'http2_request_context.dart';\n\nclass Http2ResponseContext extends ResponseContext<ServerTransportStream> {\n  final ServerTransportStream stream;\n\n  @override\n  ServerTransportStream get rawResponse => stream;\n\n  LockableBytesBuilder? _buffer;\n\n  final Http2RequestContext? _req;\n\n  bool _isDetached = false,\n      _isClosed = false,\n      _streamInitialized = false,\n      _isPush = false;\n\n  Uri? _targetUri;\n\n  Http2ResponseContext(Angel? app, this.stream, this._req) {\n    this.app = app;\n    _targetUri = _req?.uri;\n  }\n\n  final List<Http2ResponseContext> _pushes = [];\n\n  /// Returns `true` if an attempt to [push] a resource will succeed.\n  ///\n  /// See [ServerTransportStream].`push`.\n  bool get canPush => stream.canPush;\n\n  /// Returns a [List] of all resources that have [push]ed to the client.\n  List<Http2ResponseContext> get pushes => List.unmodifiable(_pushes);\n\n  @override\n  ServerTransportStream detach() {\n    _isDetached = true;\n    return stream;\n  }\n\n  @override\n  RequestContext? get correspondingRequest => _req;\n\n  Uri? get targetUri => _targetUri;\n\n  @override\n  bool get isOpen {\n    return !_isClosed && !_isDetached;\n  }\n\n  @override\n  bool get isBuffered => _buffer != null;\n\n  @override\n  BytesBuilder? get buffer => _buffer;\n\n  // @override\n  // void addError(Object error, [StackTrace? stackTrace]) {\n  //   super.addError(error, stackTrace);\n  // }\n\n  @override\n  void useBuffer() {\n    _buffer = LockableBytesBuilder();\n  }\n\n  /// Write headers, status, etc. to the underlying [stream].\n  bool _openStream() {\n    if (_isPush || _streamInitialized) return false;\n\n    var headers = <Header>[Header.ascii(':status', statusCode.toString())];\n\n    if (encoders.isNotEmpty && correspondingRequest != null) {\n      if (_allowedEncodings != null) {\n        for (var encodingName in _allowedEncodings!) {\n          Converter<List<int>, List<int>>? encoder;\n          var key = encodingName;\n\n          if (encoders.containsKey(encodingName)) {\n            encoder = encoders[encodingName];\n          } else if (encodingName == '*') {\n            encoder = encoders[key = encoders.keys.first];\n          }\n\n          if (encoder != null) {\n            this.headers['content-encoding'] = key;\n            break;\n          }\n        }\n      }\n    }\n\n    // Add all normal headers\n    for (var key in this.headers.keys) {\n      headers.add(Header.ascii(key.toLowerCase(), this.headers[key]!));\n    }\n\n    // Persist session ID\n    cookies.add(Cookie('DARTSESSID', _req!.session!.id));\n\n    // Send all cookies\n    for (var cookie in cookies) {\n      headers.add(Header.ascii('set-cookie', cookie.toString()));\n    }\n\n    stream.sendHeaders(headers);\n    return _streamInitialized = true;\n  }\n\n  Iterable<String>? __allowedEncodings;\n\n  Iterable<String>? get _allowedEncodings {\n    return __allowedEncodings ??= correspondingRequest?.headers\n        ?.value('accept-encoding')\n        ?.split(',')\n        .map((s) => s.trim())\n        .where((s) => s.isNotEmpty)\n        .map((str) {\n          // Ignore quality specifications in accept-encoding\n          // ex. gzip;q=0.8\n          if (!str.contains(';')) return str;\n          return str.split(';')[0];\n        });\n  }\n\n  @override\n  Future addStream(Stream<List<int>> stream) {\n    if (!isOpen && isBuffered) throw ResponseContext.closed();\n    _openStream();\n\n    var output = stream;\n\n    if (encoders.isNotEmpty && correspondingRequest != null) {\n      if (_allowedEncodings != null) {\n        for (var encodingName in _allowedEncodings!) {\n          Converter<List<int>, List<int>>? encoder;\n          var key = encodingName;\n\n          if (encoders.containsKey(encodingName)) {\n            encoder = encoders[encodingName];\n          } else if (encodingName == '*') {\n            encoder = encoders[key = encoders.keys.first];\n          }\n\n          if (encoder != null) {\n            output = encoders[key]!.bind(output);\n            break;\n          }\n        }\n      }\n    }\n\n    return output.forEach(this.stream.sendData);\n  }\n\n  @override\n  void add(List<int> data) {\n    if (!isOpen && isBuffered) {\n      throw ResponseContext.closed();\n    } else if (!isBuffered) {\n      _openStream();\n\n      if (!_isClosed) {\n        if (encoders.isNotEmpty && correspondingRequest != null) {\n          if (_allowedEncodings != null) {\n            for (var encodingName in _allowedEncodings!) {\n              Converter<List<int>, List<int>>? encoder;\n              var key = encodingName;\n\n              if (encoders.containsKey(encodingName)) {\n                encoder = encoders[encodingName];\n              } else if (encodingName == '*') {\n                encoder = encoders[key = encoders.keys.first];\n              }\n\n              if (encoder != null) {\n                data = encoders[key]!.convert(data);\n                break;\n              }\n            }\n          }\n        }\n\n        stream.sendData(data);\n      }\n    } else {\n      buffer!.add(data);\n    }\n  }\n\n  @override\n  Future close() async {\n    if (!_isDetached && !_isClosed && !isBuffered) {\n      _openStream();\n      await stream.outgoingMessages.close();\n    }\n\n    _isClosed = true;\n    await super.close();\n  }\n\n  /// Pushes a resource to the client.\n  Http2ResponseContext push(\n    String path, {\n    Map<String, String> headers = const {},\n    String method = 'GET',\n  }) {\n    var targetUri = _req!.uri!.replace(path: path);\n\n    var h = <Header>[\n      Header.ascii(':authority', targetUri.authority),\n      Header.ascii(':method', method),\n      Header.ascii(':path', targetUri.path),\n      Header.ascii(':scheme', targetUri.scheme),\n    ];\n\n    for (var key in headers.keys) {\n      h.add(Header.ascii(key, headers[key]!));\n    }\n\n    var s = stream.push(h);\n    var r = Http2ResponseContext(app, s, _req)\n      .._isPush = true\n      .._targetUri = targetUri;\n    _pushes.add(r);\n    return r;\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/safe_stream_controller.dart",
    "content": "import 'dart:async';\n\ntypedef _InitCallback = void Function();\n\n/// A [StreamController] boilerplate that prevents memory leaks.\nabstract class SafeCtrl<T> {\n  factory SafeCtrl() => _SingleSafeCtrl();\n\n  factory SafeCtrl.broadcast() => _BroadcastSafeCtrl();\n\n  Stream<T> get stream;\n\n  void add(T event);\n\n  void addError(Error error, [StackTrace? stackTrace]);\n\n  Future close();\n\n  void whenInitialized(void Function() callback);\n}\n\nclass _SingleSafeCtrl<T> implements SafeCtrl<T> {\n  late StreamController<T> _stream;\n  bool _hasListener = false, _initialized = false;\n  _InitCallback? _initializer;\n\n  _SingleSafeCtrl() {\n    _stream = StreamController<T>(\n      onListen: () {\n        _hasListener = true;\n\n        if (!_initialized && _initializer != null) {\n          _initializer!();\n          _initialized = true;\n        }\n      },\n      onPause: () {\n        _hasListener = false;\n      },\n      onResume: () {\n        _hasListener = true;\n      },\n      onCancel: () {\n        _hasListener = false;\n      },\n    );\n  }\n\n  @override\n  Stream<T> get stream => _stream.stream;\n\n  @override\n  void add(T event) {\n    if (_hasListener) _stream.add(event);\n  }\n\n  @override\n  void addError(error, [StackTrace? stackTrace]) {\n    if (_hasListener) _stream.addError(error as Object, stackTrace);\n  }\n\n  @override\n  Future close() {\n    return _stream.close();\n  }\n\n  @override\n  void whenInitialized(void Function() callback) {\n    if (!_initialized) {\n      if (!_hasListener) {\n        _initializer = callback;\n      } else {\n        _initializer!();\n        _initialized = true;\n      }\n    }\n  }\n}\n\nclass _BroadcastSafeCtrl<T> implements SafeCtrl<T> {\n  late StreamController<T> _stream;\n  int _listeners = 0;\n  bool _initialized = false;\n  _InitCallback? _initializer;\n\n  _BroadcastSafeCtrl() {\n    _stream = StreamController<T>.broadcast(\n      onListen: () {\n        _listeners++;\n\n        if (!_initialized && _initializer != null) {\n          _initializer!();\n          _initialized = true;\n        }\n      },\n      onCancel: () {\n        _listeners--;\n      },\n    );\n  }\n\n  @override\n  Stream<T> get stream => _stream.stream;\n\n  @override\n  void add(T event) {\n    if (_listeners > 0) _stream.add(event);\n  }\n\n  @override\n  void addError(error, [StackTrace? stackTrace]) {\n    if (_listeners > 0) _stream.addError(error as Object, stackTrace);\n  }\n\n  @override\n  Future close() {\n    return _stream.close();\n  }\n\n  @override\n  void whenInitialized(void Function() callback) {\n    if (!_initialized) {\n      if (_listeners <= 0) {\n        _initializer = callback;\n      } else {\n        _initializer!();\n        _initialized = true;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/framework/lib/src/util.dart",
    "content": "import 'package:angel3_container/angel3_container.dart';\n\nfinal RegExp straySlashes = RegExp(r'(^/+)|(/+$)');\n\nT? matchingAnnotation<T>(List<ReflectedInstance> metadata) {\n  for (var metaDatum in metadata) {\n    if (metaDatum.type.reflectedType == T) {\n      return metaDatum.reflectee as T?;\n    }\n  }\n\n  return null;\n}\n\nT? getAnnotation<T>(Object obj, Reflector? reflector) {\n  if (reflector == null) {\n    return null;\n  } else {\n    if (obj is Function) {\n      var methodMirror = reflector.reflectFunction(obj)!;\n      return matchingAnnotation<T>(methodMirror.annotations);\n    } else {\n      var classMirror = reflector.reflectClass(obj.runtimeType)!;\n      return matchingAnnotation<T>(classMirror.annotations);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/framework/melos_angel3_framework.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/framework/performance/hello/angel.md",
    "content": "# Angel Performance Results\n\n5 consecutive trials run on a Windows 10 box with 4GB RAM, and several programs open in the background.\n\nSetup:\n\n* Angel framework `1.0.8`\n* Running `wrk` 4.0.2.2\n* 2 threads\n* 256 connections\n* 30 seconds\n\nAverage:\n\n* `11070.18` req/sec\n* `11.86` ms latency\n\n```bash\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    12.23ms    7.56ms 206.05ms   93.09%\n    Req/Sec     5.48k   761.94     7.18k    87.50%\n  324822 requests in 30.06s, 62.88MB read\nRequests/sec:  10806.24\nTransfer/sec:      2.09MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    11.06ms    4.88ms 134.86ms   78.68%\n    Req/Sec     5.98k   539.40     7.50k    91.40%\n  356355 requests in 30.11s, 68.99MB read\nRequests/sec:  11836.11\nTransfer/sec:      2.29MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    12.03ms    6.18ms 159.93ms   87.89%\n    Req/Sec     5.52k     0.88k    7.32k    90.31%\n  327749 requests in 30.06s, 63.45MB read\nRequests/sec:  10901.35\nTransfer/sec:      2.11MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    12.92ms    7.06ms 189.00ms   82.48%\n    Req/Sec     5.12k     1.00k    6.42k    75.59%\n  302273 requests in 30.05s, 58.52MB read\nRequests/sec:  10059.96\nTransfer/sec:      1.95MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    11.05ms    4.92ms 104.90ms   69.57%\n    Req/Sec     5.95k     0.87k    7.65k    76.80%\n  352798 requests in 30.03s, 68.30MB read\nRequests/sec:  11747.23\nTransfer/sec:      2.27MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$\n```\n"
  },
  {
    "path": "packages/framework/performance/hello/main.dart",
    "content": "/// A basic server that prints \"Hello, world!\"\nlibrary;\n\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp.custom(app, startShared, useZone: false);\n\n  app.get('/', (req, res) => res.write('Hello, world!'));\n  app.optimizeForProduction(force: true);\n\n  var oldHandler = app.errorHandler;\n  app.errorHandler = (e, req, res) {\n    print('Oops: ${e.error ?? e}');\n    print(e.stackTrace);\n    return oldHandler(e, req, res);\n  };\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/framework/performance/hello/raw.dart",
    "content": "/// A basic server that prints \"Hello, world!\"\nlibrary;\n\nimport 'dart:io';\n\nFuture<void> main() {\n  return HttpServer.bind('127.0.0.1', 3000, shared: true).then((server) {\n    print('Listening at http://${server.address.address}:${server.port}');\n\n    server.listen((request) {\n      if (request.uri.path == '/') {\n        request.response.write('Hello, world!');\n      }\n\n      request.response.close();\n    });\n  });\n}\n"
  },
  {
    "path": "packages/framework/performance/hello/raw.md",
    "content": "# `dart:io` Results\n\n5 consecutive trials run on a Windows 10 box with 4GB RAM, and several programs open in the background.\n\nSetup:\n\n* Running `wrk` 4.0.2.2\n* 2 threads\n* 256 connections\n* 30 seconds\n\nAverage:\n\n* `14598.16` req/sec\n* `8.88` ms latency\n\n```bash\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     9.67ms    8.19ms 202.28ms   96.17%\n    Req/Sec     7.15k     1.47k    9.97k    73.76%\n  417716 requests in 30.07s, 82.06MB read\nRequests/sec:  13892.50\nTransfer/sec:      2.73MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     8.47ms    3.14ms 100.77ms   65.40%\n    Req/Sec     7.61k   670.47     8.85k    73.88%\n  453301 requests in 30.07s, 89.05MB read\nRequests/sec:  15077.15\nTransfer/sec:      2.96MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     8.62ms    3.51ms  73.34ms   63.74%\n    Req/Sec     7.52k   650.22     8.91k    79.17%\n  448445 requests in 30.07s, 88.10MB read\nRequests/sec:  14911.53\nTransfer/sec:      2.93MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     8.75ms    3.51ms  70.50ms   64.53%\n    Req/Sec     7.41k   825.50    10.23k    72.24%\n  441338 requests in 30.09s, 86.70MB read\nRequests/sec:  14665.62\nTransfer/sec:      2.88MB\ntobe@LAPTOP-VBHCSVRH:/mnt/c/Users/thosa$ wrk -c 256 -d 30 -t 2 http://localhost:3000\nRunning 30s test @ http://localhost:3000\n  2 threads and 256 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     8.90ms    3.62ms  78.36ms   66.71%\n    Req/Sec     7.31k   742.11    10.79k    77.84%\n  434674 requests in 30.09s, 85.39MB read\nRequests/sec:  14443.98\nTransfer/sec:      2.84MB\n```\n"
  },
  {
    "path": "packages/framework/pubspec.yaml",
    "content": "name: angel3_framework\nversion: 8.7.0\ndescription: A high-powered HTTP server extensible framework with dependency injection, routing and much more.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/framework\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_container: ^8.0.0\n  angel3_http_exception: ^8.0.0\n  angel3_model: ^8.0.0\n  angel3_route: ^8.0.0\n  angel3_mock_request: ^8.0.0\n  belatuk_merge_map: ^5.1.0\n  belatuk_combinator: ^5.1.0\n  belatuk_http_server: ^4.1.0\n  charcode: ^1.3.0\n  file: ^7.0.0\n  http_parser: ^4.0.0\n  http2: ^2.0.0\n  logging: ^1.1.0\n  matcher: ^0.12.16\n  meta: ^1.9.0\n  mime: ^2.0.0\n  path: ^1.8.0\n  quiver: ^3.2.0\n  recase: ^4.1.0\n  stack_trace: ^1.11.0\n  string_scanner: ^1.2.0\n  tuple: ^2.0.0\n  uuid: ^4.0.0\n  collection: ^1.17.0\ndev_dependencies:\n  http: ^1.0.0\n  io: ^1.0.0\n  test: ^1.24.0\n  lints: ^6.0.0\n\n\n"
  },
  {
    "path": "packages/framework/test/accepts_test.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nfinal Uri endpoint = Uri.parse('http://example.com/accept');\n\nvoid main() {\n  test('no content type', () async {\n    var req = await acceptContentTypes();\n    expect(req.acceptsAll, isFalse);\n    //expect(req.accepts(ContentType.JSON), isFalse);\n    expect(req.accepts('application/json'), isFalse);\n    //expect(req.accepts(ContentType.HTML), isFalse);\n    expect(req.accepts('text/html'), isFalse);\n  });\n\n  test('wildcard', () async {\n    var req = await acceptContentTypes(['*/*']);\n    expect(req.acceptsAll, isTrue);\n    //expect(req.accepts(ContentType.JSON), isTrue);\n    expect(req.accepts('application/json'), isTrue);\n    //expect(req.accepts(ContentType.HTML), isTrue);\n    expect(req.accepts('text/html'), isTrue);\n  });\n\n  test('specific type', () async {\n    var req = await acceptContentTypes(['text/html']);\n    expect(req.acceptsAll, isFalse);\n    //expect(req.accepts(ContentType.JSON), isFalse);\n    expect(req.accepts('application/json'), isFalse);\n    //expect(req.accepts(ContentType.HTML), isTrue);\n    expect(req.accepts('text/html'), isTrue);\n  });\n\n  test('strict', () async {\n    var req = await acceptContentTypes(['text/html', '*/*']);\n    expect(req.accepts('text/html'), isTrue);\n    //expect(req.accepts(ContentType.HTML), isTrue);\n    //expect(req.accepts(ContentType.JSON, strict: true), isFalse);\n    expect(req.accepts('application/json', strict: true), isFalse);\n  });\n\n  group('disallow null', () {\n    late RequestContext req;\n\n    setUp(() async {\n      req = await acceptContentTypes();\n    });\n\n    test('throws error', () {\n      expect(() => req.accepts(null), throwsArgumentError);\n    });\n  });\n}\n\nFuture<RequestContext> acceptContentTypes([\n  Iterable<String> contentTypes = const [],\n]) {\n  var headerString = contentTypes.isEmpty\n      ? ContentType.text\n      : contentTypes.join(',');\n  var rq = MockHttpRequest('GET', endpoint, persistentConnection: false);\n  rq.headers.set('accept', headerString);\n  rq.close();\n  var app = Angel(reflector: MirrorsReflector());\n  var http = AngelHttp(app);\n  return http.createRequestContext(rq, rq.response);\n}\n"
  },
  {
    "path": "packages/framework/test/all.dart",
    "content": "import 'dart:io';\nimport 'package:io/ansi.dart';\nimport 'http_404_hole_test.dart' as hole404;\nimport 'accepts_test.dart' as accepts;\nimport 'anonymous_service_test.dart' as anonymous_service;\nimport 'body_test.dart' as body;\nimport 'controller_test.dart' as controller;\nimport 'detach_test.dart' as detach;\nimport 'di_test.dart' as di;\nimport 'encoders_buffer_test.dart' as encoders_buffer;\nimport 'env_test.dart' as env;\nimport 'exception_test.dart' as exception;\nimport 'extension_test.dart' as extension_test;\nimport 'find_one_test.dart' as find_one;\nimport 'general_test.dart' as general;\nimport 'hooked_test.dart' as hooked;\nimport 'parameter_meta_test.dart' as parameter_meta;\nimport 'parse_id_test.dart' as parse_id;\nimport 'precontained_test.dart' as precontained;\nimport 'primitives_test.dart' as primitives;\nimport 'repeat_request_test.dart' as repeat_request;\nimport 'req_shutdown_test.dart' as req_shutdown;\nimport 'routing_test.dart' as routing;\nimport 'serialize_test.dart' as serialize;\nimport 'server_test.dart' as server;\nimport 'service_map_test.dart' as service_map;\nimport 'services_test.dart' as services;\nimport 'streaming_test.dart' as streaming;\nimport 'view_generator_test.dart' as view_generator;\n//import 'response_header_test.dart' as response_header;\nimport 'package:test/test.dart';\n\n/// For running with coverage\nvoid main() {\n  print(cyan.wrap('Running tests on ${Platform.version}'));\n  group('http_404_hole', hole404.main);\n  group('accepts', accepts.main);\n  group('anonymous service', anonymous_service.main);\n  group('body', body.main);\n  //group('response_header', response_header.main);\n  group('controller', controller.main);\n  group('detach', detach.main);\n  group('di', di.main);\n  group('encoders_buffer', encoders_buffer.main);\n  group('env', env.main);\n  group('exception', exception.main);\n  group('extension', extension_test.main);\n  group('find_one', find_one.main);\n  group('general', general.main);\n  group('hooked', hooked.main);\n  group('parameter_meta', parameter_meta.main);\n  group('parse_id', parse_id.main);\n  group('precontained', precontained.main);\n  group('primitives', primitives.main);\n  group('repeat_request', repeat_request.main);\n  group('req_shutdown', req_shutdown.main);\n  group('routing', routing.main);\n  group('serialize', serialize.main);\n  group('server', server.main);\n  group('service_map', service_map.main);\n  group('services', services.main);\n  group('streaming', streaming.main);\n  group('view generator', view_generator.main);\n}\n"
  },
  {
    "path": "packages/framework/test/anonymous_service_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('custom methods', () async {\n    var svc = AnonymousService<String?, String?>(\n      index: ([p]) async => ['index'],\n      read: (id, [p]) async => 'read',\n      create: (data, [p]) async => 'create',\n      modify: (id, data, [p]) async => 'modify',\n      update: (id, data, [p]) async => 'update',\n      remove: (id, [p]) async => 'remove',\n    );\n    expect(await svc.index(), ['index']);\n    expect(await svc.read(null), 'read');\n    expect(await svc.create(null), 'create');\n    expect(await svc.modify(null, null), 'modify');\n    expect(await svc.update(null, null), 'update');\n    expect(await svc.remove(null), 'remove');\n  });\n\n  test('defaults to throwing', () async {\n    try {\n      var svc = AnonymousService();\n      await svc.read(1);\n      throw 'Should have thrown 405!';\n    } on AngelHttpException {\n      // print('Ok!');\n    }\n    try {\n      var svc = AnonymousService();\n      await svc.modify(2, null);\n      throw 'Should have thrown 405!';\n    } on AngelHttpException {\n      // print('Ok!');\n    }\n    try {\n      var svc = AnonymousService();\n      await svc.update(3, null);\n      throw 'Should have thrown 405!';\n    } on AngelHttpException {\n      // print('Ok!');\n    }\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/body_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  var app = Angel();\n  var http = AngelHttp(app);\n\n  Future<RequestContext> request({\n    bool asJson = true,\n    bool parse = true,\n    Map<String, dynamic>? bodyFields,\n    List? bodyList,\n  }) async {\n    var rq = MockHttpRequest(\n      'POST',\n      Uri(path: '/'),\n      persistentConnection: false,\n    );\n\n    if (bodyFields != null) {\n      if (asJson) {\n        rq\n          ..headers.contentType = ContentType('application', 'json')\n          ..write(json.encode(bodyFields));\n      } else {\n        var b = StringBuffer();\n        var i = 0;\n        for (var entry in bodyFields.entries) {\n          if (i++ > 0) b.write('&');\n          b.write(entry.key);\n          b.write('=');\n          b.write(Uri.encodeComponent(entry.value.toString()));\n        }\n\n        rq\n          ..headers.contentType = ContentType(\n            'application',\n            'x-www-form-urlencoded',\n          )\n          ..write(json.encode(b.toString()));\n      }\n    } else if (bodyList != null) {\n      rq\n        ..headers.contentType = ContentType('application', 'json')\n        ..write(json.encode(bodyList));\n    }\n\n    await rq.close();\n    var req = await http.createRequestContext(rq, rq.response);\n    if (parse) await req.parseBody();\n    return req;\n  }\n\n  test('parses json maps', () async {\n    var req = await request(bodyFields: {'hello': 'world'});\n    expect(req.bodyAsObject, TypeMatcher<Map<String, dynamic>>());\n    expect(req.bodyAsMap, {'hello': 'world'});\n  });\n\n  test('parses json lists', () async {\n    var req = await request(bodyList: ['foo', 'bar']);\n    expect(req.bodyAsObject, TypeMatcher<List>());\n    expect(req.bodyAsList, ['foo', 'bar']);\n  });\n\n  test('deserializeBody', () async {\n    var req = await request(\n      asJson: true,\n      bodyFields: {'text': 'Hey', 'complete': false},\n    );\n    var todo = await req.deserializeBody(Todo.fromMap);\n    expect(todo.text, 'Hey');\n    expect(todo.completed, false);\n  });\n\n  test('decodeBody', () async {\n    var req = await request(\n      asJson: true,\n      bodyFields: {'text': 'Hey', 'complete': false},\n    );\n    var todo = await req.decodeBody(TodoCodec());\n    expect(todo.text, 'Hey');\n    expect(todo.completed, false);\n  });\n\n  test('throws when body has not been parsed', () async {\n    var req = await request(parse: false);\n    expect(() => req.bodyAsObject, throwsStateError);\n    expect(() => req.bodyAsMap, throwsStateError);\n    expect(() => req.bodyAsList, throwsStateError);\n  });\n\n  test('can set body object exactly once', () async {\n    var req = await request(parse: false);\n    req.bodyAsObject = 23;\n    expect(req.bodyAsObject, 23);\n    expect(() => req.bodyAsObject = {45.6: '34'}, throwsStateError);\n  });\n\n  test('can set body map exactly once', () async {\n    var req = await request(parse: false);\n    req.bodyAsMap = {'hey': 'yes'};\n    expect(req.bodyAsMap, {'hey': 'yes'});\n    expect(() => req.bodyAsMap = {'hm': 'ok'}, throwsStateError);\n  });\n\n  test('can set body list exactly once', () async {\n    var req = await request(parse: false);\n    req.bodyAsList = [\n      {'hey': 'yes'},\n    ];\n    expect(req.bodyAsList, [\n      {'hey': 'yes'},\n    ]);\n    expect(\n      () => req.bodyAsList = [\n        {'hm': 'ok'},\n      ],\n      throwsStateError,\n    );\n  });\n}\n\nclass Todo {\n  String? text;\n  bool? completed;\n\n  Todo({this.text, this.completed});\n\n  static Todo fromMap(Map? m) =>\n      Todo(text: m!['text'] as String?, completed: m['complete'] as bool?);\n}\n\nclass TodoCodec extends Codec<Todo, Map?> {\n  @override\n  Converter<Map, Todo> get decoder => TodoDecoder();\n\n  @override\n  Converter<Todo, Map> get encoder => throw UnsupportedError('no encoder');\n}\n\nclass TodoDecoder extends Converter<Map, Todo> {\n  @override\n  Todo convert(Map input) => Todo.fromMap(input);\n}\n"
  },
  {
    "path": "packages/framework/test/common.dart",
    "content": "library;\n\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:matcher/matcher.dart';\n\nclass Todo extends Model {\n  String? text;\n  String? over;\n\n  Todo({this.text, this.over});\n\n  Map<String, dynamic> toJson() {\n    return {'text': text, 'over': over};\n  }\n}\n\nclass BookService extends Service {\n  @override\n  Future<List> index([params]) async {\n    print('Book params: $params');\n\n    return [\n      {'foo': 'bar'},\n    ];\n  }\n}\n\nvoid incrementTodoTimes(dynamic e) {\n  IncrementService.times++;\n}\n\n@Hooks(before: [incrementTodoTimes])\nclass IncrementService extends Service {\n  static int times = 0;\n\n  @override\n  @Hooks(after: [incrementTodoTimes])\n  Future<List> index([params]) async => [];\n}\n\nclass IsInstanceOf<T> implements Matcher {\n  const IsInstanceOf();\n\n  @override\n  Description describeMismatch(\n    item,\n    Description mismatchDescription,\n    Map matchState,\n    bool verbose,\n  ) {\n    return mismatchDescription.add('$item is not an instance of $T');\n  }\n\n  @override\n  Description describe(Description description) {\n    return description.add('is an instance of $T');\n  }\n\n  @override\n  bool matches(item, Map matchState) => item is T;\n}\n"
  },
  {
    "path": "packages/framework/test/controller_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nimport 'common.dart';\n\n@Expose('/todos', middleware: [foo])\nclass TodoController extends Controller {\n  List<Todo> todos = [Todo(text: 'Hello', over: 'world')];\n\n  @Expose('/:id', middleware: [bar])\n  Future<Todo> fetchTodo(\n    String id,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    expect(req, isNotNull);\n    expect(res, isNotNull);\n    return todos[int.parse(id)];\n  }\n\n  @Expose('/namedRoute/:foo', as: 'foo')\n  Future<String> someRandomRoute(\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    return \"${req.params['foo']}!\";\n  }\n}\n\nclass NoExposeController extends Controller {\n  String getIndex() => 'Hey!';\n\n  int timesTwo(int n) => n * 2;\n\n  String repeatName(String name, int times) {\n    var b = StringBuffer();\n    for (var i = 0; i < times; i++) {\n      b.writeln(name);\n    }\n    return b.toString();\n  }\n\n  @Expose('/yellow', method: 'POST')\n  String someColor() => 'yellow';\n\n  @Expose.patch\n  int three() => 333;\n\n  @noExpose\n  String hideThis() => 'Should not be exposed';\n}\n\n@Expose('/named', as: 'foo')\nclass NamedController extends Controller {\n  @Expose('/optional/:arg?', allowNull: ['arg'])\n  int optional() => 2;\n}\n\nbool foo(RequestContext req, ResponseContext res) {\n  res.write('Hello, ');\n  return true;\n}\n\nbool bar(RequestContext req, ResponseContext res) {\n  res.write('world!');\n  return true;\n}\n\nvoid main() {\n  late Angel app;\n  late TodoController todoController;\n  late NoExposeController noExposeCtrl;\n  late HttpServer server;\n  var client = http.Client();\n  String? url;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    app.get(\n      '/redirect',\n      (req, res) async =>\n          res.redirectToAction('TodoController@foo', {'foo': 'world'}),\n    );\n\n    // Register as a singleton, just for the purpose of this test\n    if (!app.container.has<TodoController>()) {\n      app.container.registerSingleton(todoController = TodoController());\n    }\n\n    // Using mountController<T>();\n    await app.mountController<TodoController>();\n\n    noExposeCtrl = await app.mountController<NoExposeController>();\n\n    // Place controller in group. The applyRoutes() call, however, is async.\n    // Until https://github.com/angel-dart/route/issues/28 is closed,\n    // this will need to be done by manually mounting the router.\n    var subRouter = Router<RequestHandler>();\n    await todoController.applyRoutes(subRouter, app.container.reflector);\n    app.mount('/ctrl_group', subRouter);\n\n    print(app.controllers);\n    app.dumpTree();\n\n    server = await AngelHttp(app).startServer();\n    url = 'http://${server.address.address}:${server.port}';\n  });\n\n  tearDown(() async {\n    await server.close(force: true);\n    url = null;\n  });\n\n  test('basic', () {\n    expect(todoController.app, app);\n  });\n\n  test('create dynamic handler', () async {\n    var app = Angel(reflector: MirrorsReflector());\n    app.get(\n      '/foo',\n      ioc(({String? bar}) {\n        return 2;\n      }, optional: ['bar']),\n    );\n    var rq = MockHttpRequest('GET', Uri(path: 'foo'));\n    await AngelHttp(app).handleRequest(rq);\n    var body = await utf8.decoder.bind(rq.response).join();\n    expect(json.decode(body), 2);\n  });\n\n  test('optional name', () async {\n    var app = Angel(reflector: MirrorsReflector());\n    await app.configure(NamedController().configureServer);\n    expect(app.controllers['foo'], const IsInstanceOf<NamedController>());\n  });\n\n  test('middleware', () async {\n    var rgx = RegExp('^Hello, world!');\n    var response = await client.get(Uri.parse('$url/todos/0'));\n    print('Response: ${response.body}');\n\n    expect(rgx.firstMatch(response.body)?.start, equals(0));\n\n    var todo = json.decode(response.body.replaceAll(rgx, '')) as Map;\n    print('Todo: $todo');\n    expect(todo['text'], equals('Hello'));\n    expect(todo['over'], equals('world'));\n  });\n\n  test('controller in group', () async {\n    var rgx = RegExp('^Hello, world!');\n    var response = await client.get(Uri.parse('$url/ctrl_group/todos/0'));\n    print('Response: ${response.body}');\n\n    expect(rgx.firstMatch(response.body)?.start, equals(0));\n\n    var todo = json.decode(response.body.replaceAll(rgx, '')) as Map;\n    print('Todo: $todo');\n    expect(todo['text'], equals('Hello'));\n    expect(todo['over'], equals('world'));\n  });\n\n  test('named actions', () async {\n    var response = await client.get(Uri.parse('$url/redirect'));\n    print('Response: ${response.body}');\n    expect(response.body, equals('Hello, \"world!\"'));\n  });\n\n  group('optional expose', () {\n    test('removes suffixes from controller names', () {\n      expect(noExposeCtrl.mountPoint!.path, 'no_expose');\n    });\n\n    test('mounts correct routes', () {\n      print(noExposeCtrl.routeMappings.keys);\n      expect(noExposeCtrl.routeMappings.keys.toList(), [\n        'getIndex',\n        'timesTwo',\n        'repeatName',\n        'someColor',\n        'three',\n      ]);\n    });\n\n    test('mounts correct methods', () {\n      void expectMethod(String name, String method) {\n        expect(noExposeCtrl.routeMappings[name]!.method, method);\n      }\n\n      expectMethod('getIndex', 'GET');\n      expectMethod('timesTwo', 'GET');\n      expectMethod('repeatName', 'GET');\n      expectMethod('someColor', 'POST');\n      expectMethod('three', 'PATCH');\n    });\n\n    test('mounts correct paths', () {\n      void expectPath(String name, String path) {\n        expect(noExposeCtrl.routeMappings[name]!.path, path);\n      }\n\n      expectPath('getIndex', '/');\n      expectPath('timesTwo', '/times_two/int:n');\n      expectPath('repeatName', '/repeat_name/:name/int:times');\n      expectPath('someColor', '/yellow');\n      expectPath('three', '/three');\n    });\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/detach_test.dart",
    "content": "import 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late AngelHttp http;\n\n  setUp(() async {\n    var app = Angel();\n    http = AngelHttp(app);\n\n    app.get('/detach', (req, res) async {\n      if (res is HttpResponseContext) {\n        var io = res.detach();\n        io.write('Hey!');\n        await io.close();\n      } else {\n        throw StateError('This endpoint only supports HTTP/1.1.');\n      }\n    });\n  });\n\n  tearDown(() => http.close());\n\n  test('detach response', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/detach'));\n    await rq.close();\n    var rs = rq.response;\n    await http.handleRequest(rq);\n    var body = await rs.transform(utf8.decoder).join();\n    expect(body, 'Hey!');\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/di_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:http/http.dart';\nimport 'package:test/test.dart';\n\nimport 'common.dart';\n\nfinal String sampleText = 'make your bed';\nfinal String sampleOver = 'never';\n\nvoid main() {\n  late Angel app;\n  late http.Client client;\n  late HttpServer server;\n  String? url;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    client = http.Client();\n\n    // Inject some todos\n    app.container.registerSingleton(Todo(text: sampleText, over: sampleOver));\n    app.container.registerFactory<Future<Foo>>((container) async {\n      var req = container.make<RequestContext>();\n      var text = await utf8.decoder.bind(req.body!).join();\n      return Foo(text);\n    });\n\n    app.get('/errands', ioc((Todo singleton) => singleton));\n    app.get(\n      '/errands3',\n      ioc(\n        ({required Errand singleton, Todo? foo, RequestContext? req}) =>\n            singleton.text,\n      ),\n    );\n    app.post('/async', ioc((Foo foo) => {'baz': foo.bar}));\n    await app.configure(SingletonController().configureServer);\n    await app.configure(ErrandController().configureServer);\n\n    server = await AngelHttp(app).startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    url = null;\n    client.close();\n    await server.close(force: true);\n  });\n\n  test('runContained with custom container', () async {\n    var app = Angel();\n    var c = Container(const MirrorsReflector());\n    c.registerSingleton(Todo(text: 'Hey!'));\n\n    app.get('/', (req, res) async {\n      return app.runContained((Todo t) => t.text, req, res, c);\n    });\n\n    var rq = MockHttpRequest('GET', Uri(path: '/'));\n    await rq.close();\n    var rs = rq.response;\n    await AngelHttp(app).handleRequest(rq);\n    var text = await rs.transform(utf8.decoder).join();\n    expect(text, json.encode('Hey!'));\n  });\n\n  test('singleton in route', () async {\n    validateTodoSingleton(await client.get(Uri.parse('$url/errands')));\n  });\n\n  test('singleton in controller', () async {\n    validateTodoSingleton(await client.get(Uri.parse('$url/errands2')));\n  });\n\n  test('make in route', () async {\n    var response = await client.get(Uri.parse('$url/errands3'));\n    var text = await json.decode(response.body) as String?;\n    expect(text, equals(sampleText));\n  });\n\n  test('make in controller', () async {\n    var response = await client.get(Uri.parse('$url/errands4'));\n    var text = await json.decode(response.body) as String?;\n    expect(text, equals(sampleText));\n  });\n\n  test('resolve from future in controller', () async {\n    var response = await client.post(\n      Uri.parse('$url/errands4/async'),\n      body: 'hey',\n    );\n    expect(response.body, json.encode({'bar': 'hey'}));\n  });\n\n  test('resolve from future in route', () async {\n    var response = await client.post(Uri.parse('$url/async'), body: 'yes');\n    expect(response.body, json.encode({'baz': 'yes'}));\n  });\n}\n\nvoid validateTodoSingleton(Response response) {\n  var todo = json.decode(response.body.toString()) as Map;\n  expect(todo['id'], equals(null));\n  expect(todo['text'], equals(sampleText));\n  expect(todo['over'], equals(sampleOver));\n}\n\n@Expose('/errands2')\nclass SingletonController extends Controller {\n  @Expose('/')\n  Todo todo(Todo singleton) => singleton;\n}\n\n@Expose('/errands4')\nclass ErrandController extends Controller {\n  @Expose('/')\n  String? errand(Errand errand) {\n    return errand.text;\n  }\n\n  @Expose('/async', method: 'POST')\n  Map<String, String> asyncResolve(Foo foo) {\n    return {'bar': foo.bar};\n  }\n}\n\nclass Foo {\n  final String bar;\n\n  Foo(this.bar);\n}\n\nclass Errand {\n  Todo todo;\n\n  String? get text => todo.text;\n\n  Errand(this.todo);\n}\n"
  },
  {
    "path": "packages/framework/test/encoders_buffer_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' hide BytesBuilder;\nimport 'dart:typed_data' show BytesBuilder;\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nFuture<List<int>> getBody(MockHttpResponse rs) async {\n  var list = await rs.toList();\n  var bb = BytesBuilder();\n  list.forEach(bb.add);\n  return bb.takeBytes();\n}\n\nvoid main() {\n  late Angel app;\n\n  setUp(() {\n    app = Angel(reflector: MirrorsReflector());\n    app.encoders.addAll({'deflate': zlib.encoder, 'gzip': gzip.encoder});\n\n    app.get('/hello', (req, res) {\n      res\n        ..useBuffer()\n        ..write('Hello, world!');\n    });\n  });\n\n  tearDown(() => app.close());\n\n  encodingTests(() => app);\n}\n\nvoid encodingTests(Angel Function() getApp) {\n  group('encoding', () {\n    Angel app;\n    late AngelHttp http;\n\n    setUp(() {\n      app = getApp();\n      http = AngelHttp(app);\n    });\n\n    test('sends plaintext if no accept-encoding', () async {\n      var rq = MockHttpRequest('GET', Uri.parse('/hello'));\n      await rq.close();\n      var rs = rq.response;\n      await http.handleRequest(rq);\n\n      var body = await rs.transform(utf8.decoder).join();\n      expect(body, 'Hello, world!');\n    });\n\n    test('encodes if wildcard', () async {\n      var rq = MockHttpRequest('GET', Uri.parse('/hello'))\n        ..headers.set('accept-encoding', '*');\n      await rq.close();\n      var rs = rq.response;\n      await http.handleRequest(rq);\n\n      var body = await getBody(rs);\n      //print(rs.headers);\n      expect(rs.headers.value('content-encoding'), 'deflate');\n      expect(body, zlib.encode(utf8.encode('Hello, world!')));\n    });\n\n    test('encodes if wildcard + multiple', () async {\n      var rq = MockHttpRequest('GET', Uri.parse('/hello'))\n        ..headers.set('accept-encoding', ['foo', 'bar', '*']);\n      await rq.close();\n      var rs = rq.response;\n      await http.handleRequest(rq);\n\n      var body = await getBody(rs);\n      expect(rs.headers.value('content-encoding'), 'deflate');\n      expect(body, zlib.encode(utf8.encode('Hello, world!')));\n    });\n\n    test('encodes if explicit', () async {\n      var rq = MockHttpRequest('GET', Uri.parse('/hello'))\n        ..headers.set('accept-encoding', 'gzip');\n      await rq.close();\n      var rs = rq.response;\n      await http.handleRequest(rq);\n\n      var body = await getBody(rs);\n      expect(rs.headers.value('content-encoding'), 'gzip');\n      expect(body, gzip.encode(utf8.encode('Hello, world!')));\n    });\n\n    test('only uses one encoder', () async {\n      var rq = MockHttpRequest('GET', Uri.parse('/hello'));\n      rq.headers.set('accept-encoding', ['gzip', 'deflate']);\n      await rq.close();\n      var rs = rq.response;\n      await http.handleRequest(rq);\n\n      var body = await getBody(rs);\n      expect(rs.headers.value('content-encoding'), 'gzip');\n      expect(body, gzip.encode(utf8.encode('Hello, world!')));\n    });\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/env_test.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('custom value', () => expect(AngelEnvironment('hey').value, 'hey'));\n\n  test('lowercases', () => expect(AngelEnvironment('HeY').value, 'hey'));\n  test(\n    'default to env or development',\n    () => expect(\n      AngelEnvironment().value,\n      (Platform.environment['ANGEL_ENV'] ?? 'development').toLowerCase(),\n    ),\n  );\n  test(\n    'isDevelopment',\n    () => expect(AngelEnvironment('development').isDevelopment, true),\n  );\n  test('isStaging', () => expect(AngelEnvironment('staging').isStaging, true));\n  test(\n    'isDevelopment',\n    () => expect(AngelEnvironment('production').isProduction, true),\n  );\n}\n"
  },
  {
    "path": "packages/framework/test/exception_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'dart:convert';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('named constructors', () {\n    expect(\n      AngelHttpException.badRequest(),\n      isException(400, '400 Bad Request'),\n    );\n    expect(\n      AngelHttpException.notAuthenticated(),\n      isException(401, '401 Not Authenticated'),\n    );\n    expect(\n      AngelHttpException.paymentRequired(),\n      isException(402, '402 Payment Required'),\n    );\n    expect(AngelHttpException.forbidden(), isException(403, '403 Forbidden'));\n    expect(AngelHttpException.notFound(), isException(404, '404 Not Found'));\n    expect(\n      AngelHttpException.methodNotAllowed(),\n      isException(405, '405 Method Not Allowed'),\n    );\n    expect(\n      AngelHttpException.notAcceptable(),\n      isException(406, '406 Not Acceptable'),\n    );\n    expect(AngelHttpException.methodTimeout(), isException(408, '408 Timeout'));\n    expect(AngelHttpException.conflict(), isException(409, '409 Conflict'));\n    expect(\n      AngelHttpException.notProcessable(),\n      isException(422, '422 Not Processable'),\n    );\n    expect(\n      AngelHttpException.notImplemented(),\n      isException(501, '501 Not Implemented'),\n    );\n    expect(\n      AngelHttpException.unavailable(),\n      isException(503, '503 Unavailable'),\n    );\n  });\n\n  test('fromMap', () {\n    expect(\n      AngelHttpException.fromMap({'status_code': -1, 'message': 'ok'}),\n      isException(-1, 'ok'),\n    );\n  });\n\n  test('toMap = toJson', () {\n    var exc = AngelHttpException.badRequest();\n    expect(exc.toMap(), exc.toJson());\n    var json_ = json.encode(exc.toJson());\n    var exc2 = AngelHttpException.fromJson(json_);\n    expect(exc2.toJson(), exc.toJson());\n  });\n\n  test('toString', () {\n    expect(\n      AngelHttpException(statusCode: 420, message: 'Blaze It').toString(),\n      '420: Blaze It',\n    );\n  });\n}\n\nMatcher isException(int statusCode, String message) =>\n    _IsException(statusCode, message);\n\nclass _IsException extends Matcher {\n  final int statusCode;\n  final String message;\n\n  _IsException(this.statusCode, this.message);\n\n  @override\n  Description describe(Description description) =>\n      description.add('has status code $statusCode and message \"$message\"');\n\n  @override\n  bool matches(item, Map matchState) {\n    return item is AngelHttpException &&\n        item.statusCode == statusCode &&\n        item.message == message;\n  }\n}\n"
  },
  {
    "path": "packages/framework/test/extension_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nfinal Uri endpoint = Uri.parse('http://example.com');\n\nvoid main() {\n  test('single extension', () async {\n    var req = await makeRequest('foo.js');\n    expect(req.extension, '.js');\n  });\n\n  test('multiple extensions', () async {\n    var req = await makeRequest('foo.min.js');\n    expect(req.extension, '.js');\n  });\n\n  test('no extension', () async {\n    var req = await makeRequest('foo');\n    expect(req.extension, '');\n  });\n}\n\nFuture<RequestContext> makeRequest(String path) {\n  var rq = MockHttpRequest('GET', endpoint.replace(path: path))..close();\n  var app = Angel(reflector: MirrorsReflector());\n  var http = AngelHttp(app);\n  return http.createRequestContext(rq, rq.response);\n}\n"
  },
  {
    "path": "packages/framework/test/find_one_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  var throwsAnAngelHttpException = throwsA(\n    const IsInstanceOf<AngelHttpException>(),\n  );\n\n  /*\n  test('throw 404 on null', () {\n    var service = AnonymousService(index: ([p]) => null);\n    expect(() => service.findOne(), throwsAnAngelHttpException);\n  });\n  */\n\n  test('throw 404 on empty iterable', () {\n    var service = AnonymousService(index: ([p]) => []);\n    expect(() => service.findOne(), throwsAnAngelHttpException);\n  });\n\n  test('return first element of iterable', () async {\n    var service = AnonymousService(index: ([p]) => [2]);\n    expect(await service.findOne(), 2);\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/general_test.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'dart:convert';\nimport 'package:http/http.dart' as http;\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app;\n  late http.Client client;\n  late HttpServer server;\n  late String url;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector())\n      ..post('/foo', (req, res) => res.serialize({'hello': 'world'}))\n      ..all('*', (req, res) => throw AngelHttpException.notFound());\n    client = http.Client();\n\n    server = await AngelHttp(app).startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    client.close();\n    await server.close(force: true);\n  });\n\n  test('allow override of method', () async {\n    var response = await client.get(\n      Uri.parse('$url/foo'),\n      headers: {'X-HTTP-Method-Override': 'POST'},\n    );\n    print('Response: ${response.body}');\n    expect(json.decode(response.body), equals({'hello': 'world'}));\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/hm.dart",
    "content": "import 'dart:async';\nimport 'package:io/ansi.dart';\nimport 'all.dart' as hm;\n\nvoid main() async {\n  var zone = Zone.current.fork(\n    specification: ZoneSpecification(\n      print: (self, parent, zone, line) {\n        if (line == 'null') {\n          parent.print(zone, cyan.wrap(StackTrace.current.toString())!);\n        }\n      },\n    ),\n  );\n  return await zone.run(hm.main);\n}\n"
  },
  {
    "path": "packages/framework/test/hooked_test.dart",
    "content": "import 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  Map headers = <String, String>{\n    'Accept': 'application/json',\n    'Content-Type': 'application/json',\n  };\n\n  late Angel app;\n  late HttpServer server;\n  late String url;\n  late http.Client client;\n  late HookedService todoService;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    client = http.Client();\n    app.use('/todos', MapService());\n    app.use('/books', BookService());\n\n    todoService =\n        app.findHookedService<MapService>('todos')\n            as HookedService<dynamic, dynamic, Service>;\n\n    todoService.beforeAllStream().listen((e) {\n      print('Fired ${e.eventName}! Data: ${e.data}; Params: ${e.params}');\n    });\n\n    app.errorHandler = (e, req, res) {\n      throw e.error as Object;\n    };\n\n    server = await AngelHttp(app).startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    await server.close(force: true);\n    client.close();\n  });\n\n  test('listen before and after', () async {\n    var count = 0;\n\n    todoService\n      ..beforeIndexed.listen((_) {\n        count++;\n      })\n      ..afterIndexed.listen((_) {\n        count++;\n      });\n\n    var response = await client.get(Uri.parse('$url/todos'));\n    print(response.body);\n    expect(count, equals(2));\n  });\n\n  test('cancel before', () async {\n    todoService.beforeCreated\n      ..listen((HookedServiceEvent event) {\n        event.cancel({'hello': 'hooked world'});\n      })\n      ..listen((HookedServiceEvent event) {\n        event.cancel({'this_hook': 'should never run'});\n      });\n\n    var response = await client.post(\n      Uri.parse('$url/todos'),\n      body: json.encode({'arbitrary': 'data'}),\n      headers: headers as Map<String, String>,\n    );\n    print(response.body);\n    var result = json.decode(response.body) as Map;\n    expect(result['hello'], equals('hooked world'));\n  });\n\n  test('cancel after', () async {\n    todoService.afterIndexed\n      ..listen((HookedServiceEvent event) async {\n        // Hooks can be Futures ;)\n        event.cancel([\n          {'angel': 'framework'},\n        ]);\n      })\n      ..listen((HookedServiceEvent event) {\n        event.cancel({'this_hook': 'should never run either'});\n      });\n\n    var response = await client.get(Uri.parse('$url/todos'));\n    print(response.body);\n    var result = json.decode(response.body) as List;\n    expect(result[0]['angel'], equals('framework'));\n  });\n\n  test('asStream() fires', () async {\n    var stream = todoService.afterCreated.asStream();\n    await todoService.create({'angel': 'framework'});\n    expect(await stream.first.then((e) => e.result['angel']), 'framework');\n  });\n\n  test('metadata', () async {\n    final service = HookedService(IncrementService())..addHooks(app);\n    expect(service.inner, isNot(const IsInstanceOf<MapService>()));\n    IncrementService.times = 0;\n    await service.index();\n    expect(IncrementService.times, equals(2));\n  });\n\n  test('inject request + response', () async {\n    var books =\n        app.findService('books')\n            as HookedService<dynamic, dynamic, Service<dynamic, dynamic>>;\n\n    books.beforeIndexed.listen((e) {\n      expect([e.request, e.response], everyElement(isNotNull));\n      print('Indexing books at path: ${e.request?.path}');\n    });\n\n    var response = await client.get(Uri.parse('$url/books'));\n    print(response.body);\n\n    var result = json.decode(response.body);\n    expect(result, isList);\n    expect(result, isNotEmpty);\n    expect(result[0], equals({'foo': 'bar'}));\n  });\n\n  test('contains provider in before and after', () async {\n    var svc = HookedService(AnonymousService(index: ([p]) async => []));\n\n    void ensureProviderIsPresent(HookedServiceEvent e) {\n      var type = e.isBefore ? 'before' : 'after';\n      print('Params to $type ${e.eventName}: ${e.params}');\n      expect(e.params, isMap);\n      expect(e.params.keys, contains('provider'));\n      expect(e.params['provider'], const IsInstanceOf<Providers>());\n    }\n\n    svc\n      ..beforeAll(ensureProviderIsPresent)\n      ..afterAll(ensureProviderIsPresent);\n\n    await svc.index({'provider': const Providers('testing')});\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/http2/adapter_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' hide BytesBuilder;\nimport 'dart:typed_data';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart' hide Header;\nimport 'package:angel3_framework/http2.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:http/src/multipart_file.dart' as http;\nimport 'package:http/src/multipart_request.dart' as http;\nimport 'package:http/io_client.dart';\nimport 'package:http2/transport.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'http2_client.dart';\n\nconst String jfk =\n    'Ask not what your country can do for you, but what you can do for your country.';\n\nStream<List<int>> jfkStream() {\n  return Stream.fromIterable([utf8.encode(jfk)]);\n}\n\nvoid main() {\n  var client = Http2Client();\n  late IOClient h1c;\n  Angel app;\n  late AngelHttp2 http2;\n  late Uri serverRoot;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector())..encoders['gzip'] = gzip.encoder;\n    hierarchicalLoggingEnabled = true;\n    app.logger = Logger.detached('angel.http2')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error == null) return;\n        print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    app.get('/', (req, res) async {\n      res.write('Hello world');\n      await res.close();\n    });\n\n    app.all('/method', (req, res) => req.method);\n\n    app.get('/json', (_, _) => {'foo': 'bar'});\n\n    app.get('/stream', (req, res) => jfkStream().pipe(res));\n\n    app.get('/headers', (req, res) async {\n      res.headers.addAll({'foo': 'bar', 'x-angel': 'http2'});\n      await res.close();\n    });\n\n    app.get('/status', (req, res) async {\n      res.statusCode = 1337;\n      await res.close();\n    });\n\n    app.post('/body', (req, res) => req.parseBody().then((_) => req.bodyAsMap));\n\n    app.post('/upload', (req, res) async {\n      await req.parseBody();\n      var body = req.bodyAsMap;\n      var files = req.uploadedFiles ?? [];\n\n      var file = files.firstWhereOrNull((f) => f.name == 'file')!;\n      return [\n        await file.data.map((l) => l.length).reduce((a, b) => a + b),\n        file.contentType.mimeType,\n        body,\n      ];\n    });\n\n    app.get('/push', (req, res) async {\n      res.write('ok');\n\n      if (res is Http2ResponseContext && res.canPush) {\n        var a = res.push('a')..write('a');\n        await a.close();\n\n        var b = res.push('b')..write('b');\n        await b.close();\n      }\n\n      await res.close();\n    });\n\n    app.get('/param/:name', (req, res) => req.params);\n\n    app.get('/query', (req, res) {\n      print('incoming URI: ${req.uri}');\n      return req.queryParameters;\n    });\n\n    var ctx = SecurityContext()\n      ..useCertificateChain('dev.pem')\n      ..usePrivateKey('dev.key', password: 'dartdart')\n      ..setAlpnProtocols(['h2'], true);\n\n    // Create an HTTP client that trusts our server.\n    h1c = IOClient(HttpClient()..badCertificateCallback = (_, _, _) => true);\n\n    http2 = AngelHttp2(app, ctx, allowHttp1: true);\n\n    var server = await http2.startServer();\n    serverRoot = Uri.parse('https://127.0.0.1:${server.port}');\n  });\n\n  tearDown(() async {\n    await http2.close();\n    h1c.close();\n  });\n\n  test('buffered response', () async {\n    var response = await client.get(serverRoot);\n    expect(response.body, 'Hello world');\n  });\n\n  test('allowHttp1', () async {\n    var response = await h1c.get(serverRoot);\n    expect(response.body, 'Hello world');\n  });\n\n  test('streamed response', () async {\n    var response = await client.get(serverRoot.replace(path: '/stream'));\n    expect(response.body, jfk);\n  });\n\n  group('gzip', () {\n    test('buffered response', () async {\n      var response = await client.get(\n        serverRoot,\n        headers: {'accept-encoding': 'gzip, deflate, br'},\n      );\n      expect(response.headers['content-encoding'], 'gzip');\n      var decoded = gzip.decode(response.bodyBytes);\n      expect(utf8.decode(decoded), 'Hello world');\n    });\n\n    test('streamed response', () async {\n      var response = await client.get(\n        serverRoot.replace(path: '/stream'),\n        headers: {'accept-encoding': 'gzip'},\n      );\n      expect(response.headers['content-encoding'], 'gzip');\n      //print(response.body);\n      var decoded = gzip.decode(response.bodyBytes);\n      expect(utf8.decode(decoded), jfk);\n    });\n  });\n\n  test('query uri decoded', () async {\n    var uri = serverRoot.replace(\n      path: '/query',\n      queryParameters: {'foo!': 'bar?'},\n    );\n    var response = await client.get(uri);\n    print('Sent $uri');\n    expect(response.body, json.encode({'foo!': 'bar?'}));\n  });\n\n  test('params uri decoded', () async {\n    var response = await client.get(serverRoot.replace(path: '/param/foo!'));\n    expect(response.body, json.encode({'name': 'foo!'}));\n  });\n\n  test('method parsed', () async {\n    var response = await client.delete(serverRoot.replace(path: '/method'));\n    expect(response.body, json.encode('DELETE'));\n  });\n\n  test('json response', () async {\n    var response = await client.get(serverRoot.replace(path: '/json'));\n    expect(response.body, json.encode({'foo': 'bar'}));\n    expect(\n      ContentType.parse(response.headers['content-type']!).mimeType,\n      ContentType.json.mimeType,\n    );\n  });\n\n  test('status sent', () async {\n    var response = await client.get(serverRoot.replace(path: '/status'));\n    expect(response.statusCode, 1337);\n  });\n\n  test('headers sent', () async {\n    var response = await client.get(serverRoot.replace(path: '/headers'));\n    expect(response.headers['foo'], 'bar');\n    expect(response.headers['x-angel'], 'http2');\n  });\n\n  test('server push', () async {\n    var socket = await SecureSocket.connect(\n      serverRoot.host,\n      serverRoot.port,\n      onBadCertificate: (_) => true,\n      supportedProtocols: ['h2'],\n    );\n\n    var connection = ClientTransportConnection.viaSocket(\n      socket,\n      settings: ClientSettings(allowServerPushes: true),\n    );\n\n    var headers = <Header>[\n      Header.ascii(':authority', serverRoot.authority),\n      Header.ascii(':method', 'GET'),\n      Header.ascii(':path', serverRoot.replace(path: '/push').path),\n      Header.ascii(':scheme', serverRoot.scheme),\n    ];\n\n    var stream = connection.makeRequest(headers, endStream: true);\n\n    var bb = await stream.incomingMessages\n        .where((s) => s is DataStreamMessage)\n        .cast<DataStreamMessage>()\n        .fold<BytesBuilder>(BytesBuilder(), (out, msg) => out..add(msg.bytes));\n\n    // Check that main body was sent\n    expect(utf8.decode(bb.takeBytes()), 'ok');\n\n    var pushes = await stream.peerPushes.toList();\n    expect(pushes, hasLength(2));\n\n    var pushA = pushes[0], pushB = pushes[1];\n\n    String getPath(TransportStreamPush p) => ascii.decode(\n      p.requestHeaders.firstWhere((h) => ascii.decode(h.name) == ':path').value,\n    );\n\n    /*\n    Future<String> getBody(ClientTransportStream stream) async {\n      await stream.outgoingMessages.close();\n      var bb = await stream.incomingMessages\n          .map((s) {\n            if (s is HeadersStreamMessage) {\n              for (var h in s.headers) {\n                print('${ASCII.decode(h.name)}: ${ASCII.decode(h.value)}');\n              }\n            } else if (s is DataStreamMessage) {\n              print(UTF8.decode(s.bytes));\n            }\n\n            return s;\n          })\n          .where((s) => s is DataStreamMessage)\n          .cast<DataStreamMessage>()\n          .fold<BytesBuilder>(\n              BytesBuilder(), (out, msg) => out..add(msg.bytes));\n      return UTF8.decode(bb.takeBytes());\n    }\n    */\n\n    expect(getPath(pushA), '/a');\n    expect(getPath(pushB), '/b');\n\n    // However, Chrome, Firefox, Edge all can\n    //expect(await getBody(pushA.stream), 'a');\n    //expect(await getBody(pushB.stream), 'b');\n  });\n\n  group('body parsing', () {\n    test('urlencoded body parsed', () async {\n      var response = await client.post(\n        serverRoot.replace(path: '/body'),\n        headers: {\n          'accept': 'application/json',\n          'content-type': 'application/x-www-form-urlencoded',\n        },\n        body: 'foo=bar',\n      );\n      expect(response.body, json.encode({'foo': 'bar'}));\n    });\n\n    test('json body parsed', () async {\n      var response = await client.post(\n        serverRoot.replace(path: '/body'),\n        headers: {\n          'accept': 'application/json',\n          'content-type': 'application/json',\n        },\n        body: json.encode({'foo': 'bar'}),\n      );\n      expect(response.body, json.encode({'foo': 'bar'}));\n    });\n\n    test('multipart body parsed', () async {\n      var rq = http.MultipartRequest(\n        'POST',\n        serverRoot.replace(path: '/upload'),\n      );\n      rq.headers.addAll({'accept': 'application/json'});\n\n      rq.fields['foo'] = 'bar';\n      rq.files.add(\n        http.MultipartFile(\n          'file',\n          Stream.fromIterable([utf8.encode('hello world')]),\n          11,\n          contentType: MediaType('angel', 'framework'),\n        ),\n      );\n\n      var response = await client.send(rq);\n      var responseBody = await response.stream.transform(utf8.decoder).join();\n\n      expect(\n        responseBody,\n        json.encode([\n          11,\n          'angel/framework',\n          {'foo': 'bar'},\n        ]),\n      );\n    });\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/http2/http2_client.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io' hide BytesBuilder;\nimport 'dart:typed_data';\nimport 'package:http/http.dart';\nimport 'package:http2/transport.dart';\n\n/// Simple HTTP/2 client\nclass Http2Client extends BaseClient {\n  static Future<ClientTransportStream> convertRequestToStream(\n    BaseRequest request,\n  ) async {\n    // Connect a socket\n    var socket = await SecureSocket.connect(\n      request.url.host,\n      request.url.port,\n      onBadCertificate: (_) => true,\n      supportedProtocols: ['h2'],\n    );\n\n    var connection = ClientTransportConnection.viaSocket(socket);\n\n    var headers = <Header>[\n      Header.ascii(':authority', request.url.authority),\n      Header.ascii(':method', request.method),\n      Header.ascii(\n        ':path',\n        request.url.path +\n            (request.url.hasQuery ? ('?${request.url.query}') : ''),\n      ),\n      Header.ascii(':scheme', request.url.scheme),\n    ];\n\n    var bb = await request.finalize().fold<BytesBuilder>(\n      BytesBuilder(),\n      (out, list) => out..add(list),\n    );\n    var body = bb.takeBytes();\n\n    if (body.isNotEmpty) {\n      headers.add(Header.ascii('content-length', body.length.toString()));\n    }\n\n    request.headers.forEach((k, v) {\n      headers.add(Header.ascii(k, v));\n    });\n\n    var stream = connection.makeRequest(headers, endStream: body.isEmpty);\n\n    if (body.isNotEmpty) {\n      stream.sendData(body, endStream: true);\n    } else {\n      await (stream.outgoingMessages.close());\n    }\n\n    return stream;\n  }\n\n  /// Returns `true` if the response stream was closed.\n  static Future<bool> readResponse(\n    ClientTransportStream stream,\n    Map<String, String> headers,\n    BytesBuilder body,\n  ) {\n    var c = Completer<bool>();\n    var closed = false;\n\n    stream.incomingMessages.listen(\n      (msg) {\n        if (msg is HeadersStreamMessage) {\n          for (var header in msg.headers) {\n            var name = ascii.decode(header.name).toLowerCase(),\n                value = ascii.decode(header.value);\n            headers[name] = value;\n            //print('$name: $value');\n          }\n        } else if (msg is DataStreamMessage) {\n          body.add(msg.bytes);\n        }\n\n        if (!closed && msg.endStream) closed = true;\n      },\n      cancelOnError: true,\n      onError: c.completeError,\n      onDone: () => c.complete(closed),\n    );\n\n    return c.future;\n  }\n\n  @override\n  Future<StreamedResponse> send(BaseRequest request) async {\n    var stream = await convertRequestToStream(request);\n    var headers = <String, String>{};\n    var body = BytesBuilder();\n    var closed = await readResponse(stream, headers, body);\n    return StreamedResponse(\n      Stream.fromIterable([body.takeBytes()]),\n      int.parse(headers[':status']!),\n      headers: headers,\n      isRedirect: headers.containsKey('location'),\n      contentLength: headers.containsKey('content-length')\n          ? int.parse(headers['content-length']!)\n          : null,\n      request: request,\n      reasonPhrase: null,\n      // doesn't exist in HTTP/2\n      persistentConnection: !closed,\n    );\n  }\n}\n"
  },
  {
    "path": "packages/framework/test/http_404_hole_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:charcode/ascii.dart';\nimport 'package:http/io_client.dart' as http;\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'pretty_log.dart';\n\nvoid main() {\n  late http.IOClient client;\n  late AngelHttp driver;\n  late Logger logger;\n\n  setUp(() async {\n    client = http.IOClient();\n    hierarchicalLoggingEnabled = true;\n\n    logger = Logger.detached('http_404_hole')\n      ..level = Level.ALL\n      ..onRecord.listen(prettyLog);\n\n    var app = Angel(logger: logger);\n\n    app.fallback(hello);\n    app.fallback(throw404);\n\n    // The error handler in the boilerplate.\n    var oldErrorHandler = app.errorHandler;\n    app.errorHandler = (e, req, res) async {\n      if (req.accepts('text/html', strict: true)) {\n        if (e.statusCode == 404 && req.accepts('text/html', strict: true)) {\n          await res.render('error', {\n            'message': 'No file exists at ${req.uri}.',\n          });\n        } else {\n          await res.render('error', {'message': e.message});\n        }\n      } else {\n        return await oldErrorHandler(e, req, res);\n      }\n    };\n\n    driver = AngelHttp(app);\n    await driver.startServer();\n  });\n\n  tearDown(() {\n    logger.clearListeners();\n    client.close();\n    scheduleMicrotask(driver.close);\n  });\n\n  test('does not continue processing after streaming', () async {\n    var url = driver.uri.replace(path: '/hey');\n    for (var i = 0; i < 100; i++) {\n      var r = await client.get(url);\n      print('#$i: ${r.statusCode}: ${r.body}');\n      expect(r.statusCode, 200);\n      expect(r.body, 'Hello!');\n    }\n  });\n}\n\n/// Simulate angel_static\nFuture<void> hello(RequestContext req, ResponseContext res) {\n  if (req.path == 'hey') {\n    var bytes = [$H, $e, $l, $l, $o, $exclamation];\n    var s = Stream<List<int>>.fromIterable([bytes]);\n    return s.pipe(res);\n  } else {\n    return Future.value();\n  }\n}\n\n/// 404\nvoid throw404(RequestContext req, ResponseContext res) {\n  Zone.current.handleUncaughtError(\n    'This 404 should not occur.',\n    StackTrace.current,\n  );\n  throw AngelHttpException.notFound();\n}\n"
  },
  {
    "path": "packages/framework/test/jsonp_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  var app = Angel();\n  var http = AngelHttp(app);\n\n  app.get('/default', (req, res) => res.jsonp({'foo': 'bar'}));\n\n  app.get(\n    '/callback',\n    (req, res) => res.jsonp({'foo': 'bar'}, callbackName: 'doIt'),\n  );\n\n  app.get(\n    '/contentType',\n    (req, res) =>\n        res.jsonp({'foo': 'bar'}, contentType: MediaType('foo', 'bar')),\n  );\n\n  Future<MediaType> getContentType(String path) async {\n    var rq = MockHttpRequest('GET', Uri(path: '/$path'));\n    await rq.close();\n    await http.handleRequest(rq);\n    return MediaType.parse(rq.response.headers.contentType.toString());\n  }\n\n  Future<String> getText(String path) async {\n    var rq = MockHttpRequest('GET', Uri(path: '/$path'));\n    await rq.close();\n    await http.handleRequest(rq);\n    return await rq.response.transform(utf8.decoder).join();\n  }\n\n  test('default', () async {\n    var response = await getText('default');\n    var contentType = await getContentType('default');\n    expect(response, r'callback({\"foo\":\"bar\"})');\n    expect(contentType.mimeType, 'application/javascript');\n  });\n\n  test('callback', () async {\n    var response = await getText('callback');\n    var contentType = await getContentType('callback');\n    expect(response, r'doIt({\"foo\":\"bar\"})');\n    expect(contentType.mimeType, 'application/javascript');\n  });\n\n  test('content type', () async {\n    var response = await getText('contentType');\n    var contentType = await getContentType('contentType');\n    expect(response, r'callback({\"foo\":\"bar\"})');\n    expect(contentType.mimeType, 'foo/bar');\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/parameter_meta_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:logging/logging.dart';\n\nimport 'package:test/test.dart';\n\nFuture<String> readResponse(MockHttpResponse rs) {\n  return rs.transform(utf8.decoder).join();\n}\n\nFuture printResponse(MockHttpResponse rs) {\n  return readResponse(rs).then((text) {\n    print(text.isEmpty ? '<empty response>' : text);\n  });\n}\n\nvoid main() {\n  group('parameter_meta', parameterMetaTests);\n}\n\nvoid parameterMetaTests() {\n  Angel app;\n  late AngelHttp http;\n\n  setUp(() {\n    app = Angel(reflector: MirrorsReflector());\n    http = AngelHttp(app);\n\n    app.get(\n      '/cookie',\n      ioc((@CookieValue('token') String jwt) {\n        return jwt;\n      }),\n    );\n\n    app.get(\n      '/header',\n      ioc((@Header('x-foo') String header) {\n        return header;\n      }),\n    );\n\n    app.get(\n      '/query',\n      ioc((@Query('q') String query) {\n        return query;\n      }),\n    );\n\n    app.get(\n      '/session',\n      ioc((@Session('foo') String foo) {\n        return foo;\n      }),\n    );\n\n    app.get(\n      '/match',\n      ioc((@Query('mode', match: 'pos') String mode) {\n        return 'YES $mode';\n      }),\n    );\n\n    app.get(\n      '/match',\n      ioc((@Query('mode', match: 'neg') String mode) {\n        return 'NO $mode';\n      }),\n    );\n\n    app.get(\n      '/match',\n      ioc((@Query('mode') String mode) {\n        return 'DEFAULT $mode';\n      }),\n    );\n\n    app.logger = Logger('parameter_meta_test')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n  });\n\n  test('injects header or throws', () async {\n    // Invalid request\n    var rq = MockHttpRequest('GET', Uri.parse('/header'));\n    await rq.close();\n    var rs = rq.response;\n    //TODO: Using await will hang. To be resolved.\n    http.handleRequest(rq);\n\n    await printResponse(rs);\n    expect(rs.statusCode, 400);\n\n    // Valid request\n    rq = MockHttpRequest('GET', Uri.parse('/header'))\n      ..headers.add('x-foo', 'bar');\n    await rq.close();\n    rs = rq.response;\n    http.handleRequest(rq);\n\n    var body = await readResponse(rs);\n    print('Body: $body');\n    expect(rs.statusCode, 200);\n    expect(body, json.encode('bar'));\n  });\n\n  test('injects session or throws', () async {\n    // Invalid request\n    var rq = MockHttpRequest('GET', Uri.parse('/session'));\n    await rq.close();\n    var rs = rq.response;\n    http\n        .handleRequest(rq)\n        .timeout(const Duration(seconds: 5))\n        .catchError((_) => null);\n\n    await printResponse(rs);\n    expect(rs.statusCode, 500);\n\n    rq = MockHttpRequest('GET', Uri.parse('/session'));\n    rq.session['foo'] = 'bar';\n    await rq.close();\n    rs = rq.response;\n    http.handleRequest(rq);\n\n    await printResponse(rs);\n    expect(rs.statusCode, 200);\n  });\n\n  // Originally, the plan was to test cookie, session, header, etc.,\n  // but that behavior has been consolidated into `getValue`. Thus,\n  // they will all function the same way.\n\n  test('pattern matching', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/match?mode=pos'));\n    await rq.close();\n    var rs = rq.response;\n    http.handleRequest(rq);\n    var body = await readResponse(rs);\n    print('Body: $body');\n    expect(rs.statusCode, 200);\n    expect(body, json.encode('YES pos'));\n\n    rq = MockHttpRequest('GET', Uri.parse('/match?mode=neg'));\n    await rq.close();\n    rs = rq.response;\n    http.handleRequest(rq);\n    body = await readResponse(rs);\n    print('Body: $body');\n    expect(rs.statusCode, 200);\n    expect(body, json.encode('NO neg'));\n\n    // Fallback\n    rq = MockHttpRequest('GET', Uri.parse('/match?mode=ambi'));\n    await rq.close();\n    rs = rq.response;\n    http.handleRequest(rq);\n    body = await readResponse(rs);\n    print('Body: $body');\n    expect(rs.statusCode, 200);\n    expect(body, json.encode('DEFAULT ambi'));\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/parse_id_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('null', () {\n    expect(Service.parseId('null'), 'null');\n    expect(Service.parseId(null), 'null');\n  });\n\n  test('String', () {\n    expect(Service.parseId('23'), '23');\n  });\n\n  test('int', () {\n    expect(Service.parseId<int>('23'), 23);\n  });\n\n  test('double', () {\n    expect(Service.parseId<double>('23.4'), 23.4);\n  });\n\n  test('num', () {\n    expect(Service.parseId<num>('23.4'), 23.4);\n  });\n\n  test('bool', () {\n    expect(Service.parseId<bool>('true'), true);\n    expect(Service.parseId<bool>(true), true);\n    expect(Service.parseId<bool>('false'), false);\n    expect(Service.parseId<bool>(false), false);\n    expect(Service.parseId<bool>('hmm'), false);\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/precontained_test.dart",
    "content": "import 'dart:convert';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\n\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('preinjects functions', () async {\n    var app = Angel(reflector: MirrorsReflector())\n      ..configuration['foo'] = 'bar'\n      ..get('/foo', ioc(echoAppFoo));\n    app.optimizeForProduction(force: true);\n    print(app.preContained);\n    expect(app.preContained.keys, contains(echoAppFoo));\n\n    var rq = MockHttpRequest('GET', Uri(path: '/foo'));\n    await rq.close();\n    await AngelHttp(app).handleRequest(rq);\n    var rs = rq.response;\n    var body = await rs.transform(utf8.decoder).join();\n    expect(body, json.encode('bar'));\n  }, skip: 'Angel no longer has to preinject functions');\n}\n\nString echoAppFoo(String foo) => foo;\n"
  },
  {
    "path": "packages/framework/test/pretty_log.dart",
    "content": "import 'package:logging/logging.dart';\nimport 'package:io/ansi.dart';\n\n/// Prints the contents of a [LogRecord] with pretty colors.\nvoid prettyLog(LogRecord record) {\n  var code = chooseLogColor(record.level);\n\n  if (record.error == null) print(code.wrap(record.toString()));\n\n  if (record.error != null) {\n    var err = record.error;\n    print(code.wrap('$record\\n'));\n    print(code.wrap(err.toString()));\n\n    if (record.stackTrace != null) {\n      print(code.wrap(record.stackTrace.toString()));\n    }\n  }\n}\n\n/// Chooses a color based on the logger [level].\nAnsiCode chooseLogColor(Level level) {\n  if (level == Level.SHOUT) {\n    return backgroundRed;\n  } else if (level == Level.SEVERE) {\n    return red;\n  } else if (level == Level.WARNING) {\n    return yellow;\n  } else if (level == Level.INFO) {\n    return cyan;\n  } else if (level == Level.CONFIG ||\n      level == Level.FINE ||\n      level == Level.FINER ||\n      level == Level.FINEST) {\n    return lightGray;\n  }\n  return resetAll;\n}\n"
  },
  {
    "path": "packages/framework/test/primitives_test.dart",
    "content": "import 'dart:convert';\nimport 'dart:io' show stderr;\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\n\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app;\n  late AngelHttp http;\n\n  setUp(() {\n    app = Angel(reflector: MirrorsReflector())\n      ..configuration['global'] = 305; // Pitbull!\n    http = AngelHttp(app);\n\n    app.get('/string/:string', ioc((String string) => string));\n\n    app.get(\n      '/num/parsed/:num',\n      chain([\n        (req, res) {\n          req.params['n'] = num.parse(req.params['num'].toString());\n          return true;\n        },\n        ioc((num n) => n),\n      ]),\n    );\n\n    app.get('/num/global', ioc((num global) => global));\n\n    app.errorHandler = (e, req, res) {\n      stderr\n        ..writeln(e.error)\n        ..writeln(e.stackTrace);\n    };\n  });\n\n  tearDown(() => app.close());\n\n  test('String type annotation', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/string/hello'));\n    await rq.close();\n    await http.handleRequest(rq);\n    var rs = await rq.response.transform(utf8.decoder).join();\n    expect(rs, json.encode('hello'));\n  });\n\n  test('Primitive after parsed param injection', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/num/parsed/24'));\n    await rq.close();\n    await http.handleRequest(rq);\n    var rs = await rq.response.transform(utf8.decoder).join();\n    expect(rs, json.encode(24));\n  });\n\n  test('globally-injected primitive', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/num/global'));\n    await rq.close();\n    await http.handleRequest(rq);\n    var rs = await rq.response.transform(utf8.decoder).join();\n    expect(rs, json.encode(305));\n  });\n\n  test('unparsed primitive throws error', () async {\n    var rq = MockHttpRequest('GET', Uri.parse('/num/unparsed/32'));\n    await rq.close();\n    var req = await http.createRequestContext(rq, rq.response);\n    var res = await http.createResponseContext(rq, rq.response, req);\n    expect(\n      () => app.runContained((num unparsed) => unparsed, req, res),\n      throwsA(isA<ArgumentError>()),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/repeat_request_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  MockHttpRequest mk(int id) {\n    return MockHttpRequest('GET', Uri.parse('/test/$id'))..close();\n  }\n\n  test('can request the same url twice', () async {\n    var app = Angel(reflector: MirrorsReflector())\n      ..get('/test/:id', ioc((id) => 'Hello $id'));\n    var rq1 = mk(1), rq2 = mk(2), rq3 = mk(1);\n    await Future.wait([rq1, rq2, rq3].map(AngelHttp(app).handleRequest));\n    var body1 = await rq1.response.transform(utf8.decoder).join(),\n        body2 = await rq2.response.transform(utf8.decoder).join(),\n        body3 = await rq3.response.transform(utf8.decoder).join();\n    print('Response #1: $body1');\n    print('Response #2: $body2');\n    print('Response #3: $body3');\n    expect(body1, allOf(isNot(body2), equals(body3)));\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/req_shutdown_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http/io_client.dart' as http;\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'pretty_log.dart';\n\nvoid main() {\n  late http.IOClient client;\n  late AngelHttp driver;\n  late Logger logger;\n  late StringBuffer buf;\n\n  setUp(() async {\n    buf = StringBuffer();\n    client = http.IOClient();\n    hierarchicalLoggingEnabled = true;\n\n    logger = Logger.detached('req_shutdown')\n      ..level = Level.ALL\n      ..onRecord.listen(prettyLog);\n\n    var app = Angel(logger: logger);\n\n    app.fallback((req, res) {\n      req.shutdownHooks.add(() => buf.write('Hello, '));\n      req.shutdownHooks.add(() => buf.write('world!'));\n    });\n\n    driver = AngelHttp(app);\n    await driver.startServer();\n  });\n\n  tearDown(() {\n    logger.clearListeners();\n    client.close();\n    scheduleMicrotask(driver.close);\n  });\n\n  test('does not continue processing after streaming', () async {\n    await client.get(driver.uri);\n    await Future.delayed(Duration(milliseconds: 100));\n    expect(buf.toString(), 'Hello, world!');\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/response_header_test.dart",
    "content": "import 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/src/http/angel_http.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app;\n  late AngelHttp http;\n  late HttpClient client;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    http = AngelHttp(app);\n\n    await http.startServer();\n\n    var formData = {'id': 100, 'name': 'William'};\n    app.get('/api/v1/user/list', (RequestContext req, res) async {\n      //await req.parseBody();\n      //res.write('Hello, World!');\n      res.json(formData);\n    });\n\n    client = HttpClient();\n  });\n\n  tearDown(() async {\n    client.close();\n    await http.close();\n  });\n\n  test('Remove Response Header', () async {\n    http.removeResponseHeader({'x-frame-options': 'SAMEORIGIN'});\n\n    var request = await client.get('localhost', 3000, '/api/v1/user/list');\n    HttpClientResponse response = await request.close();\n    //print(response.headers);\n    expect(response.headers['x-frame-options'], isNull);\n  }, skip: true);\n\n  test('Add Response Header', () async {\n    http.addResponseHeader({\n      'X-XSRF_TOKEN':\n          'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e',\n    });\n\n    var request = await client.get('localhost', 3000, '/api/v1/user/list');\n    HttpClientResponse response = await request.close();\n    //print(response.headers);\n    expect(\n      response.headers['X-XSRF_TOKEN'],\n      equals([\n        'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e',\n      ]),\n    );\n  }, skip: true);\n}\n"
  },
  {
    "path": "packages/framework/test/routing_test.dart",
    "content": "import 'dart:convert';\nimport 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:io/ansi.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nimport 'common.dart';\n\n@Middleware([interceptor])\nFuture<String> testMiddlewareMetadata(\n  RequestContext req,\n  ResponseContext res,\n) async {\n  return 'This should not be shown.';\n}\n\n@Middleware([interceptService])\nclass QueryService extends Service {\n  @override\n  @Middleware([interceptor])\n  Future<Map?> read(id, [Map? params]) async => params;\n}\n\nvoid interceptor(RequestContext req, ResponseContext res) {\n  res\n    ..write('Middleware')\n    ..close();\n}\n\nbool interceptService(RequestContext req, ResponseContext res) {\n  res.write('Service with ');\n  return true;\n}\n\nvoid main() {\n  late Angel app;\n  late Angel nested;\n  late Angel todos;\n  late String url;\n  late http.Client client;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    nested = Angel(reflector: MirrorsReflector());\n    todos = Angel(reflector: MirrorsReflector());\n\n    for (var app in [app, nested, todos]) {\n      app.logger = Logger('routing_test')\n        ..onRecord.listen((rec) {\n          if (rec.error != null) {\n            stdout\n              ..writeln(cyan.wrap(rec.toString()))\n              ..writeln(cyan.wrap(rec.error.toString()))\n              ..writeln(cyan.wrap(rec.stackTrace.toString()));\n          }\n        });\n    }\n\n    todos.get('/action/:action', (req, res) => res.json(req.params));\n\n    late Route ted;\n\n    ted = nested.post('/ted/:route', (RequestContext req, res) {\n      print('Params: ${req.params}');\n      print('Path: ${ted.path}, uri: ${req.path}');\n      print('matcher: ${ted.parser}');\n      return req.params;\n    });\n\n    app.mount('/nes', nested);\n    app.get('/meta', testMiddlewareMetadata);\n    app.get(\n      '/intercepted',\n      (req, res) => 'This should not be shown',\n      middleware: [interceptor],\n    );\n    app.get('/hello', (req, res) => 'world');\n    app.get('/name/:first/last/:last', (req, res) => req.params);\n    app.post(\n      '/lambda',\n      (RequestContext req, res) => req.parseBody().then((_) => req.bodyAsMap),\n    );\n    app.mount('/todos/:id', todos);\n    app\n            .get(\n              '/greet/:name',\n              (RequestContext req, res) async => \"Hello ${req.params['name']}\",\n            )\n            .name =\n        'Named routes';\n    app.get('/named', (req, ResponseContext res) async {\n      await res.redirectTo('Named routes', {'name': 'tests'});\n    });\n    app.get('/log', (RequestContext req, res) async {\n      print('Query: ${req.queryParameters}');\n      return 'Logged';\n    });\n\n    app.get('/method', (req, res) => 'Only GET');\n    app.post('/method', (req, res) => 'Only POST');\n\n    app.use('/query', QueryService());\n\n    RequestHandler write(String message) {\n      return (req, res) {\n        res.write(message);\n        return true;\n      };\n    }\n\n    app\n        .chain([write('a')])\n        .chain([write('b'), write('c')])\n        .get('/chained', (req, res) => res.close());\n\n    app.fallback((req, res) => 'MJ');\n\n    //app.dumpTree(header: \"DUMPING ROUTES:\", showMatchers: true);\n\n    client = http.Client();\n    var server = await AngelHttp(app).startServer('127.0.0.1', 0);\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    await app.close();\n    client.close();\n  });\n\n  test('Can match basic url', () async {\n    var response = await client.get(Uri.parse('$url/hello'));\n    expect(response.body, equals('\"world\"'));\n  });\n\n  test('Can match url with multiple parameters', () async {\n    var response = await client.get(Uri.parse('$url/name/HELLO/last/WORLD'));\n    print('Response: ${response.body}');\n    var json_ = json.decode(response.body);\n    expect(json_, const IsInstanceOf<Map>());\n    expect(json_['first'], equals('HELLO'));\n    expect(json_['last'], equals('WORLD'));\n  });\n\n  test('Chained routes', () async {\n    var response = await client.get(Uri.parse('$url/chained'));\n    expect(response.body, equals('abc'));\n  });\n\n  test('Can nest another Angel instance', () async {\n    var response = await client.post(Uri.parse('$url/nes/ted/foo'));\n    var json_ = json.decode(response.body);\n    expect(json_['route'], equals('foo'));\n  });\n\n  test('Can parse parameters from a nested Angel instance', () async {\n    var response = await client.get(Uri.parse('$url/todos/1337/action/test'));\n    var json_ = json.decode(response.body);\n    print('JSON: $json_');\n    expect(json_['id'], equals('1337'));\n    expect(json_['action'], equals('test'));\n  });\n\n  test('Can add and use named middleware', () async {\n    var response = await client.get(Uri.parse('$url/intercepted'));\n    expect(response.body, equals('Middleware'));\n  });\n\n  test('Middleware via metadata', () async {\n    // Metadata\n    var response = await client.get(Uri.parse('$url/meta'));\n    expect(response.body, equals('Middleware'));\n  });\n\n  test('Can serialize function result as JSON', () async {\n    Map headers = <String, String>{'Content-Type': 'application/json'};\n    var postData = json.encode({'it': 'works'});\n    var response = await client.post(\n      Uri.parse('$url/lambda'),\n      headers: headers as Map<String, String>,\n      body: postData,\n    );\n    print('Response: ${response.body}');\n    expect(json.decode(response.body)['it'], equals('works'));\n  });\n\n  test('Fallback routes', () async {\n    var response = await client.get(Uri.parse('$url/my_favorite_artist'));\n    expect(response.body, equals('\"MJ\"'));\n  });\n\n  /* TODO: Revisit this later\n  test('Can name routes', () {\n    Route foo = app.get('/framework/:id', null)..name = 'frm';\n    print('Foo: $foo');\n    String uri = foo.makeUri({'id': 'angel'});\n    print(uri);\n    expect(uri, equals('framework/angel'));\n  });\n  */\n\n  test('Redirect to named routes', () async {\n    var response = await client.get(Uri.parse('$url/named'));\n    print(response.body);\n    expect(json.decode(response.body), equals('Hello tests'));\n  });\n\n  test('Match routes, even with query params', () async {\n    var response = await client.get(\n      Uri.parse('$url/log?foo=bar&bar=baz&baz.foo=bar&baz.bar=foo'),\n    );\n    print(response.body);\n    expect(json.decode(response.body), equals('Logged'));\n\n    response = await client.get(Uri.parse('$url/query/foo?bar=baz'));\n    print(response.body);\n    expect(response.body, equals('Service with Middleware'));\n  });\n\n  test('only match route with matching method', () async {\n    var response = await client.get(Uri.parse('$url/method'));\n    print(response.body);\n    expect(response.body, '\"Only GET\"');\n\n    response = await client.post(Uri.parse('$url/method'));\n    print(response.body);\n    expect(response.body, '\"Only POST\"');\n\n    response = await client.patch(Uri.parse('$url/method'));\n    print(response.body);\n    expect(response.body, '\"MJ\"');\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/serialize_test.dart",
    "content": "import 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:http_parser/http_parser.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app;\n  late http.Client client;\n  late HttpServer server;\n  late String url;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector())\n      ..get('/foo', ioc(() => {'hello': 'world'}))\n      ..get('/bar', (req, res) async {\n        await res.serialize({\n          'hello': 'world',\n        }, contentType: MediaType('text', 'html'));\n      });\n    client = http.Client();\n\n    server = await AngelHttp(app).startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    client.close();\n    await server.close(force: true);\n  });\n\n  test('correct content-type', () async {\n    var response = await client.get(Uri.parse('$url/foo'));\n    print('Response: ${response.body}');\n    expect(response.headers['content-type'], contains('application/json'));\n\n    response = await client.get(Uri.parse('$url/bar'));\n    print('Response: ${response.body}');\n    expect(response.headers['content-type'], contains('text/html'));\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/server_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\n\nimport 'package:test/test.dart';\n\nfinal Uri $foo = Uri.parse('http://localhost:3000/foo');\n\n/// Additional tests to improve coverage of server.dart\nvoid main() {\n  group('scoping', () {\n    var parent = Angel(reflector: MirrorsReflector())..configuration['two'] = 2;\n    var child = Angel(reflector: MirrorsReflector());\n    parent.mount('/child', child);\n\n    test('sets children', () {\n      expect(parent.children, contains(child));\n    });\n\n    test('sets parent', () {\n      expect(child.parent, parent);\n    });\n\n    test('properties can climb up hierarchy', () {\n      expect(child.findProperty('two'), 2);\n    });\n  });\n\n  test('custom server generator', () {\n    var app = Angel(reflector: MirrorsReflector());\n    var http = AngelHttp.custom(app, HttpServer.bind);\n    expect(http.serverGenerator, HttpServer.bind);\n  });\n\n  test('default error handler', () async {\n    var app = Angel(reflector: MirrorsReflector());\n    var http = AngelHttp(app);\n    var rq = MockHttpRequest('GET', $foo);\n    await (rq.close());\n    var rs = rq.response;\n    var req = await http.createRequestContext(rq, rs);\n    var res = await http.createResponseContext(rq, rs);\n    var e = AngelHttpException(\n      statusCode: 321,\n      message: 'Hello',\n      errors: ['foo', 'bar'],\n    );\n    await app.errorHandler(e, req, res);\n    await http.sendResponse(rq, rs, req, res);\n    expect(\n      ContentType.parse(rs.headers.value('content-type')!).mimeType,\n      'text/html',\n    );\n    expect(rs.statusCode, e.statusCode);\n    var body = await rs.transform(utf8.decoder).join();\n    expect(body, contains('<title>${e.message}</title>'));\n    expect(body, contains('<li>foo</li>'));\n    expect(body, contains('<li>bar</li>'));\n  });\n\n  test('plug-ins run on startup', () async {\n    var app = Angel(reflector: MirrorsReflector());\n    app.startupHooks.add((app) => app.configuration['two'] = 2);\n\n    var http = AngelHttp(app);\n    await http.startServer();\n    expect(app.configuration['two'], 2);\n    await app.close();\n    await http.close();\n  });\n\n  test('warning when adding routes to flattened router', () {\n    var app = Angel(reflector: MirrorsReflector())\n      ..optimizeForProduction(force: true);\n    app.dumpTree();\n    app.get('/', (req, res) => 2);\n    app.mount('/foo', Router()..get('/', (req, res) => 3));\n  });\n\n  test('services close on close call', () async {\n    var app = Angel(reflector: MirrorsReflector());\n    var svc = CustomCloseService();\n    expect(svc.value, 2);\n    app.use('/', svc);\n    await app.close();\n    expect(svc.value, 3);\n  });\n\n  test('global injection added to injection map', () async {\n    var app = Angel(reflector: MirrorsReflector())..configuration['a'] = 'b';\n    var http = AngelHttp(app);\n    app.get('/', ioc((String a) => a));\n    var rq = MockHttpRequest('GET', Uri.parse('/'));\n    await (rq.close());\n    await http.handleRequest(rq);\n    var body = await rq.response.transform(utf8.decoder).join();\n    expect(body, json.encode('b'));\n  });\n\n  test('global injected serializer', () async {\n    var app = Angel(reflector: MirrorsReflector())..serializer = (_) => 'x';\n    var http = AngelHttp(app);\n    app.get($foo.path, (req, ResponseContext res) => res.serialize(null));\n    var rq = MockHttpRequest('GET', $foo);\n    await (rq.close());\n    await http.handleRequest(rq);\n    var body = await rq.response.transform(utf8.decoder).join();\n    expect(body, 'x');\n  });\n\n  group('handler results', () {\n    var app = Angel(reflector: MirrorsReflector());\n    var http = AngelHttp(app);\n    app.responseFinalizers.add(\n      (req, res) => throw AngelHttpException.forbidden(),\n    );\n    late RequestContext req;\n    late ResponseContext res;\n\n    setUp(() async {\n      var rq = MockHttpRequest('GET', $foo);\n      await (rq.close());\n      req = await http.createRequestContext(rq, rq.response);\n      res = await http.createResponseContext(rq, rq.response);\n    });\n\n    group('getHandlerResult', () {\n      test('return request handler', () async {\n        handler(req, res) => (req, res) async {\n          return 2;\n        };\n        var r = await app.getHandlerResult(handler, req, res);\n        expect(r, 2);\n      });\n\n      test('return future', () async {\n        var handler = Future.value(2);\n        expect(await app.getHandlerResult(handler, req, res), 2);\n      });\n    });\n\n    group('executeHandler', () {\n      test('return Stream', () async {\n        handler(req, res) => Stream.fromIterable([2, 3]);\n        expect(await app.executeHandler(handler, req, res), isFalse);\n      });\n\n      test('end response', () async {\n        handler(req, ResponseContext res) => res.close();\n        expect(await app.executeHandler(handler, req, res), isFalse);\n      });\n    });\n  });\n\n  group('handleAngelHttpException', () {\n    late Angel app;\n    late AngelHttp http;\n\n    setUp(() async {\n      app = Angel(reflector: MirrorsReflector());\n      app.get('/wtf', (req, res) => throw AngelHttpException.forbidden());\n      app.get('/wtf2', (req, res) => throw AngelHttpException.forbidden());\n      http = AngelHttp(app);\n      await http.startServer('127.0.0.1', 0);\n\n      var oldHandler = app.errorHandler;\n      app.errorHandler = (e, req, res) {\n        print('FATAL: ${e.error ?? e}');\n        print(e.stackTrace);\n        return oldHandler(e, req, res);\n      };\n    });\n\n    tearDown(() => app.close());\n\n    test('can send json', () async {\n      var rq = MockHttpRequest('GET', Uri(path: 'wtf'))\n        ..headers.set('accept', 'application/json');\n      await rq.close();\n      http.handleRequest(rq);\n      await rq.response.toList();\n      expect(rq.response.statusCode, 403);\n      expect(rq.response.headers.contentType!.mimeType, 'application/json');\n    });\n\n    test('can throw in finalizer', () async {\n      var rq = MockHttpRequest('GET', Uri(path: 'wtf'))\n        ..headers.set('accept', 'application/json');\n      await rq.close();\n      http.handleRequest(rq);\n      await rq.response.toList();\n      expect(rq.response.statusCode, 403);\n      expect(rq.response.headers.contentType!.mimeType, 'application/json');\n    });\n\n    test('can send html', () async {\n      var rq = MockHttpRequest('GET', Uri(path: 'wtf2'));\n      //rq.headers.set('accept', 'text/html');\n      await rq.close();\n      http.handleRequest(rq);\n      await rq.response.toList();\n      expect(rq.response.statusCode, 403);\n      expect(rq.response.headers.contentType?.mimeType, 'text/html');\n    });\n  });\n}\n\nclass CustomCloseService extends Service {\n  int value = 2;\n\n  @override\n  void close() {\n    value = 3;\n    super.close();\n  }\n}\n\n@Expose('/foo')\nclass FooController extends Controller {\n  @Expose('/bar')\n  Future<String> bar() async => 'baz';\n}\n"
  },
  {
    "path": "packages/framework/test/service_map_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\nimport 'package:quiver/core.dart';\n\nvoid main() {\n  MapService inner;\n  late Service<String?, Todo> mapped;\n\n  setUp(() {\n    inner = MapService();\n    mapped = inner.map<Todo>(Todo.fromMap, Todo.toMap);\n  });\n\n  test('create', () async {\n    var result = await mapped.create(Todo(text: 'hello', complete: false));\n    print(result);\n    expect(result, Todo(text: 'hello', complete: false));\n  });\n\n  group('after create', () {\n    late Todo result;\n    String? id;\n\n    setUp(() async {\n      result = await mapped.create(Todo(text: 'hello', complete: false));\n      id = result.id;\n    });\n\n    test('index', () async {\n      expect(await mapped.index(), [result]);\n    });\n\n    test('modify', () async {\n      var newTodo = Todo(text: 'yes', complete: true);\n      expect(await mapped.update(id, newTodo), newTodo);\n    });\n\n    test('update', () async {\n      var newTodo = Todo(id: 'hmmm', text: 'yes', complete: true);\n      expect(await mapped.update(id, newTodo), newTodo);\n    });\n\n    test('read', () async {\n      expect(await mapped.read(id), result);\n    });\n\n    test('remove', () async {\n      expect(await mapped.remove(id), result);\n    });\n  });\n}\n\nclass Todo {\n  final String? id, text;\n  final bool? complete;\n\n  Todo({this.id, this.text, this.complete});\n\n  static Todo fromMap(Map<String, dynamic> json) {\n    return Todo(\n      id: json['id'] as String?,\n      text: json['text'] as String?,\n      complete: json['complete'] as bool?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(Todo model) {\n    return {'id': model.id, 'text': model.text, 'complete': model.complete};\n  }\n\n  @override\n  bool operator ==(other) =>\n      other is Todo && other.text == text && other.complete == complete;\n\n  @override\n  String toString() => '$id:$text($complete)';\n\n  @override\n  int get hashCode => hash2(text.hashCode, complete.hashCode);\n}\n"
  },
  {
    "path": "packages/framework/test/services_test.dart",
    "content": "import 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'dart:convert';\nimport 'package:http/http.dart' as http;\nimport 'package:stack_trace/stack_trace.dart';\nimport 'package:test/test.dart';\n\nclass Todo extends Model {\n  String? text;\n  String? over;\n}\n\nvoid main() {\n  Map headers = <String, String>{\n    'Accept': 'application/json',\n    'Content-Type': 'application/json',\n  };\n  late Angel app;\n  late MapService service;\n  late String url;\n  late http.Client client;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector())\n      ..use('/todos', service = MapService())\n      ..errorHandler = (e, req, res) {\n        if (e.error != null) print('Whoops: ${e.error}');\n        if (e.stackTrace != null) print(Chain.forTrace(e.stackTrace!).terse);\n      };\n\n    var server = await AngelHttp(app).startServer();\n    client = http.Client();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    await app.close();\n    client.close();\n  });\n\n  group('memory', () {\n    test('can index an empty service', () async {\n      var response = await client.get(Uri.parse('$url/todos/'));\n      print(response.body);\n      expect(response.body, equals('[]'));\n      print(response.body);\n      expect(json.decode(response.body).length, 0);\n    });\n\n    test('can create data', () async {\n      var postData = json.encode({'text': 'Hello, world!'});\n      var response = await client.post(\n        Uri.parse('$url/todos'),\n        headers: headers as Map<String, String>,\n        body: postData,\n      );\n      expect(response.statusCode, 201);\n      var jsons = json.decode(response.body);\n      print(jsons);\n      expect(jsons['text'], equals('Hello, world!'));\n    });\n\n    test('can fetch data', () async {\n      var postData = json.encode({'text': 'Hello, world!'});\n      await client.post(\n        Uri.parse('$url/todos'),\n        headers: headers as Map<String, String>,\n        body: postData,\n      );\n      var response = await client.get(Uri.parse('$url/todos/0'));\n      expect(response.statusCode, 200);\n      var jsons = json.decode(response.body);\n      print(jsons);\n      expect(jsons['text'], equals('Hello, world!'));\n    });\n\n    test('can modify data', () async {\n      var postData = json.encode({'text': 'Hello, world!'});\n      await client.post(\n        Uri.parse('$url/todos'),\n        headers: headers as Map<String, String>,\n        body: postData,\n      );\n      postData = json.encode({'text': 'modified'});\n\n      var response = await client.patch(\n        Uri.parse('$url/todos/0'),\n        headers: headers,\n        body: postData,\n      );\n      expect(response.statusCode, 200);\n      var jsons = json.decode(response.body);\n      print(jsons);\n      expect(jsons['text'], equals('modified'));\n    });\n\n    test('can overwrite data', () async {\n      var postData = json.encode({'text': 'Hello, world!'});\n      await client.post(\n        Uri.parse('$url/todos'),\n        headers: headers as Map<String, String>,\n        body: postData,\n      );\n      postData = json.encode({'over': 'write'});\n\n      var response = await client.post(\n        Uri.parse('$url/todos/0'),\n        headers: headers,\n        body: postData,\n      );\n      expect(response.statusCode, 200);\n      var jsons = json.decode(response.body);\n      print(jsons);\n      expect(jsons['text'], equals(null));\n      expect(jsons['over'], equals('write'));\n    });\n\n    test('readMany', () async {\n      var items = <Map>[\n        await service.create({'foo': 'bar'}),\n        await service.create({'bar': 'baz'}),\n        await service.create({'baz': 'quux'}),\n      ];\n\n      var ids = items.map((m) => m['id'] as String?).toList();\n      expect(await service.readMany(ids), items);\n    });\n\n    test('can delete data', () async {\n      var postData = json.encode({'text': 'Hello, world!'});\n      var created = await client\n          .post(\n            Uri.parse('$url/todos'),\n            headers: headers as Map<String, String>,\n            body: postData,\n          )\n          .then((r) => json.decode(r.body));\n      var response = await client.delete(\n        Uri.parse(\"$url/todos/${created['id']}\"),\n      );\n      expect(response.statusCode, 200);\n      var json_ = json.decode(response.body);\n      print(json_);\n      expect(json_['text'], equals('Hello, world!'));\n    });\n\n    test('cannot remove all unless explicitly set', () async {\n      var response = await client.delete(Uri.parse('$url/todos/null'));\n      expect(response.statusCode, 403);\n    });\n  });\n}\n"
  },
  {
    "path": "packages/framework/test/streaming_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:logging/logging.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\n\nimport 'package:test/test.dart';\n\nimport 'encoders_buffer_test.dart' show encodingTests;\n\nvoid main() {\n  late Angel app;\n  late AngelHttp http;\n\n  setUp(() {\n    app = Angel(reflector: MirrorsReflector());\n    http = AngelHttp(app, useZone: true);\n\n    app.logger = Logger('streaming_test')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    app.encoders.addAll({'deflate': zlib.encoder, 'gzip': gzip.encoder});\n\n    app.get('/hello', (req, res) {\n      return Stream<List<int>>.fromIterable([\n        'Hello, world!'.codeUnits,\n      ]).pipe(res);\n    });\n\n    app.get('/write', (req, res) async {\n      await res.addStream(\n        Stream<List<int>>.fromIterable(['Hello, world!'.codeUnits]),\n      );\n      res.write('bye');\n      await res.close();\n    });\n\n    app.get('/multiple', (req, res) async {\n      await res.addStream(\n        Stream<List<int>>.fromIterable(['Hello, world!'.codeUnits]),\n      );\n      await res.addStream(Stream<List<int>>.fromIterable(['bye'.codeUnits]));\n      await res.close();\n    });\n\n    app.get('/overwrite', (req, res) async {\n      res.statusCode = 32;\n      await Stream<List<int>>.fromIterable([\n        'Hello, world!'.codeUnits,\n      ]).pipe(res);\n\n      var f = Stream<List<int>>.fromIterable([\n        'Hello, world!'.codeUnits,\n      ]).pipe(res).then((_) => false).catchError((_) => true);\n\n      expect(f, completion(true));\n    });\n\n    app.get('/error', (req, res) => res.addError(StateError('wtf')));\n\n    app.errorHandler = (e, req, res) async {\n      stderr\n        ..writeln(e.error)\n        ..writeln(e.stackTrace);\n    };\n  });\n\n  tearDown(() => http.close());\n\n  void expectHelloBye(String path) async {\n    var rq = MockHttpRequest('GET', Uri.parse(path));\n    await (rq.close());\n    await http.handleRequest(rq);\n    var body = await rq.response.transform(utf8.decoder).join();\n    expect(body, 'Hello, world!bye');\n  }\n\n  test('write after addStream', () => expectHelloBye('/write'));\n\n  test('multiple addStream', () => expectHelloBye('/multiple'));\n\n  test('cannot write after close', () async {\n    try {\n      var rq = MockHttpRequest('GET', Uri.parse('/overwrite'));\n      await rq.close();\n      await http.handleRequest(rq);\n      var body = await rq.response.transform(utf8.decoder).join();\n\n      if (rq.response.statusCode != 32) {\n        throw 'overwrite should throw error; response: $body';\n      }\n    } on StateError {\n      // Success\n    }\n  });\n\n  test('res => addError', () async {\n    try {\n      var rq = MockHttpRequest('GET', Uri.parse('/error'));\n      await (rq.close());\n      await http.handleRequest(rq);\n      var body = await rq.response.transform(utf8.decoder).join();\n      throw 'addError should throw error; response: $body';\n    } on StateError {\n      // Should throw error...\n    }\n  });\n\n  encodingTests(() => app);\n}\n"
  },
  {
    "path": "packages/framework/test/view_generator_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('default view generator', () async {\n    var app = Angel();\n    var view = await app.viewGenerator!('foo', {'bar': 'baz'});\n    expect(view, contains('No view engine'));\n  });\n}\n"
  },
  {
    "path": "packages/html/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/html/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.4.0\n\n* Require Dart >= 3.11\n\n## 8.3.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.1.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.0.0\n\n* Require Dart >= 3.0\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n* Updated repository link\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* No release Skipped\n\n## 3.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 2.0.0\n\n* Angel 2 + Dart 2 updates.\n"
  },
  {
    "path": "packages/html/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/html/README.md",
    "content": "# Angel3 HTML\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_html?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/html/LICENSE)\n\nA plug-in that allows you to return `belatuk_html_builder` AST's from request handlers, and have them sent as HTML automatically.\n\n[`package:belatuk_html_builder`](https://pub.dev/packages/belatuk_html_builder) is a simple virtual DOM library with a handy Dart DSL that makes it easy to build HTML AST's:\n\n```dart\nimport 'package:belatuk_html_builder/elements.dart';\n\nNode myDom = html(lang: 'en', c: [\n  head(c: [\n    meta(name: 'viewport', content: 'width=device-width, initial-scale=1'),\n    title(c: [\n      text('html_builder example page')\n    ]),\n  ]),\n  body(c: [\n    h1(c: [\n      text('Hello world!'),\n    ]),\n  ]),\n]);\n```\n\nThis plug-in means that you can now `return` these AST's, and Angel will automatically send them to clients. Ultimately, the implication is that you can use `belatuk_html_builder` as a substitute for a templating system within Dart. With [hot reloading](https://pub.dev/packages/angel3_hot), you won't even need to reload your server (as it should be).\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_html: ^6.0.0\n```\n\n## Usage\n\nThe `renderHtml` function does all the magic for you.\n\n```dart\nconfigureServer(Angel app) async {\n  // Wire it up!\n  app.fallback(renderHtml());\n  \n  // You can pass a custom StringRenderer if you need more control over the output.\n  app.fallback(renderHtml(renderer: new StringRenderer(html5: false)));\n  \n  app.get('/greet/:name', (RequestContext req) {\n    return html(lang: 'en', c: [\n     head(c: [\n       meta(name: 'viewport', content: 'width=device-width, initial-scale=1'),\n       title(c: [\n         text('Greetings!')\n       ]),\n     ]),\n     body(c: [\n       h1(c: [\n         text('Hello, ${req.params['id']}!'),\n       ]),\n     ]),\n   ]);\n  });\n}\n```\n\nBy default, `renderHtml` will ignore the client's `Accept` header. However, if you pass `enforceAcceptHeader` as `true`, then a `406 Not Acceptable` error will be thrown if the client doesn't accept `*/*` or `text/html`.\n\n```dart\nconfigureServer(Angel app) async {\n  // Wire it up!\n  app.fallback(renderHtml(enforceAcceptHeader: true));\n  \n  // ...\n}\n```\n"
  },
  {
    "path": "packages/html/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/html/example/main.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_html/angel3_html.dart';\nimport 'package:belatuk_html_builder/elements.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n  app.logger = Logger('angel_html')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  app.fallback(renderHtml());\n\n  app.get('/html', (req, res) {\n    return html(\n      c: [\n        head(\n          c: [\n            title(c: [text('ok')]),\n          ],\n        ),\n      ],\n    );\n  });\n\n  app.get(\n    '/strict',\n    chain([\n      renderHtml(\n        enforceAcceptHeader: true,\n        renderer: StringRenderer(\n          //doctype: null,\n          pretty: false,\n        ),\n      ),\n      (req, res) {\n        return div(c: [text('strict')]);\n      },\n    ]),\n  );\n\n  app.fallback((req, res) => throw AngelHttpException.notFound());\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/html/lib/angel3_html.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:belatuk_html_builder/belatuk_html_builder.dart';\n\n/// Returns a [RequestMiddleware] that allows you to return `html_builder` [Node]s as responses.\n///\n/// You can provide a custom [renderer]. The default renders minified HTML5 pages.\n///\n/// Set [enforceAcceptHeader] to `true` to throw a `406 Not Acceptable` if the client doesn't accept HTML responses.\nRequestHandler renderHtml({\n  StringRenderer? renderer,\n  bool? enforceAcceptHeader,\n}) {\n  renderer ??= StringRenderer(pretty: false, html5: true);\n\n  return (RequestContext req, ResponseContext res) {\n    var oldSerializer = res.serializer;\n\n    res.serializer = (data) {\n      if (data is! Node) {\n        return oldSerializer(data);\n      } else {\n        if (enforceAcceptHeader == true && !req.accepts('text/html')) {\n          throw AngelHttpException.notAcceptable();\n        }\n\n        var content = renderer!.render(data);\n        res\n          ..headers['content-type'] = 'text/html'\n          ..write(content);\n        res.close();\n        return '';\n      }\n    };\n\n    return Future<bool>.value(true);\n  };\n}\n"
  },
  {
    "path": "packages/html/melos_angel3_html.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/html/pubspec.yaml",
    "content": "name: angel3_html\nversion: 8.4.0\ndescription: Support for rendering html_builder AST's as responses in Angel.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/angel3/packages/html_builder\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  belatuk_html_builder: ^5.0.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  html: ^0.15.0\n  logging: ^1.0.1\n  test: ^1.21.0\n  lints: ^6.0.0\n\n"
  },
  {
    "path": "packages/html/test/all_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_html/angel3_html.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:belatuk_html_builder/elements.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  Angel app;\n  late TestClient client;\n\n  setUp(() async {\n    app = Angel();\n\n    app.fallback(renderHtml());\n\n    app.get('/html', (req, res) {\n      return html(\n        c: [\n          head(\n            c: [\n              title(c: [text('ok')]),\n            ],\n          ),\n        ],\n      );\n    });\n\n    app.get(\n      '/strict',\n      chain([\n        renderHtml(\n          enforceAcceptHeader: true,\n          renderer: StringRenderer(\n            //doctype: null,\n            pretty: false,\n          ),\n        ),\n        (req, res) {\n          return div(c: [text('strict')]);\n        },\n      ]),\n    );\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  test('sets content type and body', () async {\n    var response = await client.get(Uri.parse('/html'));\n    print('Response: ${response.body}');\n\n    expect(\n      response,\n      allOf(\n        hasContentType('text/html'),\n        hasBody('<!DOCTYPE html><html><head><title>ok</title></head></html>'),\n      ),\n    );\n  });\n\n  group('enforce accept header', () {\n    test('sends if correct accept or wildcard', () async {\n      var response = await client.get(\n        Uri.parse('/strict'),\n        headers: {'accept': '*/*'},\n      );\n      print('Response: ${response.body}');\n      expect(\n        response,\n        allOf(hasContentType('text/html'), hasBody('<div>strict</div>')),\n      );\n\n      response = await client.get(\n        Uri.parse('/strict'),\n        headers: {'accept': 'text/html,application/json,text/xml'},\n      );\n      print('Response: ${response.body}');\n      expect(\n        response,\n        allOf(hasContentType('text/html'), hasBody('<div>strict</div>')),\n      );\n    });\n\n    test('throws if incorrect or no accept', () async {\n      var response = await client.get(Uri.parse('/strict'));\n      print('Response: ${response.statusCode} ${response.body}');\n      expect(response, hasStatus(406));\n\n      response = await client.get(\n        Uri.parse('/strict'),\n        headers: {'accept': 'application/json,text/xml'},\n      );\n      print('Response: ${response.body}');\n      expect(\n        response,\n        isAngelHttpException(statusCode: 406, message: '406 Not Acceptable'),\n      );\n    });\n  });\n}\n"
  },
  {
    "path": "packages/jael/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/README.md",
    "content": "# JAEL3\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3?include_prereleases)\n\nA simple server-side HTML templating engine for Dart.\n\nThough its syntax is but a superset of HTML, it supports features such as:\n\n* **Custom elements**\n* Loops\n* Conditionals\n* Template inheritance\n* Block scoping\n* `switch` syntax\n* Interpolation of any Dart expression\n\nJael3 is a good choice for applications of any scale, especially when the development team is small, or the time invested in building an SPA would be too much.\n\n## Documentation\n\nEach of the [packages within this repository](#this-repository) contains some sort of documentation.\n\nDocumentation for Jael syntax and directives has been **moved** to the [Angel3 framework wiki](https://angel3-docs.dukefirehawk.com/packages/front-end/jael).\n\n## This Repository\n\nWithin this repository are three packages:\n\n* `package:jael3` - Contains the Jael parser, AST, and HTML renderer.\n* `package:jael3_preprocessor` - Handles template inheritance, and facilitates the use of \"compile-time\" constructs.\n* `package:angel3_jael` - [Angel3](https://angel3-framework.web.app/) support for Jael.\n"
  },
  {
    "path": "packages/jael/angel_jael/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/jael/angel_jael/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.1\n\n* Updated `jael3`\n* Updated `jael_preprocessor`\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.3.1\n\n* Removed debug message\n\n## 4.3.0\n\n* Added `jaelTemplatePreload` to preload all JAEL templates into a cache\n\n## 4.2.3\n\n* Turned on generated HTML minification by default\n\n## 4.2.2\n\n* Turned on JAEL template caching by default\n\n## 4.2.1\n\n* Added `minified` parameter for generating minified HTML output\n\n## 4.2.0\n\n* Updated to use `package:belatuk_code_buffer`\n\n## 4.1.0\n\n* Updated to use `package:belatuk_symbol_table`\n* Updated linter to `package:lints`\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.0.0\n\n* Angel 2 and Dart 2 updates.\n* Default to `.jael` instead of `.jl`.\n\n## 1.0.3\n\n* Update for annoying map casting bug.\n\n## 1.0.2\n\n* Update for DSX support.\n* Clear the buffer on errors.\n\n## 1.0.1\n\n* Use `Renderer.errorDocument`.\n"
  },
  {
    "path": "packages/jael/angel_jael/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/angel_jael/README.md",
    "content": "# Angel3 Jael\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_jael?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/jael/angel_jael/LICENSE)\n\n[Angel 3](https://pub.dev/packages/angel3_framework) support for [Jael 3](https://pub.dev/packages/jael3).\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_jael: ^8.0.0\n```\n\n## Usage\n\nJust like `mustache` and other renderers, configuring Angel to use Jael is as simple as calling `app.configure`:\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_jael/angel3_jael.dart';\nimport 'package:file/file.dart';\n\nAngelConfigurer myPlugin(FileSystem fileSystem) {\n    return (Angel app) async {\n        // Connect Jael to your server...\n        await app.configure(\n        jael(fileSystem.directory('views')),\n      );\n    };\n}\n```\n\n`package:angel3_jael` supports caching views and minified html output by default, to improve performance. You might want to disable them in development, so consider setting these flags to `false`:\n\n```dart\njael(viewsDirectory, cacheViews: false, minified: false);\n```\n\nKeep in mind that this package uses `package:file`, rather than `dart:io`.\n\nThe following is a basic example of a server setup that can render Jael templates from a directory named `views`:\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_jael/angel3_jael.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel();\n  var fileSystem = const LocalFileSystem();\n\n  await app.configure(\n    jael(fileSystem.directory('views')),\n  );\n\n  // Render the contents of views/index.jael\n  app.get('/', (res) => res.render('index', {'title': 'ESKETTIT'}));\n\n  app.use(() => throw AngelHttpException.notFound());\n\n  app.logger = Logger('angel')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  var server = await app.startServer(null, 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n```\n\nTo apply additional transforms to parsed documents, provide a set of `patch` functions, like in `package:jael3_preprocessor`.\n\n## Performance Optimization\n\nFor handling large volume of initial requests, consider using `jaelTemplatePreload` to preload all the JAEL templates\ninto an external cache.\n\n```dart\n\n  var templateDir = fileSystem.directory('views');\n\n  // Preload JAEL view templates into cache\n  var viewCache = <String, Document>{};\n  jaelTemplatePreload(templateDir, viewCache);\n\n  // Inject cache into JAEL renderer\n  await app.configure(\n    jael(fileSystem.directory('views'), cache: viewCache),\n  );\n\n```\n"
  },
  {
    "path": "packages/jael/angel_jael/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jael/angel_jael/example/main.dart",
    "content": "import 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_jael/angel3_jael.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n  var fileSystem = const LocalFileSystem();\n\n  await app.configure(jael(fileSystem.directory('views')));\n\n  app.get(\n    '/',\n    (req, res) => res.render('index', {'title': 'Sample App', 'message': null}),\n  );\n\n  app.post('/', (req, res) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    print('Body: $body');\n    var msg = body['message'] ?? '<unknown>';\n    return await res.render('index', {\n      'title': 'Form Submission',\n      'message': msg,\n      'json_message': json.encode(msg),\n    });\n  });\n\n  app.fallback((req, res) => throw AngelHttpException.notFound());\n\n  app.logger = Logger('angel')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/jael/angel_jael/example/views/index.jael",
    "content": "<extend src=\"layout.jael\">\n    <block name=\"content\">\n        <i if=message != null>\n            <script>\n                window.alert({{- json_message }});\n            </script>\n            You said: {{ message }}\n        </i>\n        <form action=\"/\" method=\"post\">\n            <input name=\"message\" placeholder=\"Say something...\" type=\"text\" value=message>\n            <br>\n            <input type=\"submit\" value=\"Submit\">\n        </form>\n    </block>\n</extend>"
  },
  {
    "path": "packages/jael/angel_jael/example/views/layout.jael",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta name=\"viewport\"\n          content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">\n    <title>{{title}}</title>\n</head>\n<body>\n<h1>\n    {{title}}\n</h1>\n<block name=\"content\">\n    <i>Content goes here.</i>\n</block>\n<script>\n    console.info('JAEL :)');\n</script>\n</body>\n</html>"
  },
  {
    "path": "packages/jael/angel_jael/lib/angel3_jael.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:file/file.dart';\nimport 'package:jael3/jael3.dart';\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\n\n/// Configures an Angel server to use Jael to render templates.\n///\n/// To enable \"minified\" output, set minified to true\n///\n/// For custom HTML formating, you need to override the [createBuffer] parameter\n/// with a function that returns a new instance of [CodeBuffer].\n///\n/// To apply additional transforms to parsed documents, provide a set of [patch] functions.\nAngelConfigurer jael(\n  Directory viewsDirectory, {\n  String fileExtension = '.jael',\n  bool strictResolution = false,\n  bool cacheViews = true,\n  Map<String, Document>? cache,\n  Iterable<Patcher> patch = const [],\n  bool asDSX = false,\n  bool minified = true,\n  CodeBuffer Function()? createBuffer,\n}) {\n  var localCache = cache ?? <String, Document>{};\n\n  var bufferFunc = createBuffer ?? () => CodeBuffer();\n\n  if (minified) {\n    bufferFunc = () => CodeBuffer(space: '', newline: '');\n  }\n\n  return (Angel app) async {\n    app.viewGenerator = (String name, [Map? locals]) async {\n      var errors = <JaelError>[];\n      Document? processed;\n\n      //var stopwatch = Stopwatch()..start();\n\n      if (cacheViews && localCache.containsKey(name)) {\n        processed = localCache[name];\n      } else {\n        processed = await _loadViewTemplate(\n          viewsDirectory,\n          name,\n          fileExtension: fileExtension,\n          asDSX: asDSX,\n          patch: patch,\n        );\n\n        if (cacheViews) {\n          localCache[name] = processed!;\n        }\n      }\n      //print('Time executed: ${stopwatch.elapsed.inMilliseconds}');\n      //stopwatch.stop();\n\n      var buf = bufferFunc();\n      var scope = SymbolTable(\n        values:\n            locals?.keys.fold<Map<String, dynamic>>(\n              <String, dynamic>{},\n              (out, k) => out..[k.toString()] = locals[k],\n            ) ??\n            <String, dynamic>{},\n      );\n\n      if (errors.isEmpty) {\n        try {\n          const Renderer().render(\n            processed!,\n            buf,\n            scope,\n            strictResolution: strictResolution,\n          );\n          return buf.toString();\n        } on JaelError catch (e) {\n          errors.add(e);\n        }\n      }\n\n      Renderer.errorDocument(errors, buf..clear());\n      return buf.toString();\n    };\n  };\n}\n\n/// Preload all of Jael templates into a cache\n///\n///\n/// To apply additional transforms to parsed documents, provide a set of [patch] functions.\nFuture<void> jaelTemplatePreload(\n  Directory viewsDirectory,\n  Map<String, Document> cache, {\n  String fileExtension = '.jael',\n  bool asDSX = false,\n  Iterable<Patcher> patch = const [],\n}) async {\n  await viewsDirectory.list(recursive: true).forEach((f) async {\n    if (f.basename.endsWith(fileExtension)) {\n      var name = f.basename.split(\".\");\n      if (name.length > 1) {\n        //print(\"View: ${name[0]}\");\n        Document? processed = await _loadViewTemplate(viewsDirectory, name[0]);\n        if (processed != null) {\n          cache[name[0]] = processed;\n        }\n      }\n    }\n  });\n}\n\nFuture<Document?> _loadViewTemplate(\n  Directory viewsDirectory,\n  String name, {\n  String fileExtension = '.jael',\n  bool asDSX = false,\n  Iterable<Patcher> patch = const [],\n}) async {\n  var errors = <JaelError>[];\n  Document? processed;\n\n  var file = viewsDirectory.childFile(name + fileExtension);\n  var contents = await file.readAsString();\n  var doc = parseDocument(\n    contents,\n    sourceUrl: file.uri,\n    asDSX: asDSX,\n    onError: errors.add,\n  );\n\n  if (doc == null) {\n    throw ArgumentError(\"${file.basename} does not exists\");\n  }\n\n  try {\n    processed = await (resolve(\n      doc,\n      viewsDirectory,\n      patch: patch,\n      onError: errors.add,\n    ));\n  } catch (e) {\n    // Ignore these errors, so that we can show syntax errors.\n  }\n  if (processed == null) {\n    throw ArgumentError(\"${file.basename} does not exists\");\n  }\n  return processed;\n}\n"
  },
  {
    "path": "packages/jael/angel_jael/melos_angel3_jael.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/angel_jael/pubspec.yaml",
    "content": "name: angel3_jael\nversion: 8.4.0\ndescription: Angel support for the Jael templating engine, similar to Blade or Liquid.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/jael/angel_jael\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  jael3: ^8.0.0\n  jael3_preprocessor: ^8.0.0\n  belatuk_code_buffer: ^5.1.0\n  belatuk_symbol_table: ^5.1.0\n  file: ^7.0.0\n  logging: ^1.2.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  html: ^0.15.0\n  test: ^1.24.0\n  lints: ^6.0.0\n\n"
  },
  {
    "path": "packages/jael/angel_jael/test/all_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_jael/angel3_jael.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:file/memory.dart';\nimport 'package:html/parser.dart' as html;\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  // These tests need not actually test that the preprocessor or renderer works,\n  // because those packages are already tested.\n  //\n  // Instead, just test that we can render at all.\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel();\n    app.configuration['properties'] = app.configuration;\n\n    var fileSystem = MemoryFileSystem();\n    var viewsDirectory = fileSystem.directory('views')..createSync();\n\n    viewsDirectory.childFile('layout.jael').writeAsStringSync('''\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>Hello</title>\n  </head>\n  <body>\n    <block name=\"content\">\n      Fallback content\n    </block>\n  </body>\n</html>\n    ''');\n\n    viewsDirectory.childFile('github.jael').writeAsStringSync('''\n<extend src=\"layout.jael\">\n  <block name=\"content\">{{username}}</block>\n</extend>\n    ''');\n\n    app.get('/github/:username', (req, res) {\n      var username = req.params['username'];\n      return res.render('github', {'username': username});\n    });\n\n    await app.configure(jael(viewsDirectory, minified: false));\n\n    app.fallback((req, res) => throw AngelHttpException.notFound());\n\n    app.logger = Logger('angel')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    client = await connectTo(app);\n  });\n\n  test('can render', () async {\n    var response = await client.get(Uri.parse('/github/thosakwe'));\n    print('Body:\\n${response.body}');\n    expect(\n      html.parse(response.body).outerHtml,\n      html\n          .parse(\n            '''\n<html>\n  <head>\n    <title>\n      Hello\n    </title>\n  </head>\n  <body>\n    thosakwe\n  </body>\n</html>'''\n                .trim(),\n          )\n          .outerHtml,\n    );\n  });\n}\n"
  },
  {
    "path": "packages/jael/angel_jael/test/minified_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_jael/angel3_jael.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:file/memory.dart';\nimport 'package:html/parser.dart' as html;\nimport 'package:jael3/jael3.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  // These tests need not actually test that the preprocessor or renderer works,\n  // because those packages are already tested.\n  //\n  // Instead, just test that we can render at all.\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel();\n    app.configuration['properties'] = app.configuration;\n\n    var fileSystem = MemoryFileSystem();\n    var viewsDirectory = fileSystem.directory('views')..createSync();\n\n    viewsDirectory.childFile('layout.jael').writeAsStringSync('''\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>Hello</title>\n  </head>\n  <body>\n    <block name=\"content\">\n      Fallback content\n    </block>\n  </body>\n</html>\n    ''');\n\n    viewsDirectory.childFile('github.jael').writeAsStringSync('''\n<extend src=\"layout.jael\">\n  <block name=\"content\">{{username}}</block>\n</extend>\n    ''');\n\n    app.get('/github/:username', (req, res) async {\n      var username = req.params['username'];\n      return res.render('github', {'username': username});\n    });\n\n    //Preload the view template\n    var viewCache = <String, Document>{};\n    jaelTemplatePreload(viewsDirectory, viewCache);\n\n    await app.configure(jael(viewsDirectory, cache: viewCache));\n\n    app.fallback((req, res) => throw AngelHttpException.notFound());\n\n    app.logger = Logger('angel')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    client = await connectTo(app);\n  });\n\n  test('can render', () async {\n    var response = await client.get(Uri.parse('/github/thosakwe'));\n    //print('Body:\\n${response.body}');\n    expect(\n      html.parse(response.body).outerHtml,\n      html\n          .parse(\n            '''<html><head><title>Hello</title></head><body>thosakwe</body></html>'''\n                .trim(),\n          )\n          .outerHtml,\n    );\n  });\n\n  test('initial load concurreny', () async {\n    // Concurrently hit the same JAEL page\n    for (var i = 0; i < 512; i++) {\n      client.get(Uri.parse('/github/thosakwe'));\n    }\n\n    Stopwatch stopwatch = Stopwatch()..start();\n    var response = await client.get(Uri.parse('/github/thosakwe'));\n    var elapsedTime = stopwatch.elapsed.inMilliseconds;\n\n    print('Latency is $elapsedTime');\n\n    print('Body:\\n${response.body}');\n    expect(\n      html.parse(response.body).outerHtml,\n      html\n          .parse(\n            '''<html><head><title>Hello</title></head><body>thosakwe</body></html>'''\n                .trim(),\n          )\n          .outerHtml,\n    );\n  });\n}\n"
  },
  {
    "path": "packages/jael/jael/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/jael/jael/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.4.0\n\n* Require Dart >= 3.11\n\n## 8.3.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.1\n\n* Fixed analyze errors\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.2.0\n\n* Updated to use `package:belatuk_code_buffer`\n\n## 4.1.0\n\n* Updated to use `package:belatuk_symbol_table`\n* Updated linter to `package:lints`\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.0.2\n\n* Fixed handling of `if` in non-strict mode.\n* Roll `JaelFormatter` and `jaelfmt`.\n\n## 2.0.1\n\n* Fixed bug where the `textarea` name check would never return `true`.\n\n## 2.0.0+1\n\n* Meta-update for Pub score.\n\n## 2.0.0\n\n* Dart 2 updates.\n* Remove usage of `package:dart2_constant`.\n\n## 1.0.6+1\n\n* Ensure `<element>` passes attributes.\n\n## 1.0.6\n\n* Add `index-as` to `for-each`.\n* Support registering + rendering custom elements.\n* Improve handling of booleans in non-strict mode.\n\n## 1.0.5\n\n* Add support for DSX, a port of JSX to Dart.\n\n## 1.0.4\n\n* Skip HTML comments in free text.\n\n## 1.0.3\n\n* Fix a scanner bug that prevented proper parsing of HTML nodes\nfollowed by free text.\n* Don't trim `<textarea>` content.\n\n## 1.0.2\n\n* Use `package:dart2_constant`.\n* Upgrade `package:symbol_table`.\n* Added `Renderer.errorDocument`.\n\n## 1.0.1\n\n* Reworked the scanner; thereby fixing an extremely pesky bug\nthat prevented successful parsing of Jael files containing\nJavaScript.\n"
  },
  {
    "path": "packages/jael/jael/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/jael/README.md",
    "content": "# Jael 3\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/jael/jael/LICENSE)\n\nA simple server-side HTML templating engine for Dart.\n\n[See documentation.](https://angel3-docs.dukefirehawk.com/packages/front-end/jael)\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  jael3: ^8.0.0\n```\n\n## API\n\nThe core `jael3` package exports classes for parsing Jael templates, an AST library, and a `Renderer` class that generates HTML on-the-fly.\n\n```dart\nimport 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:jael3/jael3.dart' as jael;\n\nvoid myFunction() {\n    const template = '''\n<html>\n  <body>\n    <h1>Hello</h1>\n    <img src=profile['avatar']>\n  </body>\n</html>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael', asDSX: false);\n    var scope = SymbolTable(values: {\n      'profile': {\n        'avatar': 'thosakwe.png',\n      }\n    });\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n}\n```\n\nPre-processing (i.e. handling of blocks and includes) is handled by `package:jael3_preprocessor.`.\n"
  },
  {
    "path": "packages/jael/jael/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jael/jael/bin/jaelfmt.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:io';\nimport 'package:args/args.dart';\nimport 'package:jael3/jael3.dart';\n\nvar argParser = ArgParser()\n  ..addOption(\n    'line-length',\n    abbr: 'l',\n    help: 'The maximum length of a single line. Longer lines will wrap.',\n    defaultsTo: '80',\n  )\n  ..addOption(\n    'stdin-name',\n    help: 'The filename to print when an error occurs in standard input.',\n    defaultsTo: '<stdin>',\n  )\n  ..addOption(\n    'tab-size',\n    help: 'The number of spaces to output where a TAB would be inserted.',\n    defaultsTo: '2',\n  )\n  ..addFlag(\n    'dry-run',\n    abbr: 'n',\n    help:\n        'Print the names of files that would be changed, without actually overwriting them.',\n    negatable: false,\n  )\n  ..addFlag(\n    'help',\n    abbr: 'h',\n    help: 'Print this usage information.',\n    negatable: false,\n  )\n  ..addFlag(\n    'insert-spaces',\n    help: 'Insert spaces instead of TAB character.',\n    defaultsTo: true,\n  )\n  ..addFlag(\n    'overwrite',\n    abbr: 'w',\n    help: 'Overwrite input files with formatted output.',\n    negatable: false,\n  );\n\nvoid main(List<String> args) async {\n  try {\n    var argResults = argParser.parse(args);\n    if (argResults['help'] as bool) {\n      stdout\n        ..writeln('Formatter for Jael templates.')\n        ..writeln();\n      printUsage(stdout);\n      return;\n    }\n\n    if (argResults.rest.isEmpty) {\n      var text = await stdin.transform(utf8.decoder).join();\n      var result = format(\n        argResults['stdin-name'] as String?,\n        text,\n        argResults,\n      );\n      if (result != null) print(result);\n    } else {\n      for (var arg in argResults.rest) {\n        await formatPath(arg, argResults);\n      }\n    }\n  } on ArgParserException catch (e) {\n    stderr\n      ..writeln(e.message)\n      ..writeln();\n    printUsage(stderr);\n    exitCode = 65;\n  }\n}\n\nvoid printUsage(IOSink sink) {\n  sink\n    ..writeln('Usage: jaelfmt [options...] [files or directories...]')\n    ..writeln()\n    ..writeln('Options:')\n    ..writeln(argParser.usage);\n}\n\nFuture<void> formatPath(String path, ArgResults argResults) async {\n  var stat = await FileStat.stat(path);\n  await formatStat(stat, path, argResults);\n}\n\nFuture<void> formatStat(\n  FileStat stat,\n  String path,\n  ArgResults argResults,\n) async {\n  switch (stat.type) {\n    case FileSystemEntityType.directory:\n      await for (var entity in Directory(path).list()) {\n        await formatStat(await entity.stat(), entity.path, argResults);\n      }\n      break;\n    case FileSystemEntityType.file:\n      if (path.endsWith('.jael')) await formatFile(File(path), argResults);\n      break;\n    case FileSystemEntityType.link:\n      var link = await Link(path).resolveSymbolicLinks();\n      await formatPath(link, argResults);\n      break;\n    default:\n      throw 'No file or directory found at \"$path\".';\n  }\n}\n\nFuture<void> formatFile(File file, ArgResults argResults) async {\n  var content = await file.readAsString();\n  var formatted = format(file.path, content, argResults);\n  if (formatted == null) return;\n  if (argResults['overwrite'] as bool) {\n    if (formatted != content) {\n      if (argResults['dry-run'] as bool) {\n        print('Would have formatted ${file.path}');\n      } else {\n        file.writeAsStringSync(formatted);\n        print('Formatted ${file.path}');\n      }\n    } else {\n      print('Unchanged ${file.path}');\n    }\n  } else {\n    print(formatted);\n  }\n}\n\nString? format(String? filename, String content, ArgResults argResults) {\n  var errored = false;\n  var doc = parseDocument(\n    content,\n    sourceUrl: filename,\n    onError: (e) {\n      stderr.writeln(e);\n      errored = true;\n    },\n  );\n  if (errored) return null;\n  var fmt = JaelFormatter(\n    int.parse(argResults['tab-size'] as String),\n    argResults['insert-spaces'] as bool?,\n    int.parse(argResults['line-length'] as String),\n  );\n\n  if (doc == null) {\n    return null;\n  }\n  return fmt.apply(doc);\n}\n"
  },
  {
    "path": "packages/jael/jael/example/main.dart",
    "content": "import 'dart:io';\nimport 'package:charcode/charcode.dart';\nimport 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\n\nvoid main() {\n  while (true) {\n    var buf = StringBuffer();\n    int ch;\n    print('Enter lines of Jael text, terminated by CTRL^D.');\n    print('All environment variables are injected into the template scope.');\n\n    while ((ch = stdin.readByteSync()) != $eot && ch != -1) {\n      buf.writeCharCode(ch);\n    }\n\n    var document = jael.parseDocument(\n      buf.toString(),\n      sourceUrl: 'stdin',\n      onError: stderr.writeln,\n    );\n\n    if (document == null) {\n      stderr.writeln('Could not parse the given text.');\n    } else {\n      var output = CodeBuffer();\n      const jael.Renderer().render(\n        document,\n        output,\n        SymbolTable(values: Platform.environment),\n        strictResolution: false,\n      );\n      print('GENERATED HTML:\\n$output');\n    }\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/jael3.dart",
    "content": "export 'src/ast/ast.dart';\nexport 'src/text/parser.dart';\nexport 'src/text/scanner.dart';\nexport 'src/formatter.dart';\nexport 'src/renderer.dart';\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/array.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass Array extends Expression {\n  final Token lBracket, rBracket;\n  final List<Expression> items;\n\n  Array(this.lBracket, this.rBracket, this.items);\n\n  @override\n  List compute(scope) => items.map((e) => e.compute(scope)).toList();\n\n  @override\n  FileSpan get span {\n    return items\n        .fold<FileSpan?>(lBracket.span, (out, i) => out!.expand(i.span))!\n        .expand(rBracket.span);\n  }\n}\n\nclass IndexerExpression extends Expression {\n  final Expression target, indexer;\n  final Token lBracket, rBracket;\n\n  IndexerExpression(this.target, this.lBracket, this.indexer, this.rBracket);\n\n  @override\n  FileSpan get span {\n    return target.span\n        .expand(lBracket.span)\n        .expand(indexer.span)\n        .expand(rBracket.span);\n  }\n\n  @override\n  dynamic compute(scope) {\n    var a = target.compute(scope), b = indexer.compute(scope);\n    return a[b];\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/ast.dart",
    "content": "export 'array.dart';\nexport 'ast_node.dart';\nexport 'attribute.dart';\nexport 'binary.dart';\nexport 'call.dart';\nexport 'conditional.dart';\nexport 'document.dart';\nexport 'element.dart';\nexport 'error.dart';\nexport 'expression.dart';\nexport 'identifier.dart';\nexport 'interpolation.dart';\nexport 'map.dart';\nexport 'member.dart';\nexport 'new.dart';\nexport 'number.dart';\nexport 'string.dart';\nexport 'token.dart';\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/ast_node.dart",
    "content": "import 'package:source_span/source_span.dart';\n\nabstract class AstNode {\n  FileSpan get span;\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/attribute.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'ast_node.dart';\nimport 'expression.dart';\nimport 'identifier.dart';\nimport 'string.dart';\nimport 'token.dart';\n\nclass Attribute extends AstNode {\n  final Identifier? id;\n  final StringLiteral? string;\n  final Token? equals, nequ;\n  final Expression? value;\n\n  Attribute(this.id, this.string, this.equals, this.nequ, this.value);\n\n  bool get isRaw => nequ != null;\n\n  Expression get nameNode => id ?? string!;\n\n  String get name => string?.value ?? id!.name;\n\n  @override\n  FileSpan get span {\n    if (equals == null || value == null) return nameNode.span;\n    //return nameNode.span.expand(equals!.span ?? nequ!.span).expand(value!.span);\n    return nameNode.span.expand(equals!.span).expand(value!.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/binary.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass BinaryExpression extends Expression {\n  final Expression left, right;\n  final Token operator;\n\n  BinaryExpression(this.left, this.operator, this.right);\n\n  @override\n  dynamic compute(scope) {\n    var l = left.compute(scope), r = right.compute(scope);\n\n    switch (operator.type) {\n      case TokenType.asterisk:\n        return l * r;\n      case TokenType.slash:\n        return l / r;\n      case TokenType.plus:\n        if (l is String || r is String) return l.toString() + r.toString();\n        return l + r;\n      case TokenType.minus:\n        return l - r;\n      case TokenType.lt:\n        return l < r;\n      case TokenType.gt:\n        return l > r;\n      case TokenType.lte:\n        return l <= r;\n      case TokenType.gte:\n        return l >= r;\n      case TokenType.equ:\n        return l == r;\n      case TokenType.nequ:\n        return l != r;\n      case TokenType.elvis:\n        return l ?? r;\n      default:\n        throw UnsupportedError(\n          'Unsupported binary operator: \"${operator.span.text}\".',\n        );\n    }\n  }\n\n  @override\n  FileSpan get span => left.span.expand(operator.span).expand(right.span);\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/call.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'ast_node.dart';\nimport 'expression.dart';\nimport 'identifier.dart';\nimport 'token.dart';\n\nclass Call extends Expression {\n  final Expression target;\n  final Token lParen, rParen;\n  final List<Expression> arguments;\n  final List<NamedArgument> namedArguments;\n\n  Call(\n    this.target,\n    this.lParen,\n    this.rParen,\n    this.arguments,\n    this.namedArguments,\n  );\n\n  @override\n  FileSpan get span {\n    return arguments\n        .fold<FileSpan?>(target.span, (out, a) => out!.expand(a.span))!\n        .expand(\n          namedArguments.fold<FileSpan?>(\n            lParen.span,\n            (out, a) => out!.expand(a.span),\n          )!,\n        )\n        .expand(rParen.span);\n  }\n\n  List computePositional(SymbolTable? scope) =>\n      arguments.map((e) => e.compute(scope)).toList();\n\n  Map<Symbol, dynamic> computeNamed(SymbolTable? scope) {\n    return namedArguments.fold<Map<Symbol, dynamic>>({}, (out, a) {\n      return out..[Symbol(a.name.name)] = a.value.compute(scope);\n    });\n  }\n\n  @override\n  dynamic compute(scope) {\n    var callee = target.compute(scope);\n    var args = computePositional(scope);\n    var named = computeNamed(scope);\n\n    return Function.apply(callee as Function, args, named);\n  }\n}\n\nclass NamedArgument extends AstNode {\n  final Identifier name;\n  final Token colon;\n  final Expression value;\n\n  NamedArgument(this.name, this.colon, this.value);\n\n  @override\n  FileSpan get span {\n    return name.span.expand(colon.span).expand(value.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/conditional.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass Conditional extends Expression {\n  final Expression condition, ifTrue, ifFalse;\n  final Token question, colon;\n\n  Conditional(\n    this.condition,\n    this.question,\n    this.ifTrue,\n    this.colon,\n    this.ifFalse,\n  );\n\n  @override\n  FileSpan get span {\n    return condition.span\n        .expand(question.span)\n        .expand(ifTrue.span)\n        .expand(colon.span)\n        .expand(ifFalse.span);\n  }\n\n  @override\n  dynamic compute(scope) {\n    var v = condition.compute(scope) as bool;\n\n    if (scope?.resolve('!strict!')?.value == false) {\n      v = v == true;\n    }\n\n    return v ? ifTrue.compute(scope) : ifFalse.compute(scope);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/document.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'ast_node.dart';\nimport 'element.dart';\nimport 'identifier.dart';\nimport 'string.dart';\nimport 'token.dart';\n\nclass Document extends AstNode {\n  final Doctype? doctype;\n  final Element root;\n\n  Document(this.doctype, this.root);\n\n  @override\n  FileSpan get span {\n    if (doctype == null) return root.span;\n    return doctype!.span.expand(root.span);\n  }\n}\n\nclass HtmlComment extends ElementChild {\n  final Token htmlComment;\n\n  HtmlComment(this.htmlComment);\n\n  @override\n  FileSpan get span => htmlComment.span;\n}\n\nclass Text extends ElementChild {\n  final Token text;\n\n  Text(this.text);\n\n  @override\n  FileSpan get span => text.span;\n}\n\nclass Doctype extends AstNode {\n  final Token lt, doctype, gt;\n  final Identifier html;\n  final Identifier? public;\n  final StringLiteral? name, url;\n\n  Doctype(\n    this.lt,\n    this.doctype,\n    this.html,\n    this.public,\n    this.name,\n    this.url,\n    this.gt,\n  );\n\n  @override\n  FileSpan get span {\n    if (public == null || name == null || url == null) {\n      return lt.span.expand(doctype.span).expand(html.span).expand(gt.span);\n    }\n    return lt.span\n        .expand(doctype.span)\n        .expand(html.span)\n        .expand(public!.span)\n        .expand(name!.span)\n        .expand(url!.span)\n        .expand(gt.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/element.dart",
    "content": "import 'package:collection/collection.dart' show IterableExtension;\nimport 'package:source_span/source_span.dart';\nimport 'ast_node.dart';\nimport 'attribute.dart';\nimport 'identifier.dart';\nimport 'token.dart';\n\nabstract class ElementChild extends AstNode {}\n\nclass TextNode extends ElementChild {\n  final Token text;\n\n  TextNode(this.text);\n\n  @override\n  FileSpan get span => text.span;\n}\n\nabstract class Element extends ElementChild {\n  static const List<String> selfClosing = [\n    'include',\n    'base',\n    'basefont',\n    'frame',\n    'link',\n    'meta',\n    'area',\n    'br',\n    'col',\n    'hr',\n    'img',\n    'input',\n    'param',\n  ];\n\n  Identifier get tagName;\n\n  Iterable<Attribute> get attributes;\n\n  Iterable<ElementChild> get children;\n\n  Attribute? getAttribute(String name) =>\n      attributes.firstWhereOrNull((a) => a.name == name);\n}\n\nclass SelfClosingElement extends Element {\n  final Token? slash;\n  final Token lt, gt;\n\n  @override\n  final Identifier tagName;\n\n  @override\n  final Iterable<Attribute> attributes;\n\n  @override\n  Iterable<ElementChild> get children => [];\n\n  SelfClosingElement(\n    this.lt,\n    this.tagName,\n    this.attributes,\n    this.slash,\n    this.gt,\n  );\n\n  @override\n  FileSpan get span {\n    var start = attributes.fold<FileSpan>(\n      lt.span.expand(tagName.span),\n      (out, a) => out.expand(a.span),\n    );\n    return slash != null\n        ? start.expand(slash!.span).expand(gt.span)\n        : start.expand(gt.span);\n  }\n}\n\nclass RegularElement extends Element {\n  final Token? gt2;\n  final Token lt2, slash, lt, gt;\n\n  @override\n  final Identifier tagName;\n  final Identifier tagName2;\n  @override\n  final Iterable<Attribute> attributes;\n  @override\n  final Iterable<ElementChild> children;\n\n  RegularElement(\n    this.lt,\n    this.tagName,\n    this.attributes,\n    this.gt,\n    this.children,\n    this.lt2,\n    this.slash,\n    this.tagName2,\n    this.gt2,\n  );\n\n  @override\n  FileSpan get span {\n    var openingTag = attributes\n        .fold<FileSpan>(\n          lt.span.expand(tagName.span),\n          (out, a) => out.expand(a.span),\n        )\n        .expand(gt.span);\n\n    if (gt2 == null) return openingTag;\n\n    return children\n        .fold<FileSpan>(openingTag, (out, c) => out.expand(c.span))\n        .expand(lt2.span)\n        .expand(slash.span)\n        .expand(tagName2.span)\n        .expand(gt2!.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/error.dart",
    "content": "import 'package:source_span/source_span.dart';\n\nclass JaelError extends Error {\n  final JaelErrorSeverity severity;\n  final String message;\n  final FileSpan span;\n\n  JaelError(this.severity, this.message, this.span);\n\n  @override\n  String toString() {\n    var label = severity == JaelErrorSeverity.warning ? 'warning' : 'error';\n    return '$label: ${span.start.toolString}: $message\\n${span.highlight(color: true)}';\n  }\n}\n\nenum JaelErrorSeverity { warning, error }\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/expression.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'ast_node.dart';\nimport 'token.dart';\n\nabstract class Expression extends AstNode {\n  dynamic compute(SymbolTable? scope);\n}\n\nabstract class Literal extends Expression {}\n\nclass Negation extends Expression {\n  final Token exclamation;\n  final Expression expression;\n\n  Negation(this.exclamation, this.expression);\n\n  @override\n  FileSpan get span {\n    return exclamation.span.expand(expression.span);\n  }\n\n  @override\n  bool compute(SymbolTable? scope) {\n    var v = expression.compute(scope) as bool;\n    if (scope?.resolve('!strict!')?.value == false) {\n      v = v == true;\n    }\n\n    return !v;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/identifier.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass Identifier extends Expression {\n  late Token id;\n\n  Identifier(this.id);\n\n  // TODO: Fix for SyntheticIdentifier\n  Identifier.noToken(Token? token) {\n    if (token != null) {\n      id = token;\n    }\n  }\n\n  @override\n  dynamic compute(SymbolTable? scope) {\n    switch (name) {\n      case 'null':\n        return null;\n      case 'true':\n        return true;\n      case 'false':\n        return false;\n      default:\n        var symbol = scope?.resolve(name);\n        if (symbol == null) {\n          if (scope?.resolve('!strict!')?.value == false) return null;\n          throw ArgumentError('The name \"$name\" does not exist in this scope.');\n        }\n        return scope?.resolve(name)!.value;\n    }\n  }\n\n  String get name => id.span.text;\n\n  @override\n  FileSpan get span => id.span;\n}\n\nclass SyntheticIdentifier extends Identifier {\n  @override\n  final String name;\n\n  SyntheticIdentifier(this.name, [Token? token]) : super.noToken(token);\n\n  @override\n  FileSpan get span {\n    //return id.span;\n    throw UnsupportedError('Cannot get the span of a SyntheticIdentifier.');\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/interpolation.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'element.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass Interpolation extends ElementChild {\n  final Token doubleCurlyL, doubleCurlyR;\n  final Expression expression;\n\n  Interpolation(this.doubleCurlyL, this.expression, this.doubleCurlyR);\n\n  bool get isRaw => doubleCurlyL.span.text.endsWith('-');\n\n  @override\n  FileSpan get span {\n    return doubleCurlyL.span.expand(expression.span).expand(doubleCurlyR.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/map.dart",
    "content": "import 'package:source_span/source_span.dart';\nimport 'ast_node.dart';\nimport 'expression.dart';\nimport 'identifier.dart';\nimport 'token.dart';\n\nclass MapLiteral extends Literal {\n  final Token lCurly, rCurly;\n  final List<KeyValuePair> pairs;\n\n  MapLiteral(this.lCurly, this.pairs, this.rCurly);\n\n  @override\n  Map compute(scope) {\n    return pairs.fold<Map>({}, (out, p) {\n      dynamic key;\n      dynamic value;\n\n      if (p.colon == null) {\n        if (p.key is! Identifier) {\n          key = value = p.key.compute(scope);\n        } else {\n          key = (p.key as Identifier).name;\n          value = p.key.compute(scope);\n        }\n      } else {\n        key = p.key.compute(scope);\n        value = p.value?.compute(scope);\n      }\n\n      return out..[key] = value;\n    });\n  }\n\n  @override\n  FileSpan get span {\n    return pairs\n        .fold<FileSpan?>(lCurly.span, (out, p) => out?.expand(p.span))!\n        .expand(rCurly.span);\n  }\n}\n\nclass KeyValuePair extends AstNode {\n  final Expression key;\n  final Expression? value;\n\n  final Token? colon;\n\n  KeyValuePair(this.key, this.colon, this.value);\n\n  @override\n  FileSpan get span {\n    if (colon == null || value == null) return key.span;\n    return colon!.span.expand(colon!.span).expand(value!.span);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/member.dart",
    "content": "import 'dart:mirrors';\nimport 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'expression.dart';\nimport 'identifier.dart';\nimport 'token.dart';\n\nclass MemberExpression extends Expression {\n  final Expression expression;\n  final Token op;\n  final Identifier name;\n\n  MemberExpression(this.expression, this.op, this.name);\n\n  @override\n  dynamic compute(SymbolTable? scope) {\n    var target = expression.compute(scope);\n    if (op.span.text == '?.' && target == null) return null;\n    return reflect(target).getField(Symbol(name.name)).reflectee;\n  }\n\n  @override\n  FileSpan get span => expression.span.expand(op.span).expand(name.span);\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/new.dart",
    "content": "import 'dart:mirrors';\nimport 'package:source_span/source_span.dart';\nimport 'call.dart';\nimport 'expression.dart';\nimport 'member.dart';\nimport 'token.dart';\n\nclass NewExpression extends Expression {\n  final Token $new;\n  final Call call;\n\n  NewExpression(this.$new, this.call);\n\n  @override\n  FileSpan get span => $new.span.expand(call.span);\n\n  @override\n  dynamic compute(scope) {\n    var targetType = call.target.compute(scope);\n    var positional = call.computePositional(scope);\n    var named = call.computeNamed(scope);\n    var name = '';\n\n    if (call.target is MemberExpression) {\n      name = (call.target as MemberExpression).name.name;\n    }\n\n    return reflectClass(\n      targetType as Type,\n    ).newInstance(Symbol(name), positional, named).reflectee;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/number.dart",
    "content": "import 'dart:math' as math;\nimport 'package:source_span/source_span.dart';\nimport 'expression.dart';\nimport 'token.dart';\n\nclass NumberLiteral extends Literal {\n  final Token number;\n  num? _value;\n\n  NumberLiteral(this.number);\n\n  @override\n  FileSpan get span => number.span;\n\n  static num parse(String value) {\n    var e = value.indexOf('E');\n    e != -1 ? e : e = value.indexOf('e');\n\n    if (e == -1) return num.parse(value);\n\n    var plainNumber = num.parse(value.substring(0, e));\n    var exp = value.substring(e + 1);\n    return plainNumber * math.pow(10, num.parse(exp));\n  }\n\n  @override\n  num compute(scope) {\n    return _value ??= parse(number.span.text);\n  }\n}\n\nclass HexLiteral extends Literal {\n  final Token hex;\n  num? _value;\n\n  HexLiteral(this.hex);\n\n  @override\n  FileSpan get span => hex.span;\n\n  static num parse(String value) => int.parse(value.substring(2), radix: 16);\n\n  @override\n  num compute(scope) {\n    return _value ??= parse(hex.span.text);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/string.dart",
    "content": "import 'package:charcode/charcode.dart';\nimport 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport '../ast/ast.dart';\n\nclass StringLiteral extends Literal {\n  final Token string;\n  final String value;\n\n  StringLiteral(this.string, this.value);\n\n  static String parseValue(Token string) {\n    var buf = StringBuffer();\n\n    var text = string.span.text.substring(1, string.span.text.length - 1);\n    var codeUnits = text.codeUnits;\n\n    for (var i = 0; i < codeUnits.length; i++) {\n      var ch = codeUnits[i];\n\n      if (ch == $backslash) {\n        if (i < codeUnits.length - 5 && codeUnits[i + 1] == $u) {\n          var c1 = codeUnits[i += 2],\n              c2 = codeUnits[++i],\n              c3 = codeUnits[++i],\n              c4 = codeUnits[++i];\n          var hexString = String.fromCharCodes([c1, c2, c3, c4]);\n          var hexNumber = int.parse(hexString, radix: 16);\n          buf.write(String.fromCharCode(hexNumber));\n          continue;\n        }\n\n        if (i < codeUnits.length - 1) {\n          var next = codeUnits[++i];\n\n          switch (next) {\n            case $b:\n              buf.write('\\b');\n              break;\n            case $f:\n              buf.write('\\f');\n              break;\n            case $n:\n              buf.writeCharCode($lf);\n              break;\n            case $r:\n              buf.writeCharCode($cr);\n              break;\n            case $t:\n              buf.writeCharCode($tab);\n              break;\n            default:\n              buf.writeCharCode(next);\n          }\n        } else {\n          throw JaelError(\n            JaelErrorSeverity.error,\n            'Unexpected \"\\\\\" in string literal.',\n            string.span,\n          );\n        }\n      } else {\n        buf.writeCharCode(ch);\n      }\n    }\n\n    return buf.toString();\n  }\n\n  @override\n  String compute(SymbolTable? scope) {\n    return value;\n  }\n\n  @override\n  FileSpan get span => string.span;\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/ast/token.dart",
    "content": "import 'package:source_span/source_span.dart';\n\nclass Token {\n  final TokenType type;\n  final FileSpan span;\n  final Match? match;\n\n  Token(this.type, this.span, this.match);\n\n  @override\n  String toString() {\n    return '${span.start.toolString}: \"${span.text}\" => $type';\n  }\n}\n\nenum TokenType {\n  /*\n   * HTML\n   */\n  doctype,\n  htmlComment,\n  lt,\n  gt,\n  slash,\n  equals,\n  id,\n  text,\n\n  // Keywords\n  $new,\n\n  /*\n   * Expression\n   */\n  lBracket,\n  rBracket,\n  lDoubleCurly,\n  rDoubleCurly,\n  lCurly,\n  rCurly,\n  lParen,\n  rParen,\n  asterisk,\n  colon,\n  comma,\n  dot,\n  exclamation,\n  percent,\n  plus,\n  minus,\n  elvis,\n  elvisDot,\n  lte,\n  gte,\n  equ,\n  nequ,\n  number,\n  hex,\n  string,\n  question,\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/formatter.dart",
    "content": "import 'ast/ast.dart';\n\n/// Jael formatter\nclass JaelFormatter {\n  final num tabSize;\n  final bool? insertSpaces;\n  final int maxLineLength;\n  final _buffer = StringBuffer();\n  int _level = 0;\n  String? _spaces;\n\n  static String _spaceString(int tabSize) {\n    var b = StringBuffer();\n    for (var i = 0; i < tabSize; i++) {\n      b.write(' ');\n    }\n    return b.toString();\n  }\n\n  JaelFormatter(this.tabSize, this.insertSpaces, this.maxLineLength) {\n    _spaces = insertSpaces! ? _spaceString(tabSize.toInt()) : '\\t';\n  }\n\n  void _indent() {\n    _level++;\n  }\n\n  void _outdent() {\n    if (_level > 0) _level--;\n  }\n\n  void _applySpacing() {\n    for (var i = 0; i < _level; i++) {\n      _buffer.write(_spaces);\n    }\n  }\n\n  int get _spaceLength {\n    var out = 0;\n    for (var i = 0; i < _level; i++) {\n      out += _spaces!.length;\n    }\n    return out;\n  }\n\n  String apply(Document document) {\n    if (document.doctype != null) {\n      _buffer.write('<!doctype');\n\n      if (document.doctype?.html != null) _buffer.write(' html');\n      if (document.doctype?.public != null) _buffer.write(' public');\n\n      if (document.doctype?.url != null) {\n        _buffer.write('${document.doctype!.url}');\n      }\n\n      _buffer.writeln('>');\n    }\n\n    _formatChild(document.root, 0);\n\n    return _buffer.toString().trim();\n  }\n\n  int _formatChild(\n    ElementChild? child,\n    int lineLength, {\n    bool isFirst = false,\n    bool isLast = false,\n  }) {\n    if (child == null) {\n      return lineLength;\n    } else if (child is Element) {\n      return _formatElement(child, lineLength);\n    }\n    String s;\n    if (child is Interpolation) {\n      var b = StringBuffer('{{');\n      if (child.isRaw) b.write('-');\n      b.write(' ');\n      b.write(child.expression.span.text.trim());\n      b.write(' }}');\n      s = b.toString();\n    } else {\n      s = child.span.text;\n    }\n    if (isFirst) {\n      s = s.trimLeft();\n    }\n    if (isLast) {\n      s = s.trimRight();\n    }\n\n    var ll = lineLength + s.length;\n    if (ll <= maxLineLength) {\n      _buffer.write(s);\n      return ll;\n    } else {\n      _buffer.writeln(s);\n      return _spaceLength;\n    }\n  }\n\n  int _formatElement(Element element, int lineLength) {\n    // print([\n    //   element.tagName.name,\n    //   element.children.map((c) => c.runtimeType),\n    // ]);\n    var header = '<${element.tagName.name}';\n    var attrParts = element.attributes.isEmpty\n        ? <String>[]\n        : element.attributes.map(_formatAttribute);\n    var attrLen = attrParts.isEmpty\n        ? 0\n        : attrParts.map((s) => s.length).reduce((a, b) => a + b);\n    _applySpacing();\n    _buffer.write(header);\n\n    // If the line will be less than maxLineLength characters, write all attrs.\n    var ll =\n        lineLength +\n        (element is SelfClosingElement ? 2 : 1) +\n        header.length +\n        attrLen;\n    if (ll <= maxLineLength) {\n      attrParts.forEach(_buffer.write);\n    } else {\n      // Otherwise, them out with tabs.\n      _buffer.writeln();\n      _indent();\n      var i = 0;\n      for (var p in attrParts) {\n        if (i++ > 0) {\n          _buffer.writeln();\n        }\n        _applySpacing();\n        _buffer.write(p);\n      }\n      _outdent();\n    }\n\n    if (element is SelfClosingElement) {\n      _buffer.writeln('/>');\n      return _spaceLength;\n    } else {\n      _buffer.write('>');\n      if (element.children.isNotEmpty) {\n        _buffer.writeln();\n      }\n    }\n\n    _indent();\n    var lll = _spaceLength;\n    var i = 1;\n    ElementChild? last;\n    for (var c in element.children) {\n      if (lll == _spaceLength && c is! Element) {\n        _applySpacing();\n      }\n      lll = _formatChild(\n        c,\n        lineLength + lll,\n        isFirst: i == 1 || last is Element,\n        isLast: i == element.children.length,\n      );\n      if (i++ == element.children.length && c is! Element) {\n        _buffer.writeln();\n      }\n      last = c;\n    }\n    _outdent();\n\n    if (element.children.isNotEmpty) {\n      // _buffer.writeln();\n      _applySpacing();\n    }\n    _buffer.writeln('</${element.tagName.name}>');\n\n    return lineLength;\n  }\n\n  String _formatAttribute(Attribute attr) {\n    var b = StringBuffer();\n    b.write(' ${attr.name}');\n\n    if (attr.value != null) {\n      if (attr.value is Identifier) {\n        var id = attr.value as Identifier;\n        if (id.name == 'true') {\n          b.write(id.name);\n        } else if (id.name != 'false') {\n          if (attr.nequ != null) b.write('!=');\n          if (attr.equals != null) b.write('=');\n          b.write(id.name);\n        }\n      } else {\n        if (attr.nequ != null) b.write('!=');\n        if (attr.equals != null) b.write('=');\n        b.write(attr.value!.span.text);\n      }\n    }\n    return b.toString();\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/renderer.dart",
    "content": "import 'dart:convert';\nimport 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\n//import 'package:source_span/source_span.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'ast/ast.dart';\nimport 'text/parser.dart';\nimport 'text/scanner.dart';\n\n/// Parses a Jael document.\nDocument? parseDocument(\n  String text, {\n  sourceUrl,\n  bool asDSX = false,\n  void Function(JaelError error)? onError,\n}) {\n  var scanner = scan(text, sourceUrl: sourceUrl, asDSX: asDSX);\n\n  //scanner.tokens.forEach(print);\n\n  if (scanner.errors.isNotEmpty && onError != null) {\n    scanner.errors.forEach(onError);\n  } else if (scanner.errors.isNotEmpty) {\n    throw scanner.errors.first;\n  }\n\n  var parser = Parser(scanner, asDSX: asDSX);\n  var doc = parser.parseDocument();\n\n  if (parser.errors.isNotEmpty && onError != null) {\n    parser.errors.forEach(onError);\n  } else if (parser.errors.isNotEmpty) {\n    throw parser.errors.first;\n  }\n\n  return doc;\n}\n\nclass Renderer {\n  const Renderer();\n\n  /// Render an error page.\n  static void errorDocument(Iterable<JaelError> errors, CodeBuffer buf) {\n    buf\n      ..writeln('<!DOCTYPE html>')\n      ..writeln('<html lang=\"en\">')\n      ..indent()\n      ..writeln('<head>')\n      ..indent()\n      ..writeln(\n        '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">',\n      )\n      ..writeln('<title>${errors.length} Error(s)</title>')\n      ..outdent()\n      ..writeln('</head>')\n      ..writeln('<body>')\n      ..writeln('<h1>${errors.length} Error(s)</h1>')\n      ..writeln('<ul>')\n      ..indent();\n\n    for (var error in errors) {\n      var type = error.severity == JaelErrorSeverity.warning\n          ? 'warning'\n          : 'error';\n      buf\n        ..writeln('<li>')\n        ..indent()\n        ..writeln(\n          '<b>$type:</b> ${error.span.start.toolString}: ${error.message}',\n        )\n        ..writeln('<br>')\n        ..writeln(\n          '<span style=\"color: red;\">${htmlEscape.convert(error.span.highlight(color: false)).replaceAll('\\n', '<br>')}</span>',\n        )\n        ..outdent()\n        ..writeln('</li>');\n    }\n\n    buf\n      ..outdent()\n      ..writeln('</ul>')\n      ..writeln('</body>')\n      ..writeln('</html>');\n  }\n\n  /// Renders a [document] into the [buffer] as HTML.\n  ///\n  /// If [strictResolution] is `false` (default: `true`), then undefined identifiers will return `null`\n  /// instead of throwing.\n  void render(\n    Document document,\n    CodeBuffer buffer,\n    SymbolTable scope, {\n    bool strictResolution = true,\n  }) {\n    scope.create('!strict!', value: strictResolution != false);\n\n    if (document.doctype != null) buffer.writeln(document.doctype!.span.text);\n    renderElement(\n      document.root,\n      buffer,\n      scope,\n      document.doctype?.public == null,\n    );\n  }\n\n  void renderElement(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    var childScope = scope.createChild();\n\n    if (element.attributes.any((a) => a.name == 'for-each')) {\n      renderForeach(element, buffer, childScope, html5);\n      return;\n    } else if (element.attributes.any((a) => a.name == 'if')) {\n      renderIf(element, buffer, childScope, html5);\n      return;\n    } else if (element.tagName.name == 'declare') {\n      renderDeclare(element, buffer, childScope, html5);\n      return;\n    } else if (element.tagName.name == 'switch') {\n      renderSwitch(element, buffer, childScope, html5);\n      return;\n    } else if (element.tagName.name == 'element') {\n      registerCustomElement(element, buffer, childScope, html5);\n      return;\n    } else {\n      var customElementValue = scope\n          .resolve(customElementName(element.tagName.name))\n          ?.value;\n\n      if (customElementValue is Element) {\n        renderCustomElement(element, buffer, childScope, html5);\n        return;\n      }\n    }\n\n    buffer\n      ..write('<')\n      ..write(element.tagName.name);\n\n    for (var attribute in element.attributes) {\n      var value = attribute.value?.compute(childScope);\n\n      if (value == false || value == null) continue;\n\n      buffer.write(' ${attribute.name}');\n\n      if (value == true) {\n        continue;\n      } else {\n        buffer.write('=\"');\n      }\n\n      String msg;\n\n      if (value is Iterable) {\n        msg = value.join(' ');\n      } else if (value is Map) {\n        msg = value.keys.fold<StringBuffer>(StringBuffer(), (buf, k) {\n          var v = value[k];\n          if (v == null) return buf;\n          return buf..write('$k: $v;');\n        }).toString();\n      } else {\n        msg = value.toString();\n      }\n\n      buffer.write(attribute.isRaw ? msg : htmlEscape.convert(msg));\n      buffer.write('\"');\n    }\n\n    if (element is SelfClosingElement) {\n      if (html5) {\n        buffer.writeln('>');\n      } else {\n        buffer.writeln('/>');\n      }\n    } else {\n      buffer.writeln('>');\n      buffer.indent();\n\n      for (var i = 0; i < element.children.length; i++) {\n        var child = element.children.elementAt(i);\n        renderElementChild(\n          element,\n          child,\n          buffer,\n          childScope,\n          html5,\n          i,\n          element.children.length,\n        );\n      }\n\n      buffer.writeln();\n      buffer.outdent();\n      buffer.writeln('</${element.tagName.name}>');\n    }\n  }\n\n  void renderForeach(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    var attribute = element.attributes.singleWhere((a) => a.name == 'for-each');\n    if (attribute.value == null) return;\n\n    var asAttribute = element.attributes.firstWhereOrNull(\n      (a) => a.name == 'as',\n    );\n    var indexAsAttribute = element.attributes.firstWhereOrNull(\n      (a) => a.name == 'index-as',\n    );\n    var alias = asAttribute?.value?.compute(scope)?.toString() ?? 'item';\n    var indexAs = indexAsAttribute?.value?.compute(scope)?.toString() ?? 'i';\n    var otherAttributes = element.attributes.where(\n      (a) => a.name != 'for-each' && a.name != 'as' && a.name != 'index-as',\n    );\n    late Element strippedElement;\n\n    if (element is SelfClosingElement) {\n      strippedElement = SelfClosingElement(\n        element.lt,\n        element.tagName,\n        otherAttributes,\n        element.slash,\n        element.gt,\n      );\n    } else if (element is RegularElement) {\n      strippedElement = RegularElement(\n        element.lt,\n        element.tagName,\n        otherAttributes,\n        element.gt,\n        element.children,\n        element.lt2,\n        element.slash,\n        element.tagName2,\n        element.gt2,\n      );\n    }\n\n    var i = 0;\n    for (var item in attribute.value!.compute(scope)) {\n      var childScope = scope.createChild(values: {alias: item, indexAs: i++});\n      renderElement(strippedElement, buffer, childScope, html5);\n    }\n  }\n\n  void renderIf(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    var attribute = element.attributes.singleWhere((a) => a.name == 'if');\n\n    var vv = attribute.value!.compute(scope);\n\n    if (scope.resolve('!strict!')?.value == false) {\n      vv = vv == true;\n    }\n\n    var v = vv as bool;\n\n    if (!v) return;\n\n    var otherAttributes = element.attributes.where((a) => a.name != 'if');\n    late Element strippedElement;\n\n    if (element is SelfClosingElement) {\n      strippedElement = SelfClosingElement(\n        element.lt,\n        element.tagName,\n        otherAttributes,\n        element.slash,\n        element.gt,\n      );\n    } else if (element is RegularElement) {\n      strippedElement = RegularElement(\n        element.lt,\n        element.tagName,\n        otherAttributes,\n        element.gt,\n        element.children,\n        element.lt2,\n        element.slash,\n        element.tagName2,\n        element.gt2,\n      );\n    }\n\n    renderElement(strippedElement, buffer, scope, html5);\n  }\n\n  void renderDeclare(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    for (var attribute in element.attributes) {\n      scope.create(\n        attribute.name,\n        value: attribute.value?.compute(scope),\n        constant: true,\n      );\n    }\n\n    for (var i = 0; i < element.children.length; i++) {\n      var child = element.children.elementAt(i);\n      renderElementChild(\n        element,\n        child,\n        buffer,\n        scope,\n        html5,\n        i,\n        element.children.length,\n      );\n    }\n  }\n\n  void renderSwitch(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    var value = element.attributes\n        .firstWhereOrNull((a) => a.name == 'value')\n        ?.value\n        ?.compute(scope);\n\n    var cases = element.children.whereType<Element>().where(\n      (c) => c.tagName.name == 'case',\n    );\n\n    for (var child in cases) {\n      var comparison = child.attributes\n          .firstWhereOrNull((a) => a.name == 'value')\n          ?.value\n          ?.compute(scope);\n      if (comparison == value) {\n        for (var i = 0; i < child.children.length; i++) {\n          var c = child.children.elementAt(i);\n          renderElementChild(\n            element,\n            c,\n            buffer,\n            scope,\n            html5,\n            i,\n            child.children.length,\n          );\n        }\n\n        return;\n      }\n    }\n\n    var defaultCase =\n        element.children.firstWhereOrNull(\n              (c) => c is Element && c.tagName.name == 'default',\n            )\n            as Element?;\n    if (defaultCase != null) {\n      for (var i = 0; i < defaultCase.children.length; i++) {\n        var child = defaultCase.children.elementAt(i);\n        renderElementChild(\n          element,\n          child,\n          buffer,\n          scope,\n          html5,\n          i,\n          defaultCase.children.length,\n        );\n      }\n    }\n  }\n\n  void renderElementChild(\n    Element parent,\n    ElementChild child,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n    int index,\n    int total,\n  ) {\n    if (child is Text && parent.tagName.name != 'textarea') {\n      if (index == 0) {\n        buffer.write(child.span.text.trimLeft());\n      } else if (index == total - 1) {\n        buffer.write(child.span.text.trimRight());\n      } else {\n        buffer.write(child.span.text);\n      }\n    } else if (child is Interpolation) {\n      var value = child.expression.compute(scope);\n\n      if (value != null) {\n        if (child.isRaw) {\n          buffer.write(value);\n        } else {\n          buffer.write(htmlEscape.convert(value.toString()));\n        }\n      }\n    } else if (child is Element) {\n      if (buffer.lastLine?.text.isNotEmpty == true) buffer.writeln();\n      renderElement(child, buffer, scope, html5);\n    }\n  }\n\n  static String customElementName(String name) => 'elements@$name';\n\n  void registerCustomElement(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    if (element is! RegularElement) {\n      throw JaelError(\n        JaelErrorSeverity.error,\n        'Custom elements cannot be self-closing.',\n        element.span,\n      );\n    }\n\n    var name = element.getAttribute('name')?.value?.compute(scope)?.toString();\n\n    if (name == null) {\n      throw JaelError(\n        JaelErrorSeverity.error,\n        \"Attribute 'name' is required when registering a custom element.\",\n        element.tagName.span,\n      );\n    }\n\n    try {\n      var p = scope.isRoot ? scope : scope.parent!;\n      p.create(customElementName(name), value: element, constant: true);\n    } on StateError {\n      throw JaelError(\n        JaelErrorSeverity.error,\n        \"Cannot re-define element '$name' in this scope.\",\n        element.getAttribute('name')!.span,\n      );\n    }\n  }\n\n  void renderCustomElement(\n    Element element,\n    CodeBuffer buffer,\n    SymbolTable scope,\n    bool html5,\n  ) {\n    var template =\n        scope.resolve(customElementName(element.tagName.name))!.value\n            as RegularElement?;\n    var renderAs = element.getAttribute('as')?.value?.compute(scope);\n    var attrs = element.attributes.where((a) => a.name != 'as');\n\n    for (var attribute in attrs) {\n      if (attribute.name.startsWith('@')) {\n        scope.create(\n          attribute.name.substring(1),\n          value: attribute.value?.compute(scope),\n          constant: true,\n        );\n      }\n    }\n\n    if (renderAs == false) {\n      for (var i = 0; i < template!.children.length; i++) {\n        var child = template.children.elementAt(i);\n        renderElementChild(\n          element,\n          child,\n          buffer,\n          scope,\n          html5,\n          i,\n          element.children.length,\n        );\n      }\n    } else {\n      var tagName = renderAs?.toString() ?? 'div';\n\n      var syntheticElement = RegularElement(\n        template!.lt,\n        SyntheticIdentifier(tagName),\n        element.attributes.where(\n          (a) => a.name != 'as' && !a.name.startsWith('@'),\n        ),\n        template.gt,\n        template.children,\n        template.lt2,\n        template.slash,\n        SyntheticIdentifier(tagName),\n        template.gt2,\n      );\n\n      renderElement(syntheticElement, buffer, scope, html5);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/text/parselet/infix.dart",
    "content": "part of 'parselet.dart';\n\nconst Map<TokenType, InfixParselet> infixParselets = {\n  TokenType.lParen: CallParselet(),\n  TokenType.elvisDot: MemberParselet(),\n  TokenType.dot: MemberParselet(),\n  TokenType.lBracket: IndexerParselet(),\n  TokenType.asterisk: BinaryParselet(14),\n  TokenType.slash: BinaryParselet(14),\n  TokenType.percent: BinaryParselet(14),\n  TokenType.plus: BinaryParselet(13),\n  TokenType.minus: BinaryParselet(13),\n  TokenType.lt: BinaryParselet(11),\n  TokenType.lte: BinaryParselet(11),\n  TokenType.gt: BinaryParselet(11),\n  TokenType.gte: BinaryParselet(11),\n  TokenType.equ: BinaryParselet(10),\n  TokenType.nequ: BinaryParselet(10),\n  TokenType.question: ConditionalParselet(),\n  TokenType.equals: BinaryParselet(3),\n  TokenType.elvis: BinaryParselet(3),\n};\n\nclass ConditionalParselet implements InfixParselet {\n  @override\n  int get precedence => 4;\n\n  const ConditionalParselet();\n\n  @override\n  Expression? parse(Parser parser, Expression left, Token token) {\n    var ifTrue = parser.parseExpression(0);\n\n    if (ifTrue == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in conditional expression.',\n          token.span,\n        ),\n      );\n      return null;\n    }\n\n    if (!parser.next(TokenType.colon)) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \":\" in conditional expression.',\n          ifTrue.span,\n        ),\n      );\n      return null;\n    }\n\n    var colon = parser.current;\n    var ifFalse = parser.parseExpression(0);\n\n    if (ifFalse == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in conditional expression.',\n          colon.span,\n        ),\n      );\n      return null;\n    }\n\n    return Conditional(left, token, ifTrue, colon, ifFalse);\n  }\n}\n\nclass BinaryParselet implements InfixParselet {\n  @override\n  final int precedence;\n\n  const BinaryParselet(this.precedence);\n\n  @override\n  Expression? parse(Parser parser, Expression left, Token token) {\n    var right = parser.parseExpression(precedence);\n\n    if (right == null) {\n      if (token.type != TokenType.gt) {\n        parser.errors.add(\n          JaelError(\n            JaelErrorSeverity.error,\n            'Missing expression after operator \"${token.span.text}\", following expression ${left.span.text}.',\n            token.span,\n          ),\n        );\n      }\n      return null;\n    }\n\n    return BinaryExpression(left, token, right);\n  }\n}\n\nclass CallParselet implements InfixParselet {\n  const CallParselet();\n\n  @override\n  int get precedence => 19;\n\n  @override\n  Expression? parse(Parser parser, Expression left, Token token) {\n    var arguments = <Expression>[];\n    var namedArguments = <NamedArgument>[];\n    var argument = parser.parseExpression(0);\n\n    while (argument != null) {\n      arguments.add(argument);\n      if (!parser.next(TokenType.comma)) break;\n      parser.skipExtraneous(TokenType.comma);\n      argument = parser.parseExpression(0);\n    }\n\n    var namedArgument = parser.parseNamedArgument();\n\n    while (namedArgument != null) {\n      namedArguments.add(namedArgument);\n      if (!parser.next(TokenType.comma)) break;\n      parser.skipExtraneous(TokenType.comma);\n      namedArgument = parser.parseNamedArgument();\n    }\n\n    if (!parser.next(TokenType.rParen)) {\n      var lastSpan = arguments.isEmpty ? null : arguments.last.span;\n      lastSpan ??= token.span;\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \")\" after argument list.',\n          lastSpan,\n        ),\n      );\n      return null;\n    }\n\n    return Call(left, token, parser.current, arguments, namedArguments);\n  }\n}\n\nclass IndexerParselet implements InfixParselet {\n  const IndexerParselet();\n\n  @override\n  int get precedence => 19;\n\n  @override\n  Expression? parse(Parser parser, Expression left, Token token) {\n    var indexer = parser.parseExpression(0);\n\n    if (indexer == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression after \"[\".',\n          left.span,\n        ),\n      );\n      return null;\n    }\n\n    if (!parser.next(TokenType.rBracket)) {\n      parser.errors.add(\n        JaelError(JaelErrorSeverity.error, 'Missing \"]\".', indexer.span),\n      );\n      return null;\n    }\n\n    return IndexerExpression(left, token, indexer, parser.current);\n  }\n}\n\nclass MemberParselet implements InfixParselet {\n  const MemberParselet();\n\n  @override\n  int get precedence => 19;\n\n  @override\n  Expression? parse(Parser parser, Expression left, Token token) {\n    var name = parser.parseIdentifier();\n\n    if (name == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected the name of a property following \".\"',\n          token.span,\n        ),\n      );\n      return null;\n    }\n\n    return MemberExpression(left, token, name);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/text/parselet/parselet.dart",
    "content": "library;\n\nimport '../../ast/ast.dart';\nimport '../parser.dart';\npart 'infix.dart';\npart 'prefix.dart';\n\nabstract class PrefixParselet {\n  Expression? parse(Parser parser, Token token);\n}\n\nabstract class InfixParselet {\n  int get precedence;\n  Expression? parse(Parser parser, Expression left, Token token);\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/text/parselet/prefix.dart",
    "content": "part of 'parselet.dart';\n\nconst Map<TokenType, PrefixParselet> prefixParselets = {\n  TokenType.exclamation: NotParselet(),\n  TokenType.$new: NewParselet(),\n  TokenType.number: NumberParselet(),\n  TokenType.hex: HexParselet(),\n  TokenType.string: StringParselet(),\n  TokenType.lCurly: MapParselet(),\n  TokenType.lBracket: ArrayParselet(),\n  TokenType.id: IdentifierParselet(),\n  TokenType.lParen: ParenthesisParselet(),\n};\n\nclass NotParselet implements PrefixParselet {\n  const NotParselet();\n\n  @override\n  Expression parse(Parser parser, Token token) {\n    var expression = parser.parseExpression(0);\n\n    if (expression == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression after \"!\" in negation expression.',\n          token.span,\n        ),\n      );\n    }\n\n    return Negation(token, expression!);\n  }\n}\n\nclass NewParselet implements PrefixParselet {\n  const NewParselet();\n\n  @override\n  Expression? parse(Parser parser, Token token) {\n    var call = parser.parseExpression(0);\n\n    if (call == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          '\"new\" must precede a call expression. Nothing was found.',\n          call!.span,\n        ),\n      );\n      return null;\n    } else if (call is Call) {\n      return NewExpression(token, call);\n    } else {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          '\"new\" must precede a call expression, not a(n) ${call.runtimeType}.',\n          call.span,\n        ),\n      );\n      return null;\n    }\n  }\n}\n\nclass NumberParselet implements PrefixParselet {\n  const NumberParselet();\n\n  @override\n  Expression parse(Parser parser, Token token) => NumberLiteral(token);\n}\n\nclass HexParselet implements PrefixParselet {\n  const HexParselet();\n\n  @override\n  Expression parse(Parser parser, Token token) => HexLiteral(token);\n}\n\nclass StringParselet implements PrefixParselet {\n  const StringParselet();\n\n  @override\n  Expression parse(Parser parser, Token token) =>\n      StringLiteral(token, StringLiteral.parseValue(token));\n}\n\nclass ArrayParselet implements PrefixParselet {\n  const ArrayParselet();\n\n  @override\n  Expression? parse(Parser parser, Token token) {\n    var items = <Expression>[];\n    var item = parser.parseExpression(0);\n\n    while (item != null) {\n      items.add(item);\n      if (!parser.next(TokenType.comma)) break;\n      parser.skipExtraneous(TokenType.comma);\n      item = parser.parseExpression(0);\n    }\n\n    if (!parser.next(TokenType.rBracket)) {\n      var lastSpan = items.isEmpty ? null : items.last.span;\n      lastSpan ??= token.span;\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \"]\" to terminate array literal.',\n          lastSpan,\n        ),\n      );\n      return null;\n    }\n\n    return Array(token, parser.current, items);\n  }\n}\n\nclass MapParselet implements PrefixParselet {\n  const MapParselet();\n\n  @override\n  Expression? parse(Parser parser, Token token) {\n    var pairs = <KeyValuePair>[];\n    var pair = parser.parseKeyValuePair();\n\n    while (pair != null) {\n      pairs.add(pair);\n      if (!parser.next(TokenType.comma)) break;\n      parser.skipExtraneous(TokenType.comma);\n      pair = parser.parseKeyValuePair();\n    }\n\n    if (!parser.next(TokenType.rCurly)) {\n      var lastSpan = pairs.isEmpty ? token.span : pairs.last.span;\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \"}\" in map literal.',\n          lastSpan,\n        ),\n      );\n      return null;\n    }\n\n    return MapLiteral(token, pairs, parser.current);\n  }\n}\n\nclass IdentifierParselet implements PrefixParselet {\n  const IdentifierParselet();\n\n  @override\n  Expression parse(Parser parser, Token token) => Identifier(token);\n}\n\nclass ParenthesisParselet implements PrefixParselet {\n  const ParenthesisParselet();\n\n  @override\n  Expression? parse(Parser parser, Token? token) {\n    var expression = parser.parseExpression(0);\n\n    if (expression == null) {\n      parser.errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression after \"(\".',\n          token!.span,\n        ),\n      );\n      return null;\n    }\n\n    if (!parser.next(TokenType.rParen)) {\n      parser.errors.add(\n        JaelError(JaelErrorSeverity.error, 'Missing \")\".', expression.span),\n      );\n      return null;\n    }\n\n    return expression;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/text/parser.dart",
    "content": "import '../ast/ast.dart';\nimport 'parselet/parselet.dart';\nimport 'scanner.dart';\n\nclass Parser {\n  final List<JaelError> errors = [];\n  final Scanner scanner;\n  final bool asDSX;\n\n  late Token _current;\n  int _index = -1;\n\n  Parser(this.scanner, {this.asDSX = false});\n\n  Token get current => _current;\n\n  int _nextPrecedence() {\n    var tok = peek();\n    if (tok == null) return 0;\n\n    var parser = infixParselets[tok.type];\n    return parser?.precedence ?? 0;\n  }\n\n  bool next(TokenType type) {\n    if (_index >= scanner.tokens.length - 1) return false;\n    var peek = scanner.tokens[_index + 1];\n\n    if (peek.type != type) return false;\n\n    _current = peek;\n    _index++;\n    return true;\n  }\n\n  Token? peek() {\n    if (_index >= scanner.tokens.length - 1) return null;\n    return scanner.tokens[_index + 1];\n  }\n\n  Token? maybe(TokenType type) => next(type) ? _current : null;\n\n  void skipExtraneous(TokenType type) {\n    while (next(type)) {\n      // Skip...\n    }\n  }\n\n  Document? parseDocument() {\n    var doctype = parseDoctype();\n\n    if (doctype == null) {\n      var root = parseElement();\n      if (root == null) return null;\n      return Document(null, root);\n    }\n\n    var root = parseElement();\n\n    if (root == null) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing root element after !DOCTYPE declaration.',\n          doctype.span,\n        ),\n      );\n      return null;\n    }\n\n    return Document(doctype, root);\n  }\n\n  StringLiteral? implicitString() {\n    if (next(TokenType.string)) {\n      var result = prefixParselets[TokenType.string]?.parse(this, _current);\n      if (result != null) {\n        return result as StringLiteral;\n      }\n      return null;\n    }\n    /*else if (next(TokenType.text)) {\n\n    }*/\n\n    return null;\n  }\n\n  Doctype? parseDoctype() {\n    if (!next(TokenType.lt)) return null;\n    var lt = _current;\n\n    if (!next(TokenType.doctype)) {\n      _index--;\n      return null;\n    }\n    var doctype = _current;\n    var html = parseIdentifier();\n    if (html == null || html.span.text.toLowerCase() != 'html') {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected \"html\" in doctype declaration.',\n          html?.span ?? doctype.span,\n        ),\n      );\n\n      return null;\n    }\n\n    var public = parseIdentifier();\n    if (public == null) {\n      if (!next(TokenType.gt)) {\n        errors.add(\n          JaelError(\n            JaelErrorSeverity.error,\n            'Expected \">\" in doctype declaration.',\n            html.span,\n          ),\n        );\n        // ?? doctype.span));\n        return null;\n      }\n\n      return Doctype(lt, doctype, html, null, null, null, _current);\n    }\n\n    if (public.span.text.toLowerCase() != 'public') {\n      //errors.add(JaelError(\n      //    JaelErrorSeverity.error,\n      //    'Expected \"public\" in doctype declaration.',\n      //    public!.span ?? html?.span));\n\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected \"public\" in doctype declaration.',\n          public.span,\n        ),\n      );\n\n      return null;\n    }\n\n    var stringParser = prefixParselets[TokenType.string];\n\n    if (!next(TokenType.string)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected string in doctype declaration.',\n          public.span,\n        ),\n      );\n      return null;\n    }\n\n    var name = stringParser?.parse(this, _current) as StringLiteral;\n\n    if (!next(TokenType.string)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected string in doctype declaration.',\n          name.span,\n        ),\n      );\n      return null;\n    }\n\n    var url = stringParser?.parse(this, _current) as StringLiteral;\n\n    if (!next(TokenType.gt)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Expected \">\" in doctype declaration.',\n          url.span,\n        ),\n      );\n      return null;\n    }\n\n    return Doctype(lt, doctype, html, public, name, url, _current);\n  }\n\n  ElementChild? parseElementChild() =>\n      parseHtmlComment() ??\n      parseInterpolation() ??\n      parseText() ??\n      parseElement();\n\n  HtmlComment? parseHtmlComment() =>\n      next(TokenType.htmlComment) ? HtmlComment(_current) : null;\n\n  Text? parseText() => next(TokenType.text) ? Text(_current) : null;\n\n  Interpolation? parseInterpolation() {\n    if (!next(asDSX ? TokenType.lCurly : TokenType.lDoubleCurly)) return null;\n    var doubleCurlyL = _current;\n\n    var expression = parseExpression(0);\n\n    if (expression == null) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in interpolation.',\n          doubleCurlyL.span,\n        ),\n      );\n      return null;\n    }\n\n    if (!next(asDSX ? TokenType.rCurly : TokenType.rDoubleCurly)) {\n      var expected = asDSX ? '}' : '}}';\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing closing \"$expected\" in interpolation.',\n          expression.span,\n        ),\n      );\n      return null;\n    }\n\n    return Interpolation(doubleCurlyL, expression, _current);\n  }\n\n  Element? parseElement() {\n    if (!next(TokenType.lt)) return null;\n    var lt = _current;\n\n    if (next(TokenType.slash)) {\n      // We entered a closing tag, don't keep reading...\n      _index -= 2;\n      return null;\n    }\n\n    var tagName = parseIdentifier();\n\n    if (tagName == null) {\n      errors.add(\n        JaelError(JaelErrorSeverity.error, 'Missing tag name.', lt.span),\n      );\n      return null;\n    }\n\n    var attributes = <Attribute>[];\n    var attribute = parseAttribute();\n\n    while (attribute != null) {\n      attributes.add(attribute);\n      attribute = parseAttribute();\n    }\n\n    if (next(TokenType.slash)) {\n      // Try for self-closing...\n      var slash = _current;\n\n      if (!next(TokenType.gt)) {\n        errors.add(\n          JaelError(\n            JaelErrorSeverity.error,\n            'Missing \">\" in self-closing \"${tagName.name}\" tag.',\n            slash.span,\n          ),\n        );\n        return null;\n      }\n\n      return SelfClosingElement(lt, tagName, attributes, slash, _current);\n    }\n\n    if (!next(TokenType.gt)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \">\" in \"${tagName.name}\" tag.',\n          attributes.isEmpty ? tagName.span : attributes.last.span,\n        ),\n      );\n      return null;\n    }\n\n    var gt = _current;\n\n    // Implicit self-closing\n    if (Element.selfClosing.contains(tagName.name)) {\n      return SelfClosingElement(lt, tagName, attributes, null, gt);\n    }\n\n    var children = <ElementChild>[];\n    var child = parseElementChild();\n\n    while (child != null) {\n      // if (child is! HtmlComment) children.add(child);\n      children.add(child);\n      child = parseElementChild();\n    }\n\n    // Parse closing tag\n    if (!next(TokenType.lt)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing closing tag for \"${tagName.name}\" tag.',\n          children.isEmpty ? tagName.span : children.last.span,\n        ),\n      );\n      return null;\n    }\n\n    var lt2 = _current;\n\n    if (!next(TokenType.slash)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \"/\" in \"${tagName.name}\" closing tag.',\n          lt2.span,\n        ),\n      );\n      return null;\n    }\n\n    var slash = _current;\n    var tagName2 = parseIdentifier();\n\n    if (tagName2 == null) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \"${tagName.name}\" in \"${tagName.name}\" closing tag.',\n          slash.span,\n        ),\n      );\n      return null;\n    }\n\n    if (tagName2.name != tagName.name) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Mismatched closing tags. Expected \"${tagName.span.text}\"; got \"${tagName2.name}\" instead.',\n          lt2.span,\n        ),\n      );\n      return null;\n    }\n\n    if (!next(TokenType.gt)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \">\" in \"${tagName.name}\" closing tag.',\n          tagName2.span,\n        ),\n      );\n      return null;\n    }\n\n    return RegularElement(\n      lt,\n      tagName,\n      attributes,\n      gt,\n      children,\n      lt2,\n      slash,\n      tagName2,\n      _current,\n    );\n  }\n\n  Attribute? parseAttribute() {\n    Identifier? id;\n    StringLiteral? string;\n\n    if ((id = parseIdentifier()) != null) {\n      // Nothing\n    } else if (next(TokenType.string)) {\n      string = StringLiteral(_current, StringLiteral.parseValue(_current));\n    } else {\n      return null;\n    }\n\n    Token? equals, nequ;\n\n    if (next(TokenType.equals)) {\n      equals = _current;\n    } else if (!asDSX && next(TokenType.nequ)) {\n      nequ = _current;\n    } else {\n      return Attribute(id, string, null, null, null);\n    }\n\n    if (!asDSX) {\n      var value = parseExpression(0);\n\n      if (value == null) {\n        errors.add(\n          JaelError(\n            JaelErrorSeverity.error,\n            'Missing expression in attribute.',\n            equals?.span ?? nequ!.span,\n          ),\n        );\n        return null;\n      }\n\n      return Attribute(id, string, equals, nequ, value);\n    } else {\n      // Find either a string, or an interpolation.\n      var value = implicitString();\n\n      if (value != null) {\n        return Attribute(id, string, equals, nequ, value);\n      }\n\n      var interpolation = parseInterpolation();\n\n      if (interpolation != null) {\n        return Attribute(id, string, equals, nequ, interpolation.expression);\n      }\n\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in attribute.',\n          equals?.span ?? nequ!.span,\n        ),\n      );\n      return null;\n    }\n  }\n\n  Expression? parseExpression(int precedence) {\n    // Only consume a token if it could potentially be a prefix parselet\n\n    for (var type in prefixParselets.keys) {\n      if (next(type)) {\n        var left = prefixParselets[type]?.parse(this, _current);\n\n        while (precedence < _nextPrecedence()) {\n          _current = scanner.tokens[++_index];\n\n          if (_current.type == TokenType.slash &&\n              peek()?.type == TokenType.gt) {\n            // Handle `/>`\n            //\n            // Don't register this as an infix expression.\n            // Instead, backtrack, and return the current expression.\n            _index--;\n            return left;\n          }\n\n          var infix = infixParselets[_current.type]!;\n          Expression? newLeft;\n          if (left != null) {\n            newLeft = infix.parse(this, left, _current);\n          }\n\n          if (newLeft == null) {\n            if (_current.type == TokenType.gt) _index--;\n            return left;\n          }\n          left = newLeft;\n        }\n\n        return left;\n      }\n    }\n\n    // Nothing was parsed; return null.\n    return null;\n  }\n\n  Identifier? parseIdentifier() =>\n      next(TokenType.id) ? Identifier(_current) : null;\n\n  KeyValuePair? parseKeyValuePair() {\n    var key = parseExpression(0);\n    if (key == null) return null;\n\n    if (!next(TokenType.colon)) return KeyValuePair(key, null, null);\n\n    var colon = _current, value = parseExpression(0) as Token?;\n\n    if (value == null) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in key-value pair.',\n          colon.span,\n        ),\n      );\n      return null;\n    }\n\n    return KeyValuePair(key, colon, value as Expression);\n  }\n\n  NamedArgument? parseNamedArgument() {\n    var name = parseIdentifier();\n    if (name == null) return null;\n\n    if (!next(TokenType.colon)) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing \":\" in named argument.',\n          name.span,\n        ),\n      );\n      return null;\n    }\n\n    var colon = _current, value = parseExpression(0) as Token?;\n\n    if (value == null) {\n      errors.add(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing expression in named argument.',\n          colon.span,\n        ),\n      );\n      return null;\n    }\n\n    return NamedArgument(name, colon, value as Expression);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/lib/src/text/scanner.dart",
    "content": "import 'dart:collection';\nimport 'package:charcode/ascii.dart';\nimport 'package:string_scanner/string_scanner.dart';\nimport '../ast/ast.dart';\n\nfinal RegExp _whitespace = RegExp(r'[ \\n\\r\\t]+');\n\nfinal RegExp _id = RegExp(\n  r'@?(([A-Za-z][A-Za-z0-9_]*-)*([A-Za-z][A-Za-z0-9_]*))',\n);\nfinal RegExp _string1 = RegExp(\n  r\"'((\\\\(['\\\\/bfnrt]|(u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))|([^'\\\\]))*'\",\n);\nfinal RegExp _string2 = RegExp(\n  r'\"((\\\\([\"\\\\/bfnrt]|(u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))|([^\"\\\\]))*\"',\n);\n\nScanner scan(String text, {sourceUrl, bool asDSX = false}) =>\n    _Scanner(text, sourceUrl)..scan(asDSX: asDSX);\n\nabstract class Scanner {\n  List<JaelError> get errors;\n\n  List<Token> get tokens;\n}\n\nfinal RegExp _htmlComment = RegExp(r'<!--[^$]*-->');\n\nfinal Map<Pattern, TokenType> _expressionPatterns = {\n  //final Map<Pattern, TokenType> _htmlPatterns = {\n  '{{': TokenType.lDoubleCurly,\n  '{{-': TokenType.lDoubleCurly,\n\n  //\n  _htmlComment: TokenType.htmlComment,\n  '!DOCTYPE': TokenType.doctype,\n  '!doctype': TokenType.doctype,\n  '<': TokenType.lt,\n  '>': TokenType.gt,\n  '/': TokenType.slash,\n  '=': TokenType.equals,\n  '!=': TokenType.nequ,\n  _string1: TokenType.string,\n  _string2: TokenType.string,\n  _id: TokenType.id,\n  //};\n\n  //final Map<Pattern, TokenType> _expressionPatterns = {\n  '}}': TokenType.rDoubleCurly,\n\n  // Keywords\n  'new': TokenType.$new,\n\n  // Misc.\n  '*': TokenType.asterisk,\n  ':': TokenType.colon,\n  ',': TokenType.comma,\n  '.': TokenType.dot,\n  '??': TokenType.elvis,\n  '?.': TokenType.elvisDot,\n  //'=': TokenType.equals,\n  '!': TokenType.exclamation,\n  '-': TokenType.minus,\n  '%': TokenType.percent,\n  '+': TokenType.plus,\n  '[': TokenType.lBracket,\n  ']': TokenType.rBracket,\n  '{': TokenType.lCurly,\n  '}': TokenType.rCurly,\n  '(': TokenType.lParen,\n  ')': TokenType.rParen,\n  //'/': TokenType.slash,\n  //'<': TokenType.lt,\n  '<=': TokenType.lte,\n  //'>': TokenType.gt,\n  '>=': TokenType.gte,\n  '==': TokenType.equ,\n  //'!=': TokenType.nequ,\n  //'=': TokenType.equals,\n  RegExp(r'-?[0-9]+(\\.[0-9]+)?([Ee][0-9]+)?'): TokenType.number,\n  RegExp(r'0x[A-Fa-f0-9]+'): TokenType.hex,\n  _string1: TokenType.string,\n  _string2: TokenType.string,\n  _id: TokenType.id,\n};\n\nclass _Scanner implements Scanner {\n  @override\n  final List<JaelError> errors = [];\n\n  @override\n  final List<Token> tokens = [];\n  _ScannerState state = _ScannerState.html;\n  final Queue<String?> openTags = Queue();\n\n  late SpanScanner _scanner;\n\n  _Scanner(String text, sourceUrl) {\n    _scanner = SpanScanner(text, sourceUrl: sourceUrl);\n  }\n\n  void scan({bool asDSX = false}) {\n    while (!_scanner.isDone) {\n      if (state == _ScannerState.html) {\n        scanHtml(asDSX);\n      } else if (state == _ScannerState.freeText) {\n        // Just keep parsing until we hit \"</\"\n        var start = _scanner.state, end = start;\n\n        while (!_scanner.isDone) {\n          // Skip through comments\n          if (_scanner.scan(_htmlComment)) continue;\n\n          // Break on {{ or {\n          if (_scanner.matches(asDSX ? '{' : '{{')) {\n            state = _ScannerState.html;\n            //_scanner.position--;\n            break;\n          }\n\n          var ch = _scanner.readChar();\n\n          if (ch == $lt) {\n            // && !_scanner.isDone) {\n            if (_scanner.matches('/')) {\n              // If we reached \"</\", backtrack and break into HTML\n              openTags.removeFirst();\n              _scanner.position--;\n              state = _ScannerState.html;\n              break;\n            } else if (_scanner.matches(_id)) {\n              // Also break when we reach <foo.\n              //\n              // HOWEVER, that is also JavaScript. So we must\n              // only break in this case when the current tag is NOT \"script\".\n              var shouldBreak =\n                  (openTags.isEmpty || openTags.first != 'script');\n\n              if (!shouldBreak) {\n                // Try to see if we are closing a script tag\n                var replay = _scanner.state;\n                _scanner\n                  ..readChar()\n                  ..scan(_whitespace);\n                //print(_scanner.emptySpan.highlight());\n\n                if (_scanner.matches(_id)) {\n                  //print(_scanner.lastMatch[0]);\n                  shouldBreak = _scanner.lastMatch?[0] == 'script';\n                  _scanner.position--;\n                }\n\n                if (!shouldBreak) {\n                  _scanner.state = replay;\n                }\n              }\n\n              if (shouldBreak) {\n                openTags.removeFirst();\n                _scanner.position--;\n                state = _ScannerState.html;\n                break;\n              }\n            }\n          }\n\n          // Otherwise, just add to the \"buffer\"\n          end = _scanner.state;\n        }\n\n        var span = _scanner.spanFrom(start, end);\n\n        if (span.text.isNotEmpty == true) {\n          tokens.add(Token(TokenType.text, span, null));\n        }\n      }\n    }\n  }\n\n  void scanHtml(bool asDSX) {\n    var brackets = Queue<Token>();\n\n    do {\n      // Only continue if we find a left bracket\n      if (true) {\n        // || _scanner.matches('<') || _scanner.matches('{{')) {\n        var potential = <Token>[];\n\n        while (true) {\n          // Scan whitespace\n          _scanner.scan(_whitespace);\n\n          _expressionPatterns.forEach((pattern, type) {\n            if (_scanner.matches(pattern)) {\n              if (_scanner.lastSpan != null) {\n                potential.add(\n                  Token(type, _scanner.lastSpan!, _scanner.lastMatch),\n                );\n              } else {\n                // TODO: To be relooked\n              }\n            }\n          });\n\n          potential.sort((a, b) => b.span.length.compareTo(a.span.length));\n\n          if (potential.isEmpty) break;\n\n          var token = potential.first;\n          tokens.add(token);\n\n          _scanner.scan(token.span.text);\n\n          if (token.type == TokenType.lt) {\n            brackets.addFirst(token);\n\n            // Try to see if we are at a tag.\n            var replay = _scanner.state;\n            _scanner.scan(_whitespace);\n\n            if (_scanner.matches(_id)) {\n              openTags.addFirst(_scanner.lastMatch![0]);\n            } else {\n              _scanner.state = replay;\n            }\n          } else if (token.type == TokenType.slash) {\n            // Only push if we're at </foo\n            if (brackets.isNotEmpty && brackets.first.type == TokenType.lt) {\n              brackets\n                ..removeFirst()\n                ..addFirst(token);\n            }\n          } else if (token.type == TokenType.gt) {\n            // Only pop the bracket if we're at foo>, </foo> or foo/>\n            if (brackets.isNotEmpty && brackets.first.type == TokenType.slash) {\n              // </foo>\n              brackets.removeFirst();\n\n              // Now, ONLY continue parsing HTML if the next character is '<'.\n              var replay = _scanner.state;\n              _scanner.scan(_whitespace);\n\n              if (!_scanner.matches('<')) {\n                _scanner.state = replay;\n                state = _ScannerState.freeText;\n                break;\n              }\n            }\n            //else if (_scanner.matches('>')) brackets.removeFirst();\n            else if (brackets.isNotEmpty &&\n                brackets.first.type == TokenType.lt) {\n              // We're at foo>, try to parse text?\n              brackets.removeFirst();\n\n              var replay = _scanner.state;\n              _scanner.scan(_whitespace);\n\n              if (!_scanner.matches('<')) {\n                _scanner.state = replay;\n                state = _ScannerState.freeText;\n                break;\n              }\n            }\n          } else if (token.type ==\n              (asDSX ? TokenType.rCurly : TokenType.rDoubleCurly)) {\n            state = _ScannerState.freeText;\n            break;\n          }\n\n          potential.clear();\n        }\n      }\n    } while (brackets.isNotEmpty && !_scanner.isDone);\n\n    state = _ScannerState.freeText;\n  }\n}\n\nenum _ScannerState { html, freeText }\n"
  },
  {
    "path": "packages/jael/jael/melos_jael3.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/jael/pubspec.yaml",
    "content": "name: jael3\nversion: 8.4.0\ndescription:  A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/jael/jael\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  args: ^2.4.0\n  charcode: ^1.3.0\n  belatuk_code_buffer: ^5.1.0\n  belatuk_symbol_table: ^5.1.0\n  source_span: ^1.10.0\n  string_scanner: ^1.2.0\n  collection: ^1.17.0\n  matcher: ^0.12.10 \ndev_dependencies:\n  lints: ^6.0.0\n  test: ^1.24.0\nexecutables:\n  jaelfmt: jaelfmt"
  },
  {
    "path": "packages/jael/jael/test/render/custom_element_test.dart",
    "content": "import 'dart:math';\nimport 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('render into div', () {\n    var template = '''\n    <div>\n      <element name=\"square-root\">\n        The square root of {{ n }} is {{ sqrt(n).toInt() }}.\n      </element>\n      <square-root @n=16 />\n    </div>\n    ''';\n\n    var html = render(template, {'sqrt': sqrt});\n    print(html);\n\n    expect(\n      html,\n      '''\n<div>\n  <div>\n    The square root of 16 is 4.\n  </div>\n</div>\n    '''\n          .trim(),\n    );\n  });\n\n  test('render into explicit tag name', () {\n    var template = '''\n    <div>\n      <element name=\"square-root\">\n        The square root of {{ n }} is {{ sqrt(n).toInt() }}.\n      </element>\n      <square-root as=\"span\" @n=16 />\n    </div>\n    ''';\n\n    var html = render(template, {'sqrt': sqrt});\n    print(html);\n\n    expect(\n      html,\n      '''\n<div>\n  <span>\n    The square root of 16 is 4.\n  </span>\n</div>\n    '''\n          .trim(),\n    );\n  });\n\n  test('pass attributes', () {\n    var template = '''\n    <div>\n      <element name=\"square-root\">\n        The square root of {{ n }} is {{ sqrt(n).toInt() }}.\n      </element>\n      <square-root foo=\"bar\" baz=\"quux\" @n=16 />\n    </div>\n    ''';\n\n    var html = render(template, {'sqrt': sqrt});\n    print(html);\n\n    expect(\n      html,\n      '''\n<div>\n  <div foo=\"bar\" baz=\"quux\">\n    The square root of 16 is 4.\n  </div>\n</div>\n    '''\n          .trim(),\n    );\n  });\n\n  test('render without tag name', () {\n    var template = '''\n    <div>\n      <element name=\"square-root\">\n        The square root of {{ n }} is {{ sqrt(n).toInt() }}.\n      </element>\n      <square-root as=false @n=16 />\n    </div>\n    ''';\n\n    var html = render(template, {'sqrt': sqrt});\n    print(html);\n\n    expect(\n      html,\n      '''\n<div>\n  The square root of 16 is 4.\n      \n</div>\n    '''\n          .trim(),\n    );\n  });\n}\n\nString render(String template, [Map<String, dynamic> values = const {}]) {\n  var doc = jael.parseDocument(template, onError: (e) => throw e)!;\n  var buffer = CodeBuffer();\n  const jael.Renderer().render(doc, buffer, SymbolTable(values: values));\n  return buffer.toString();\n}\n"
  },
  {
    "path": "packages/jael/jael/test/render/dsx_test.dart",
    "content": "import 'package:jael3/jael3.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('attributes', () {\n    var doc = parseDSX('''\n    <foo bar=\"baz\" yes={no} />\n    ''')!;\n\n    var foo = doc.root as SelfClosingElement;\n    expect(foo.tagName.name, 'foo');\n    expect(foo.attributes, hasLength(2));\n    expect(foo.getAttribute('bar'), isNotNull);\n    expect(foo.getAttribute('yes'), isNotNull);\n    expect(foo.getAttribute('bar')?.value?.compute(null), 'baz');\n    expect(\n      foo\n          .getAttribute('yes')\n          ?.value\n          ?.compute(SymbolTable(values: {'no': 'maybe'})),\n      'maybe',\n    );\n  });\n\n  test('children', () {\n    var doc = parseDSX('''\n    <foo bar=\"baz\" yes={no}>\n      <bar>{24 * 3}</bar>\n    </foo>\n    ''')!;\n\n    var bar = doc.root.children.first as RegularElement;\n    expect(bar.tagName.name, 'bar');\n\n    var interpolation = bar.children.first as Interpolation;\n    expect(interpolation.expression.compute(null), 24 * 3);\n  });\n}\n\nDocument? parseDSX(String text) {\n  return parseDocument(\n    text,\n    sourceUrl: 'test.dsx',\n    asDSX: true,\n    onError: (e) => throw e,\n  );\n}\n"
  },
  {
    "path": "packages/jael/jael/test/render/render_test.dart",
    "content": "import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  test('attribute binding', () {\n    const template = '''\n<html>\n  <body>\n    <h1>Hello</h1>\n    <img ready=\"always\" data-img-src=profile['avatar'] />\n    <input name=\"csrf_token\" type=\"hidden\" value=csrf_token>\n  </body>\n</html>\n''';\n\n    var buf = CodeBuffer();\n    jael.Document? document;\n    late SymbolTable scope;\n\n    try {\n      document = jael.parseDocument(template, sourceUrl: 'test.jael');\n      scope = SymbolTable<dynamic>(\n        values: {\n          'csrf_token': 'foo',\n          'profile': {'avatar': 'thosakwe.png'},\n        },\n      );\n    } on jael.JaelError catch (e) {\n      print(e);\n      print(e.stackTrace);\n    }\n\n    expect(document, isNotNull);\n    const jael.Renderer().render(document!, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<html>\n  <body>\n    <h1>\n      Hello\n    </h1>\n    <img ready=\"always\" data-img-src=\"thosakwe.png\">\n    <input name=\"csrf_token\" type=\"hidden\" value=\"foo\">\n  </body>\n</html>\n    '''\n          .trim(),\n    );\n  });\n\n  test('interpolation', () {\n    const template = '''\n<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n  <body>\n    <h1>Pokémon</h1>\n    {{ pokemon.name }} - {{ pokemon.type }}\n    <img>\n  </body>\n</html>\n''';\n\n    var buf = CodeBuffer();\n    //jael.scan(template, sourceUrl: 'test.jael').tokens.forEach(print);\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable<dynamic>(\n      values: {'pokemon': const _Pokemon('Darkrai', 'Dark')},\n    );\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString().replaceAll('\\n', '').replaceAll(' ', '').trim(),\n      '''\n<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n  <body>\n    <h1>\n      Pokémon\n    </h1>\n    Darkrai - Dark\n    <img/>\n  </body>\n</html>\n    '''\n          .replaceAll('\\n', '')\n          .replaceAll(' ', '')\n          .trim(),\n    );\n  });\n\n  test('for loop', () {\n    const template = '''\n<html>\n  <body>\n    <h1>Pokémon</h1>\n    <ul>\n      <li for-each=starters as=\"starter\" index-as=\"idx\">#{{ idx }} {{ starter.name }} - {{ starter.type }}</li>\n    </ul>\n  </body>\n</html>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable<dynamic>(values: {'starters': _starters});\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<html>\n  <body>\n    <h1>\n      Pokémon\n    </h1>\n    <ul>\n      <li>\n        #0 Bulbasaur - Grass\n      </li>\n      <li>\n        #1 Charmander - Fire\n      </li>\n      <li>\n        #2 Squirtle - Water\n      </li>\n    </ul>\n  </body>\n</html>\n    '''\n          .trim(),\n    );\n  });\n\n  test('conditional', () {\n    const template = '''\n<html>\n  <body>\n    <h1>Conditional</h1>\n    <b if=starters.isEmpty>Empty</b>\n    <b if=starters.isNotEmpty>Not empty</b>\n  </body>\n</html>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable<dynamic>(values: {'starters': _starters});\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<html>\n  <body>\n    <h1>\n      Conditional\n    </h1>\n    <b>\n      Not empty\n    </b>\n  </body>\n</html>  \n    '''\n          .trim(),\n    );\n  });\n\n  test('declare', () {\n    const template = '''\n<div>\n <declare one=1 two=2 three=3>\n   <ul>\n    <li>{{one}}</li>\n    <li>{{two}}</li>\n    <li>{{three}}</li>\n   </ul>\n   <ul>\n    <declare three=4>\n      <li>{{one}}</li>\n      <li>{{two}}</li>\n      <li>{{three}}</li>\n    </declare>\n   </ul>\n </declare>\n</div>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable();\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<div>\n  <ul>\n    <li>\n      1\n    </li>\n    <li>\n      2\n    </li>\n    <li>\n      3\n    </li>\n  </ul>\n  <ul>\n    <li>\n      1\n    </li>\n    <li>\n      2\n    </li>\n    <li>\n      4\n    </li>\n  </ul>\n</div>\n'''\n          .trim(),\n    );\n  });\n\n  test('unescaped attr/interp', () {\n    const template = '''\n<div>\n  <img src!=\"<SCARY XSS>\" />\n  {{- \"<MORE SCARY XSS>\" }}\n</div>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable();\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString().replaceAll('\\n', '').replaceAll(' ', '').trim(),\n      '''\n<div>\n  <img src=\"<SCARY XSS>\">\n  <MORE SCARY XSS>\n</div>\n'''\n          .replaceAll('\\n', '')\n          .replaceAll(' ', '')\n          .trim(),\n    );\n  });\n\n  test('quoted attribute name', () {\n    const template = '''\n<button '(click)'=\"myEventHandler(\\$event)\"></button>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable();\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<button (click)=\"myEventHandler(\\$event)\">\n</button>\n'''\n          .trim(),\n    );\n  });\n\n  test('switch', () {\n    const template = '''\n<switch value=account.isDisabled>\n  <case value=true>\n    BAN HAMMER LOLOL\n  </case>\n  <case value=false>\n    You are in good standing.\n  </case>\n  <default>\n    Weird...\n  </default>\n</switch>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable<dynamic>(\n      values: {'account': _Account(isDisabled: true)},\n    );\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(buf.toString().trim(), 'BAN HAMMER LOLOL');\n  });\n\n  test('default', () {\n    const template = '''\n<switch value=account.isDisabled>\n  <case value=true>\n    BAN HAMMER LOLOL\n  </case>\n  <case value=false>\n    You are in good standing.\n  </case>\n  <default>\n    Weird...\n  </default>\n</switch>\n''';\n\n    var buf = CodeBuffer();\n    var document = jael.parseDocument(template, sourceUrl: 'test.jael')!;\n    var scope = SymbolTable<dynamic>(\n      values: {'account': _Account(isDisabled: null)},\n    );\n\n    const jael.Renderer().render(document, buf, scope);\n    print(buf);\n\n    expect(buf.toString().trim(), 'Weird...');\n  });\n}\n\nconst List<_Pokemon> _starters = [\n  _Pokemon('Bulbasaur', 'Grass'),\n  _Pokemon('Charmander', 'Fire'),\n  _Pokemon('Squirtle', 'Water'),\n];\n\nclass _Pokemon {\n  final String name, type;\n\n  const _Pokemon(this.name, this.type);\n}\n\nclass _Account {\n  final bool? isDisabled;\n\n  _Account({this.isDisabled});\n}\n"
  },
  {
    "path": "packages/jael/jael/test/text/common.dart",
    "content": "import 'package:matcher/matcher.dart';\nimport 'package:jael3/src/ast/token.dart';\n\nMatcher isToken(TokenType type, [String? text]) => _IsToken(type, text);\n\nclass _IsToken extends Matcher {\n  final TokenType type;\n  final String? text;\n\n  _IsToken(this.type, [this.text]);\n\n  @override\n  Description describe(Description description) {\n    if (text == null) return description.add('has type $type');\n    return description.add('has type $type and text \"$text\"');\n  }\n\n  @override\n  bool matches(item, Map matchState) {\n    return item is Token &&\n        item.type == type &&\n        (text == null || item.span.text == text);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael/test/text/scan_test.dart",
    "content": "import 'package:jael3/src/ast/token.dart';\nimport 'package:jael3/src/text/scanner.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  test('plain html', () {\n    var tokens = scan('<img src=\"foo.png\" />', sourceUrl: 'test.jael').tokens;\n    tokens.forEach(print);\n\n    expect(tokens, hasLength(7));\n    expect(tokens[0], isToken(TokenType.lt));\n    expect(tokens[1], isToken(TokenType.id, 'img'));\n    expect(tokens[2], isToken(TokenType.id, 'src'));\n    expect(tokens[3], isToken(TokenType.equals));\n    expect(tokens[4], isToken(TokenType.string, '\"foo.png\"'));\n    expect(tokens[5], isToken(TokenType.slash));\n    expect(tokens[6], isToken(TokenType.gt));\n  });\n\n  test('single quotes', () {\n    var tokens = scan('<p>It\\'s lit</p>', sourceUrl: 'test.jael').tokens;\n    tokens.forEach(print);\n\n    expect(tokens, hasLength(8));\n    expect(tokens[0], isToken(TokenType.lt));\n    expect(tokens[1], isToken(TokenType.id, 'p'));\n    expect(tokens[2], isToken(TokenType.gt));\n    expect(tokens[3], isToken(TokenType.text, 'It\\'s lit'));\n    expect(tokens[4], isToken(TokenType.lt));\n    expect(tokens[5], isToken(TokenType.slash));\n    expect(tokens[6], isToken(TokenType.id, 'p'));\n    expect(tokens[7], isToken(TokenType.gt));\n  });\n\n  test('text node', () {\n    var tokens = scan('<p>Hello\\nworld</p>', sourceUrl: 'test.jael').tokens;\n    tokens.forEach(print);\n\n    expect(tokens, hasLength(8));\n    expect(tokens[0], isToken(TokenType.lt));\n    expect(tokens[1], isToken(TokenType.id, 'p'));\n    expect(tokens[2], isToken(TokenType.gt));\n    expect(tokens[3], isToken(TokenType.text, 'Hello\\nworld'));\n    expect(tokens[4], isToken(TokenType.lt));\n    expect(tokens[5], isToken(TokenType.slash));\n    expect(tokens[6], isToken(TokenType.id, 'p'));\n    expect(tokens[7], isToken(TokenType.gt));\n  });\n\n  test('mixed', () {\n    var tokens = scan(\n      '<ul number=1 + 2>three{{four > five.six}}</ul>',\n      sourceUrl: 'test.jael',\n    ).tokens;\n    tokens.forEach(print);\n\n    expect(tokens, hasLength(20));\n    expect(tokens[0], isToken(TokenType.lt));\n    expect(tokens[1], isToken(TokenType.id, 'ul'));\n    expect(tokens[2], isToken(TokenType.id, 'number'));\n    expect(tokens[3], isToken(TokenType.equals));\n    expect(tokens[4], isToken(TokenType.number, '1'));\n    expect(tokens[5], isToken(TokenType.plus));\n    expect(tokens[6], isToken(TokenType.number, '2'));\n    expect(tokens[7], isToken(TokenType.gt));\n    expect(tokens[8], isToken(TokenType.text, 'three'));\n    expect(tokens[9], isToken(TokenType.lDoubleCurly));\n    expect(tokens[10], isToken(TokenType.id, 'four'));\n    expect(tokens[11], isToken(TokenType.gt));\n    expect(tokens[12], isToken(TokenType.id, 'five'));\n    expect(tokens[13], isToken(TokenType.dot));\n    expect(tokens[14], isToken(TokenType.id, 'six'));\n    expect(tokens[15], isToken(TokenType.rDoubleCurly));\n    expect(tokens[16], isToken(TokenType.lt));\n    expect(tokens[17], isToken(TokenType.slash));\n    expect(tokens[18], isToken(TokenType.id, 'ul'));\n    expect(tokens[19], isToken(TokenType.gt));\n  });\n\n  test('script tag interpolation', () {\n    var tokens = scan(\n      '''\n<script aria-label=\"script\">\n  window.alert('a string');\n</script>\n'''\n          .trim(),\n      sourceUrl: 'test.jael',\n    ).tokens;\n    tokens.forEach(print);\n\n    expect(tokens, hasLength(11));\n    expect(tokens[0], isToken(TokenType.lt));\n    expect(tokens[1], isToken(TokenType.id, 'script'));\n    expect(tokens[2], isToken(TokenType.id, 'aria-label'));\n    expect(tokens[3], isToken(TokenType.equals));\n    expect(tokens[4], isToken(TokenType.string));\n    expect(tokens[5], isToken(TokenType.gt));\n    expect(\n      tokens[6],\n      isToken(TokenType.text, \"\\n  window.alert('a string');\\n\"),\n    );\n    expect(tokens[7], isToken(TokenType.lt));\n    expect(tokens[8], isToken(TokenType.slash));\n    expect(tokens[9], isToken(TokenType.id, 'script'));\n    expect(tokens[10], isToken(TokenType.gt));\n  });\n}\n"
  },
  {
    "path": "packages/jael/jael.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$/angel_jael\">\n      <excludeFolder url=\"file://$MODULE_DIR$/angel_jael/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/angel_jael/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/angel_jael/build\" />\n    </content>\n    <content url=\"file://$MODULE_DIR$/build_jael\">\n      <excludeFolder url=\"file://$MODULE_DIR$/build_jael/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build_jael/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build_jael/build\" />\n    </content>\n    <content url=\"file://$MODULE_DIR$/dsx\">\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx/build\" />\n    </content>\n    <content url=\"file://$MODULE_DIR$/dsx_generator\">\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx_generator/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx_generator/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/dsx_generator/build\" />\n    </content>\n    <content url=\"file://$MODULE_DIR$/jael\">\n      <excludeFolder url=\"file://$MODULE_DIR$/jael/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/jael/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/jael/build\" />\n    </content>\n    <content url=\"file://$MODULE_DIR$/jael_preprocessor\">\n      <excludeFolder url=\"file://$MODULE_DIR$/jael_preprocessor/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/jael_preprocessor/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/jael_preprocessor/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/jael_language_server/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/jael_language_server/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jael/jael_language_server/bin/jael3_language_server.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:args/args.dart';\nimport 'package:io/ansi.dart';\nimport 'package:io/io.dart';\n//import 'package:dart_language_server/dart_language_server.dart';\nimport 'package:jael3_language_server/jael3_language_server.dart';\nimport 'package:jael3_language_server/src/protocol/language_server/server.dart';\n\nvoid main(List<String> args) async {\n  var argParser = ArgParser()\n    ..addFlag(\n      'help',\n      abbr: 'h',\n      negatable: false,\n      help: 'Print this help information.',\n    )\n    ..addOption('log-file', help: 'A path to which to write a log file.');\n\n  void printUsage() {\n    print('usage: jael_language_server [options...]\\n\\nOptions:');\n    print(argParser.usage);\n  }\n\n  try {\n    var argResults = argParser.parse(args);\n\n    if (argResults['help'] as bool) {\n      printUsage();\n      return;\n    } else {\n      var jaelServer = JaelLanguageServer();\n\n      if (argResults.wasParsed('log-file')) {\n        var f = File(argResults['log-file'] as String);\n        await f.create(recursive: true);\n\n        jaelServer.logger.onRecord.listen((rec) async {\n          var sink = f.openWrite(mode: FileMode.append);\n          sink.writeln(rec);\n          if (rec.error != null) sink.writeln(rec.error);\n          if (rec.stackTrace != null) sink.writeln(rec.stackTrace);\n          await sink.close();\n        });\n      } else {\n        jaelServer.logger.onRecord.listen((rec) async {\n          var sink = stderr;\n          sink.writeln(rec);\n          if (rec.error != null) sink.writeln(rec.error);\n          if (rec.stackTrace != null) sink.writeln(rec.stackTrace);\n        });\n      }\n\n      var spec = ZoneSpecification(\n        handleUncaughtError: (self, parent, zone, error, stackTrace) {\n          jaelServer.logger.severe('Uncaught', error, stackTrace);\n        },\n        print: (self, parent, zone, line) {\n          jaelServer.logger.info(line);\n        },\n      );\n      var zone = Zone.current.fork(specification: spec);\n      await zone.run(() async {\n        var stdio = StdIOLanguageServer.start(jaelServer);\n        await stdio.onDone;\n      });\n    }\n  } on ArgParserException catch (e) {\n    print('${red.wrap('error')}: ${e.message}\\n');\n    printUsage();\n    exitCode = ExitCode.usage.code;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/jael3_language_server.dart",
    "content": "export 'src/server.dart';\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/analyzer.dart",
    "content": "import 'package:jael3/jael3.dart';\nimport 'package:logging/logging.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'object.dart';\n\nclass Analyzer extends Parser {\n  final Logger logger;\n  Analyzer(super.scanner, this.logger);\n\n  //@override\n  //final errors = <JaelError>[];\n\n  SymbolTable<JaelObject>? _scope = SymbolTable<JaelObject>();\n  var allDefinitions = <Variable<JaelObject>>[];\n\n  SymbolTable<JaelObject>? get parentScope =>\n      _scope!.isRoot ? _scope : _scope!.parent;\n\n  SymbolTable<JaelObject>? get scope => _scope;\n\n  bool ensureAttributeIsPresent(Element element, String name) {\n    if (element.getAttribute(name)?.value == null) {\n      addError(\n        JaelError(\n          JaelErrorSeverity.error,\n          'Missing required attribute `$name`.',\n          element.span,\n        ),\n      );\n      return false;\n    }\n    return true;\n  }\n\n  void addError(JaelError e) {\n    errors.add(e);\n    logger.severe(e.message, e.span.highlight());\n  }\n\n  bool ensureAttributeIsConstantString(Element element, String name) {\n    var a = element.getAttribute(name);\n    if (a?.value is! StringLiteral || a?.value == null) {\n      var e = JaelError(\n        JaelErrorSeverity.warning,\n        '`$name` attribute should be a constant string literal.',\n        a?.span ?? element.tagName.span,\n      );\n      addError(e);\n      return false;\n    }\n\n    return true;\n  }\n\n  @override\n  Element? parseElement() {\n    try {\n      _scope = _scope!.createChild();\n      var element = super.parseElement();\n      if (element == null) return null;\n\n      // Check if any custom element exists.\n      _scope!\n          .resolve(element.tagName.name)\n          ?.value\n          ?.usages\n          .add(SymbolUsage(SymbolUsageType.read, element.span));\n\n      // Validate attrs\n      var forEach = element.getAttribute('for-each');\n      if (forEach != null) {\n        var asAttr = element.getAttribute('as');\n        if (asAttr != null) {\n          if (ensureAttributeIsConstantString(element, 'as')) {\n            var asName = asAttr.string!.value;\n            _scope!.create(\n              asName,\n              value: JaelVariable(asName, asAttr.span),\n              constant: true,\n            );\n          }\n        }\n\n        if (forEach.value != null) {\n          addError(\n            JaelError(\n              JaelErrorSeverity.error,\n              'Missing value for `for-each` directive.',\n              forEach.span,\n            ),\n          );\n        }\n      }\n\n      var iff = element.getAttribute('if');\n      if (iff != null) {\n        if (iff.value != null) {\n          addError(\n            JaelError(\n              JaelErrorSeverity.error,\n              'Missing value for `iff` directive.',\n              iff.span,\n            ),\n          );\n        }\n      }\n\n      // Validate the tag itself\n      if (element is RegularElement) {\n        if (element.tagName.name == 'block') {\n          ensureAttributeIsConstantString(element, 'name');\n          //logger.info('Found <block> at ${element.span.start.toolString}');\n        } else if (element.tagName.name == 'case') {\n          ensureAttributeIsPresent(element, 'value');\n          //logger.info('Found <case> at ${element.span.start.toolString}');\n        } else if (element.tagName.name == 'declare') {\n          if (element.attributes.isEmpty) {\n            addError(\n              JaelError(\n                JaelErrorSeverity.warning,\n                '`declare` directive does not define any new symbols.',\n                element.tagName.span,\n              ),\n            );\n          } else {\n            for (var attr in element.attributes) {\n              _scope!.create(\n                attr.name,\n                value: JaelVariable(attr.name, attr.span),\n              );\n            }\n          }\n        } else if (element.tagName.name == 'element') {\n          if (ensureAttributeIsConstantString(element, 'name')) {\n            var nameCtx = element.getAttribute('name')!.value as StringLiteral;\n            var name = nameCtx.value;\n            //logger.info(\n            //    'Found custom element $name at ${element.span.start.toolString}');\n            try {\n              var symbol = parentScope!.create(\n                name,\n                value: JaelCustomElement(name, element.tagName.span),\n                constant: true,\n              );\n              allDefinitions.add(symbol);\n            } on StateError catch (e) {\n              addError(\n                JaelError(\n                  JaelErrorSeverity.error,\n                  e.message,\n                  element.tagName.span,\n                ),\n              );\n            }\n          }\n        } else if (element.tagName.name == 'extend') {\n          ensureAttributeIsConstantString(element, 'src');\n          //logger.info('Found <extend> at ${element.span.start.toolString}');\n        }\n      } else if (element is SelfClosingElement) {\n        if (element.tagName.name == 'include') {\n          //logger.info('Found <include> at ${element.span.start.toolString}');\n          ensureAttributeIsConstantString(element, 'src');\n        }\n      }\n\n      return element;\n    } finally {\n      _scope = _scope!.parent;\n    }\n  }\n\n  @override\n  Expression? parseExpression(int precedence) {\n    var expr = super.parseExpression(precedence);\n    if (expr == null) return null;\n\n    if (expr is Identifier) {\n      var ref = _scope!.resolve(expr.name);\n      ref?.value?.usages.add(SymbolUsage(SymbolUsageType.read, expr.span));\n    }\n\n    return expr;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/object.dart",
    "content": "import 'dart:collection';\n\nimport 'package:source_span/source_span.dart';\n\nabstract class JaelObject {\n  final FileSpan span;\n  final usages = <SymbolUsage>[];\n  String get name;\n\n  JaelObject(this.span);\n}\n\nclass JaelCustomElement extends JaelObject {\n  @override\n  final String name;\n  final attributes = SplayTreeSet<String>();\n\n  JaelCustomElement(this.name, FileSpan span) : super(span);\n}\n\nclass JaelVariable extends JaelObject {\n  @override\n  final String name;\n  JaelVariable(this.name, FileSpan span) : super(span);\n}\n\nclass SymbolUsage {\n  final SymbolUsageType type;\n  final FileSpan span;\n\n  SymbolUsage(this.type, this.span);\n}\n\nenum SymbolUsageType { definition, read }\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/protocol/language_server/interface.dart",
    "content": "import 'dart:async';\n\nimport 'package:json_rpc_2/json_rpc_2.dart';\n\nimport 'messages.dart';\n\nabstract class LanguageServer {\n  final _onDone = Completer<void>();\n  Future<void> get onDone => _onDone.future;\n\n  Future<void> shutdown() async {}\n  void exit() {\n    _onDone.complete();\n  }\n\n  Future<ServerCapabilities> initialize(\n    int? clientPid,\n    String? rootUri,\n    ClientCapabilities clientCapabilities,\n    String? trace,\n  ) async => ServerCapabilities((b) => b);\n  void initialized() {}\n  void textDocumentDidOpen(TextDocumentItem document) {}\n  void textDocumentDidChange(\n    VersionedTextDocumentIdentifier documentId,\n    List<TextDocumentContentChangeEvent> changes,\n  ) {}\n  void textDocumentDidClose(TextDocumentIdentifier documentId) {}\n  Future<CompletionList> textDocumentCompletion(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async => CompletionList((b) => b);\n  Future<Location?> textDocumentDefinition(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async => null;\n  Future<List<Location>> textDocumentReferences(\n    TextDocumentIdentifier documentId,\n    Position position,\n    ReferenceContext context,\n  ) async => [];\n  Future<List<Location>> textDocumentImplementation(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async => [];\n  Future<List<DocumentHighlight>> textDocumentHighlight(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async => [];\n  Future<List<SymbolInformation>> textDocumentSymbols(\n    TextDocumentIdentifier documentId,\n  ) async => [];\n  Future<List<SymbolInformation>> workspaceSymbol(String? query) async => [];\n  Future<dynamic> textDocumentHover(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async => null;\n  Future<List<dynamic /*Command|CodeAction*/>> textDocumentCodeAction(\n    TextDocumentIdentifier documentId,\n    Range range,\n    CodeActionContext context,\n  ) async => [];\n  Future<void> workspaceExecuteCommand(\n    String? command,\n    List<dynamic>? arguments,\n  ) async {}\n  Future<WorkspaceEdit?> textDocumentRename(\n    TextDocumentIdentifier documentId,\n    Position position,\n    String? newName,\n  ) async => null;\n  Stream<Diagnostics> get diagnostics => Stream.empty();\n  Stream<ApplyWorkspaceEditParams> get workspaceEdits => Stream.empty();\n  Stream<ShowMessageParams>? get showMessages => Stream.empty();\n  Stream<ShowMessageParams> get logMessages => Stream.empty();\n\n  void setupExtraMethods(Peer peer) {}\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/protocol/language_server/messages.dart",
    "content": "class ApplyWorkspaceEditParams {\n  ApplyWorkspaceEditParams._(this.edit, this.label);\n\n  factory ApplyWorkspaceEditParams(\n    void Function(ApplyWorkspaceEditParams$Builder) init,\n  ) {\n    final b = ApplyWorkspaceEditParams$Builder._();\n    init(b);\n    return ApplyWorkspaceEditParams._(b.edit, b.label);\n  }\n\n  factory ApplyWorkspaceEditParams.fromJson(Map params) =>\n      ApplyWorkspaceEditParams._(\n        params.containsKey('edit') && params['edit'] != null\n            ? WorkspaceEdit.fromJson((params['edit'] as Map))\n            : null,\n        params.containsKey('label') && params['label'] != null\n            ? (params['label'] as String?)\n            : null,\n      );\n\n  final WorkspaceEdit? edit;\n\n  final String? label;\n\n  Map toJson() => {'edit': edit?.toJson(), 'label': label};\n  @override\n  int get hashCode {\n    var hash = 711903695;\n    hash = _hashCombine(hash, _deepHashCode(edit));\n    hash = _hashCombine(hash, _deepHashCode(label));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ApplyWorkspaceEditParams &&\n      edit == other.edit &&\n      label == other.label;\n}\n\nclass ApplyWorkspaceEditParams$Builder {\n  ApplyWorkspaceEditParams$Builder._();\n\n  WorkspaceEdit? edit;\n\n  String? label;\n}\n\nclass ClientCapabilities {\n  ClientCapabilities._(this.textDocument, this.workspace);\n\n  factory ClientCapabilities(void Function(ClientCapabilities$Builder) init) {\n    final b = ClientCapabilities$Builder._();\n    init(b);\n    return ClientCapabilities._(b.textDocument, b.workspace);\n  }\n\n  factory ClientCapabilities.fromJson(Map params) => ClientCapabilities._(\n    params.containsKey('textDocument') && params['textDocument'] != null\n        ? TextDocumentClientCapabilities.fromJson(\n            (params['textDocument'] as Map),\n          )\n        : null,\n    params.containsKey('workspace') && params['workspace'] != null\n        ? WorkspaceClientCapabilities.fromJson((params['workspace'] as Map))\n        : null,\n  );\n\n  final TextDocumentClientCapabilities? textDocument;\n\n  final WorkspaceClientCapabilities? workspace;\n\n  Map toJson() => {\n    'textDocument': textDocument?.toJson(),\n    'workspace': workspace?.toJson(),\n  };\n  @override\n  int get hashCode {\n    var hash = 410602613;\n    hash = _hashCombine(hash, _deepHashCode(textDocument));\n    hash = _hashCombine(hash, _deepHashCode(workspace));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ClientCapabilities &&\n      textDocument == other.textDocument &&\n      workspace == other.workspace;\n}\n\nclass ClientCapabilities$Builder {\n  ClientCapabilities$Builder._();\n\n  TextDocumentClientCapabilities? textDocument;\n\n  WorkspaceClientCapabilities? workspace;\n}\n\nclass CodeAction {\n  CodeAction._(\n    this.command,\n    this.diagnostics,\n    this.edit,\n    this.kind,\n    this.title,\n  );\n\n  factory CodeAction(void Function(CodeAction$Builder) init) {\n    final b = CodeAction$Builder._();\n    init(b);\n    return CodeAction._(b.command, b.diagnostics, b.edit, b.kind, b.title);\n  }\n\n  factory CodeAction.fromJson(Map params) => CodeAction._(\n    params.containsKey('command') && params['command'] != null\n        ? Command.fromJson((params['command'] as Map))\n        : null,\n    params.containsKey('diagnostics') && params['diagnostics'] != null\n        ? (params['diagnostics'] as List)\n              .map((v) => Diagnostic.fromJson((v as Map)))\n              .toList()\n        : null,\n    params.containsKey('edit') && params['edit'] != null\n        ? WorkspaceEdit.fromJson((params['edit'] as Map))\n        : null,\n    params.containsKey('kind') && params['kind'] != null\n        ? (params['kind'] as String?)\n        : null,\n    params.containsKey('title') && params['title'] != null\n        ? (params['title'] as String?)\n        : null,\n  );\n\n  final Command? command;\n\n  final List<Diagnostic>? diagnostics;\n\n  final WorkspaceEdit? edit;\n\n  final String? kind;\n\n  final String? title;\n\n  Map toJson() => {\n    'command': command?.toJson(),\n    'diagnostics': diagnostics?.map((v) => v.toJson()).toList(),\n    'edit': edit?.toJson(),\n    'kind': kind,\n    'title': title,\n  };\n  @override\n  int get hashCode {\n    var hash = 817881006;\n    hash = _hashCombine(hash, _deepHashCode(command));\n    hash = _hashCombine(hash, _deepHashCode(diagnostics));\n    hash = _hashCombine(hash, _deepHashCode(edit));\n    hash = _hashCombine(hash, _deepHashCode(kind));\n    hash = _hashCombine(hash, _deepHashCode(title));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeAction &&\n      command == other.command &&\n      _deepEquals(diagnostics, other.diagnostics) &&\n      edit == other.edit &&\n      kind == other.kind &&\n      title == other.title;\n}\n\nclass CodeAction$Builder {\n  CodeAction$Builder._();\n\n  Command? command;\n\n  List<Diagnostic>? diagnostics;\n\n  WorkspaceEdit? edit;\n\n  String? kind;\n\n  String? title;\n}\n\nclass CodeActionCapabilities {\n  CodeActionCapabilities._(\n    this.codeActionLiteralSupport,\n    this.dynamicRegistration,\n  );\n\n  factory CodeActionCapabilities(\n    void Function(CodeActionCapabilities$Builder) init,\n  ) {\n    final b = CodeActionCapabilities$Builder._();\n    init(b);\n    return CodeActionCapabilities._(\n      b.codeActionLiteralSupport,\n      b.dynamicRegistration,\n    );\n  }\n\n  factory CodeActionCapabilities.fromJson(Map params) =>\n      CodeActionCapabilities._(\n        params.containsKey('codeActionLiteralSupport') &&\n                params['codeActionLiteralSupport'] != null\n            ? CodeActionLiteralSupport.fromJson(\n                (params['codeActionLiteralSupport'] as Map),\n              )\n            : null,\n        params.containsKey('dynamicRegistration') &&\n                params['dynamicRegistration'] != null\n            ? (params['dynamicRegistration'] as bool?)\n            : null,\n      );\n\n  final CodeActionLiteralSupport? codeActionLiteralSupport;\n\n  final bool? dynamicRegistration;\n\n  Map toJson() => {\n    'codeActionLiteralSupport': codeActionLiteralSupport?.toJson(),\n    'dynamicRegistration': dynamicRegistration,\n  };\n  @override\n  int get hashCode {\n    var hash = 857718763;\n    hash = _hashCombine(hash, _deepHashCode(codeActionLiteralSupport));\n    hash = _hashCombine(hash, _deepHashCode(dynamicRegistration));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeActionCapabilities &&\n      codeActionLiteralSupport == other.codeActionLiteralSupport &&\n      dynamicRegistration == other.dynamicRegistration;\n}\n\nclass CodeActionCapabilities$Builder {\n  CodeActionCapabilities$Builder._();\n\n  CodeActionLiteralSupport? codeActionLiteralSupport;\n\n  bool? dynamicRegistration;\n}\n\nclass CodeActionContext {\n  CodeActionContext._(this.diagnostics);\n\n  factory CodeActionContext(void Function(CodeActionContext$Builder) init) {\n    final b = CodeActionContext$Builder._();\n    init(b);\n    return CodeActionContext._(b.diagnostics);\n  }\n\n  factory CodeActionContext.fromJson(Map params) => CodeActionContext._(\n    params.containsKey('diagnostics') && params['diagnostics'] != null\n        ? (params['diagnostics'] as List)\n              .map((v) => Diagnostic.fromJson((v as Map)))\n              .toList()\n        : null,\n  );\n\n  final List<Diagnostic>? diagnostics;\n\n  Map toJson() => {'diagnostics': diagnostics?.map((v) => v.toJson()).toList()};\n  @override\n  int get hashCode {\n    var hash = 698635161;\n    hash = _hashCombine(hash, _deepHashCode(diagnostics));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeActionContext && _deepEquals(diagnostics, other.diagnostics);\n}\n\nclass CodeActionContext$Builder {\n  CodeActionContext$Builder._();\n\n  List<Diagnostic>? diagnostics;\n}\n\nclass CodeActionKinds {\n  CodeActionKinds._(this.valueSet);\n\n  factory CodeActionKinds(void Function(CodeActionKinds$Builder) init) {\n    final b = CodeActionKinds$Builder._();\n    init(b);\n    return CodeActionKinds._(b.valueSet);\n  }\n\n  factory CodeActionKinds.fromJson(Map params) => CodeActionKinds._(\n    params.containsKey('valueSet') && params['valueSet'] != null\n        ? (params['valueSet'] as List).cast<String>()\n        : null,\n  );\n\n  final List<String>? valueSet;\n\n  Map toJson() => {'valueSet': valueSet};\n  @override\n  int get hashCode {\n    var hash = 274472753;\n    hash = _hashCombine(hash, _deepHashCode(valueSet));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeActionKinds && _deepEquals(valueSet, other.valueSet);\n}\n\nclass CodeActionKinds$Builder {\n  CodeActionKinds$Builder._();\n\n  List<String>? valueSet;\n}\n\nclass CodeActionLiteralSupport {\n  CodeActionLiteralSupport._(this.codeActionKind);\n\n  factory CodeActionLiteralSupport(\n    void Function(CodeActionLiteralSupport$Builder) init,\n  ) {\n    final b = CodeActionLiteralSupport$Builder._();\n    init(b);\n    return CodeActionLiteralSupport._(b.codeActionKind);\n  }\n\n  factory CodeActionLiteralSupport.fromJson(Map params) =>\n      CodeActionLiteralSupport._(\n        params.containsKey('codeActionKind') && params['codeActionKind'] != null\n            ? CodeActionKinds.fromJson((params['codeActionKind'] as Map))\n            : null,\n      );\n\n  final CodeActionKinds? codeActionKind;\n\n  Map toJson() => {'codeActionKind': codeActionKind?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 9179648;\n    hash = _hashCombine(hash, _deepHashCode(codeActionKind));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeActionLiteralSupport &&\n      codeActionKind == other.codeActionKind;\n}\n\nclass CodeActionLiteralSupport$Builder {\n  CodeActionLiteralSupport$Builder._();\n\n  CodeActionKinds? codeActionKind;\n}\n\nclass CodeLensOptions {\n  CodeLensOptions._(this.resolveProvider);\n\n  factory CodeLensOptions(void Function(CodeLensOptions$Builder) init) {\n    final b = CodeLensOptions$Builder._();\n    init(b);\n    return CodeLensOptions._(b.resolveProvider);\n  }\n\n  factory CodeLensOptions.fromJson(Map params) => CodeLensOptions._(\n    params.containsKey('resolveProvider') && params['resolveProvider'] != null\n        ? (params['resolveProvider'] as bool?)\n        : null,\n  );\n\n  final bool? resolveProvider;\n\n  Map toJson() => {'resolveProvider': resolveProvider};\n  @override\n  int get hashCode {\n    var hash = 875601242;\n    hash = _hashCombine(hash, _deepHashCode(resolveProvider));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CodeLensOptions && resolveProvider == other.resolveProvider;\n}\n\nclass CodeLensOptions$Builder {\n  CodeLensOptions$Builder._();\n\n  bool? resolveProvider;\n}\n\nclass Command {\n  Command._(this.arguments, this.command, this.title);\n\n  factory Command(void Function(Command$Builder) init) {\n    final b = Command$Builder._();\n    init(b);\n    return Command._(b.arguments, b.command, b.title);\n  }\n\n  factory Command.fromJson(Map params) => Command._(\n    params.containsKey('arguments') && params['arguments'] != null\n        ? (params['arguments'] as List).cast<dynamic>()\n        : null,\n    params.containsKey('command') && params['command'] != null\n        ? (params['command'] as String?)\n        : null,\n    params.containsKey('title') && params['title'] != null\n        ? (params['title'] as String?)\n        : null,\n  );\n\n  final List<dynamic>? arguments;\n\n  final String? command;\n\n  final String? title;\n\n  Map toJson() => {'arguments': arguments, 'command': command, 'title': title};\n  @override\n  int get hashCode {\n    var hash = 306969625;\n    hash = _hashCombine(hash, _deepHashCode(arguments));\n    hash = _hashCombine(hash, _deepHashCode(command));\n    hash = _hashCombine(hash, _deepHashCode(title));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Command &&\n      _deepEquals(arguments, other.arguments) &&\n      command == other.command &&\n      title == other.title;\n}\n\nclass Command$Builder {\n  Command$Builder._();\n\n  List<dynamic>? arguments;\n\n  String? command;\n\n  String? title;\n}\n\nclass CompletionCapabilities {\n  CompletionCapabilities._(this.completionItem, this.dynamicRegistration);\n\n  factory CompletionCapabilities(\n    void Function(CompletionCapabilities$Builder) init,\n  ) {\n    final b = CompletionCapabilities$Builder._();\n    init(b);\n    return CompletionCapabilities._(b.completionItem, b.dynamicRegistration);\n  }\n\n  factory CompletionCapabilities.fromJson(Map params) =>\n      CompletionCapabilities._(\n        params.containsKey('completionItem') && params['completionItem'] != null\n            ? CompletionItemCapabilities.fromJson(\n                (params['completionItem'] as Map),\n              )\n            : null,\n        params.containsKey('dynamicRegistration') &&\n                params['dynamicRegistration'] != null\n            ? (params['dynamicRegistration'] as bool?)\n            : null,\n      );\n\n  final CompletionItemCapabilities? completionItem;\n\n  final bool? dynamicRegistration;\n\n  Map toJson() => {\n    'completionItem': completionItem?.toJson(),\n    'dynamicRegistration': dynamicRegistration,\n  };\n  @override\n  int get hashCode {\n    var hash = 490073846;\n    hash = _hashCombine(hash, _deepHashCode(completionItem));\n    hash = _hashCombine(hash, _deepHashCode(dynamicRegistration));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CompletionCapabilities &&\n      completionItem == other.completionItem &&\n      dynamicRegistration == other.dynamicRegistration;\n}\n\nclass CompletionCapabilities$Builder {\n  CompletionCapabilities$Builder._();\n\n  CompletionItemCapabilities? completionItem;\n\n  bool? dynamicRegistration;\n}\n\nclass CompletionItem {\n  CompletionItem._(\n    this.additionalTextEdits,\n    this.command,\n    this.data,\n    this.detail,\n    this.documentation,\n    this.filterText,\n    this.insertText,\n    this.insertTextFormat,\n    this.kind,\n    this.label,\n    this.sortText,\n    this.textEdit,\n  );\n\n  factory CompletionItem(void Function(CompletionItem$Builder) init) {\n    final b = CompletionItem$Builder._();\n    init(b);\n    return CompletionItem._(\n      b.additionalTextEdits,\n      b.command,\n      b.data,\n      b.detail,\n      b.documentation,\n      b.filterText,\n      b.insertText,\n      b.insertTextFormat,\n      b.kind,\n      b.label,\n      b.sortText,\n      b.textEdit,\n    );\n  }\n\n  factory CompletionItem.fromJson(Map params) => CompletionItem._(\n    params.containsKey('additionalTextEdits') &&\n            params['additionalTextEdits'] != null\n        ? (params['additionalTextEdits'] as List)\n              .map((v) => TextEdit.fromJson((v as Map)))\n              .toList()\n        : null,\n    params.containsKey('command') && params['command'] != null\n        ? Command.fromJson((params['command'] as Map))\n        : null,\n    params.containsKey('data') && params['data'] != null\n        ? (params['data'] as dynamic)\n        : null,\n    params.containsKey('detail') && params['detail'] != null\n        ? (params['detail'] as String?)\n        : null,\n    params.containsKey('documentation') && params['documentation'] != null\n        ? (params['documentation'] as String?)\n        : null,\n    params.containsKey('filterText') && params['filterText'] != null\n        ? (params['filterText'] as String?)\n        : null,\n    params.containsKey('insertText') && params['insertText'] != null\n        ? (params['insertText'] as String?)\n        : null,\n    params.containsKey('insertTextFormat') && params['insertTextFormat'] != null\n        ? InsertTextFormat.fromJson((params['insertTextFormat'] as int?))\n        : null,\n    params.containsKey('kind') && params['kind'] != null\n        ? CompletionItemKind.fromJson((params['kind'] as int?))\n        : null,\n    params.containsKey('label') && params['label'] != null\n        ? (params['label'] as String?)\n        : null,\n    params.containsKey('sortText') && params['sortText'] != null\n        ? (params['sortText'] as String?)\n        : null,\n    params.containsKey('textEdit') && params['textEdit'] != null\n        ? TextEdit.fromJson((params['textEdit'] as Map))\n        : null,\n  );\n\n  final List<TextEdit>? additionalTextEdits;\n\n  final Command? command;\n\n  final dynamic data;\n\n  final String? detail;\n\n  final String? documentation;\n\n  final String? filterText;\n\n  final String? insertText;\n\n  final InsertTextFormat? insertTextFormat;\n\n  final CompletionItemKind? kind;\n\n  final String? label;\n\n  final String? sortText;\n\n  final TextEdit? textEdit;\n\n  Map toJson() => {\n    'additionalTextEdits': additionalTextEdits?.map((v) => v.toJson()).toList(),\n    'command': command?.toJson(),\n    'data': data,\n    'detail': detail,\n    'documentation': documentation,\n    'filterText': filterText,\n    'insertText': insertText,\n    'insertTextFormat': insertTextFormat?.toJson(),\n    'kind': kind?.toJson(),\n    'label': label,\n    'sortText': sortText,\n    'textEdit': textEdit?.toJson(),\n  };\n  @override\n  int get hashCode {\n    var hash = 546046223;\n    hash = _hashCombine(hash, _deepHashCode(additionalTextEdits));\n    hash = _hashCombine(hash, _deepHashCode(command));\n    hash = _hashCombine(hash, _deepHashCode(data));\n    hash = _hashCombine(hash, _deepHashCode(detail));\n    hash = _hashCombine(hash, _deepHashCode(documentation));\n    hash = _hashCombine(hash, _deepHashCode(filterText));\n    hash = _hashCombine(hash, _deepHashCode(insertText));\n    hash = _hashCombine(hash, _deepHashCode(insertTextFormat));\n    hash = _hashCombine(hash, _deepHashCode(kind));\n    hash = _hashCombine(hash, _deepHashCode(label));\n    hash = _hashCombine(hash, _deepHashCode(sortText));\n    hash = _hashCombine(hash, _deepHashCode(textEdit));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CompletionItem &&\n      _deepEquals(additionalTextEdits, other.additionalTextEdits) &&\n      command == other.command &&\n      data == other.data &&\n      detail == other.detail &&\n      documentation == other.documentation &&\n      filterText == other.filterText &&\n      insertText == other.insertText &&\n      insertTextFormat == other.insertTextFormat &&\n      kind == other.kind &&\n      label == other.label &&\n      sortText == other.sortText &&\n      textEdit == other.textEdit;\n}\n\nclass CompletionItem$Builder {\n  CompletionItem$Builder._();\n\n  List<TextEdit>? additionalTextEdits;\n\n  Command? command;\n\n  dynamic data;\n\n  String? detail;\n\n  String? documentation;\n\n  String? filterText;\n\n  String? insertText;\n\n  InsertTextFormat? insertTextFormat;\n\n  CompletionItemKind? kind;\n\n  String? label;\n\n  String? sortText;\n\n  TextEdit? textEdit;\n}\n\nclass CompletionItemCapabilities {\n  CompletionItemCapabilities._(this.snippetSupport);\n\n  factory CompletionItemCapabilities(\n    void Function(CompletionItemCapabilities$Builder) init,\n  ) {\n    final b = CompletionItemCapabilities$Builder._();\n    init(b);\n    return CompletionItemCapabilities._(b.snippetSupport);\n  }\n\n  factory CompletionItemCapabilities.fromJson(Map params) =>\n      CompletionItemCapabilities._(\n        params.containsKey('snippetSupport') && params['snippetSupport'] != null\n            ? (params['snippetSupport'] as bool?)\n            : null,\n      );\n\n  final bool? snippetSupport;\n\n  Map toJson() => {'snippetSupport': snippetSupport};\n  @override\n  int get hashCode {\n    var hash = 402194464;\n    hash = _hashCombine(hash, _deepHashCode(snippetSupport));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CompletionItemCapabilities &&\n      snippetSupport == other.snippetSupport;\n}\n\nclass CompletionItemCapabilities$Builder {\n  CompletionItemCapabilities$Builder._();\n\n  bool? snippetSupport;\n}\n\nclass CompletionItemKind {\n  factory CompletionItemKind.fromJson(int? value) {\n    const values = {\n      7: CompletionItemKind.classKind,\n      16: CompletionItemKind.color,\n      4: CompletionItemKind.constructor,\n      13: CompletionItemKind.enumKind,\n      5: CompletionItemKind.field,\n      17: CompletionItemKind.file,\n      3: CompletionItemKind.function,\n      8: CompletionItemKind.interface,\n      14: CompletionItemKind.keyword,\n      2: CompletionItemKind.method,\n      9: CompletionItemKind.module,\n      10: CompletionItemKind.property,\n      18: CompletionItemKind.reference,\n      15: CompletionItemKind.snippet,\n      1: CompletionItemKind.text,\n      11: CompletionItemKind.unit,\n      12: CompletionItemKind.value,\n      6: CompletionItemKind.variable,\n    };\n    return values[value!]!;\n  }\n\n  const CompletionItemKind._(this._value);\n\n  static const classKind = CompletionItemKind._(7);\n\n  static const color = CompletionItemKind._(16);\n\n  static const constructor = CompletionItemKind._(4);\n\n  static const enumKind = CompletionItemKind._(13);\n\n  static const field = CompletionItemKind._(5);\n\n  static const file = CompletionItemKind._(17);\n\n  static const function = CompletionItemKind._(3);\n\n  static const interface = CompletionItemKind._(8);\n\n  static const keyword = CompletionItemKind._(14);\n\n  static const method = CompletionItemKind._(2);\n\n  static const module = CompletionItemKind._(9);\n\n  static const property = CompletionItemKind._(10);\n\n  static const reference = CompletionItemKind._(18);\n\n  static const snippet = CompletionItemKind._(15);\n\n  static const text = CompletionItemKind._(1);\n\n  static const unit = CompletionItemKind._(11);\n\n  static const value = CompletionItemKind._(12);\n\n  static const variable = CompletionItemKind._(6);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass CompletionList {\n  CompletionList._(this.isIncomplete, this.items);\n\n  factory CompletionList(void Function(CompletionList$Builder) init) {\n    final b = CompletionList$Builder._();\n    init(b);\n    return CompletionList._(b.isIncomplete, b.items);\n  }\n\n  factory CompletionList.fromJson(Map params) => CompletionList._(\n    params.containsKey('isIncomplete') && params['isIncomplete'] != null\n        ? (params['isIncomplete'] as bool?)\n        : null,\n    params.containsKey('items') && params['items'] != null\n        ? (params['items'] as List)\n              .map((v) => CompletionItem.fromJson((v as Map)))\n              .toList()\n        : null,\n  );\n\n  final bool? isIncomplete;\n\n  final List<CompletionItem?>? items;\n\n  Map toJson() => {\n    'isIncomplete': isIncomplete,\n    'items': items?.map((v) => v?.toJson()).toList(),\n  };\n  @override\n  int get hashCode {\n    var hash = 475661732;\n    hash = _hashCombine(hash, _deepHashCode(isIncomplete));\n    hash = _hashCombine(hash, _deepHashCode(items));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CompletionList &&\n      isIncomplete == other.isIncomplete &&\n      _deepEquals(items, other.items);\n}\n\nclass CompletionList$Builder {\n  CompletionList$Builder._();\n\n  bool? isIncomplete;\n\n  List<CompletionItem?>? items;\n}\n\nclass CompletionOptions {\n  CompletionOptions._(this.resolveProvider, this.triggerCharacters);\n\n  factory CompletionOptions(void Function(CompletionOptions$Builder) init) {\n    final b = CompletionOptions$Builder._();\n    init(b);\n    return CompletionOptions._(b.resolveProvider, b.triggerCharacters);\n  }\n\n  factory CompletionOptions.fromJson(Map params) => CompletionOptions._(\n    params.containsKey('resolveProvider') && params['resolveProvider'] != null\n        ? (params['resolveProvider'] as bool?)\n        : null,\n    params.containsKey('triggerCharacters') &&\n            params['triggerCharacters'] != null\n        ? (params['triggerCharacters'] as List).cast<String>()\n        : null,\n  );\n\n  final bool? resolveProvider;\n\n  final List<String>? triggerCharacters;\n\n  Map toJson() => {\n    'resolveProvider': resolveProvider,\n    'triggerCharacters': triggerCharacters,\n  };\n  @override\n  int get hashCode {\n    var hash = 251829316;\n    hash = _hashCombine(hash, _deepHashCode(resolveProvider));\n    hash = _hashCombine(hash, _deepHashCode(triggerCharacters));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is CompletionOptions &&\n      resolveProvider == other.resolveProvider &&\n      _deepEquals(triggerCharacters, other.triggerCharacters);\n}\n\nclass CompletionOptions$Builder {\n  CompletionOptions$Builder._();\n\n  bool? resolveProvider;\n\n  List<String>? triggerCharacters;\n}\n\nclass Diagnostic {\n  Diagnostic._(this.code, this.message, this.range, this.severity, this.source);\n\n  factory Diagnostic(void Function(Diagnostic$Builder) init) {\n    final b = Diagnostic$Builder._();\n    init(b);\n    return Diagnostic._(b.code, b.message, b.range, b.severity, b.source);\n  }\n\n  factory Diagnostic.fromJson(Map params) => Diagnostic._(\n    params.containsKey('code') && params['code'] != null\n        ? (params['code'] as dynamic)\n        : null,\n    params.containsKey('message') && params['message'] != null\n        ? (params['message'] as String?)\n        : null,\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n    params.containsKey('severity') && params['severity'] != null\n        ? (params['severity'] as int?)\n        : null,\n    params.containsKey('source') && params['source'] != null\n        ? (params['source'] as String?)\n        : null,\n  );\n\n  final dynamic code;\n\n  final String? message;\n\n  final Range? range;\n\n  final int? severity;\n\n  final String? source;\n\n  Map toJson() => {\n    'code': code,\n    'message': message,\n    'range': range?.toJson(),\n    'severity': severity,\n    'source': source,\n  };\n  @override\n  int get hashCode {\n    var hash = 304962763;\n    hash = _hashCombine(hash, _deepHashCode(code));\n    hash = _hashCombine(hash, _deepHashCode(message));\n    hash = _hashCombine(hash, _deepHashCode(range));\n    hash = _hashCombine(hash, _deepHashCode(severity));\n    hash = _hashCombine(hash, _deepHashCode(source));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Diagnostic &&\n      code == other.code &&\n      message == other.message &&\n      range == other.range &&\n      severity == other.severity &&\n      source == other.source;\n}\n\nclass Diagnostic$Builder {\n  Diagnostic$Builder._();\n\n  dynamic code;\n\n  String? message;\n\n  Range? range;\n\n  int? severity;\n\n  String? source;\n}\n\nclass Diagnostics {\n  Diagnostics._(this.diagnostics, this.uri);\n\n  factory Diagnostics(void Function(Diagnostics$Builder) init) {\n    final b = Diagnostics$Builder._();\n    init(b);\n    return Diagnostics._(b.diagnostics, b.uri);\n  }\n\n  factory Diagnostics.fromJson(Map params) => Diagnostics._(\n    params.containsKey('diagnostics') && params['diagnostics'] != null\n        ? (params['diagnostics'] as List)\n              .map((v) => Diagnostic.fromJson((v as Map)))\n              .toList()\n        : null,\n    params.containsKey('uri') && params['uri'] != null\n        ? (params['uri'] as String?)\n        : null,\n  );\n\n  final List<Diagnostic>? diagnostics;\n\n  final String? uri;\n\n  Map toJson() => {\n    'diagnostics': diagnostics?.map((v) => v.toJson()).toList(),\n    'uri': uri,\n  };\n  @override\n  int get hashCode {\n    var hash = 133599092;\n    hash = _hashCombine(hash, _deepHashCode(diagnostics));\n    hash = _hashCombine(hash, _deepHashCode(uri));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Diagnostics &&\n      _deepEquals(diagnostics, other.diagnostics) &&\n      uri == other.uri;\n}\n\nclass Diagnostics$Builder {\n  Diagnostics$Builder._();\n\n  List<Diagnostic>? diagnostics;\n\n  String? uri;\n}\n\nclass DocumentHighlight {\n  DocumentHighlight._(this.kind, this.range);\n\n  factory DocumentHighlight(void Function(DocumentHighlight$Builder) init) {\n    final b = DocumentHighlight$Builder._();\n    init(b);\n    return DocumentHighlight._(b.kind, b.range);\n  }\n\n  factory DocumentHighlight.fromJson(Map params) => DocumentHighlight._(\n    params.containsKey('kind') && params['kind'] != null\n        ? DocumentHighlightKind.fromJson((params['kind'] as int?))\n        : null,\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n  );\n\n  final DocumentHighlightKind? kind;\n\n  final Range? range;\n\n  Map toJson() => {'kind': kind?.toJson(), 'range': range?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 33231655;\n    hash = _hashCombine(hash, _deepHashCode(kind));\n    hash = _hashCombine(hash, _deepHashCode(range));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is DocumentHighlight && kind == other.kind && range == other.range;\n}\n\nclass DocumentHighlight$Builder {\n  DocumentHighlight$Builder._();\n\n  DocumentHighlightKind? kind;\n\n  Range? range;\n}\n\nclass DocumentHighlightKind {\n  factory DocumentHighlightKind.fromJson(int? value) {\n    const values = {\n      2: DocumentHighlightKind.read,\n      1: DocumentHighlightKind.text,\n      3: DocumentHighlightKind.write,\n    };\n    return values[value!]!;\n  }\n\n  const DocumentHighlightKind._(this._value);\n\n  static const read = DocumentHighlightKind._(2);\n\n  static const text = DocumentHighlightKind._(1);\n\n  static const write = DocumentHighlightKind._(3);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass DocumentLinkOptions {\n  DocumentLinkOptions._(this.resolveProvider);\n\n  factory DocumentLinkOptions(void Function(DocumentLinkOptions$Builder) init) {\n    final b = DocumentLinkOptions$Builder._();\n    init(b);\n    return DocumentLinkOptions._(b.resolveProvider);\n  }\n\n  factory DocumentLinkOptions.fromJson(Map params) => DocumentLinkOptions._(\n    params.containsKey('resolveProvider') && params['resolveProvider'] != null\n        ? (params['resolveProvider'] as bool?)\n        : null,\n  );\n\n  final bool? resolveProvider;\n\n  Map toJson() => {'resolveProvider': resolveProvider};\n  @override\n  int get hashCode {\n    var hash = 370049515;\n    hash = _hashCombine(hash, _deepHashCode(resolveProvider));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is DocumentLinkOptions && resolveProvider == other.resolveProvider;\n}\n\nclass DocumentLinkOptions$Builder {\n  DocumentLinkOptions$Builder._();\n\n  bool? resolveProvider;\n}\n\nclass DocumentOnTypeFormattingOptions {\n  DocumentOnTypeFormattingOptions._(\n    this.firstTriggerCharacter,\n    this.moreTriggerCharacter,\n  );\n\n  factory DocumentOnTypeFormattingOptions(\n    void Function(DocumentOnTypeFormattingOptions$Builder) init,\n  ) {\n    final b = DocumentOnTypeFormattingOptions$Builder._();\n    init(b);\n    return DocumentOnTypeFormattingOptions._(\n      b.firstTriggerCharacter,\n      b.moreTriggerCharacter,\n    );\n  }\n\n  factory DocumentOnTypeFormattingOptions.fromJson(Map params) =>\n      DocumentOnTypeFormattingOptions._(\n        params.containsKey('firstTriggerCharacter') &&\n                params['firstTriggerCharacter'] != null\n            ? (params['firstTriggerCharacter'] as String?)\n            : null,\n        params.containsKey('moreTriggerCharacter') &&\n                params['moreTriggerCharacter'] != null\n            ? (params['moreTriggerCharacter'] as List).cast<String>()\n            : null,\n      );\n\n  final String? firstTriggerCharacter;\n\n  final List<String>? moreTriggerCharacter;\n\n  Map toJson() => {\n    'firstTriggerCharacter': firstTriggerCharacter,\n    'moreTriggerCharacter': moreTriggerCharacter,\n  };\n  @override\n  int get hashCode {\n    var hash = 519038003;\n    hash = _hashCombine(hash, _deepHashCode(firstTriggerCharacter));\n    hash = _hashCombine(hash, _deepHashCode(moreTriggerCharacter));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is DocumentOnTypeFormattingOptions &&\n      firstTriggerCharacter == other.firstTriggerCharacter &&\n      _deepEquals(moreTriggerCharacter, other.moreTriggerCharacter);\n}\n\nclass DocumentOnTypeFormattingOptions$Builder {\n  DocumentOnTypeFormattingOptions$Builder._();\n\n  String? firstTriggerCharacter;\n\n  List<String>? moreTriggerCharacter;\n}\n\nclass DynamicRegistrationCapability {\n  DynamicRegistrationCapability._(this.dynamicRegistration);\n\n  factory DynamicRegistrationCapability(\n    void Function(DynamicRegistrationCapability$Builder) init,\n  ) {\n    final b = DynamicRegistrationCapability$Builder._();\n    init(b);\n    return DynamicRegistrationCapability._(b.dynamicRegistration);\n  }\n\n  factory DynamicRegistrationCapability.fromJson(Map params) =>\n      DynamicRegistrationCapability._(\n        params.containsKey('dynamicRegistration') &&\n                params['dynamicRegistration'] != null\n            ? (params['dynamicRegistration'] as bool?)\n            : null,\n      );\n\n  final bool? dynamicRegistration;\n\n  Map toJson() => {'dynamicRegistration': dynamicRegistration};\n  @override\n  int get hashCode {\n    var hash = 400193199;\n    hash = _hashCombine(hash, _deepHashCode(dynamicRegistration));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is DynamicRegistrationCapability &&\n      dynamicRegistration == other.dynamicRegistration;\n}\n\nclass DynamicRegistrationCapability$Builder {\n  DynamicRegistrationCapability$Builder._();\n\n  bool? dynamicRegistration;\n}\n\nclass ExecuteCommandOptions {\n  ExecuteCommandOptions._(this.commands);\n\n  factory ExecuteCommandOptions(\n    void Function(ExecuteCommandOptions$Builder) init,\n  ) {\n    final b = ExecuteCommandOptions$Builder._();\n    init(b);\n    return ExecuteCommandOptions._(b.commands);\n  }\n\n  factory ExecuteCommandOptions.fromJson(Map params) => ExecuteCommandOptions._(\n    params.containsKey('commands') && params['commands'] != null\n        ? (params['commands'] as List).cast<String>()\n        : null,\n  );\n\n  final List<String>? commands;\n\n  Map toJson() => {'commands': commands};\n  @override\n  int get hashCode {\n    var hash = 136451660;\n    hash = _hashCombine(hash, _deepHashCode(commands));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ExecuteCommandOptions && _deepEquals(commands, other.commands);\n}\n\nclass ExecuteCommandOptions$Builder {\n  ExecuteCommandOptions$Builder._();\n\n  List<String>? commands;\n}\n\nclass Hover {\n  Hover._(this.contents, this.range);\n\n  factory Hover(void Function(Hover$Builder) init) {\n    final b = Hover$Builder._();\n    init(b);\n    return Hover._(b.contents, b.range);\n  }\n\n  factory Hover.fromJson(Map params) => Hover._(\n    params.containsKey('contents') && params['contents'] != null\n        ? (params['contents'] as String?)\n        : null,\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n  );\n\n  final String? contents;\n\n  final Range? range;\n\n  Map toJson() => {'contents': contents, 'range': range?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 624710494;\n    hash = _hashCombine(hash, _deepHashCode(contents));\n    hash = _hashCombine(hash, _deepHashCode(range));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Hover && contents == other.contents && range == other.range;\n}\n\nclass Hover$Builder {\n  Hover$Builder._();\n\n  String? contents;\n\n  Range? range;\n}\n\nclass HoverCapabilities {\n  HoverCapabilities._(this.contentFormat, this.dynamicRegistration);\n\n  factory HoverCapabilities(void Function(HoverCapabilities$Builder) init) {\n    final b = HoverCapabilities$Builder._();\n    init(b);\n    return HoverCapabilities._(b.contentFormat, b.dynamicRegistration);\n  }\n\n  factory HoverCapabilities.fromJson(Map params) => HoverCapabilities._(\n    params.containsKey('contentFormat') && params['contentFormat'] != null\n        ? (params['contentFormat'] as List).cast<String>()\n        : null,\n    params.containsKey('dynamicRegistration') &&\n            params['dynamicRegistration'] != null\n        ? (params['dynamicRegistration'] as bool?)\n        : null,\n  );\n\n  final List<String>? contentFormat;\n\n  final bool? dynamicRegistration;\n\n  Map toJson() => {\n    'contentFormat': contentFormat,\n    'dynamicRegistration': dynamicRegistration,\n  };\n  @override\n  int get hashCode {\n    var hash = 400081440;\n    hash = _hashCombine(hash, _deepHashCode(contentFormat));\n    hash = _hashCombine(hash, _deepHashCode(dynamicRegistration));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is HoverCapabilities &&\n      _deepEquals(contentFormat, other.contentFormat) &&\n      dynamicRegistration == other.dynamicRegistration;\n}\n\nclass HoverCapabilities$Builder {\n  HoverCapabilities$Builder._();\n\n  List<String>? contentFormat;\n\n  bool? dynamicRegistration;\n}\n\nclass HoverMarkup {\n  HoverMarkup._(this.contents, this.range);\n\n  factory HoverMarkup(void Function(HoverMarkup$Builder) init) {\n    final b = HoverMarkup$Builder._();\n    init(b);\n    return HoverMarkup._(b.contents, b.range);\n  }\n\n  factory HoverMarkup.fromJson(Map params) => HoverMarkup._(\n    params.containsKey('contents') && params['contents'] != null\n        ? MarkupContent.fromJson((params['contents'] as Map))\n        : null,\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n  );\n\n  final MarkupContent? contents;\n\n  final Range? range;\n\n  Map toJson() => {'contents': contents?.toJson(), 'range': range?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 207034670;\n    hash = _hashCombine(hash, _deepHashCode(contents));\n    hash = _hashCombine(hash, _deepHashCode(range));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is HoverMarkup &&\n      contents == other.contents &&\n      range == other.range;\n}\n\nclass HoverMarkup$Builder {\n  HoverMarkup$Builder._();\n\n  MarkupContent? contents;\n\n  Range? range;\n}\n\nclass InsertTextFormat {\n  factory InsertTextFormat.fromJson(int? value) {\n    const values = {1: InsertTextFormat.plainText, 2: InsertTextFormat.snippet};\n    return values[value!]!;\n  }\n\n  const InsertTextFormat._(this._value);\n\n  static const plainText = InsertTextFormat._(1);\n\n  static const snippet = InsertTextFormat._(2);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass Location {\n  Location._(this.range, this.uri);\n\n  factory Location(void Function(Location$Builder) init) {\n    final b = Location$Builder._();\n    init(b);\n    return Location._(b.range, b.uri);\n  }\n\n  factory Location.fromJson(Map params) => Location._(\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n    params.containsKey('uri') && params['uri'] != null\n        ? (params['uri'] as String?)\n        : null,\n  );\n\n  final Range? range;\n\n  final String? uri;\n\n  Map toJson() => {'range': range?.toJson(), 'uri': uri};\n  @override\n  int get hashCode {\n    var hash = 1015387949;\n    hash = _hashCombine(hash, _deepHashCode(range));\n    hash = _hashCombine(hash, _deepHashCode(uri));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Location && range == other.range && uri == other.uri;\n}\n\nclass Location$Builder {\n  Location$Builder._();\n\n  Range? range;\n\n  String? uri;\n}\n\nclass MarkupContent {\n  MarkupContent._(this.kind, this.value);\n\n  factory MarkupContent(void Function(MarkupContent$Builder) init) {\n    final b = MarkupContent$Builder._();\n    init(b);\n    return MarkupContent._(b.kind, b.value);\n  }\n\n  factory MarkupContent.fromJson(Map params) => MarkupContent._(\n    params.containsKey('kind') && params['kind'] != null\n        ? MarkupContentKind.fromJson((params['kind'] as String?))\n        : null,\n    params.containsKey('value') && params['value'] != null\n        ? (params['value'] as String?)\n        : null,\n  );\n\n  final MarkupContentKind? kind;\n\n  final String? value;\n\n  Map toJson() => {'kind': kind?.toJson(), 'value': value};\n  @override\n  int get hashCode {\n    var hash = 161892004;\n    hash = _hashCombine(hash, _deepHashCode(kind));\n    hash = _hashCombine(hash, _deepHashCode(value));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is MarkupContent && kind == other.kind && value == other.value;\n}\n\nclass MarkupContent$Builder {\n  MarkupContent$Builder._();\n\n  MarkupContentKind? kind;\n\n  String? value;\n}\n\nclass MarkupContentKind {\n  factory MarkupContentKind.fromJson(String? value) {\n    const values = {\n      'markdown': MarkupContentKind.markdown,\n      'plaintext': MarkupContentKind.plaintext,\n    };\n    return values[value!]!;\n  }\n\n  const MarkupContentKind._(this._value);\n\n  static const markdown = MarkupContentKind._('markdown');\n\n  static const plaintext = MarkupContentKind._('plaintext');\n\n  final String _value;\n\n  String toJson() => _value;\n}\n\nclass MessageType {\n  factory MessageType.fromJson(int? value) {\n    const values = {\n      1: MessageType.error,\n      3: MessageType.info,\n      4: MessageType.log,\n      2: MessageType.warning,\n    };\n    return values[value!]!;\n  }\n\n  const MessageType._(this._value);\n\n  static const error = MessageType._(1);\n\n  static const info = MessageType._(3);\n\n  static const log = MessageType._(4);\n\n  static const warning = MessageType._(2);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass Position {\n  Position._(this.character, this.line);\n\n  factory Position(void Function(Position$Builder) init) {\n    final b = Position$Builder._();\n    init(b);\n    return Position._(b.character, b.line);\n  }\n\n  factory Position.fromJson(Map params) => Position._(\n    params.containsKey('character') && params['character'] != null\n        ? (params['character'] as int?)\n        : null,\n    params.containsKey('line') && params['line'] != null\n        ? (params['line'] as int?)\n        : null,\n  );\n\n  final int? character;\n\n  final int? line;\n\n  Map toJson() => {'character': character, 'line': line};\n  @override\n  int get hashCode {\n    var hash = 210930065;\n    hash = _hashCombine(hash, _deepHashCode(character));\n    hash = _hashCombine(hash, _deepHashCode(line));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Position && character == other.character && line == other.line;\n}\n\nclass Position$Builder {\n  Position$Builder._();\n\n  int? character;\n\n  int? line;\n}\n\nclass Range {\n  Range._(this.end, this.start);\n\n  factory Range(void Function(Range$Builder) init) {\n    final b = Range$Builder._();\n    init(b);\n    return Range._(b.end, b.start);\n  }\n\n  factory Range.fromJson(Map params) => Range._(\n    params.containsKey('end') && params['end'] != null\n        ? Position.fromJson((params['end'] as Map))\n        : null,\n    params.containsKey('start') && params['start'] != null\n        ? Position.fromJson((params['start'] as Map))\n        : null,\n  );\n\n  final Position? end;\n\n  final Position? start;\n\n  Map toJson() => {'end': end?.toJson(), 'start': start?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 682876634;\n    hash = _hashCombine(hash, _deepHashCode(end));\n    hash = _hashCombine(hash, _deepHashCode(start));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is Range && end == other.end && start == other.start;\n}\n\nclass Range$Builder {\n  Range$Builder._();\n\n  Position? end;\n\n  Position? start;\n}\n\nclass ReferenceContext {\n  ReferenceContext._(this.includeDeclaration);\n\n  factory ReferenceContext(void Function(ReferenceContext$Builder) init) {\n    final b = ReferenceContext$Builder._();\n    init(b);\n    return ReferenceContext._(b.includeDeclaration);\n  }\n\n  factory ReferenceContext.fromJson(Map params) => ReferenceContext._(\n    params.containsKey('includeDeclaration') &&\n            params['includeDeclaration'] != null\n        ? (params['includeDeclaration'] as bool?)\n        : null,\n  );\n\n  final bool? includeDeclaration;\n\n  Map toJson() => {'includeDeclaration': includeDeclaration};\n  @override\n  int get hashCode {\n    var hash = 82198676;\n    hash = _hashCombine(hash, _deepHashCode(includeDeclaration));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ReferenceContext &&\n      includeDeclaration == other.includeDeclaration;\n}\n\nclass ReferenceContext$Builder {\n  ReferenceContext$Builder._();\n\n  bool? includeDeclaration;\n}\n\nclass SaveOptions {\n  SaveOptions._(this.includeText);\n\n  factory SaveOptions(void Function(SaveOptions$Builder) init) {\n    final b = SaveOptions$Builder._();\n    init(b);\n    return SaveOptions._(b.includeText);\n  }\n\n  factory SaveOptions.fromJson(Map params) => SaveOptions._(\n    params.containsKey('includeText') && params['includeText'] != null\n        ? (params['includeText'] as bool?)\n        : null,\n  );\n\n  final bool? includeText;\n\n  Map toJson() => {'includeText': includeText};\n  @override\n  int get hashCode {\n    var hash = 11958891;\n    hash = _hashCombine(hash, _deepHashCode(includeText));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is SaveOptions && includeText == other.includeText;\n}\n\nclass SaveOptions$Builder {\n  SaveOptions$Builder._();\n\n  bool? includeText;\n}\n\nclass ServerCapabilities {\n  ServerCapabilities._(\n    this.codeActionProvider,\n    this.codeLensProvider,\n    this.completionProvider,\n    this.definitionProvider,\n    this.documentFormattingProvider,\n    this.documentHighlightProvider,\n    this.documentLinkProvider,\n    this.documentOnTypeFormattingProvider,\n    this.documentRangeFormattingProvider,\n    this.documentSymbolProvider,\n    this.executeCommandProvider,\n    this.hoverProvider,\n    this.implementationProvider,\n    this.referencesProvider,\n    this.renameProvider,\n    this.signatureHelpProvider,\n    this.textDocumentSync,\n    this.workspaceSymbolProvider,\n  );\n\n  factory ServerCapabilities(void Function(ServerCapabilities$Builder) init) {\n    final b = ServerCapabilities$Builder._();\n    init(b);\n    return ServerCapabilities._(\n      b.codeActionProvider,\n      b.codeLensProvider,\n      b.completionProvider,\n      b.definitionProvider,\n      b.documentFormattingProvider,\n      b.documentHighlightProvider,\n      b.documentLinkProvider,\n      b.documentOnTypeFormattingProvider,\n      b.documentRangeFormattingProvider,\n      b.documentSymbolProvider,\n      b.executeCommandProvider,\n      b.hoverProvider,\n      b.implementationProvider,\n      b.referencesProvider,\n      b.renameProvider,\n      b.signatureHelpProvider,\n      b.textDocumentSync,\n      b.workspaceSymbolProvider,\n    );\n  }\n\n  factory ServerCapabilities.fromJson(Map params) => ServerCapabilities._(\n    params.containsKey('codeActionProvider') &&\n            params['codeActionProvider'] != null\n        ? (params['codeActionProvider'] as bool?)\n        : null,\n    params.containsKey('codeLensProvider') && params['codeLensProvider'] != null\n        ? CodeLensOptions.fromJson((params['codeLensProvider'] as Map))\n        : null,\n    params.containsKey('completionProvider') &&\n            params['completionProvider'] != null\n        ? CompletionOptions.fromJson((params['completionProvider'] as Map))\n        : null,\n    params.containsKey('definitionProvider') &&\n            params['definitionProvider'] != null\n        ? (params['definitionProvider'] as bool?)\n        : null,\n    params.containsKey('documentFormattingProvider') &&\n            params['documentFormattingProvider'] != null\n        ? (params['documentFormattingProvider'] as bool?)\n        : null,\n    params.containsKey('documentHighlightProvider') &&\n            params['documentHighlightProvider'] != null\n        ? (params['documentHighlightProvider'] as bool?)\n        : null,\n    params.containsKey('documentLinkProvider') &&\n            params['documentLinkProvider'] != null\n        ? DocumentLinkOptions.fromJson((params['documentLinkProvider'] as Map))\n        : null,\n    params.containsKey('documentOnTypeFormattingProvider') &&\n            params['documentOnTypeFormattingProvider'] != null\n        ? DocumentOnTypeFormattingOptions.fromJson(\n            (params['documentOnTypeFormattingProvider'] as Map),\n          )\n        : null,\n    params.containsKey('documentRangeFormattingProvider') &&\n            params['documentRangeFormattingProvider'] != null\n        ? (params['documentRangeFormattingProvider'] as bool?)\n        : null,\n    params.containsKey('documentSymbolProvider') &&\n            params['documentSymbolProvider'] != null\n        ? (params['documentSymbolProvider'] as bool?)\n        : null,\n    params.containsKey('executeCommandProvider') &&\n            params['executeCommandProvider'] != null\n        ? ExecuteCommandOptions.fromJson(\n            (params['executeCommandProvider'] as Map),\n          )\n        : null,\n    params.containsKey('hoverProvider') && params['hoverProvider'] != null\n        ? (params['hoverProvider'] as bool?)\n        : null,\n    params.containsKey('implementationProvider') &&\n            params['implementationProvider'] != null\n        ? (params['implementationProvider'] as bool?)\n        : null,\n    params.containsKey('referencesProvider') &&\n            params['referencesProvider'] != null\n        ? (params['referencesProvider'] as bool?)\n        : null,\n    params.containsKey('renameProvider') && params['renameProvider'] != null\n        ? (params['renameProvider'] as bool?)\n        : null,\n    params.containsKey('signatureHelpProvider') &&\n            params['signatureHelpProvider'] != null\n        ? SignatureHelpOptions.fromJson(\n            (params['signatureHelpProvider'] as Map),\n          )\n        : null,\n    params.containsKey('textDocumentSync') && params['textDocumentSync'] != null\n        ? TextDocumentSyncOptions.fromJson((params['textDocumentSync'] as Map))\n        : null,\n    params.containsKey('workspaceSymbolProvider') &&\n            params['workspaceSymbolProvider'] != null\n        ? (params['workspaceSymbolProvider'] as bool?)\n        : null,\n  );\n\n  final bool? codeActionProvider;\n\n  final CodeLensOptions? codeLensProvider;\n\n  final CompletionOptions? completionProvider;\n\n  final bool? definitionProvider;\n\n  final bool? documentFormattingProvider;\n\n  final bool? documentHighlightProvider;\n\n  final DocumentLinkOptions? documentLinkProvider;\n\n  final DocumentOnTypeFormattingOptions? documentOnTypeFormattingProvider;\n\n  final bool? documentRangeFormattingProvider;\n\n  final bool? documentSymbolProvider;\n\n  final ExecuteCommandOptions? executeCommandProvider;\n\n  final bool? hoverProvider;\n\n  final bool? implementationProvider;\n\n  final bool? referencesProvider;\n\n  final bool? renameProvider;\n\n  final SignatureHelpOptions? signatureHelpProvider;\n\n  final TextDocumentSyncOptions? textDocumentSync;\n\n  final bool? workspaceSymbolProvider;\n\n  Map toJson() => {\n    'codeActionProvider': codeActionProvider,\n    'codeLensProvider': codeLensProvider?.toJson(),\n    'completionProvider': completionProvider?.toJson(),\n    'definitionProvider': definitionProvider,\n    'documentFormattingProvider': documentFormattingProvider,\n    'documentHighlightProvider': documentHighlightProvider,\n    'documentLinkProvider': documentLinkProvider?.toJson(),\n    'documentOnTypeFormattingProvider': documentOnTypeFormattingProvider\n        ?.toJson(),\n    'documentRangeFormattingProvider': documentRangeFormattingProvider,\n    'documentSymbolProvider': documentSymbolProvider,\n    'executeCommandProvider': executeCommandProvider?.toJson(),\n    'hoverProvider': hoverProvider,\n    'implementationProvider': implementationProvider,\n    'referencesProvider': referencesProvider,\n    'renameProvider': renameProvider,\n    'signatureHelpProvider': signatureHelpProvider?.toJson(),\n    'textDocumentSync': textDocumentSync?.toJson(),\n    'workspaceSymbolProvider': workspaceSymbolProvider,\n  };\n  @override\n  int get hashCode {\n    var hash = 659932873;\n    hash = _hashCombine(hash, _deepHashCode(codeActionProvider));\n    hash = _hashCombine(hash, _deepHashCode(codeLensProvider));\n    hash = _hashCombine(hash, _deepHashCode(completionProvider));\n    hash = _hashCombine(hash, _deepHashCode(definitionProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentFormattingProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentHighlightProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentLinkProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentOnTypeFormattingProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentRangeFormattingProvider));\n    hash = _hashCombine(hash, _deepHashCode(documentSymbolProvider));\n    hash = _hashCombine(hash, _deepHashCode(executeCommandProvider));\n    hash = _hashCombine(hash, _deepHashCode(hoverProvider));\n    hash = _hashCombine(hash, _deepHashCode(implementationProvider));\n    hash = _hashCombine(hash, _deepHashCode(referencesProvider));\n    hash = _hashCombine(hash, _deepHashCode(renameProvider));\n    hash = _hashCombine(hash, _deepHashCode(signatureHelpProvider));\n    hash = _hashCombine(hash, _deepHashCode(textDocumentSync));\n    hash = _hashCombine(hash, _deepHashCode(workspaceSymbolProvider));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ServerCapabilities &&\n      codeActionProvider == other.codeActionProvider &&\n      codeLensProvider == other.codeLensProvider &&\n      completionProvider == other.completionProvider &&\n      definitionProvider == other.definitionProvider &&\n      documentFormattingProvider == other.documentFormattingProvider &&\n      documentHighlightProvider == other.documentHighlightProvider &&\n      documentLinkProvider == other.documentLinkProvider &&\n      documentOnTypeFormattingProvider ==\n          other.documentOnTypeFormattingProvider &&\n      documentRangeFormattingProvider ==\n          other.documentRangeFormattingProvider &&\n      documentSymbolProvider == other.documentSymbolProvider &&\n      executeCommandProvider == other.executeCommandProvider &&\n      hoverProvider == other.hoverProvider &&\n      implementationProvider == other.implementationProvider &&\n      referencesProvider == other.referencesProvider &&\n      renameProvider == other.renameProvider &&\n      signatureHelpProvider == other.signatureHelpProvider &&\n      textDocumentSync == other.textDocumentSync &&\n      workspaceSymbolProvider == other.workspaceSymbolProvider;\n}\n\nclass ServerCapabilities$Builder {\n  ServerCapabilities$Builder._();\n\n  bool? codeActionProvider;\n\n  CodeLensOptions? codeLensProvider;\n\n  CompletionOptions? completionProvider;\n\n  bool? definitionProvider;\n\n  bool? documentFormattingProvider;\n\n  bool? documentHighlightProvider;\n\n  DocumentLinkOptions? documentLinkProvider;\n\n  DocumentOnTypeFormattingOptions? documentOnTypeFormattingProvider;\n\n  bool? documentRangeFormattingProvider;\n\n  bool? documentSymbolProvider;\n\n  ExecuteCommandOptions? executeCommandProvider;\n\n  bool? hoverProvider;\n\n  bool? implementationProvider;\n\n  bool? referencesProvider;\n\n  bool? renameProvider;\n\n  SignatureHelpOptions? signatureHelpProvider;\n\n  TextDocumentSyncOptions? textDocumentSync;\n\n  bool? workspaceSymbolProvider;\n}\n\nclass ShowMessageParams {\n  ShowMessageParams._(this.message, this.type);\n\n  factory ShowMessageParams(void Function(ShowMessageParams$Builder) init) {\n    final b = ShowMessageParams$Builder._();\n    init(b);\n    return ShowMessageParams._(b.message, b.type);\n  }\n\n  factory ShowMessageParams.fromJson(Map params) => ShowMessageParams._(\n    params.containsKey('message') && params['message'] != null\n        ? (params['message'] as String?)\n        : null,\n    params.containsKey('type') && params['type'] != null\n        ? MessageType.fromJson((params['type'] as int?))\n        : null,\n  );\n\n  final String? message;\n\n  final MessageType? type;\n\n  Map toJson() => {'message': message, 'type': type?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 684261254;\n    hash = _hashCombine(hash, _deepHashCode(message));\n    hash = _hashCombine(hash, _deepHashCode(type));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is ShowMessageParams &&\n      message == other.message &&\n      type == other.type;\n}\n\nclass ShowMessageParams$Builder {\n  ShowMessageParams$Builder._();\n\n  String? message;\n\n  MessageType? type;\n}\n\nclass SignatureHelpOptions {\n  SignatureHelpOptions._(this.triggerCharacters);\n\n  factory SignatureHelpOptions(\n    void Function(SignatureHelpOptions$Builder) init,\n  ) {\n    final b = SignatureHelpOptions$Builder._();\n    init(b);\n    return SignatureHelpOptions._(b.triggerCharacters);\n  }\n\n  factory SignatureHelpOptions.fromJson(Map params) => SignatureHelpOptions._(\n    params.containsKey('triggerCharacters') &&\n            params['triggerCharacters'] != null\n        ? (params['triggerCharacters'] as List).cast<String>()\n        : null,\n  );\n\n  final List<String>? triggerCharacters;\n\n  Map toJson() => {'triggerCharacters': triggerCharacters};\n  @override\n  int get hashCode {\n    var hash = 979113728;\n    hash = _hashCombine(hash, _deepHashCode(triggerCharacters));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is SignatureHelpOptions &&\n      _deepEquals(triggerCharacters, other.triggerCharacters);\n}\n\nclass SignatureHelpOptions$Builder {\n  SignatureHelpOptions$Builder._();\n\n  List<String>? triggerCharacters;\n}\n\nclass SymbolInformation {\n  SymbolInformation._(this.containerName, this.kind, this.location, this.name);\n\n  factory SymbolInformation(void Function(SymbolInformation$Builder) init) {\n    final b = SymbolInformation$Builder._();\n    init(b);\n    return SymbolInformation._(b.containerName, b.kind, b.location, b.name);\n  }\n\n  factory SymbolInformation.fromJson(Map params) => SymbolInformation._(\n    params.containsKey('containerName') && params['containerName'] != null\n        ? (params['containerName'] as String?)\n        : null,\n    params.containsKey('kind') && params['kind'] != null\n        ? SymbolKind.fromJson((params['kind'] as int?))\n        : null,\n    params.containsKey('location') && params['location'] != null\n        ? Location.fromJson((params['location'] as Map))\n        : null,\n    params.containsKey('name') && params['name'] != null\n        ? (params['name'] as String?)\n        : null,\n  );\n\n  final String? containerName;\n\n  final SymbolKind? kind;\n\n  final Location? location;\n\n  final String? name;\n\n  Map toJson() => {\n    'containerName': containerName,\n    'kind': kind?.toJson(),\n    'location': location?.toJson(),\n    'name': name,\n  };\n  @override\n  int get hashCode {\n    var hash = 260018179;\n    hash = _hashCombine(hash, _deepHashCode(containerName));\n    hash = _hashCombine(hash, _deepHashCode(kind));\n    hash = _hashCombine(hash, _deepHashCode(location));\n    hash = _hashCombine(hash, _deepHashCode(name));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is SymbolInformation &&\n      containerName == other.containerName &&\n      kind == other.kind &&\n      location == other.location &&\n      name == other.name;\n}\n\nclass SymbolInformation$Builder {\n  SymbolInformation$Builder._();\n\n  String? containerName;\n\n  SymbolKind? kind;\n\n  Location? location;\n\n  String? name;\n}\n\nclass SymbolKind {\n  factory SymbolKind.fromJson(int? value) {\n    const values = {\n      18: SymbolKind.array,\n      17: SymbolKind.boolean,\n      5: SymbolKind.classSymbol,\n      14: SymbolKind.constant,\n      9: SymbolKind.constructor,\n      22: SymbolKind.enumMember,\n      10: SymbolKind.enumSymbol,\n      24: SymbolKind.event,\n      8: SymbolKind.field,\n      1: SymbolKind.file,\n      12: SymbolKind.function,\n      11: SymbolKind.interface,\n      20: SymbolKind.key,\n      6: SymbolKind.method,\n      2: SymbolKind.module,\n      3: SymbolKind.namespace,\n      21: SymbolKind.nullSymbol,\n      16: SymbolKind.number,\n      19: SymbolKind.object,\n      25: SymbolKind.operator,\n      4: SymbolKind.package,\n      7: SymbolKind.property,\n      15: SymbolKind.string,\n      23: SymbolKind.struct,\n      26: SymbolKind.typeParameter,\n      13: SymbolKind.variable,\n    };\n    return values[value!]!;\n  }\n\n  const SymbolKind._(this._value);\n\n  static const array = SymbolKind._(18);\n\n  static const boolean = SymbolKind._(17);\n\n  static const classSymbol = SymbolKind._(5);\n\n  static const constant = SymbolKind._(14);\n\n  static const constructor = SymbolKind._(9);\n\n  static const enumMember = SymbolKind._(22);\n\n  static const enumSymbol = SymbolKind._(10);\n\n  static const event = SymbolKind._(24);\n\n  static const field = SymbolKind._(8);\n\n  static const file = SymbolKind._(1);\n\n  static const function = SymbolKind._(12);\n\n  static const interface = SymbolKind._(11);\n\n  static const key = SymbolKind._(20);\n\n  static const method = SymbolKind._(6);\n\n  static const module = SymbolKind._(2);\n\n  static const namespace = SymbolKind._(3);\n\n  static const nullSymbol = SymbolKind._(21);\n\n  static const number = SymbolKind._(16);\n\n  static const object = SymbolKind._(19);\n\n  static const operator = SymbolKind._(25);\n\n  static const package = SymbolKind._(4);\n\n  static const property = SymbolKind._(7);\n\n  static const string = SymbolKind._(15);\n\n  static const struct = SymbolKind._(23);\n\n  static const typeParameter = SymbolKind._(26);\n\n  static const variable = SymbolKind._(13);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass SynchronizationCapabilities {\n  SynchronizationCapabilities._(\n    this.didSave,\n    this.dynamicRegistration,\n    this.willSave,\n    this.willSaveWaitUntil,\n  );\n\n  factory SynchronizationCapabilities(\n    void Function(SynchronizationCapabilities$Builder) init,\n  ) {\n    final b = SynchronizationCapabilities$Builder._();\n    init(b);\n    return SynchronizationCapabilities._(\n      b.didSave,\n      b.dynamicRegistration,\n      b.willSave,\n      b.willSaveWaitUntil,\n    );\n  }\n\n  factory SynchronizationCapabilities.fromJson(Map params) =>\n      SynchronizationCapabilities._(\n        params.containsKey('didSave') && params['didSave'] != null\n            ? (params['didSave'] as bool?)\n            : null,\n        params.containsKey('dynamicRegistration') &&\n                params['dynamicRegistration'] != null\n            ? (params['dynamicRegistration'] as bool?)\n            : null,\n        params.containsKey('willSave') && params['willSave'] != null\n            ? (params['willSave'] as bool?)\n            : null,\n        params.containsKey('willSaveWaitUntil') &&\n                params['willSaveWaitUntil'] != null\n            ? (params['willSaveWaitUntil'] as bool?)\n            : null,\n      );\n\n  final bool? didSave;\n\n  final bool? dynamicRegistration;\n\n  final bool? willSave;\n\n  final bool? willSaveWaitUntil;\n\n  Map toJson() => {\n    'didSave': didSave,\n    'dynamicRegistration': dynamicRegistration,\n    'willSave': willSave,\n    'willSaveWaitUntil': willSaveWaitUntil,\n  };\n  @override\n  int get hashCode {\n    var hash = 1050620504;\n    hash = _hashCombine(hash, _deepHashCode(didSave));\n    hash = _hashCombine(hash, _deepHashCode(dynamicRegistration));\n    hash = _hashCombine(hash, _deepHashCode(willSave));\n    hash = _hashCombine(hash, _deepHashCode(willSaveWaitUntil));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is SynchronizationCapabilities &&\n      didSave == other.didSave &&\n      dynamicRegistration == other.dynamicRegistration &&\n      willSave == other.willSave &&\n      willSaveWaitUntil == other.willSaveWaitUntil;\n}\n\nclass SynchronizationCapabilities$Builder {\n  SynchronizationCapabilities$Builder._();\n\n  bool? didSave;\n\n  bool? dynamicRegistration;\n\n  bool? willSave;\n\n  bool? willSaveWaitUntil;\n}\n\nclass TextDocumentClientCapabilities {\n  TextDocumentClientCapabilities._(\n    this.codeAction,\n    this.codeLens,\n    this.completion,\n    this.definition,\n    this.documentHighlight,\n    this.documentLink,\n    this.documentSymbol,\n    this.formatting,\n    this.hover,\n    this.onTypeFormatting,\n    this.references,\n    this.rename,\n    this.synchronization,\n  );\n\n  factory TextDocumentClientCapabilities(\n    void Function(TextDocumentClientCapabilities$Builder) init,\n  ) {\n    final b = TextDocumentClientCapabilities$Builder._();\n    init(b);\n    return TextDocumentClientCapabilities._(\n      b.codeAction,\n      b.codeLens,\n      b.completion,\n      b.definition,\n      b.documentHighlight,\n      b.documentLink,\n      b.documentSymbol,\n      b.formatting,\n      b.hover,\n      b.onTypeFormatting,\n      b.references,\n      b.rename,\n      b.synchronization,\n    );\n  }\n\n  factory TextDocumentClientCapabilities.fromJson(\n    Map params,\n  ) => TextDocumentClientCapabilities._(\n    params.containsKey('codeAction') && params['codeAction'] != null\n        ? CodeActionCapabilities.fromJson((params['codeAction'] as Map))\n        : null,\n    params.containsKey('codeLens') && params['codeLens'] != null\n        ? DynamicRegistrationCapability.fromJson((params['codeLens'] as Map))\n        : null,\n    params.containsKey('completion') && params['completion'] != null\n        ? CompletionCapabilities.fromJson((params['completion'] as Map))\n        : null,\n    params.containsKey('definition') && params['definition'] != null\n        ? DynamicRegistrationCapability.fromJson((params['definition'] as Map))\n        : null,\n    params.containsKey('documentHighlight') &&\n            params['documentHighlight'] != null\n        ? DynamicRegistrationCapability.fromJson(\n            (params['documentHighlight'] as Map),\n          )\n        : null,\n    params.containsKey('documentLink') && params['documentLink'] != null\n        ? DynamicRegistrationCapability.fromJson(\n            (params['documentLink'] as Map),\n          )\n        : null,\n    params.containsKey('documentSymbol') && params['documentSymbol'] != null\n        ? DynamicRegistrationCapability.fromJson(\n            (params['documentSymbol'] as Map),\n          )\n        : null,\n    params.containsKey('formatting') && params['formatting'] != null\n        ? DynamicRegistrationCapability.fromJson((params['formatting'] as Map))\n        : null,\n    params.containsKey('hover') && params['hover'] != null\n        ? HoverCapabilities.fromJson((params['hover'] as Map))\n        : null,\n    params.containsKey('onTypeFormatting') && params['onTypeFormatting'] != null\n        ? DynamicRegistrationCapability.fromJson(\n            (params['onTypeFormatting'] as Map),\n          )\n        : null,\n    params.containsKey('references') && params['references'] != null\n        ? DynamicRegistrationCapability.fromJson((params['references'] as Map))\n        : null,\n    params.containsKey('rename') && params['rename'] != null\n        ? DynamicRegistrationCapability.fromJson((params['rename'] as Map))\n        : null,\n    params.containsKey('synchronization') && params['synchronization'] != null\n        ? SynchronizationCapabilities.fromJson(\n            (params['synchronization'] as Map),\n          )\n        : null,\n  );\n\n  final CodeActionCapabilities? codeAction;\n\n  final DynamicRegistrationCapability? codeLens;\n\n  final CompletionCapabilities? completion;\n\n  final DynamicRegistrationCapability? definition;\n\n  final DynamicRegistrationCapability? documentHighlight;\n\n  final DynamicRegistrationCapability? documentLink;\n\n  final DynamicRegistrationCapability? documentSymbol;\n\n  final DynamicRegistrationCapability? formatting;\n\n  final HoverCapabilities? hover;\n\n  final DynamicRegistrationCapability? onTypeFormatting;\n\n  final DynamicRegistrationCapability? references;\n\n  final DynamicRegistrationCapability? rename;\n\n  final SynchronizationCapabilities? synchronization;\n\n  Map toJson() => {\n    'codeAction': codeAction?.toJson(),\n    'codeLens': codeLens?.toJson(),\n    'completion': completion?.toJson(),\n    'definition': definition?.toJson(),\n    'documentHighlight': documentHighlight?.toJson(),\n    'documentLink': documentLink?.toJson(),\n    'documentSymbol': documentSymbol?.toJson(),\n    'formatting': formatting?.toJson(),\n    'hover': hover?.toJson(),\n    'onTypeFormatting': onTypeFormatting?.toJson(),\n    'references': references?.toJson(),\n    'rename': rename?.toJson(),\n    'synchronization': synchronization?.toJson(),\n  };\n  @override\n  int get hashCode {\n    var hash = 242077660;\n    hash = _hashCombine(hash, _deepHashCode(codeAction));\n    hash = _hashCombine(hash, _deepHashCode(codeLens));\n    hash = _hashCombine(hash, _deepHashCode(completion));\n    hash = _hashCombine(hash, _deepHashCode(definition));\n    hash = _hashCombine(hash, _deepHashCode(documentHighlight));\n    hash = _hashCombine(hash, _deepHashCode(documentLink));\n    hash = _hashCombine(hash, _deepHashCode(documentSymbol));\n    hash = _hashCombine(hash, _deepHashCode(formatting));\n    hash = _hashCombine(hash, _deepHashCode(hover));\n    hash = _hashCombine(hash, _deepHashCode(onTypeFormatting));\n    hash = _hashCombine(hash, _deepHashCode(references));\n    hash = _hashCombine(hash, _deepHashCode(rename));\n    hash = _hashCombine(hash, _deepHashCode(synchronization));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextDocumentClientCapabilities &&\n      codeAction == other.codeAction &&\n      codeLens == other.codeLens &&\n      completion == other.completion &&\n      definition == other.definition &&\n      documentHighlight == other.documentHighlight &&\n      documentLink == other.documentLink &&\n      documentSymbol == other.documentSymbol &&\n      formatting == other.formatting &&\n      hover == other.hover &&\n      onTypeFormatting == other.onTypeFormatting &&\n      references == other.references &&\n      rename == other.rename &&\n      synchronization == other.synchronization;\n}\n\nclass TextDocumentClientCapabilities$Builder {\n  TextDocumentClientCapabilities$Builder._();\n\n  CodeActionCapabilities? codeAction;\n\n  DynamicRegistrationCapability? codeLens;\n\n  CompletionCapabilities? completion;\n\n  DynamicRegistrationCapability? definition;\n\n  DynamicRegistrationCapability? documentHighlight;\n\n  DynamicRegistrationCapability? documentLink;\n\n  DynamicRegistrationCapability? documentSymbol;\n\n  DynamicRegistrationCapability? formatting;\n\n  HoverCapabilities? hover;\n\n  DynamicRegistrationCapability? onTypeFormatting;\n\n  DynamicRegistrationCapability? references;\n\n  DynamicRegistrationCapability? rename;\n\n  SynchronizationCapabilities? synchronization;\n}\n\nclass TextDocumentContentChangeEvent {\n  TextDocumentContentChangeEvent._(this.range, this.rangeLength, this.text);\n\n  factory TextDocumentContentChangeEvent(\n    void Function(TextDocumentContentChangeEvent$Builder) init,\n  ) {\n    final b = TextDocumentContentChangeEvent$Builder._();\n    init(b);\n    return TextDocumentContentChangeEvent._(b.range, b.rangeLength, b.text);\n  }\n\n  factory TextDocumentContentChangeEvent.fromJson(Map params) =>\n      TextDocumentContentChangeEvent._(\n        params.containsKey('range') && params['range'] != null\n            ? Range.fromJson((params['range'] as Map))\n            : null,\n        params.containsKey('rangeLength') && params['rangeLength'] != null\n            ? (params['rangeLength'] as int?)\n            : null,\n        params.containsKey('text') && params['text'] != null\n            ? (params['text'] as String?)\n            : null,\n      );\n\n  final Range? range;\n\n  final int? rangeLength;\n\n  final String? text;\n\n  Map toJson() => {\n    'range': range?.toJson(),\n    'rangeLength': rangeLength,\n    'text': text,\n  };\n  @override\n  int get hashCode {\n    var hash = 180616113;\n    hash = _hashCombine(hash, _deepHashCode(range));\n    hash = _hashCombine(hash, _deepHashCode(rangeLength));\n    hash = _hashCombine(hash, _deepHashCode(text));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextDocumentContentChangeEvent &&\n      range == other.range &&\n      rangeLength == other.rangeLength &&\n      text == other.text;\n}\n\nclass TextDocumentContentChangeEvent$Builder {\n  TextDocumentContentChangeEvent$Builder._();\n\n  Range? range;\n\n  int? rangeLength;\n\n  String? text;\n}\n\nclass TextDocumentIdentifier {\n  TextDocumentIdentifier._(this.uri);\n\n  factory TextDocumentIdentifier(\n    void Function(TextDocumentIdentifier$Builder) init,\n  ) {\n    final b = TextDocumentIdentifier$Builder._();\n    init(b);\n    return TextDocumentIdentifier._(b.uri);\n  }\n\n  factory TextDocumentIdentifier.fromJson(Map params) =>\n      TextDocumentIdentifier._(\n        params.containsKey('uri') && params['uri'] != null\n            ? (params['uri'] as String?)\n            : null,\n      );\n\n  final String? uri;\n\n  Map toJson() => {'uri': uri};\n  @override\n  int get hashCode {\n    var hash = 553241737;\n    hash = _hashCombine(hash, _deepHashCode(uri));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextDocumentIdentifier && uri == other.uri;\n}\n\nclass TextDocumentIdentifier$Builder {\n  TextDocumentIdentifier$Builder._();\n\n  String? uri;\n}\n\nclass TextDocumentItem {\n  TextDocumentItem._(this.languageId, this.text, this.uri, this.version);\n\n  factory TextDocumentItem(void Function(TextDocumentItem$Builder) init) {\n    final b = TextDocumentItem$Builder._();\n    init(b);\n    return TextDocumentItem._(b.languageId, b.text, b.uri, b.version);\n  }\n\n  factory TextDocumentItem.fromJson(Map params) => TextDocumentItem._(\n    params.containsKey('languageId') && params['languageId'] != null\n        ? (params['languageId'] as String?)\n        : null,\n    params.containsKey('text') && params['text'] != null\n        ? (params['text'] as String?)\n        : null,\n    params.containsKey('uri') && params['uri'] != null\n        ? (params['uri'] as String?)\n        : null,\n    params.containsKey('version') && params['version'] != null\n        ? (params['version'] as int?)\n        : null,\n  );\n\n  final String? languageId;\n\n  final String? text;\n\n  final String? uri;\n\n  final int? version;\n\n  Map toJson() => {\n    'languageId': languageId,\n    'text': text,\n    'uri': uri,\n    'version': version,\n  };\n  @override\n  int get hashCode {\n    var hash = 448755309;\n    hash = _hashCombine(hash, _deepHashCode(languageId));\n    hash = _hashCombine(hash, _deepHashCode(text));\n    hash = _hashCombine(hash, _deepHashCode(uri));\n    hash = _hashCombine(hash, _deepHashCode(version));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextDocumentItem &&\n      languageId == other.languageId &&\n      text == other.text &&\n      uri == other.uri &&\n      version == other.version;\n}\n\nclass TextDocumentItem$Builder {\n  TextDocumentItem$Builder._();\n\n  String? languageId;\n\n  String? text;\n\n  String? uri;\n\n  int? version;\n}\n\nclass TextDocumentSyncKind {\n  factory TextDocumentSyncKind.fromJson(int? value) {\n    const values = {\n      1: TextDocumentSyncKind.full,\n      2: TextDocumentSyncKind.incremental,\n      0: TextDocumentSyncKind.none,\n    };\n    return values[value!]!;\n  }\n\n  const TextDocumentSyncKind._(this._value);\n\n  static const full = TextDocumentSyncKind._(1);\n\n  static const incremental = TextDocumentSyncKind._(2);\n\n  static const none = TextDocumentSyncKind._(0);\n\n  final int _value;\n\n  int toJson() => _value;\n}\n\nclass TextDocumentSyncOptions {\n  TextDocumentSyncOptions._(\n    this.change,\n    this.openClose,\n    this.save,\n    this.willSave,\n    this.willSaveWaitUntil,\n  );\n\n  factory TextDocumentSyncOptions(\n    void Function(TextDocumentSyncOptions$Builder) init,\n  ) {\n    final b = TextDocumentSyncOptions$Builder._();\n    init(b);\n    return TextDocumentSyncOptions._(\n      b.change,\n      b.openClose,\n      b.save,\n      b.willSave,\n      b.willSaveWaitUntil,\n    );\n  }\n\n  factory TextDocumentSyncOptions.fromJson(Map params) =>\n      TextDocumentSyncOptions._(\n        params.containsKey('change') && params['change'] != null\n            ? TextDocumentSyncKind.fromJson((params['change'] as int?))\n            : null,\n        params.containsKey('openClose') && params['openClose'] != null\n            ? (params['openClose'] as bool?)\n            : null,\n        params.containsKey('save') && params['save'] != null\n            ? SaveOptions.fromJson((params['save'] as Map))\n            : null,\n        params.containsKey('willSave') && params['willSave'] != null\n            ? (params['willSave'] as bool?)\n            : null,\n        params.containsKey('willSaveWaitUntil') &&\n                params['willSaveWaitUntil'] != null\n            ? (params['willSaveWaitUntil'] as bool?)\n            : null,\n      );\n\n  final TextDocumentSyncKind? change;\n\n  final bool? openClose;\n\n  final SaveOptions? save;\n\n  final bool? willSave;\n\n  final bool? willSaveWaitUntil;\n\n  Map toJson() => {\n    'change': change?.toJson(),\n    'openClose': openClose,\n    'save': save?.toJson(),\n    'willSave': willSave,\n    'willSaveWaitUntil': willSaveWaitUntil,\n  };\n  @override\n  int get hashCode {\n    var hash = 541969480;\n    hash = _hashCombine(hash, _deepHashCode(change));\n    hash = _hashCombine(hash, _deepHashCode(openClose));\n    hash = _hashCombine(hash, _deepHashCode(save));\n    hash = _hashCombine(hash, _deepHashCode(willSave));\n    hash = _hashCombine(hash, _deepHashCode(willSaveWaitUntil));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextDocumentSyncOptions &&\n      change == other.change &&\n      openClose == other.openClose &&\n      save == other.save &&\n      willSave == other.willSave &&\n      willSaveWaitUntil == other.willSaveWaitUntil;\n}\n\nclass TextDocumentSyncOptions$Builder {\n  TextDocumentSyncOptions$Builder._();\n\n  TextDocumentSyncKind? change;\n\n  bool? openClose;\n\n  SaveOptions? save;\n\n  bool? willSave;\n\n  bool? willSaveWaitUntil;\n}\n\nclass TextEdit {\n  TextEdit._(this.newText, this.range);\n\n  factory TextEdit(void Function(TextEdit$Builder) init) {\n    final b = TextEdit$Builder._();\n    init(b);\n    return TextEdit._(b.newText, b.range);\n  }\n\n  factory TextEdit.fromJson(Map params) => TextEdit._(\n    params.containsKey('newText') && params['newText'] != null\n        ? (params['newText'] as String?)\n        : null,\n    params.containsKey('range') && params['range'] != null\n        ? Range.fromJson((params['range'] as Map))\n        : null,\n  );\n\n  final String? newText;\n\n  final Range? range;\n\n  Map toJson() => {'newText': newText, 'range': range?.toJson()};\n  @override\n  int get hashCode {\n    var hash = 1034224162;\n    hash = _hashCombine(hash, _deepHashCode(newText));\n    hash = _hashCombine(hash, _deepHashCode(range));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is TextEdit && newText == other.newText && range == other.range;\n}\n\nclass TextEdit$Builder {\n  TextEdit$Builder._();\n\n  String? newText;\n\n  Range? range;\n}\n\nclass VersionedTextDocumentIdentifier {\n  VersionedTextDocumentIdentifier._(this.uri, this.version);\n\n  factory VersionedTextDocumentIdentifier(\n    void Function(VersionedTextDocumentIdentifier$Builder) init,\n  ) {\n    final b = VersionedTextDocumentIdentifier$Builder._();\n    init(b);\n    return VersionedTextDocumentIdentifier._(b.uri, b.version);\n  }\n\n  factory VersionedTextDocumentIdentifier.fromJson(Map params) =>\n      VersionedTextDocumentIdentifier._(\n        params.containsKey('uri') && params['uri'] != null\n            ? (params['uri'] as String?)\n            : null,\n        params.containsKey('version') && params['version'] != null\n            ? (params['version'] as int?)\n            : null,\n      );\n\n  final String? uri;\n\n  final int? version;\n\n  Map toJson() => {'uri': uri, 'version': version};\n  @override\n  int get hashCode {\n    var hash = 6046273;\n    hash = _hashCombine(hash, _deepHashCode(uri));\n    hash = _hashCombine(hash, _deepHashCode(version));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is VersionedTextDocumentIdentifier &&\n      uri == other.uri &&\n      version == other.version;\n}\n\nclass VersionedTextDocumentIdentifier$Builder {\n  VersionedTextDocumentIdentifier$Builder._();\n\n  String? uri;\n\n  int? version;\n}\n\nclass WorkspaceClientCapabilities {\n  WorkspaceClientCapabilities._(\n    this.applyEdit,\n    this.didChangeConfiguration,\n    this.didChangeWatchedFiles,\n    this.executeCommand,\n    this.symbol,\n  );\n\n  factory WorkspaceClientCapabilities(\n    void Function(WorkspaceClientCapabilities$Builder) init,\n  ) {\n    final b = WorkspaceClientCapabilities$Builder._();\n    init(b);\n    return WorkspaceClientCapabilities._(\n      b.applyEdit,\n      b.didChangeConfiguration,\n      b.didChangeWatchedFiles,\n      b.executeCommand,\n      b.symbol,\n    );\n  }\n\n  factory WorkspaceClientCapabilities.fromJson(Map params) =>\n      WorkspaceClientCapabilities._(\n        params.containsKey('applyEdit') && params['applyEdit'] != null\n            ? (params['applyEdit'] as bool?)\n            : null,\n        params.containsKey('didChangeConfiguration') &&\n                params['didChangeConfiguration'] != null\n            ? DynamicRegistrationCapability.fromJson(\n                (params['didChangeConfiguration'] as Map),\n              )\n            : null,\n        params.containsKey('didChangeWatchedFiles') &&\n                params['didChangeWatchedFiles'] != null\n            ? DynamicRegistrationCapability.fromJson(\n                (params['didChangeWatchedFiles'] as Map),\n              )\n            : null,\n        params.containsKey('executeCommand') && params['executeCommand'] != null\n            ? DynamicRegistrationCapability.fromJson(\n                (params['executeCommand'] as Map),\n              )\n            : null,\n        params.containsKey('symbol') && params['symbol'] != null\n            ? DynamicRegistrationCapability.fromJson((params['symbol'] as Map))\n            : null,\n      );\n\n  final bool? applyEdit;\n\n  final DynamicRegistrationCapability? didChangeConfiguration;\n\n  final DynamicRegistrationCapability? didChangeWatchedFiles;\n\n  final DynamicRegistrationCapability? executeCommand;\n\n  final DynamicRegistrationCapability? symbol;\n\n  Map toJson() => {\n    'applyEdit': applyEdit,\n    'didChangeConfiguration': didChangeConfiguration?.toJson(),\n    'didChangeWatchedFiles': didChangeWatchedFiles?.toJson(),\n    'executeCommand': executeCommand?.toJson(),\n    'symbol': symbol?.toJson(),\n  };\n  @override\n  int get hashCode {\n    var hash = 1031534926;\n    hash = _hashCombine(hash, _deepHashCode(applyEdit));\n    hash = _hashCombine(hash, _deepHashCode(didChangeConfiguration));\n    hash = _hashCombine(hash, _deepHashCode(didChangeWatchedFiles));\n    hash = _hashCombine(hash, _deepHashCode(executeCommand));\n    hash = _hashCombine(hash, _deepHashCode(symbol));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is WorkspaceClientCapabilities &&\n      applyEdit == other.applyEdit &&\n      didChangeConfiguration == other.didChangeConfiguration &&\n      didChangeWatchedFiles == other.didChangeWatchedFiles &&\n      executeCommand == other.executeCommand &&\n      symbol == other.symbol;\n}\n\nclass WorkspaceClientCapabilities$Builder {\n  WorkspaceClientCapabilities$Builder._();\n\n  bool? applyEdit;\n\n  DynamicRegistrationCapability? didChangeConfiguration;\n\n  DynamicRegistrationCapability? didChangeWatchedFiles;\n\n  DynamicRegistrationCapability? executeCommand;\n\n  DynamicRegistrationCapability? symbol;\n}\n\nclass WorkspaceEdit {\n  WorkspaceEdit._(this.changes);\n\n  factory WorkspaceEdit(void Function(WorkspaceEdit$Builder) init) {\n    final b = WorkspaceEdit$Builder._();\n    init(b);\n    return WorkspaceEdit._(b.changes);\n  }\n\n  factory WorkspaceEdit.fromJson(Map params) => WorkspaceEdit._(\n    params.containsKey('changes') && params['changes'] != null\n        ? (params['changes'] as Map).map(\n            (k, v) => MapEntry<String, List<TextEdit>>(\n              (k as String),\n              (v as List).map((v) => TextEdit.fromJson((v as Map))).toList(),\n            ),\n          )\n        : null,\n  );\n\n  final Map<String, List<TextEdit>>? changes;\n\n  Map toJson() => {\n    'changes': changes?.map(\n      (k, v) => MapEntry<String, dynamic>(k, v.map((v) => v.toJson()).toList()),\n    ),\n  };\n  @override\n  int get hashCode {\n    var hash = 920194645;\n    hash = _hashCombine(hash, _deepHashCode(changes));\n    return _hashComplete(hash);\n  }\n\n  @override\n  bool operator ==(Object other) =>\n      other is WorkspaceEdit && _deepEquals(changes, other.changes);\n}\n\nclass WorkspaceEdit$Builder {\n  WorkspaceEdit$Builder._();\n\n  Map<String, List<TextEdit>>? changes;\n}\n\nint _hashCombine(int hash, int value) {\n  hash = 0x1fffffff & (hash + value);\n  hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));\n  return hash ^ (hash >> 6);\n}\n\nint _hashComplete(int hash) {\n  hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));\n  hash = hash ^ (hash >> 11);\n  return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));\n}\n\nint _deepHashCode(dynamic value) {\n  if (value is List) {\n    return value.map(_deepHashCode).reduce(_hashCombine);\n  }\n  if (value is Map) {\n    return (value.keys\n            .map((key) => _hashCombine(key.hashCode, _deepHashCode(value[key])))\n            .toList(growable: false)\n          ..sort())\n        .reduce(_hashCombine);\n  }\n  return value.hashCode;\n}\n\nbool _deepEquals(dynamic left, dynamic right) {\n  if (left is List && right is List) {\n    final leftLength = left.length;\n    final rightLength = right.length;\n    if (leftLength != rightLength) return false;\n    for (var i = 0; i < leftLength; i++) {\n      if (!_deepEquals(left[i], right[i])) return false;\n    }\n    return true;\n  }\n  if (left is Map && right is Map) {\n    final leftLength = left.length;\n    final rightLength = right.length;\n    if (leftLength != rightLength) return false;\n    for (final key in left.keys) {\n      if (!_deepEquals(left[key], right[key])) return false;\n    }\n    return true;\n  }\n  return left == right;\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/protocol/language_server/messages.yaml",
    "content": "TextDocumentItem:\n  uri: String\n  text: String\n  languageId: String\n  version: int\n\nTextDocumentIdentifier:\n  uri: String\n\nVersionedTextDocumentIdentifier:\n  uri: String\n  version: int\n\nTextDocumentContentChangeEvent:\n  range: Range\n  rangeLength: int\n  text: String\n\nRange:\n  start: Position\n  end: Position\n\nPosition:\n  line: int\n  character: int\n\nDiagnostics:\n  uri: String\n  diagnostics:\n    listType: Diagnostic\n\nDiagnostic:\n  range: Range\n  severity: int\n  code: dynamic\n  source: String\n  message: String\n\nCompletionList:\n  isIncomplete: bool\n  items:\n    listType: CompletionItem\n\nCompletionItem:\n  label: String\n  kind: CompletionItemKind\n  detail: String\n  documentation: String\n  sortText: String\n  filterText: String\n  insertText: String\n  insertTextFormat: InsertTextFormat\n  textEdit: TextEdit\n  additionalTextEdits:\n    listType: TextEdit\n  command: Command\n  data: dynamic\n\nCompletionItemKind:\n  enumValues:\n    text: 1\n    method: 2\n    function: 3\n    constructor: 4\n    field: 5\n    variable: 6\n    classKind: 7\n    interface: 8\n    module: 9\n    property: 10\n    unit: 11\n    value: 12\n    enumKind: 13\n    keyword: 14\n    snippet: 15\n    color: 16\n    file: 17\n    reference: 18\n  wireType: int\n\nInsertTextFormat:\n  enumValues:\n    plainText: 1\n    snippet: 2\n  wireType: int\n\nTextEdit:\n  range: Range\n  newText: String\n\nCommand:\n  title: String\n  command: String\n  arguments:\n    listType: dynamic\n\nLocation:\n  uri: String\n  range: Range\n\nDynamicRegistrationCapability:\n  dynamicRegistration: bool\n\nWorkspaceClientCapabilities:\n  applyEdit: bool\n  didChangeConfiguration: DynamicRegistrationCapability\n  didChangeWatchedFiles: DynamicRegistrationCapability\n  symbol: DynamicRegistrationCapability\n  executeCommand: DynamicRegistrationCapability\n\nSynchronizationCapabilities:\n  dynamicRegistration: bool\n  willSave: bool\n  willSaveWaitUntil: bool\n  didSave: bool\n\nCompletionItemCapabilities:\n  snippetSupport: bool\n\nCompletionCapabilities:\n  dynamicRegistration: bool\n  completionItem: CompletionItemCapabilities\n\nHoverCapabilities:\n  dynamicRegistration: bool\n  contentFormat:\n    listType: String\n\nCodeActionCapabilities:\n  dynamicRegistration: bool\n  codeActionLiteralSupport: CodeActionLiteralSupport\n\nCodeActionLiteralSupport:\n  codeActionKind: CodeActionKinds\n\nCodeActionKinds:\n  valueSet:\n    listType: String # open ended enum\n\nTextDocumentClientCapabilities:\n  codeAction: CodeActionCapabilities\n  completion: CompletionCapabilities\n  hover: HoverCapabilities\n  synchronization: SynchronizationCapabilities\n  codeLens: DynamicRegistrationCapability\n  definition: DynamicRegistrationCapability\n  documentHighlight: DynamicRegistrationCapability\n  documentLink: DynamicRegistrationCapability\n  documentSymbol: DynamicRegistrationCapability\n  formatting: DynamicRegistrationCapability\n  onTypeFormatting: DynamicRegistrationCapability\n  references: DynamicRegistrationCapability\n  rename: DynamicRegistrationCapability\n\nClientCapabilities:\n  workspace: WorkspaceClientCapabilities\n  textDocument: TextDocumentClientCapabilities\n\nTextDocumentSyncKind:\n  enumValues:\n    none: 0\n    full: 1\n    incremental: 2\n  wireType: int\n\nCompletionOptions:\n  resolveProvider: bool\n  triggerCharacters:\n    listType: String\n\nSignatureHelpOptions:\n  triggerCharacters:\n    listType: String\n\nCodeLensOptions:\n  resolveProvider: bool\n\nDocumentOnTypeFormattingOptions:\n  firstTriggerCharacter: String\n  moreTriggerCharacter:\n    listType: String\n\nDocumentLinkOptions:\n  resolveProvider: bool\n\nExecuteCommandOptions:\n  commands:\n    listType: String\n\nSaveOptions:\n  includeText: bool\n\nTextDocumentSyncOptions:\n  openClose: bool\n  change: TextDocumentSyncKind\n  willSave: bool\n  willSaveWaitUntil: bool\n  save: SaveOptions\n\nServerCapabilities:\n  codeActionProvider: bool\n  codeLensProvider: CodeLensOptions\n  completionProvider: CompletionOptions\n  definitionProvider: bool\n  documentFormattingProvider: bool\n  documentHighlightProvider: bool\n  documentLinkProvider: DocumentLinkOptions\n  documentOnTypeFormattingProvider: DocumentOnTypeFormattingOptions\n  documentRangeFormattingProvider: bool\n  documentSymbolProvider: bool\n  executeCommandProvider: ExecuteCommandOptions\n  hoverProvider: bool\n  implementationProvider: bool\n  referencesProvider: bool\n  renameProvider: bool\n  signatureHelpProvider: SignatureHelpOptions\n  textDocumentSync: TextDocumentSyncOptions\n  workspaceSymbolProvider: bool\n\nReferenceContext:\n  includeDeclaration: bool\n\nHover:\n  contents: String\n  range: Range\n\nHoverMarkup:\n  contents: MarkupContent\n  range: Range\n\nCodeActionContext:\n  diagnostics:\n    listType: Diagnostic\n\nCodeAction:\n  title: String\n  kind: String\n  diagnostics:\n    listType: Diagnostic\n  edit: WorkspaceEdit\n  command: Command\n\nApplyWorkspaceEditParams:\n  label: String\n  edit: WorkspaceEdit\n\nWorkspaceEdit:\n  # Not using `documentChanges` since there is no reasonable way to support text\n  # document version\n  changes:\n    mapType:\n      listType: TextEdit\n\nDocumentHighlight:\n  range: Range\n  kind: DocumentHighlightKind\n\nDocumentHighlightKind:\n  enumValues:\n    text: 1\n    read: 2\n    write: 3\n  wireType: int\n\nSymbolInformation:\n  name: String\n  kind: SymbolKind\n  location: Location\n  containerName: String\n\nSymbolKind:\n  enumValues:\n    file: 1\n    module: 2\n    namespace: 3\n    package: 4\n    classSymbol: 5\n    method: 6\n    property: 7\n    field: 8\n    constructor: 9\n    enumSymbol: 10\n    interface: 11\n    function: 12\n    variable: 13\n    constant: 14\n    string: 15\n    number: 16\n    boolean: 17\n    array: 18\n    object: 19\n    key: 20\n    nullSymbol: 21\n    enumMember: 22\n    struct: 23\n    event: 24\n    operator: 25\n    typeParameter: 26\n  wireType: int\n\nMarkupContentKind:\n  enumValues:\n    plaintext: 'plaintext'\n    markdown: 'markdown'\n  wireType: String\n\nMarkupContent:\n  kind: MarkupContentKind\n  value: String\n\nMessageType:\n  enumValues:\n    error: 1\n    warning: 2\n    info: 3\n    log: 4\n  wireType: int\n\nShowMessageParams:\n  type: MessageType\n  message: String\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/protocol/language_server/server.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\n\nimport 'package:json_rpc_2/json_rpc_2.dart';\n\nimport 'interface.dart';\nimport 'messages.dart';\nimport 'wireformat.dart';\n\n/// A Language Server communicating over stdin and stdout.\nclass StdIOLanguageServer {\n  final LanguageServer _server;\n  Future<void>? onDone;\n\n  /// Wrap [_server] and register RPC methods using the LSP wire protocol.\n  ///\n  /// Methods are guarded against being called before the server is initialized.\n  StdIOLanguageServer.start(this._server) {\n    final peer = Peer(lspChannel(stdin, stdout));\n\n    _lifecycleMethods(peer);\n    _fileHandlingMethods(peer);\n    _notifications(peer);\n    _completionMethods(peer);\n    _referenceMethods(peer);\n    _codeActionMethods(peer);\n\n    _server.setupExtraMethods(peer);\n\n    peer.listen();\n\n    onDone = _server.onDone.then((_) => peer.close()).then((_) => null);\n  }\n\n  bool _isInitialized = false;\n\n  void _lifecycleMethods(Peer peer) {\n    peer\n      ..registerMethod('initialize', (params) async {\n        final serverCapabilities = await _server.initialize(\n          params['processId'].valueOr(0) as int?,\n          params['rootUri'].valueOr('') as String?,\n          ClientCapabilities.fromJson(params['capabilities'].value as Map),\n          params['trace'].valueOr('off') as String?,\n        );\n        _isInitialized = true;\n        return {'capabilities': serverCapabilities.toJson()};\n      })\n      ..registerMethod('initialized', (params) => _server.initialized())\n      ..registerMethod('shutdown', _server.shutdown)\n      ..registerMethod('exit', _server.exit);\n  }\n\n  /// Register a request that will throw if throw if used before initialization.\n  void _registerRequest(Peer peer, String methodName, Function callback) {\n    peer.registerMethod(methodName, (params) {\n      if (!_isInitialized) {\n        throw RpcException(-32003, 'The server has not been initialized');\n      }\n      return callback(params);\n    });\n  }\n\n  /// Notifications are ignored until after initialization.\n  void _registerNotification(Peer peer, String methodName, Function callback) {\n    peer.registerMethod(methodName, (params) {\n      if (_isInitialized) return callback(params);\n    });\n  }\n\n  void _fileHandlingMethods(Peer peer) {\n    _registerNotification(peer, 'textDocument/didOpen', (params) {\n      _server.textDocumentDidOpen(_documentItem(params));\n    });\n    _registerNotification(peer, 'textDocument/didChange', (params) {\n      _server.textDocumentDidChange(\n        _versionedDocument(params),\n        _contentChanges(params),\n      );\n    });\n    _registerNotification(peer, 'textDocument/didClose', (params) {\n      _server.textDocumentDidClose(_document(params));\n    });\n  }\n\n  void _notifications(Peer peer) {\n    _server\n      ..diagnostics\n          .map((d) => d.toJson())\n          .forEach(\n            (diagnostics) => peer.sendNotification(\n              'textDocument/publishDiagnostics',\n              diagnostics,\n            ),\n          )\n      ..workspaceEdits.map((e) => e.toJson()).forEach((edit) {\n        // Ignore response?\n        peer.sendRequest('workspace/applyEdit', edit);\n      })\n      ..logMessages\n          .map((e) => e.toJson())\n          .forEach(\n            (message) => peer.sendNotification('window/logMessage', message),\n          )\n      ..showMessages!\n          .map((e) => e.toJson())\n          .forEach(\n            (message) => peer.sendNotification('window/showMessage', message),\n          );\n  }\n\n  void _completionMethods(Peer peer) {\n    _registerRequest(\n      peer,\n      'textDocument/completion',\n      (params) => _server\n          .textDocumentCompletion(_document(params), _position(params))\n          .then((r) => r.toJson()),\n    );\n  }\n\n  void _referenceMethods(Peer peer) {\n    _registerRequest(\n      peer,\n      'textDocument/definition',\n      (params) => _server\n          .textDocumentDefinition(_document(params), _position(params))\n          .then((r) => r?.toJson()),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/hover',\n      (params) => _server\n          .textDocumentHover(_document(params), _position(params))\n          .then((r) => r?.toJson()),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/references',\n      (params) => _server\n          .textDocumentReferences(\n            _document(params),\n            _position(params),\n            _referenceContext(params),\n          )\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/implementation',\n      (params) => _server\n          .textDocumentImplementation(_document(params), _position(params))\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/documentHighlight',\n      (params) => _server\n          .textDocumentHighlight(_document(params), _position(params))\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/documentSymbol',\n      (params) => _server\n          .textDocumentSymbols(_document(params))\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n    _registerRequest(\n      peer,\n      'workspace/symbol',\n      (params) => _server\n          .workspaceSymbol(_query(params))\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n  }\n\n  void _codeActionMethods(Peer peer) {\n    _registerRequest(\n      peer,\n      'textDocument/codeAction',\n      (params) => _server\n          .textDocumentCodeAction(\n            _document(params),\n            _range(params),\n            _codeActionContext(params),\n          )\n          .then((r) => r.map((e) => e.toJson()).toList()),\n    );\n    _registerRequest(\n      peer,\n      'workspace/executeCommand',\n      (params) => _server.workspaceExecuteCommand(\n        params['command'].value as String?,\n        params['arguments']?.value as List?,\n      ),\n    );\n    _registerRequest(\n      peer,\n      'textDocument/rename',\n      (params) async => (await _server.textDocumentRename(\n        _document(params),\n        _position(params),\n        params['newName'].value as String?,\n      ))!.toJson(),\n    );\n  }\n}\n\nTextDocumentItem _documentItem(dynamic params) =>\n    TextDocumentItem.fromJson(params['textDocument'].value as Map);\n\nVersionedTextDocumentIdentifier _versionedDocument(dynamic params) =>\n    VersionedTextDocumentIdentifier.fromJson(\n      params['textDocument'].value as Map,\n    );\n\nTextDocumentIdentifier _document(dynamic params) =>\n    TextDocumentIdentifier.fromJson(params['textDocument'].value as Map);\n\nRange _range(dynamic params) => Range.fromJson(params['range'].value as Map);\n\nPosition _position(dynamic params) =>\n    Position.fromJson(params['position'].value as Map);\n\nCodeActionContext _codeActionContext(dynamic params) =>\n    CodeActionContext.fromJson(params['context'].value as Map);\n\nReferenceContext _referenceContext(dynamic params) =>\n    ReferenceContext.fromJson(params['context'].value as Map);\n\nList<TextDocumentContentChangeEvent> _contentChanges(dynamic params) =>\n    (params['contentChanges'].value as Iterable)\n        .map((change) => TextDocumentContentChangeEvent.fromJson(change as Map))\n        .toList();\n\nString? _query(dynamic params) => params['query'].value as String?;\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/protocol/language_server/wireformat.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\n\nimport 'package:stream_channel/stream_channel.dart';\nimport 'package:async/async.dart';\n\nStreamChannel<String> lspChannel(\n  Stream<List<int>> stream,\n  StreamSink<List<int>> sink,\n) {\n  final parser = _Parser(stream);\n  final outSink = StreamSinkTransformer.fromHandlers(\n    handleData: _serialize,\n    handleDone: (sink) {\n      sink.close();\n      parser.close();\n    },\n  ).bind(sink);\n  return StreamChannel.withGuarantees(parser.stream, outSink);\n}\n\nvoid _serialize(String data, EventSink<List<int>> sink) {\n  final message = utf8.encode(data);\n  final header = 'Content-Length: ${message.length}\\r\\n\\r\\n';\n  sink.add(ascii.encode(header));\n  for (var chunk in _chunks(message, 1024)) {\n    sink.add(chunk);\n  }\n}\n\nclass _Parser {\n  final _streamCtl = StreamController<String>();\n  Stream<String> get stream => _streamCtl.stream;\n\n  final _buffer = <int>[];\n  bool _headerMode = true;\n  int _contentLength = -1;\n\n  late StreamSubscription _subscription;\n\n  _Parser(Stream<List<int>> stream) {\n    _subscription = stream\n        .expand((bytes) => bytes)\n        .listen(\n          _handleByte,\n          onDone: () {\n            _streamCtl.close();\n          },\n        );\n  }\n\n  Future<void> close() => _subscription.cancel();\n\n  void _handleByte(int byte) {\n    _buffer.add(byte);\n    if (_headerMode && _headerComplete) {\n      _contentLength = _parseContentLength();\n      _buffer.clear();\n      _headerMode = false;\n    } else if (!_headerMode && _messageComplete) {\n      _streamCtl.add(utf8.decode(_buffer));\n      _buffer.clear();\n      _headerMode = true;\n    }\n  }\n\n  /// Whether the entire message is in [_buffer].\n  bool get _messageComplete => _buffer.length >= _contentLength;\n\n  /// Decodes [_buffer] into a String and looks for the 'Content-Length' header.\n  int _parseContentLength() {\n    final asString = ascii.decode(_buffer);\n    final headers = asString.split('\\r\\n');\n    final lengthHeader = headers.firstWhere(\n      (h) => h.startsWith('Content-Length'),\n    );\n    final length = lengthHeader.split(':').last.trim();\n    return int.parse(length);\n  }\n\n  /// Whether [_buffer] ends in '\\r\\n\\r\\n'.\n  bool get _headerComplete {\n    final l = _buffer.length;\n    return l > 4 &&\n        _buffer[l - 1] == 10 &&\n        _buffer[l - 2] == 13 &&\n        _buffer[l - 3] == 10 &&\n        _buffer[l - 4] == 13;\n  }\n}\n\nIterable<List<T>> _chunks<T>(List<T> data, int chunkSize) sync* {\n  if (data.length <= chunkSize) {\n    yield data;\n    return;\n  }\n  var low = 0;\n  while (low < data.length) {\n    if (data.length > low + chunkSize) {\n      yield data.sublist(low, low + chunkSize);\n    } else {\n      yield data.sublist(low);\n    }\n    low += chunkSize;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/lib/src/server.dart",
    "content": "import 'dart:async';\n//import 'package:dart_language_server/src/protocol/language_server/interface.dart';\n//import 'package:dart_language_server/src/protocol/language_server/messages.dart';\nimport 'package:file/file.dart';\nimport 'package:file/local.dart';\nimport 'package:file/memory.dart';\nimport 'package:jael3/jael3.dart';\nimport 'package:json_rpc_2/json_rpc_2.dart' as json_rpc_2;\nimport 'package:logging/logging.dart';\nimport 'package:path/path.dart' as p;\nimport 'package:source_span/source_span.dart';\nimport 'package:string_scanner/string_scanner.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'analyzer.dart';\nimport 'object.dart';\nimport 'protocol/language_server/interface.dart';\nimport 'protocol/language_server/messages.dart';\n\nclass JaelLanguageServer extends LanguageServer {\n  final _diagnostics = StreamController<Diagnostics>();\n  final _done = Completer();\n  final _memFs = MemoryFileSystem();\n  final _localFs = const LocalFileSystem();\n  Directory? _localRootDir, _memRootDir;\n  var logger = Logger('jael');\n  late Uri _rootUri;\n  final _workspaceEdits = StreamController<ApplyWorkspaceEditParams>();\n\n  @override\n  Stream<Diagnostics> get diagnostics => _diagnostics.stream;\n\n  @override\n  Future<void> get onDone => _done.future;\n\n  @override\n  Stream<ApplyWorkspaceEditParams> get workspaceEdits => _workspaceEdits.stream;\n\n  @override\n  Future<void> shutdown() {\n    if (!_done.isCompleted) _done.complete();\n    _diagnostics.close();\n    _workspaceEdits.close();\n    return super.shutdown();\n  }\n\n  @override\n  void setupExtraMethods(json_rpc_2.Peer peer) {\n    peer.registerMethod('textDocument/formatting', (\n      json_rpc_2.Parameters params,\n    ) async {\n      var documentId = TextDocumentIdentifier.fromJson(\n        params['textDocument'].asMap,\n      );\n      var formattingOptions = FormattingOptions.fromJson(\n        params['options'].asMap,\n      );\n      return await textDocumentFormatting(documentId, formattingOptions);\n    });\n  }\n\n  @override\n  Future<ServerCapabilities> initialize(\n    int? clientPid,\n    String? rootUri,\n    ClientCapabilities clientCapabilities,\n    String? trace,\n  ) async {\n    // Find our real root dir.\n    _localRootDir = _localFs.directory(_rootUri = Uri.parse(rootUri!));\n    _memRootDir = _memFs.directory('/');\n    await _memRootDir!.create(recursive: true);\n    _memFs.currentDirectory = _memRootDir;\n\n    // Copy all real files that end in *.jael (and *.jl for legacy) into the in-memory filesystem.\n    await for (var entity in _localRootDir!.list(recursive: true)) {\n      if (entity is File && p.extension(entity.path) == '.jael') {\n        logger.info('HEY ${entity.path}');\n        var file = _memFs.file(entity.absolute.path);\n        await file.create(recursive: true);\n        await entity.openRead().cast<List<int>>().pipe(\n          file.openWrite(mode: FileMode.write),\n        );\n        logger.info(\n          'Found Jael file ${file.path}; copied to ${file.absolute.path}',\n        );\n\n        // Analyze it\n        var documentId = TextDocumentIdentifier((b) {\n          b.uri = _rootUri.replace(path: file.path).toString();\n        });\n\n        await analyzerForId(documentId);\n      }\n    }\n\n    return ServerCapabilities((b) {\n      b\n        ..codeActionProvider = false\n        ..completionProvider = CompletionOptions((b) {\n          b\n            ..resolveProvider = true\n            ..triggerCharacters =\n                'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdeghijklmnopqrstuvxwyz'.codeUnits\n                    .map((c) => String.fromCharCode(c))\n                    .toList();\n        })\n        ..definitionProvider = true\n        ..documentHighlightProvider = true\n        ..documentRangeFormattingProvider = false\n        ..documentOnTypeFormattingProvider = null\n        ..documentSymbolProvider = true\n        ..documentFormattingProvider = true\n        ..hoverProvider = true\n        ..implementationProvider = true\n        ..referencesProvider = true\n        ..renameProvider = true\n        ..signatureHelpProvider = SignatureHelpOptions((b) {})\n        ..textDocumentSync = TextDocumentSyncOptions((b) {\n          b\n            ..openClose = true\n            ..change = TextDocumentSyncKind.full\n            ..save = SaveOptions((b) {\n              b.includeText = false;\n            })\n            ..willSave = false\n            ..willSaveWaitUntil = false;\n        })\n        ..workspaceSymbolProvider = true;\n    });\n  }\n\n  Future<File> fileForId(TextDocumentIdentifier documentId) async {\n    var uri = Uri.parse(documentId.uri!);\n    var relativePath = uri.path;\n    var file = _memFs.directory('/').childFile(relativePath);\n\n    /*\n    logger.info('Searching for $relativePath. All:\\n');\n\n    await for (var entity in _memFs.directory('/').list(recursive: true)) {\n      if (entity is File) print(' * ${entity.absolute.path}');\n    }\n    */\n\n    if (!await file.exists()) {\n      await file.create(recursive: true);\n      await _localFs\n          .file(uri)\n          .openRead()\n          .cast<List<int>>()\n          .pipe(file.openWrite());\n      logger.info('Opened Jael file ${file.path}');\n    }\n\n    return file;\n  }\n\n  Future<Scanner> scannerForId(TextDocumentIdentifier documentId) async {\n    var file = await fileForId(documentId);\n    return scan(await file.readAsString(), sourceUrl: file.uri);\n  }\n\n  Future<Analyzer> analyzerForId(TextDocumentIdentifier documentId) async {\n    var scanner = await scannerForId(documentId);\n    var analyzer = Analyzer(scanner, logger)..errors.addAll(scanner.errors);\n    analyzer.parseDocument();\n    emitDiagnostics(documentId.uri, analyzer.errors.map(toDiagnostic).toList());\n    return analyzer;\n  }\n\n  Diagnostic toDiagnostic(JaelError e) {\n    return Diagnostic((b) {\n      b\n        ..message = e.message\n        ..range = toRange(e.span)\n        ..severity = toSeverity(e.severity)\n        ..source = e.span.start.sourceUrl.toString();\n    });\n  }\n\n  int toSeverity(JaelErrorSeverity s) {\n    switch (s) {\n      case JaelErrorSeverity.warning:\n        return DiagnosticSeverity.warning;\n      default:\n        return DiagnosticSeverity.error;\n    }\n  }\n\n  Range toRange(FileSpan span) {\n    return Range((b) {\n      b\n        ..start = toPosition(span.start)\n        ..end = toPosition(span.end);\n    });\n  }\n\n  Range emptyRange() {\n    return Range(\n      (b) => b\n        ..start = b.end = Position((b) {\n          b\n            ..character = 1\n            ..line = 0;\n        }),\n    );\n  }\n\n  Position toPosition(SourceLocation location) {\n    return Position((b) {\n      b\n        ..line = location.line\n        ..character = location.column;\n    });\n  }\n\n  Location toLocation(String? uri, FileSpan span) {\n    return Location((b) {\n      b\n        ..range = toRange(span)\n        ..uri = uri;\n    });\n  }\n\n  bool isReachable(JaelObject obj, Position position) {\n    return obj.span.start.line <= position.line! &&\n        obj.span.start.column <= position.character!;\n  }\n\n  CompletionItem? toCompletion(Variable<JaelObject> symbol) {\n    var value = symbol.value;\n\n    if (value is JaelCustomElement) {\n      var name = value.name;\n      return CompletionItem((b) {\n        b\n          ..kind = CompletionItemKind.classKind\n          ..label = symbol.name\n          ..textEdit = TextEdit((b) {\n            b\n              ..range = emptyRange()\n              ..newText = '<$name\\$1>\\n    \\$2\\n</name>';\n          });\n      });\n    } else if (value is JaelVariable) {\n      return CompletionItem((b) {\n        b\n          ..kind = CompletionItemKind.variable\n          ..label = symbol.name;\n      });\n    }\n\n    return null;\n  }\n\n  void emitDiagnostics(String? uri, Iterable<Diagnostic> diagnostics) {\n    _diagnostics.add(\n      Diagnostics((b) {\n        logger.info('$uri => ${diagnostics.map((d) => d.message).toList()}');\n        b\n          ..diagnostics = diagnostics.toList()\n          ..uri = uri.toString();\n      }),\n    );\n  }\n\n  @override\n  Future textDocumentDidOpen(TextDocumentItem document) async {\n    await analyzerForId(TextDocumentIdentifier((b) => b..uri = document.uri));\n  }\n\n  @override\n  Future textDocumentDidChange(\n    VersionedTextDocumentIdentifier documentId,\n    List<TextDocumentContentChangeEvent> changes,\n  ) async {\n    var id = TextDocumentIdentifier((b) => b..uri = documentId.uri);\n    var file = await fileForId(id);\n\n    for (var change in changes) {\n      if (change.text != null) {\n        await file.writeAsString(change.text!);\n      } else if (change.range != null) {\n        String? contents = await file.readAsString();\n\n        int findIndex(Position position) {\n          var lines = contents!.split('\\n');\n\n          // Sum the length of the previous lines.\n          var lineLength = lines\n              .take(position.line! - 1)\n              .map((s) => s.length)\n              .reduce((a, b) => a + b);\n          return lineLength + position.character! - 1;\n        }\n\n        if (change.range == null) {\n          contents = change.text;\n        } else {\n          var start = findIndex(change.range!.start!),\n              end = findIndex(change.range!.end!);\n          contents = contents.replaceRange(start, end, change.text!);\n        }\n\n        logger.info('${file.path} => $contents');\n        await file.writeAsString(contents!);\n      }\n    }\n\n    await analyzerForId(id);\n  }\n\n  @override\n  Future<List> textDocumentCodeAction(\n    TextDocumentIdentifier documentId,\n    Range range,\n    CodeActionContext context,\n  ) async {\n    // TODO: implement textDocumentCodeAction\n    return [];\n  }\n\n  @override\n  Future<CompletionList> textDocumentCompletion(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var analyzer = await analyzerForId(documentId);\n    var symbols = analyzer.scope!.allVariables;\n    var reachable = symbols.where((s) => isReachable(s.value!, position));\n    return CompletionList((b) {\n      b\n        ..isIncomplete = false\n        ..items = reachable.map(toCompletion).toList();\n    });\n  }\n\n  final RegExp _id = RegExp(\n    r'(([A-Za-z][A-Za-z0-9_]*-)*([A-Za-z][A-Za-z0-9_]*))',\n  );\n\n  Future<String?> currentName(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    // First, read the file.\n    var file = await fileForId(documentId);\n    var contents = await file.readAsString();\n\n    // Next, find the current index.\n    var scanner = SpanScanner(contents);\n\n    while (!scanner.isDone &&\n        (scanner.state.line != position.line ||\n            scanner.state.column != position.character)) {\n      scanner.readChar();\n    }\n\n    // Next, just read the name.\n    if (scanner.matches(_id)) {\n      var longest = scanner.lastSpan!.text;\n\n      while (scanner.matches(_id) && scanner.position > 0 && !scanner.isDone) {\n        longest = scanner.lastSpan!.text;\n        scanner.position--;\n      }\n\n      return longest;\n    } else {\n      return null;\n    }\n  }\n\n  Future<JaelObject?> currentSymbol(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var name = await currentName(documentId, position);\n    if (name == null) return null;\n    var analyzer = await analyzerForId(documentId);\n    var symbols = analyzer.allDefinitions; // ?? analyzer.scope!.allVariables;\n    logger.info(\n      'Current symbols, seeking $name: ${symbols.map((v) => v.name)}',\n    );\n    return analyzer.scope!.resolve(name)?.value;\n  }\n\n  @override\n  Future<Location?> textDocumentDefinition(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var symbol = await currentSymbol(documentId, position);\n    if (symbol != null) {\n      return toLocation(documentId.uri, symbol.span);\n    }\n    return null;\n  }\n\n  @override\n  Future<List<DocumentHighlight>> textDocumentHighlight(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var symbol = await currentSymbol(documentId, position);\n    if (symbol != null) {\n      return symbol.usages.map((u) {\n        return DocumentHighlight((b) {\n          b\n            ..range = toRange(u.span)\n            ..kind = u.type == SymbolUsageType.definition\n                ? DocumentHighlightKind.write\n                : DocumentHighlightKind.read;\n        });\n      }).toList();\n    }\n    return [];\n  }\n\n  @override\n  Future<Hover?> textDocumentHover(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var symbol = await currentSymbol(documentId, position);\n    if (symbol != null) {\n      return Hover((b) {\n        b\n          ..contents = symbol.span.text\n          ..range = toRange(symbol.span);\n      });\n    }\n\n    return null;\n  }\n\n  @override\n  Future<List<Location>> textDocumentImplementation(\n    TextDocumentIdentifier documentId,\n    Position position,\n  ) async {\n    var defn = await textDocumentDefinition(documentId, position);\n    return defn == null ? [] : [defn];\n  }\n\n  @override\n  Future<List<Location>> textDocumentReferences(\n    TextDocumentIdentifier documentId,\n    Position position,\n    ReferenceContext context,\n  ) async {\n    var symbol = await currentSymbol(documentId, position);\n    if (symbol != null) {\n      return symbol.usages.map((u) {\n        return toLocation(documentId.uri, u.span);\n      }).toList();\n    }\n\n    return [];\n  }\n\n  @override\n  Future<WorkspaceEdit> textDocumentRename(\n    TextDocumentIdentifier documentId,\n    Position position,\n    String? newName,\n  ) async {\n    var symbol = await currentSymbol(documentId, position);\n    if (symbol != null) {\n      return WorkspaceEdit((b) {\n        b.changes = {\n          symbol.name: symbol.usages.map((u) {\n            return TextEdit((b) {\n              b\n                ..range = toRange(u.span)\n                ..newText =\n                    (symbol is JaelCustomElement &&\n                        u.type == SymbolUsageType.definition)\n                    ? '\"$newName\"'\n                    : newName;\n            });\n          }).toList(),\n        };\n      });\n    }\n    return WorkspaceEdit((b) {\n      b.changes = {};\n    });\n  }\n\n  @override\n  Future<List<SymbolInformation>> textDocumentSymbols(\n    TextDocumentIdentifier documentId,\n  ) async {\n    var analyzer = await analyzerForId(documentId);\n    return analyzer.allDefinitions.map((symbol) {\n      return SymbolInformation((b) {\n        b\n          ..kind = SymbolKind.classSymbol\n          ..name = symbol.name\n          ..location = toLocation(documentId.uri, symbol.value!.span);\n      });\n    }).toList();\n  }\n\n  @override\n  Future<void> workspaceExecuteCommand(String? command, List? arguments) async {\n    // TODO: implement workspaceExecuteCommand\n  }\n\n  @override\n  Future<List<SymbolInformation>> workspaceSymbol(String? query) async {\n    var values = <JaelObject?>[];\n\n    await for (var file in _memRootDir!.list(recursive: true)) {\n      if (file is File) {\n        var id = TextDocumentIdentifier((b) {\n          b.uri = file.uri.toString();\n        });\n        var analyzer = await analyzerForId(id);\n        values.addAll(analyzer.allDefinitions.map((v) => v.value));\n      }\n    }\n\n    return values.map((o) {\n      return SymbolInformation((b) {\n        b\n          ..name = o!.name\n          ..location = toLocation(o.span.sourceUrl.toString(), o.span)\n          ..containerName = p.basename(o.span.sourceUrl!.path)\n          ..kind = o is JaelCustomElement\n              ? SymbolKind.classSymbol\n              : SymbolKind.variable;\n      });\n    }).toList();\n  }\n\n  Future<List<TextEdit>?> textDocumentFormatting(\n    TextDocumentIdentifier documentId,\n    FormattingOptions formattingOptions,\n  ) async {\n    try {\n      var errors = <JaelError>[];\n      var file = await fileForId(documentId);\n      var contents = await file.readAsString();\n      var document = parseDocument(\n        contents,\n        sourceUrl: file.uri,\n        onError: errors.add,\n      );\n      if (errors.isNotEmpty) return null;\n      var formatter = JaelFormatter(\n        formattingOptions.tabSize!,\n        formattingOptions.insertSpaces,\n        80,\n      );\n      var formatted = formatter.apply(document!);\n      logger.info('Original:$contents\\nFormatted:\\n$formatted');\n      if (formatted.isNotEmpty) await file.writeAsString(formatted);\n      return [\n        TextEdit((b) {\n          b\n            ..newText = formatted\n            ..range = toRange(\n              document.span,\n            ); //document == null ? emptyRange() : toRange(document.span);\n        }),\n      ];\n    } catch (e, st) {\n      logger.severe('Formatter error', e, st);\n      return null;\n    }\n  }\n\n  @override\n  void initialized() {\n    // TODO: implement initialized\n  }\n\n  @override\n  // TODO: implement showMessages\n  Stream<ShowMessageParams>? get showMessages => null;\n}\n\nabstract class DiagnosticSeverity {\n  static const int error = 0, warning = 1, information = 2, hint = 3;\n}\n\nclass FormattingOptions {\n  final num? tabSize;\n\n  final bool? insertSpaces;\n\n  FormattingOptions(this.tabSize, this.insertSpaces);\n\n  factory FormattingOptions.fromJson(Map json) {\n    return FormattingOptions(\n      json['tabSize'] as num?,\n      json['insertSpaces'] as bool?,\n    );\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_language_server/melos_jael3_language_server.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/jael_language_server/pubspec.yaml",
    "content": "name: jael3_language_server\nversion: 8.1.0\ndescription: Language Server Protocol implementation for the Jael templating engine.\nhomepage: https://github.com/angel-dart/vscode\npublish_to: none\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  args: ^2.4.0\n#  dart_language_server: ^0.1.16\n  file: ^7.0.0\n  io: ^1.0.0\n  jael3: ^8.0.0\n  jael3_preprocessor: ^8.0.0\n  belatuk_symbol_table: ^5.0.0\n  json_rpc_2: ^4.0.0\n  logging: ^1.2.0\n  path: ^1.8.0\n  source_span: ^1.10.0\n  string_scanner: ^1.2.0\n  lints: ^6.0.0\n  stream_channel: ^2.1.0\n  async: ^2.11.0\nexecutables:\n  jael3_language_server: jael3_language_server\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.4.0\n\n* Require Dart >= 3.11\n\n## 8.3.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n* Updated `file` to 7.0.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.1\n\n* Fixed `jael3` version\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.2.0\n\n* Updated to use `package:belatuk_code_buffer`\n\n## 4.1.0\n\n* Updated to use `package:belatuk_symbol_table`\n* Updated linter to `package:lints`\n\n## 4.0.1\n\n* Resolved static analysis warnings\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.0.1\n\n* Fixed a bug where failed file resolutions would not become proper errors.\n\n## 2.0.0+1\n\n* Homepage update for Pub.\n\n## 2.0.0\n\n* Dart 2 updates.\n* Fix a templating bug where multiple inheritance did not work.\n\n## 1.0.0+1\n\n* Minor change to `Patcher` signature for Dart 2 compatibility.\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/README.md",
    "content": "# Jael Ppreprocessor\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3_preprocessor?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/jael/jael_preprocessor/LICENSE)\n\nA pre-processor for resolving blocks and includes within [Jael 3](https://pub.dev/packages/jael3) templates.\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  jael3_prepreprocessor: ^8.0.0\n```\n\n## Usage\n\nIt is unlikely that you will directly use this package, as it is more of an implementation detail than a requirement. However, it is responsible for handling `include` and `block` directives (template inheritance), so you are a package maintainer and want to support Jael, read on.\n\nTo keep things simple, just use the `resolve` function, which will take care of inheritance for you.\n\n```dart\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;\n\nmyFunction() async {\n  var doc = await parseTemplateSomehow();\n  var resolved = await jael.resolve(doc, dir, onError: (e) => doSomething());\n}\n```\n\nYou may occasionally need to manually patch in functionality that is not available through the official Jael packages. To achieve this, simply provide an `Iterable` of `Patcher` functions:\n\n```dart\nmyOtherFunction(jael.Document doc) {\n  return jael.resolve(doc, dir, onError: errorHandler, patch: [\n    syntactic(),\n    sugar(),\n    etc(),\n  ]);\n}\n```\n\n**This package uses `package:file`, rather than `dart:io`.**\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jael/jael_preprocessor/example/main.dart",
    "content": "import 'dart:async';\n\nimport 'package:file/file.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;\n\nFuture<jael.Document?> process(\n  jael.Document doc,\n  Directory dir,\n  Function(jael.JaelError e) errorHandler,\n) {\n  return jael.resolve(\n    doc,\n    dir,\n    onError: errorHandler,\n    patch: [\n      (doc, dir, onError) {\n        print(doc!.root.children.length);\n        return doc;\n      },\n    ],\n  );\n}\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/lib/jael3_preprocessor.dart",
    "content": "import 'dart:async';\nimport 'dart:collection';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:file/file.dart';\nimport 'package:jael3/jael3.dart';\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\n\n/// Modifies a Jael document.\ntypedef Patcher =\n    FutureOr<Document>? Function(\n      Document? document,\n      Directory currentDirectory,\n      void Function(JaelError error)? onError,\n    );\n\n/// Expands all `block[name]` tags within the template, replacing them with the correct content.\n///\n/// To apply additional patches to resolved documents, provide a set of [patch]\n/// functions.\nFuture<Document?> resolve(\n  Document document,\n  Directory currentDirectory, {\n  void Function(JaelError error)? onError,\n  Iterable<Patcher>? patch,\n}) async {\n  onError ?? (e) => throw e;\n\n  // Resolve all includes...\n  var includesResolved = await resolveIncludes(\n    document,\n    currentDirectory,\n    onError,\n  );\n\n  var patched = await applyInheritance(\n    includesResolved,\n    currentDirectory,\n    onError,\n    patch,\n  );\n\n  if (patch?.isNotEmpty != true) {\n    return patched;\n  }\n\n  for (var p in patch!) {\n    patched = await p(patched, currentDirectory, onError);\n  }\n\n  return patched;\n}\n\n/// Folds any `extend` declarations.\nFuture<Document?> applyInheritance(\n  Document? document,\n  Directory currentDirectory,\n  void Function(JaelError error)? onError,\n  Iterable<Patcher>? patch,\n) async {\n  if (document == null) {\n    return null;\n  }\n  if (document.root.tagName.name != 'extend') {\n    // This is not an inherited template, so just fill in the existing blocks.\n    var root = replaceChildrenOfElement(\n      document.root,\n      {},\n      onError,\n      true,\n      false,\n    );\n    return Document(document.doctype, root);\n  }\n\n  var element = document.root;\n  var attr = element.attributes.firstWhereOrNull((a) => a.name == 'src');\n  if (attr == null) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'Missing \"src\" attribute in \"extend\" tag.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else if (attr.value is! StringLiteral) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'The \"src\" attribute in an \"extend\" tag must be a string literal.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else {\n    // In theory, there exists:\n    // * A single root template with a number of blocks\n    // * Some amount of <extend src=\"...\"> templates.\n\n    // To produce an accurate representation, we need to:\n    // 1. Find the root template, and store a copy in a variable.\n    // 2: For each <extend> template:\n    //  a. Enumerate the block overrides it defines\n    //  b. Replace matching blocks in the current document\n    //  c. If there is no block, and this is the LAST <extend>, fill in the default block content.\n    var hierarchy = await resolveHierarchy(document, currentDirectory, onError);\n    var out = hierarchy?.root;\n\n    if (out is! RegularElement) {\n      return hierarchy!.rootDocument;\n    }\n\n    Element setOut(\n      Element out,\n      Map<String?, RegularElement> definedOverrides,\n      bool anyTemplatesRemain,\n    ) {\n      var children = <ElementChild>[];\n\n      // Replace matching blocks, etc.\n      for (var c in out.children) {\n        if (c is Element) {\n          children.addAll(\n            replaceBlocks(\n              c,\n              definedOverrides,\n              onError,\n              false,\n              anyTemplatesRemain,\n            ),\n          );\n        } else {\n          children.add(c);\n        }\n      }\n\n      var root = hierarchy!.root as RegularElement;\n      return RegularElement(\n        root.lt,\n        root.tagName,\n        root.attributes,\n        root.gt,\n        children,\n        root.lt2,\n        root.slash,\n        root.tagName2,\n        root.gt2,\n      );\n    }\n\n    // Loop through all extends, filling in blocks.\n    while (hierarchy!.extendsTemplates.isNotEmpty) {\n      var tmpl = hierarchy.extendsTemplates.removeFirst();\n      var definedOverrides = findBlockOverrides(tmpl, onError);\n      //if (definedOverrides == null) break;\n      out = setOut(\n        out!,\n        definedOverrides,\n        hierarchy.extendsTemplates.isNotEmpty,\n      );\n    }\n\n    // Lastly, just default-fill any remaining blocks.\n    var definedOverrides = findBlockOverrides(out!, onError);\n    out = setOut(out, definedOverrides, false);\n\n    // Return our processed document.\n    return Document(document.doctype, out);\n  }\n}\n\nMap<String, RegularElement> findBlockOverrides(\n  Element tmpl,\n  void Function(JaelError e)? onError,\n) {\n  var out = <String, RegularElement>{};\n\n  for (var child in tmpl.children) {\n    if (child is RegularElement && child.tagName.name == 'block') {\n      var name =\n          child.attributes\n                  .firstWhereOrNull((a) => a.name == 'name')\n                  ?.value\n                  ?.compute(SymbolTable())\n              as String?;\n      if (name != null && name.trim().isNotEmpty == true) {\n        out[name] = child;\n      }\n    }\n  }\n\n  return out;\n}\n\n/// Resolves the document hierarchy at a given node in the tree.\nFuture<DocumentHierarchy?> resolveHierarchy(\n  Document document,\n  Directory currentDirectory,\n  void Function(JaelError e)? onError,\n) async {\n  var extendsTemplates = Queue<Element>();\n  String? parent;\n\n  Document? doc = document;\n  while (doc != null && (parent = getParent(doc, onError)) != null) {\n    try {\n      extendsTemplates.addFirst(doc.root);\n      var file = currentDirectory.childFile(parent!);\n      var parsed = parseDocument(\n        await file.readAsString(),\n        sourceUrl: file.uri,\n        onError: onError,\n      )!;\n\n      doc = await resolveIncludes(parsed, currentDirectory, onError);\n    } on FileSystemException catch (e) {\n      onError!(\n        JaelError(JaelErrorSeverity.error, e.message, document.root.span),\n      );\n      return null;\n    }\n  }\n\n  if (doc == null) {\n    return null;\n  }\n  return DocumentHierarchy(doc, extendsTemplates);\n}\n\nclass DocumentHierarchy {\n  final Document rootDocument;\n  final Queue<Element> extendsTemplates; // FIFO\n\n  DocumentHierarchy(this.rootDocument, this.extendsTemplates);\n\n  Element get root => rootDocument.root;\n}\n\nIterable<ElementChild> replaceBlocks(\n  Element element,\n  Map<String?, RegularElement> definedOverrides,\n  void Function(JaelError e)? onError,\n  bool replaceWithDefault,\n  bool anyTemplatesRemain,\n) {\n  if (element.tagName.name == 'block') {\n    var nameAttr = element.attributes.firstWhereOrNull((a) => a.name == 'name');\n    var name = nameAttr?.value?.compute(SymbolTable());\n\n    if (name?.trim()?.isNotEmpty != true) {\n      onError!(\n        JaelError(\n          JaelErrorSeverity.warning,\n          'This <block> has no `name` attribute, and will be outputted as-is.',\n          element.span,\n        ),\n      );\n      return [element];\n    } else if (!definedOverrides.containsKey(name)) {\n      if (element is RegularElement) {\n        if (anyTemplatesRemain || !replaceWithDefault) {\n          // If there are still templates remaining, this current block may eventually\n          // be resolved. Keep it alive.\n\n          // We can't get rid of the block itself, but it may have blocks as children...\n          var inner = allChildrenOfRegularElement(\n            element,\n            definedOverrides,\n            onError,\n            replaceWithDefault,\n            anyTemplatesRemain,\n          );\n\n          return [\n            RegularElement(\n              element.lt,\n              element.tagName,\n              element.attributes,\n              element.gt,\n              inner,\n              element.lt2,\n              element.slash,\n              element.tagName2,\n              element.gt2,\n            ),\n          ];\n        } else {\n          // Otherwise, just return the default contents.\n          return element.children;\n        }\n      } else {\n        return [element];\n      }\n    } else {\n      return allChildrenOfRegularElement(\n        definedOverrides[name]!,\n        definedOverrides,\n        onError,\n        replaceWithDefault,\n        anyTemplatesRemain,\n      );\n    }\n  } else if (element is SelfClosingElement) {\n    return [element];\n  } else {\n    return [\n      replaceChildrenOfRegularElement(\n        element as RegularElement,\n        definedOverrides,\n        onError,\n        replaceWithDefault,\n        anyTemplatesRemain,\n      ),\n    ];\n  }\n}\n\nElement replaceChildrenOfElement(\n  Element el,\n  Map<String, RegularElement> definedOverrides,\n  void Function(JaelError e)? onError,\n  bool replaceWithDefault,\n  bool anyTemplatesRemain,\n) {\n  if (el is RegularElement) {\n    return replaceChildrenOfRegularElement(\n      el,\n      definedOverrides,\n      onError,\n      replaceWithDefault,\n      anyTemplatesRemain,\n    );\n  } else {\n    return el;\n  }\n}\n\nRegularElement replaceChildrenOfRegularElement(\n  RegularElement el,\n  Map<String?, RegularElement> definedOverrides,\n  void Function(JaelError e)? onError,\n  bool replaceWithDefault,\n  bool anyTemplatesRemain,\n) {\n  var children = allChildrenOfRegularElement(\n    el,\n    definedOverrides,\n    onError,\n    replaceWithDefault,\n    anyTemplatesRemain,\n  );\n  return RegularElement(\n    el.lt,\n    el.tagName,\n    el.attributes,\n    el.gt,\n    children,\n    el.lt2,\n    el.slash,\n    el.tagName2,\n    el.gt2,\n  );\n}\n\nList<ElementChild> allChildrenOfRegularElement(\n  RegularElement el,\n  Map<String?, RegularElement> definedOverrides,\n  void Function(JaelError e)? onError,\n  bool replaceWithDefault,\n  bool anyTemplatesRemain,\n) {\n  var children = <ElementChild>[];\n\n  for (var c in el.children) {\n    if (c is Element) {\n      children.addAll(\n        replaceBlocks(\n          c,\n          definedOverrides,\n          onError,\n          replaceWithDefault,\n          anyTemplatesRemain,\n        ),\n      );\n    } else {\n      children.add(c);\n    }\n  }\n\n  return children;\n}\n\n/// Finds the name of the parent template.\nString? getParent(Document document, void Function(JaelError error)? onError) {\n  var element = document.root;\n  if (element.tagName.name != 'extend') return null;\n\n  var attr = element.attributes.firstWhereOrNull((a) => a.name == 'src');\n  if (attr == null) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'Missing \"src\" attribute in \"extend\" tag.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else if (attr.value is! StringLiteral) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'The \"src\" attribute in an \"extend\" tag must be a string literal.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else {\n    return (attr.value as StringLiteral).value;\n  }\n}\n\n/// Expands all `include[src]` tags within the template, and fills in the content of referenced files.\nFuture<Document?> resolveIncludes(\n  Document? document,\n  Directory currentDirectory,\n  void Function(JaelError error)? onError,\n) async {\n  if (document == null) {\n    return null;\n  }\n  var rootElement = await _expandIncludes(\n    document.root,\n    currentDirectory,\n    onError,\n  );\n  if (rootElement != null) {\n    return Document(document.doctype, rootElement);\n  } else {\n    return null;\n  }\n}\n\nFuture<Element?> _expandIncludes(\n  Element element,\n  Directory currentDirectory,\n  void Function(JaelError error)? onError,\n) async {\n  if (element.tagName.name != 'include') {\n    if (element is SelfClosingElement) {\n      return element;\n    } else if (element is RegularElement) {\n      var expanded = <ElementChild>[];\n\n      for (var child in element.children) {\n        if (child is Element) {\n          var includeElement = await _expandIncludes(\n            child,\n            currentDirectory,\n            onError,\n          );\n          if (includeElement != null) {\n            expanded.add(includeElement);\n          }\n        } else {\n          expanded.add(child);\n        }\n      }\n\n      return RegularElement(\n        element.lt,\n        element.tagName,\n        element.attributes,\n        element.gt,\n        expanded,\n        element.lt2,\n        element.slash,\n        element.tagName2,\n        element.gt2,\n      );\n    } else {\n      throw UnsupportedError(\n        'Unsupported element type: ${element.runtimeType}',\n      );\n    }\n  }\n\n  var attr = element.attributes.firstWhereOrNull((a) => a.name == 'src');\n  if (attr == null) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'Missing \"src\" attribute in \"include\" tag.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else if (attr.value is! StringLiteral) {\n    onError!(\n      JaelError(\n        JaelErrorSeverity.warning,\n        'The \"src\" attribute in an \"include\" tag must be a string literal.',\n        element.tagName.span,\n      ),\n    );\n    return null;\n  } else {\n    var src = (attr.value as StringLiteral).value;\n    var file = currentDirectory.fileSystem.file(\n      currentDirectory.uri.resolve(src),\n    );\n    var contents = await file.readAsString();\n    var doc = parseDocument(contents, sourceUrl: file.uri, onError: onError)!;\n    var processed = await (resolve(\n      doc,\n      currentDirectory.fileSystem.directory(file.dirname),\n      onError: onError,\n    ));\n    if (processed == null) {\n      return null;\n    }\n    return processed.root;\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/melos_jael3_preprocessor.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/jael_preprocessor/pubspec.yaml",
    "content": "name: jael3_preprocessor\nversion: 8.4.0\ndescription: A pre-processor for resolving blocks and includes within Jael templates.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/jael/jael_preprocessor\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  file: ^7.0.0\n  jael3: ^8.0.0\n  belatuk_symbol_table: ^5.1.0\n  collection: ^1.17.0\ndev_dependencies:\n  belatuk_code_buffer: ^5.1.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/test/block_test.dart",
    "content": "import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:file/file.dart';\nimport 'package:file/memory.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late FileSystem fileSystem;\n\n  setUp(() {\n    fileSystem = MemoryFileSystem();\n\n    // a.jl\n    fileSystem.file('a.jl').writeAsStringSync('<b>a.jl</b>');\n\n    // b.jl\n    fileSystem\n        .file('b.jl')\n        .writeAsStringSync(\n          '<i><include src=\"a.jl\" /><block name=\"greeting\"><p>Hello</p></block></i>',\n        );\n\n    // c.jl\n    // NOTE: This SHOULD NOT produce \"yes\", because the only children expanded within an <extend>\n    // are <block>s.\n    fileSystem\n        .file('c.jl')\n        .writeAsStringSync(\n          '<extend src=\"b.jl\"><block name=\"greeting\">Goodbye</block>Yes</extend>',\n        );\n\n    // d.jl\n    // This should not output \"Yes\", either.\n    // It should actually produce the same as c.jl, since it doesn't define any unique blocks.\n    fileSystem\n        .file('d.jl')\n        .writeAsStringSync(\n          '<extend src=\"c.jl\"><block name=\"greeting\">Saluton!</block>Yes</extend>',\n        );\n\n    // e.jl\n    fileSystem\n        .file('e.jl')\n        .writeAsStringSync(\n          '<extend src=\"c.jl\"><block name=\"greeting\">Angel <b><block name=\"name\">default</block></b></block></extend>',\n        );\n\n    // fox.jl\n    fileSystem\n        .file('fox.jl')\n        .writeAsStringSync(\n          '<div><block name=\"dance\">The name is <block name=\"name\">default-name</block></block></div>',\n        );\n\n    // trot.jl\n    fileSystem\n        .file('trot.jl')\n        .writeAsStringSync(\n          '<extend src=\"fox.jl\"><block name=\"name\">CONGA <i><block name=\"exclaim\">YEAH</block></i></block></extend>',\n        );\n\n    // foxtrot.jl\n    fileSystem\n        .file('foxtrot.jl')\n        .writeAsStringSync(\n          '<extend src=\"trot.jl\"><block name=\"exclaim\">framework</block></extend>',\n        );\n  });\n\n  test('blocks are replaced or kept', () async {\n    var file = fileSystem.file('c.jl');\n    var original = jael.parseDocument(\n      await file.readAsString(),\n      sourceUrl: file.uri,\n      onError: (e) => throw e,\n    )!;\n    var processed = await (jael.resolve(\n      original,\n      fileSystem.directory(fileSystem.currentDirectory),\n      onError: (e) => throw e,\n    ));\n    var buf = CodeBuffer();\n    var scope = SymbolTable();\n    const jael.Renderer().render(processed!, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<i>\n  <b>\n    a.jl\n  </b>\n  Goodbye\n</i>\n    '''\n          .trim(),\n    );\n  });\n\n  test('block defaults are emitted', () async {\n    var file = fileSystem.file('b.jl');\n    var original = jael.parseDocument(\n      await file.readAsString(),\n      sourceUrl: file.uri,\n      onError: (e) => throw e,\n    )!;\n    var processed = await (jael.resolve(\n      original,\n      fileSystem.directory(fileSystem.currentDirectory),\n      onError: (e) => throw e,\n    ));\n    var buf = CodeBuffer();\n    var scope = SymbolTable();\n    const jael.Renderer().render(processed!, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<i>\n  <b>\n    a.jl\n  </b>\n  <p>\n    Hello\n  </p>\n</i>\n    '''\n          .trim(),\n    );\n  });\n\n  test(\n    'block resolution only redefines blocks at one level at a time',\n    () async {\n      var file = fileSystem.file('d.jl');\n      var original = jael.parseDocument(\n        await file.readAsString(),\n        sourceUrl: file.uri,\n        onError: (e) => throw e,\n      )!;\n      var processed = await (jael.resolve(\n        original,\n        fileSystem.directory(fileSystem.currentDirectory),\n        onError: (e) => throw e,\n      ));\n      var buf = CodeBuffer();\n      var scope = SymbolTable();\n      const jael.Renderer().render(processed!, buf, scope);\n      print(buf);\n\n      expect(\n        buf.toString(),\n        '''\n<i>\n  <b>\n    a.jl\n  </b>\n  Goodbye\n</i>\n    '''\n            .trim(),\n      );\n    },\n  );\n\n  test('blocks within blocks', () async {\n    var file = fileSystem.file('foxtrot.jl');\n    var original = jael.parseDocument(\n      await file.readAsString(),\n      sourceUrl: file.uri,\n      onError: (e) => throw e,\n    )!;\n    var processed = await (jael.resolve(\n      original,\n      fileSystem.directory(fileSystem.currentDirectory),\n      onError: (e) => throw e,\n    ));\n    var buf = CodeBuffer();\n    var scope = SymbolTable();\n    const jael.Renderer().render(processed!, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<div>\n  The name is CONGA \n  <i>\n    framework\n  </i>\n</div>\n    '''\n          .trim(),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/jael/jael_preprocessor/test/include_test.dart",
    "content": "import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';\nimport 'package:file/file.dart';\nimport 'package:file/memory.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;\nimport 'package:belatuk_symbol_table/belatuk_symbol_table.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late FileSystem fileSystem;\n\n  setUp(() {\n    fileSystem = MemoryFileSystem();\n\n    // a.jl\n    fileSystem.file('a.jl').writeAsStringSync('<b>a.jl</b>');\n\n    // b.jl\n    fileSystem.file('b.jl').writeAsStringSync('<i><include src=\"a.jl\"></i>');\n\n    // c.jl\n    fileSystem.file('c.jl').writeAsStringSync('<u><include src=\"b.jl\"></u>');\n  });\n\n  test('includes are expanded', () async {\n    var file = fileSystem.file('c.jl');\n    var original = jael.parseDocument(\n      await file.readAsString(),\n      sourceUrl: file.uri,\n      onError: (e) => throw e,\n    )!;\n    var processed = await jael.resolveIncludes(\n      original,\n      fileSystem.directory(fileSystem.currentDirectory),\n      (e) => throw e,\n    );\n    var buf = CodeBuffer();\n    var scope = SymbolTable();\n    const jael.Renderer().render(processed!, buf, scope);\n    print(buf);\n\n    expect(\n      buf.toString(),\n      '''\n<u>\n  <i>\n    <b>\n      a.jl\n    </b>\n  </i>\n</u>\n'''\n          .trim(),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/jael/jael_web/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.1.0\n\n* Require Dart >= 3.11\n* Updated `analyzer` to 13.0.0\n\n## 8.0.0\n\n* Require Dart >= 3.9\n* Updated `lints` to 6.0.0\n* Updated `analyzer` to 8.4.x\n* Updated `build` to 4.0.x\n* Updated `source_gen` to 4.0.0\n* Fixed linter warnings\n* Updated repository link\n\n## 7.1.1\n\n* Added `exclusive` parameter to `createSync`\n\n## 7.1.0\n\n* Upgraded to `analyzer` 5.x.x\n* Fixed deprecation\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.1\n\n* Skipped release\n\n## 6.0.0\n\n* Skipped release\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0\n\n* Skipped release\n\n## 2.0.0\n\n* Skipped release\n\n## 1.0.0\n\n* Skipped release\n"
  },
  {
    "path": "packages/jael/jael_web/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jael/jael_web/README.md",
    "content": "# JAEL3 Web\n\n[![Pub](https://img.shields.io/pub/v/jael_web.svg)](https://pub.dartlang.org/packages/jael_web)\n[![build status](https://travis-ci.org/angel-dart/jael_web.svg)](https://travis-ci.org/angel-dart/jael)\n\nExperimental virtual DOM/SPA engine built on Jael. Supports SSR.\n**Not ready for production use.**\n\n## TODO\n\n* Bug: Builder failed to generate the class\n"
  },
  {
    "path": "packages/jael/jael_web/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jael/jael_web/build.yaml",
    "content": "builders:\n  jael_web:\n    import: \"package:jael3_web/builder.dart\"\n    builder_factories:\n      - jaelComponentBuilder\n    build_extensions:\n      .dart:\n        - .jael3_web_cmp.g.part\n    auto_apply: root_package\n    applies_builders: [\"source_gen|combining_builder\", \"source_gen|part_cleanup\"]"
  },
  {
    "path": "packages/jael/jael_web/example/main.dart",
    "content": "import 'package:jael3_web/jael3_web.dart';\nimport 'package:jael3_web/elements.dart';\npart 'main.g.dart';\n\n@Jael(\n  template: '''\n<div>\n  <h1>Hello, Jael!</h1>\n  <i>Current time: {{now}}</i>\n</div>\n''',\n)\nclass Hello extends Component with _HelloJaelTemplate {\n  @override\n  DateTime get now => DateTime.now();\n}\n\n// Could also have been:\nclass Hello2 extends Component {\n  DateTime get now => DateTime.now();\n\n  @override\n  DomNode render() {\n    return div(\n      c: [\n        h1(c: [text('Hello, Jael!')]),\n        i(c: [text('Current time: $now')]),\n      ],\n    );\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/example/main.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'main.dart';\n\n// **************************************************************************\n// JaelComponentGenerator\n// **************************************************************************\n\nmixin _HelloJaelTemplate implements Component<dynamic> {\n  DateTime get now;\n  @override\n  DomNode render() {\n    return h('div', {}, [\n      h('h1', {}, [text('Hello, Jael!')]),\n      h('i', {}, [text('Current time: '), text(now.toString())]),\n    ]);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/example/stateful.dart",
    "content": "import 'dart:async';\nimport 'package:jael3_web/jael3_web.dart';\npart 'stateful.g.dart';\n\nvoid main() {}\n\nclass _AppState {\n  final int? ticks;\n\n  _AppState({this.ticks});\n\n  _AppState copyWith({int? ticks}) {\n    return _AppState(ticks: ticks ?? this.ticks);\n  }\n}\n\n@Jael(template: '<div>Tick count: {{state.ticks}}</div>')\nclass StatefulApp extends Component<_AppState> with _StatefulAppJaelTemplate {\n  Timer? _timer;\n\n  StatefulApp() {\n    state = _AppState(ticks: 0);\n    _timer = Timer.periodic(Duration(seconds: 1), (t) {\n      setState(state.copyWith(ticks: t.tick));\n    });\n  }\n\n  @override\n  void beforeDestroy() {\n    _timer!.cancel();\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/example/stateful.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'stateful.dart';\n\n// **************************************************************************\n// JaelComponentGenerator\n// **************************************************************************\n\nmixin _StatefulAppJaelTemplate implements Component<_AppState> {\n  //Timer? get _timer;\n  @override\n  void beforeDestroy();\n\n  @override\n  DomNode render() {\n    return h('div', {}, [text('Tick count: '), text(state.ticks.toString())]);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/example/using_components.dart",
    "content": "import 'package:jael3_web/jael3_web.dart';\npart 'using_components.g.dart';\n\n@Jael(\n  template: '''\n<div>\n  <h1>Welcome to my app</h1>\n  <LabeledInput name=\"username\" />\n</div>\n''',\n)\nclass MyApp extends Component with _MyAppJaelTemplate {}\n\n@Jael(\n  template: '''\n<div>\n  <label>\n    <b>{{name}}:</b>\n  </label>\n  <br>\n  <input name=name placeholder=\"Enter \" + name + \"...\" type=\"text\">\n</div>\n''',\n)\nclass LabeledInput extends Component with _LabeledInputJaelTemplate {\n  @override\n  final String? name;\n\n  LabeledInput({this.name});\n}\n"
  },
  {
    "path": "packages/jael/jael_web/example/using_components.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'using_components.dart';\n\n// **************************************************************************\n// JaelComponentGenerator\n// **************************************************************************\n\nmixin _MyAppJaelTemplate implements Component<dynamic> {\n  @override\n  DomNode render() {\n    return h('div', {}, [\n      h('h1', {}, [text('Welcome to my app')]),\n      LabeledInput(name: \"username\"),\n    ]);\n  }\n}\n\nmixin _LabeledInputJaelTemplate implements Component<dynamic> {\n  String? get name;\n  @override\n  DomNode render() {\n    return h('div', {}, [\n      h('label', {}, [\n        h('b', {}, [text(name.toString()), text(':')]),\n      ]),\n      h('br', {}, []),\n      h('input', {\n        'name': name,\n        'placeholder': \"Enter ${name!}...\",\n        'type': \"text\",\n      }, []),\n    ]);\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/builder.dart",
    "content": "export 'src/builder/builder.dart';\n"
  },
  {
    "path": "packages/jael/jael_web/lib/elements.dart",
    "content": "export 'src/elements.dart';\n"
  },
  {
    "path": "packages/jael/jael_web/lib/jael3_web.dart",
    "content": "export 'src/builder_node.dart';\nexport 'src/component.dart';\nexport 'src/dom_builder.dart';\nexport 'src/dom_node.dart';\nexport 'src/fn.dart';\nexport 'src/jael_component.dart';\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/builder/builder.dart",
    "content": "import 'dart:async';\nimport 'package:analyzer/dart/element/element.dart';\nimport 'package:build/build.dart';\nimport 'package:code_builder/code_builder.dart';\nimport 'package:jael3/jael3.dart' as jael;\nimport 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;\nimport 'package:jael3_web/jael3_web.dart';\nimport 'package:path/path.dart' as p;\nimport 'package:source_gen/source_gen.dart';\nimport 'util.dart';\n\nvar _upper = RegExp(r'^[A-Z]');\n\nBuilder jaelComponentBuilder(_) {\n  return SharedPartBuilder([JaelComponentGenerator()], 'jael3_web_cmp');\n}\n\nclass JaelComponentGenerator extends GeneratorForAnnotation<Jael> {\n  @override\n  Future<String> generateForAnnotatedElement(\n    Element element,\n    ConstantReader annotation,\n    BuildStep buildStep,\n  ) async {\n    if (element is ClassElement) {\n      // Load the template\n      String? templateString;\n      var inputId = buildStep.inputId;\n      var ann = Jael(\n        template: annotation.peek('template')?.stringValue,\n        templateUrl: annotation.peek('templateUrl')?.stringValue,\n        asDsx: annotation.peek('asDsx')?.boolValue ?? false,\n      );\n\n      if (ann.template == null && ann.templateUrl == null) {\n        throw 'Both `template` and `templateUrl` cannot be null.';\n      }\n\n      if (ann.template != null) {\n        templateString = ann.template;\n      } else {\n        var dir = p.dirname(inputId.path);\n        var assetId = AssetId(inputId.package, p.join(dir, ann.templateUrl));\n        if (!await buildStep.canRead(assetId)) {\n          throw 'Cannot find template \"${assetId.uri}\"';\n        } else {\n          templateString = await buildStep.readAsString(assetId);\n        }\n      }\n\n      var fs = BuildFileSystem(buildStep, inputId.package);\n      var errors = <jael.JaelError>[];\n      var doc = jael.parseDocument(\n        templateString!,\n        sourceUrl: inputId.uri,\n        asDSX: ann.asDsx!,\n        onError: errors.add,\n      );\n      if (errors.isEmpty) {\n        doc = await jael.resolve(\n          doc!,\n          fs.file(inputId.uri).parent,\n          onError: errors.add,\n        );\n      }\n\n      if (errors.isNotEmpty) {\n        errors.forEach(log.severe);\n        throw 'Jael processing finished with ${errors.length} error(s).';\n      }\n\n      // Generate a _XJaelTemplate mixin class\n      var clazz = Mixin((b) {\n        b\n          ..name = '_${element.name}JaelTemplate'\n          ..implements.add(convertTypeReference(element.supertype));\n\n        // Add fields corresponding to each of the class's fields.\n        for (var field in element.fields) {\n          b.methods.add(\n            Method((b) {\n              b\n                ..name = field.name\n                ..type = MethodType.getter\n                ..returns = convertTypeReference(field.type);\n            }),\n          );\n        }\n\n        // ... And methods too.\n        for (var method in element.methods) {\n          b.methods.add(\n            Method((b) {\n              b\n                ..name = method.name\n                ..returns = convertTypeReference(method.returnType)\n                ..requiredParameters.addAll(\n                  method.formalParameters\n                      .where(isRequiredParameter)\n                      .map(convertParameter),\n                )\n                ..optionalParameters.addAll(\n                  method.formalParameters\n                      .where(isOptionalParameter)\n                      .map(convertParameter),\n                );\n            }),\n          );\n        }\n\n        // Add a render() stub\n        b.methods.add(\n          Method((b) {\n            b\n              ..name = 'render'\n              ..returns = refer('DomNode')\n              ..annotations.add(refer('override'))\n              ..body = Block((b) {\n                var result = compileElementChild(doc!.root);\n                b.addExpression(result.returned);\n              });\n          }),\n        );\n      });\n\n      return clazz.accept(DartEmitter()).toString();\n    } else {\n      throw '@Jael() is only supported for classes.';\n    }\n  }\n\n  Expression compileElementChild(jael.ElementChild child) {\n    if (child is jael.TextNode || child is jael.Text) {\n      return refer('text').call([literalString(child.span.text)]);\n    } else if (child is jael.Interpolation) {\n      Expression expr = CodeExpression(Code(child.expression.span.text));\n      expr = expr.property('toString').call([]);\n      return refer('text').call([expr]);\n    } else if (child is jael.Element) {\n      // TODO: Handle strict resolution\n      var attrs = <String, Expression>{};\n      for (var attr in child.attributes) {\n        attrs[attr.name] = attr.value == null\n            ? literalTrue\n            : CodeExpression(Code(attr.value!.span.text));\n      }\n\n      var tagName = child.tagName.name;\n      if (!_upper.hasMatch(tagName)) {\n        return refer('h').call([\n          literalString(tagName),\n          literalMap(attrs),\n          literalList(child.children.map(compileElementChild)),\n        ]);\n      } else {\n        // TODO: How to pass children?\n        return refer(tagName).newInstance([], attrs);\n      }\n      // return refer(child.tagName.name).newInstance([]);\n    } else {\n      throw 'Unsupported: $child';\n    }\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/builder/util.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:typed_data';\n\nimport 'package:analyzer/dart/element/element.dart';\nimport 'package:analyzer/dart/element/type.dart';\nimport 'package:build/build.dart';\nimport 'package:code_builder/code_builder.dart';\nimport 'package:file/file.dart';\nimport 'package:path/path.dart';\n\n/// Converts a [DartType] to a [TypeReference].\nTypeReference convertTypeReference(DartType? t) {\n  return TypeReference((b) {\n    b.symbol = t?.getDisplayString();\n\n    if (t is InterfaceType) {\n      b.types.addAll(t.typeArguments.map(convertTypeReference));\n    }\n  });\n}\n\nbool isRequiredParameter(FormalParameterElement e) {\n  return e.isRequired;\n}\n\nbool isOptionalParameter(FormalParameterElement e) {\n  return e.isOptional;\n}\n\nParameter convertParameter(FormalParameterElement e) {\n  return Parameter((b) {\n    b\n      ..name = e.name ?? ''\n      ..type = convertTypeReference(e.type)\n      ..named = e.isNamed\n      ..defaultTo = e.defaultValueCode == null\n          ? null\n          : Code(e.defaultValueCode!);\n  });\n}\n\nUnsupportedError _unsupported() =>\n    UnsupportedError('Not support in R/O build file system.');\n\nclass BuildFileSystem extends FileSystem {\n  final AssetReader reader;\n  final String package;\n  Context _path = Context();\n\n  BuildFileSystem(this.reader, this.package);\n\n  @override\n  Context get path => _path;\n\n  @override\n  Directory get currentDirectory {\n    return BuildSystemDirectory(this, reader, package, _path.current);\n  }\n\n  @override\n  set currentDirectory(value) {\n    if (value is Directory) {\n      _path = Context(current: value.path);\n    } else if (value is String) {\n      _path = Context(current: value);\n    } else {\n      throw ArgumentError();\n    }\n  }\n\n  @override\n  Directory directory(path) {\n    late String p;\n    if (path is String) {\n      p = path;\n    } else if (path is Uri) {\n      p = path.toString();\n    } else if (path is FileSystemEntity) {\n      p = path.path;\n    } else {\n      throw ArgumentError();\n    }\n    return BuildSystemDirectory(this, reader, package, p);\n  }\n\n  @override\n  File file(path) {\n    late String p;\n    if (path is String) {\n      p = path;\n    } else if (path is Uri) {\n      p = path.toString();\n    } else if (path is FileSystemEntity) {\n      p = path.path;\n    } else {\n      throw ArgumentError();\n    }\n    return BuildSystemFile(this, reader, package, p);\n  }\n\n  @override\n  Future<bool> identical(String path1, String path2) => throw _unsupported();\n\n  @override\n  bool identicalSync(String path1, String path2) => throw _unsupported();\n\n  @override\n  bool get isWatchSupported => false;\n\n  @override\n  Link link(path) => throw _unsupported();\n\n  @override\n  Future<FileStat> stat(String path) => throw _unsupported();\n\n  @override\n  FileStat statSync(String path) => throw _unsupported();\n\n  @override\n  Directory get systemTempDirectory => throw _unsupported();\n\n  @override\n  Future<FileSystemEntityType> type(String path, {bool followLinks = true}) =>\n      throw _unsupported();\n\n  @override\n  FileSystemEntityType typeSync(String path, {bool followLinks = true}) =>\n      throw _unsupported();\n}\n\nclass BuildSystemFile extends File {\n  @override\n  final BuildFileSystem fileSystem;\n  final AssetReader reader;\n  final String package;\n  @override\n  final String path;\n\n  BuildSystemFile(this.fileSystem, this.reader, this.package, this.path);\n\n  @override\n  Uri get uri => fileSystem.path.toUri(path);\n\n  @override\n  File get absolute => this;\n\n  @override\n  String get basename => fileSystem.path.basename(path);\n\n  @override\n  Future<File> copy(String newPath) => throw _unsupported();\n\n  @override\n  File copySync(String newPath) => throw _unsupported();\n\n  @override\n  Future<File> create({bool exclusive = false, bool recursive = false}) =>\n      throw _unsupported();\n\n  @override\n  void createSync({bool exclusive = false, bool recursive = false}) =>\n      throw _unsupported();\n\n  @override\n  Future<FileSystemEntity> delete({bool recursive = false}) =>\n      throw _unsupported();\n\n  @override\n  void deleteSync({bool recursive = false}) => throw _unsupported();\n\n  @override\n  String get dirname => fileSystem.path.dirname(path);\n\n  @override\n  Future<bool> exists() => throw _unsupported();\n  @override\n  bool existsSync() => throw _unsupported();\n\n  @override\n  bool get isAbsolute => true;\n\n  @override\n  Future<DateTime> lastAccessed() => throw _unsupported();\n\n  @override\n  DateTime lastAccessedSync() => throw _unsupported();\n\n  @override\n  Future<DateTime> lastModified() => throw _unsupported();\n\n  @override\n  DateTime lastModifiedSync() => throw _unsupported();\n\n  @override\n  Future<int> length() => throw _unsupported();\n  @override\n  int lengthSync() => throw _unsupported();\n\n  @override\n  Future<RandomAccessFile> open({FileMode mode = FileMode.read}) =>\n      throw _unsupported();\n\n  @override\n  Stream<List<int>> openRead([int? start, int? end]) => throw _unsupported();\n\n  @override\n  RandomAccessFile openSync({FileMode mode = FileMode.read}) =>\n      throw _unsupported();\n\n  @override\n  IOSink openWrite({\n    FileMode mode = FileMode.write,\n    Encoding encoding = utf8,\n  }) => throw _unsupported();\n\n  @override\n  Directory get parent => BuildSystemDirectory(\n    fileSystem,\n    reader,\n    package,\n    fileSystem.path.dirname(path),\n  );\n\n  @override\n  Future<Uint8List> readAsBytes() {\n    // TODO: implement readAsBytes\n    throw UnimplementedError();\n  }\n\n  @override\n  Uint8List readAsBytesSync() {\n    // TODO: implement readAsBytesSync\n    throw UnimplementedError();\n  }\n\n  @override\n  Future<List<String>> readAsLines({Encoding encoding = utf8}) {\n    // TODO: implement readAsLines\n    throw UnimplementedError();\n  }\n\n  @override\n  List<String> readAsLinesSync({Encoding encoding = utf8}) =>\n      throw _unsupported();\n\n  @override\n  Future<String> readAsString({Encoding encoding = utf8}) {\n    var assetId = AssetId(package, path);\n    return reader.readAsString(assetId);\n  }\n\n  @override\n  String readAsStringSync({Encoding encoding = utf8}) => throw _unsupported();\n\n  @override\n  Future<File> rename(String newPath) => throw _unsupported();\n\n  @override\n  File renameSync(String newPath) => throw _unsupported();\n\n  @override\n  Future<String> resolveSymbolicLinks() => throw _unsupported();\n\n  @override\n  String resolveSymbolicLinksSync() => throw _unsupported();\n\n  @override\n  Future setLastAccessed(DateTime time) => throw _unsupported();\n\n  @override\n  void setLastAccessedSync(DateTime time) => throw _unsupported();\n\n  @override\n  Future setLastModified(DateTime time) => throw _unsupported();\n\n  @override\n  void setLastModifiedSync(DateTime time) => throw _unsupported();\n\n  @override\n  Future<FileStat> stat() => throw _unsupported();\n\n  @override\n  FileStat statSync() => throw _unsupported();\n\n  @override\n  Stream<FileSystemEvent> watch({\n    int events = FileSystemEvent.all,\n    bool recursive = false,\n  }) => throw _unsupported();\n\n  @override\n  Future<File> writeAsBytes(\n    List<int> bytes, {\n    FileMode mode = FileMode.write,\n    bool flush = false,\n  }) => throw _unsupported();\n\n  @override\n  void writeAsBytesSync(\n    List<int> bytes, {\n    FileMode mode = FileMode.write,\n    bool flush = false,\n  }) => throw _unsupported();\n\n  @override\n  Future<File> writeAsString(\n    String contents, {\n    FileMode mode = FileMode.write,\n    Encoding encoding = utf8,\n    bool flush = false,\n  }) => throw _unsupported();\n\n  @override\n  void writeAsStringSync(\n    String contents, {\n    FileMode mode = FileMode.write,\n    Encoding encoding = utf8,\n    bool flush = false,\n  }) => throw _unsupported();\n}\n\nclass BuildSystemDirectory extends Directory {\n  @override\n  final BuildFileSystem fileSystem;\n  final AssetReader reader;\n  final String package;\n  @override\n  final String path;\n\n  BuildSystemDirectory(this.fileSystem, this.reader, this.package, this.path);\n\n  @override\n  Directory get absolute => this;\n\n  @override\n  String get basename => fileSystem.path.basename(path);\n\n  @override\n  Directory childDirectory(String basename) {\n    return BuildSystemDirectory(\n      fileSystem,\n      reader,\n      package,\n      fileSystem.path.join(path, basename),\n    );\n  }\n\n  @override\n  File childFile(String basename) {\n    return BuildSystemFile(\n      fileSystem,\n      reader,\n      package,\n      fileSystem.path.join(path, basename),\n    );\n  }\n\n  @override\n  Link childLink(String basename) => throw _unsupported();\n\n  @override\n  Future<Directory> create({bool recursive = false}) => throw _unsupported();\n\n  @override\n  void createSync({bool recursive = false}) => throw _unsupported();\n\n  @override\n  Future<Directory> createTemp([String? prefix]) => throw _unsupported();\n\n  @override\n  Directory createTempSync([String? prefix]) => throw _unsupported();\n\n  @override\n  Future<FileSystemEntity> delete({bool recursive = false}) =>\n      throw _unsupported();\n\n  @override\n  void deleteSync({bool recursive = false}) => throw _unsupported();\n\n  @override\n  String get dirname => fileSystem.path.dirname(path);\n\n  @override\n  Future<bool> exists() => throw _unsupported();\n\n  @override\n  bool existsSync() => throw _unsupported();\n\n  @override\n  bool get isAbsolute => true;\n\n  @override\n  Stream<FileSystemEntity> list({\n    bool recursive = false,\n    bool followLinks = true,\n  }) => throw _unsupported();\n\n  @override\n  List<FileSystemEntity> listSync({\n    bool recursive = false,\n    bool followLinks = true,\n  }) => throw _unsupported();\n\n  @override\n  Directory get parent {\n    return BuildSystemDirectory(\n      fileSystem,\n      reader,\n      package,\n      fileSystem.path.dirname(path),\n    );\n  }\n\n  @override\n  Future<Directory> rename(String newPath) => throw _unsupported();\n\n  @override\n  Directory renameSync(String newPath) => throw _unsupported();\n\n  @override\n  Future<String> resolveSymbolicLinks() => throw _unsupported();\n\n  @override\n  String resolveSymbolicLinksSync() => throw _unsupported();\n\n  @override\n  Future<FileStat> stat() => throw _unsupported();\n\n  @override\n  FileStat statSync() => throw _unsupported();\n\n  @override\n  Uri get uri => fileSystem.path.toUri(path);\n\n  @override\n  Stream<FileSystemEvent> watch({\n    int events = FileSystemEvent.all,\n    bool recursive = false,\n  }) => throw _unsupported();\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/builder_node.dart",
    "content": "import 'dom_builder.dart';\nimport 'dom_node.dart';\n\nabstract class BuilderNode extends DomNode {\n  DomBuilderElement<T>? build<T>(DomBuilder<T> dom);\n\n  void destroy<T>(DomBuilderElement<T> el);\n}\n\nDomNode h(\n  String tagName, [\n  Map<String, dynamic> props = const {},\n  Iterable<DomNode> children = const [],\n]) {\n  return _H(tagName, props, children);\n}\n\nDomNode text(String value) => _Text(value);\n\nclass _Text extends BuilderNode {\n  final String text;\n\n  _Text(this.text);\n\n  @override\n  DomBuilderElement<T>? build<T>(DomBuilder<T> dom) {\n    dom.text(text);\n    // TODO: implement build\n    return null;\n  }\n\n  @override\n  void destroy<T>(DomBuilderElement<T> el) {\n    // TODO: implement destroy\n  }\n}\n\nclass _H extends BuilderNode {\n  final String tagName;\n  final Map<String, dynamic> props;\n  final Iterable<DomNode> children;\n\n  _H(this.tagName, this.props, this.children);\n\n  @override\n  DomBuilderElement<T>? build<T>(DomBuilder<T> dom) {\n    // TODO: implement build\n    return null;\n  }\n\n  @override\n  void destroy<T>(DomBuilderElement<T> el) {\n    // TODO: implement destroy\n  }\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/component.dart",
    "content": "import 'dom_node.dart';\n\nabstract class Component<State> extends DomNode {\n  late State state;\n\n  DomNode render();\n\n  void afterMount() {}\n\n  void beforeDestroy() {}\n\n  void setState(State newState) {}\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/dom_builder.dart",
    "content": "abstract class DomBuilder<T> {\n  DomBuilderElement<T> append(\n    String tagName,\n    void Function(DomBuilderElement<T>) f,\n  );\n\n  void text(String value);\n}\n\nabstract class DomBuilderElement<T> extends DomBuilder<T> {\n  void attr(String name, [String? value]);\n\n  void attrs(Map<String, String> map);\n\n  T close();\n}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/dom_node.dart",
    "content": "abstract class DomNode {}\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/elements.dart",
    "content": "// ignore_for_file: provide_deprecation_message\n\nimport 'builder_node.dart';\nimport 'dom_node.dart';\n\nMap<String, dynamic> _apply(\n  Iterable<Map<String, dynamic>> props, [\n  Map<String, dynamic>? attrs,\n]) {\n  var map = {};\n  attrs?.forEach((k, attr) {\n    if (attr is String && attr.isNotEmpty == true) {\n      map[k] = attr;\n    } else if (attr is Iterable && attr.isNotEmpty == true) {\n      map[k] = attr.toList();\n    } else if (attr != null) {\n      map[k] = attr;\n    }\n  });\n\n  for (var p in props) {\n    map.addAll(p);\n  }\n\n  return map.cast<String, dynamic>();\n}\n\nDomNode a({\n  String? href,\n  String? rel,\n  String? target,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'a',\n  _apply(\n    [p, props],\n    {\n      'href': href,\n      'rel': rel,\n      'target': target,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode abbr({\n  String? title,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'addr',\n  _apply(\n    [p, props],\n    {'title': title, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode address({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'address',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode area({\n  String? alt,\n  Iterable<num>? coordinates,\n  String? download,\n  String? href,\n  String? hreflang,\n  String? media,\n  String? nohref,\n  String? rel,\n  String? shape,\n  String? target,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'area',\n  _apply(\n    [p, props],\n    {\n      'alt': alt,\n      'coordinates': coordinates,\n      'download': download,\n      'href': href,\n      'hreflang': hreflang,\n      'media': media,\n      'nohref': nohref,\n      'rel': rel,\n      'shape': shape,\n      'target': target,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode article({\n  dynamic className,\n  dynamic style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h('article', _apply([p, props], {'class': className, 'style': style}), [\n  ...c,\n  ...children,\n]);\n\nDomNode aside({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'aside',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode audio({\n  bool? autoplay,\n  bool? controls,\n  bool? loop,\n  bool? muted,\n  String? preload,\n  String? src,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'audio',\n  _apply(\n    [p, props],\n    {\n      'autoplay': autoplay,\n      'controls': controls,\n      'loop': loop,\n      'muted': muted,\n      'preload': preload,\n      'src': src,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode b({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'b',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode base({\n  String? href,\n  String? target,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'base',\n  _apply(\n    [p, props],\n    {\n      'href': href,\n      'target': target,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode bdi({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'bdi',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode bdo({\n  String? dir,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'bdo',\n  _apply(\n    [p, props],\n    {'dir': dir, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode blockquote({\n  String? cite,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'blockquote',\n  _apply(\n    [p, props],\n    {'cite': cite, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode body({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'body',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode br() => h('br');\n\nDomNode button({\n  bool? autofocus,\n  bool? disabled,\n  form,\n  String? formaction,\n  String? formenctype,\n  String? formmethod,\n  bool? formnovalidate,\n  String? formtarget,\n  String? name,\n  String? type,\n  String? value,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'button',\n  _apply(\n    [p, props],\n    {\n      'autofocus': autofocus,\n      'disabled': disabled,\n      'form': form,\n      'formaction': formaction,\n      'formenctype': formenctype,\n      'formmethod': formmethod,\n      'formnovalidate': formnovalidate,\n      'formtarget': formtarget,\n      'name': name,\n      'type': type,\n      'value': value,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode canvas({\n  num? height,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'canvas',\n  _apply(\n    [p, props],\n    {\n      'height': height,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode cite({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'cite',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode caption({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'caption',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode code({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'code',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode col({\n  num? span,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'col',\n  _apply(\n    [p, props],\n    {'span': span, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode colgroup({\n  num? span,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'colgroup',\n  _apply(\n    [p, props],\n    {'span': span, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode datalist({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'datalist',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode dd({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'dd',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode del({\n  String? cite,\n  String? datetime,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'del',\n  _apply(\n    [p, props],\n    {\n      'cite': cite,\n      'datetime': datetime,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode details({\n  bool? open,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'details',\n  _apply(\n    [p, props],\n    {'open': open, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode dfn({\n  String? title,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'dfn',\n  _apply(\n    [p, props],\n    {'title': title, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode dialog({\n  bool? open,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'dialog',\n  _apply(\n    [p, props],\n    {'open': open, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode div({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'div',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode dl({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'dl',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode dt({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'dt',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode em({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'em',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode embed({\n  num? height,\n  String? src,\n  String? type,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'embed',\n  _apply(\n    [p, props],\n    {\n      'height': height,\n      'src': src,\n      'type': type,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode fieldset({\n  bool? disabled,\n  String? form,\n  String? name,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'fieldset',\n  _apply(\n    [p, props],\n    {\n      'disabled': disabled,\n      'form': form,\n      'name': name,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode figcaption({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'figcaption',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode figure({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'figure',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode footer({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'footer',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode form({\n  String? accept,\n  String? acceptCharset,\n  String? action,\n  bool? autocomplete,\n  String? enctype,\n  String? method,\n  String? name,\n  bool? novalidate,\n  String? target,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'form',\n  _apply(\n    [p, props],\n    {\n      'accept': accept,\n      'accept-charset': acceptCharset,\n      'action': action,\n      'autocomplete': autocomplete != null\n          ? (autocomplete ? 'on' : 'off')\n          : null,\n      'enctype': enctype,\n      'method': method,\n      'name': name,\n      'novalidate': novalidate,\n      'target': target,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode h1({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h1',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode h2({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h2',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\nDomNode h3({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h3',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode h4({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h4',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode h5({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h5',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode h6({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'h6',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode head({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'head',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode header({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'header',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode hr() => h('hr');\n\nDomNode html({\n  String? manifest,\n  String? xmlns,\n  String? lang,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'html',\n  _apply(\n    [p, props],\n    {\n      'manifest': manifest,\n      'xmlns': xmlns,\n      'lang': lang,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode i({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'i',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode iframe({\n  num? height,\n  String? name,\n  sandbox,\n  String? src,\n  String? srcdoc,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'iframe',\n  _apply(\n    [p, props],\n    {\n      'height': height,\n      'name': name,\n      'sandbox': sandbox,\n      'src': src,\n      'srcdoc': srcdoc,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode img({\n  String? alt,\n  String? crossorigin,\n  num? height,\n  String? ismap,\n  String? longdesc,\n  sizes,\n  String? src,\n  String? srcset,\n  String? usemap,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'img',\n  _apply(\n    [p, props],\n    {\n      'alt': alt,\n      'crossorigin': crossorigin,\n      'height': height,\n      'ismap': ismap,\n      'longdesc': longdesc,\n      'sizes': sizes,\n      'src': src,\n      'srcset': srcset,\n      'usemap': usemap,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode input({\n  String? accept,\n  String? alt,\n  bool? autocomplete,\n  bool? autofocus,\n  bool? checked,\n  String? dirname,\n  bool? disabled,\n  String? form,\n  String? formaction,\n  String? formenctype,\n  String? method,\n  String? formnovalidate,\n  String? formtarget,\n  num? height,\n  String? list,\n  max,\n  num? maxlength,\n  min,\n  bool? multiple,\n  String? name,\n  String? pattern,\n  String? placeholder,\n  bool? readonly,\n  bool? required,\n  num? size,\n  String? src,\n  num? step,\n  String? type,\n  String? value,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'input',\n  _apply(\n    [p, props],\n    {\n      'accept': accept,\n      'alt': alt,\n      'autocomplete': autocomplete == null\n          ? null\n          : (autocomplete ? 'on' : 'off'),\n      'autofocus': autofocus,\n      'checked': checked,\n      'dirname': dirname,\n      'disabled': disabled,\n      'form': form,\n      'formaction': formaction,\n      'formenctype': formenctype,\n      'method': method,\n      'formnovalidate': formnovalidate,\n      'formtarget': formtarget,\n      'height': height,\n      'list': list,\n      'max': max,\n      'maxlength': maxlength,\n      'min': min,\n      'multiple': multiple,\n      'name': name,\n      'pattern': pattern,\n      'placeholder': placeholder,\n      'readonly': readonly,\n      'required': required,\n      'size': size,\n      'src': src,\n      'step': step,\n      'type': type,\n      'value': value,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode ins({\n  String? cite,\n  String? datetime,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'ins',\n  _apply(\n    [p, props],\n    {\n      'cite': cite,\n      'datetime': datetime,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode kbd({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'kbd',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode keygen({\n  bool? autofocus,\n  String? challenge,\n  bool? disabled,\n  String? from,\n  String? keytype,\n  String? name,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'keygen',\n  _apply(\n    [p, props],\n    {\n      'autofocus': autofocus,\n      'challenge': challenge,\n      'disabled': disabled,\n      'from': from,\n      'keytype': keytype,\n      'name': name,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode label({\n  String? for_,\n  String? form,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'label',\n  _apply(\n    [p, props],\n    {'for': for_, 'form': form, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode legend({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'legend',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode li({\n  num? value,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'li',\n  _apply(\n    [p, props],\n    {'value': value, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode link({\n  String? crossorigin,\n  String? href,\n  String? hreflang,\n  String? media,\n  String? rel,\n  sizes,\n  String? target,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'link',\n  _apply(\n    [p, props],\n    {\n      'crossorigin': crossorigin,\n      'href': href,\n      'hreflang': hreflang,\n      'media': media,\n      'rel': rel,\n      'sizes': sizes,\n      'target': target,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode main({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'main',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode map({\n  String? name,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'map',\n  _apply(\n    [p, props],\n    {'name': name, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode mark({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'mark',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode menu({\n  String? label,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'menu',\n  _apply(\n    [p, props],\n    {\n      'label': label,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode menuitem({\n  bool? checked,\n  command,\n  bool? default_,\n  bool? disabled,\n  String? icon,\n  String? label,\n  String? radiogroup,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'menuitem',\n  _apply(\n    [p, props],\n    {\n      'checked': checked,\n      'command': command,\n      'default': default_,\n      'disabled': disabled,\n      'icon': icon,\n      'label': label,\n      'radiogroup': radiogroup,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode meta({\n  String? charset,\n  String? content,\n  String? httpEquiv,\n  String? name,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'meta',\n  _apply(\n    [p, props],\n    {\n      'charset': charset,\n      'content': content,\n      'http-equiv': httpEquiv,\n      'name': name,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode nav({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'nav',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode noscript({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'noscript',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode object({\n  String? data,\n  String? form,\n  num? height,\n  String? name,\n  String? type,\n  String? usemap,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'object',\n  _apply(\n    [p, props],\n    {\n      'data': data,\n      'form': form,\n      'height': height,\n      'name': name,\n      'type': type,\n      'usemap': usemap,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode ol({\n  bool? reversed,\n  num? start,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'ol',\n  _apply(\n    [p, props],\n    {\n      'reversed': reversed,\n      'start': start,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode optgroup({\n  bool? disabled,\n  String? label,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'optgroup',\n  _apply(\n    [p, props],\n    {\n      'disabled': disabled,\n      'label': label,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode option({\n  bool? disabled,\n  String? label,\n  bool? selected,\n  String? value,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'option',\n  _apply(\n    [p, props],\n    {\n      'disabled': disabled,\n      'label': label,\n      'selected': selected,\n      'value': value,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode output({\n  String? for_,\n  String? form,\n  String? name,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'output',\n  _apply(\n    [p, props],\n    {\n      'for': for_,\n      'form': form,\n      'name': name,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode p({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'p',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode param({\n  String? name,\n  value,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'param',\n  _apply(\n    [p, props],\n    {\n      'name': name,\n      'value': value,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode picture({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'picture',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode pre({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'pre',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode progress({\n  num? max,\n  num? value,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'progress',\n  _apply(\n    [p, props],\n    {'max': max, 'value': value, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode q({\n  String? cite,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'q',\n  _apply(\n    [p, props],\n    {'cite': cite, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode rp({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'rp',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode rt({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'rt',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode ruby({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'ruby',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode s({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  's',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode samp({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'samp',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode script({\n  bool? async,\n  String? charset,\n  bool? defer,\n  String? src,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'script',\n  _apply(\n    [p, props],\n    {\n      'async': async,\n      'charset': charset,\n      'defer': defer,\n      'src': src,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode section({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'section',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode select({\n  bool? autofocus,\n  bool? disabled,\n  String? form,\n  bool? multiple,\n  bool? required,\n  num? size,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'select',\n  _apply(\n    [p, props],\n    {\n      'autofocus': autofocus,\n      'disabled': disabled,\n      'form': form,\n      'multiple': multiple,\n      'required': required,\n      'size': size,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode small({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'small',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode source({\n  String? src,\n  String? srcset,\n  String? media,\n  sizes,\n  String? type,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'source',\n  _apply(\n    [p, props],\n    {\n      'src': src,\n      'srcset': srcset,\n      'media': media,\n      'sizes': sizes,\n      'type': type,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode span({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'span',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode strong({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'strong',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode style({\n  String? media,\n  bool? scoped,\n  String? type,\n  String? id,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'style',\n  _apply(\n    [p, props],\n    {'media': media, 'scoped': scoped, 'type': type, 'id': id},\n  ),\n  [...c, ...children],\n);\n\nDomNode sub({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'sub',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode summary({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'summary',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode sup({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'sup',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode table({\n  bool? sortable,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'table',\n  _apply(\n    [p, props],\n    {'sortable': sortable, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode tbody({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'tbody',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode td({\n  num? colspan,\n  headers,\n  num? rowspan,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'td',\n  _apply(\n    [p, props],\n    {\n      'colspan': colspan,\n      'headers': headers,\n      'rowspan': rowspan,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode textarea({\n  bool? autofocus,\n  num? cols,\n  String? dirname,\n  bool? disabled,\n  String? form,\n  num? maxlength,\n  String? name,\n  String? placeholder,\n  bool? readonly,\n  bool? required,\n  num? rows,\n  String? wrap,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'textarea',\n  _apply(\n    [p, props],\n    {\n      'autofocus': autofocus,\n      'cols': cols,\n      'dirname': dirname,\n      'disabled': disabled,\n      'form': form,\n      'maxlength': maxlength,\n      'name': name,\n      'placeholder': placeholder,\n      'readonly': readonly,\n      'required': required,\n      'rows': rows,\n      'wrap': wrap,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode tfoot({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'tfoot',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode th({\n  String? abbr,\n  num? colspan,\n  headers,\n  num? rowspan,\n  String? scope,\n  sorted,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'th',\n  _apply(\n    [p, props],\n    {\n      'abbr': abbr,\n      'colspan': colspan,\n      'headers': headers,\n      'rowspan': rowspan,\n      'scope': scope,\n      'sorted': sorted,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode thead({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'thead',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode time({\n  String? datetime,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'time',\n  _apply(\n    [p, props],\n    {'datetime': datetime, 'id': id, 'class': className, 'style': style},\n  ),\n  [...c, ...children],\n);\n\nDomNode title({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'title',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode tr({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'tr',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode track({\n  bool? default_,\n  String? kind,\n  String? label,\n  String? src,\n  String? srclang,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n}) => h(\n  'track',\n  _apply(\n    [p, props],\n    {\n      'default': default_,\n      'kind': kind,\n      'label': label,\n      'src': src,\n      'srclang': srclang,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n);\n\nDomNode u({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'u',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode ul({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'ul',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode var_({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'var',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n\nDomNode video({\n  bool? autoplay,\n  bool? controls,\n  num? height,\n  bool? loop,\n  bool? muted,\n  String? poster,\n  String? preload,\n  String? src,\n  num? width,\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'video',\n  _apply(\n    [p, props],\n    {\n      'autoplay': autoplay,\n      'controls': controls,\n      'height': height,\n      'loop': loop,\n      'muted': muted,\n      'poster': poster,\n      'preload': preload,\n      'src': src,\n      'width': width,\n      'id': id,\n      'class': className,\n      'style': style,\n    },\n  ),\n  [...c, ...children],\n);\n\nDomNode wbr({\n  String? id,\n  className,\n  style,\n  Map<String, dynamic> p = const {},\n  @deprecated Map<String, dynamic> props = const {},\n  Iterable<DomNode> c = const [],\n  @deprecated Iterable<DomNode> children = const [],\n}) => h(\n  'wbr',\n  _apply([p, props], {'id': id, 'class': className, 'style': style}),\n  [...c, ...children],\n);\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/fn.dart",
    "content": "// TODO: Lambda/anonymous component\n//\n// import 'component.dart';\n// import 'dom_node.dart';\n\n// class Fn<T> extends Component {\n//   final DomNode Function(T) f;\n\n//   Fn(this.f);\n// }\n"
  },
  {
    "path": "packages/jael/jael_web/lib/src/jael_component.dart",
    "content": "/// A annotation for components that source-gen their `render()` methods.\nclass Jael {\n  /// The raw template.\n  final String? template;\n\n  /// The path to a [template].\n  final String? templateUrl;\n\n  /// Whether to parse the [template] as `DSX`.\n  final bool? asDsx;\n\n  const Jael({this.template, this.templateUrl, this.asDsx});\n}\n\n/// Shorthand for enabling `DSX` syntax when using a [Jael] annotation.\nclass Dsx extends Jael {\n  const Dsx({super.template, super.templateUrl}) : super(asDsx: true);\n}\n"
  },
  {
    "path": "packages/jael/jael_web/melos_jael3_web.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jael/jael_web/pubspec.yaml",
    "content": "name: jael3_web\nversion: 8.1.0\ndescription: Experimental virtual DOM/SPA engine built on Jael3. Supports SSR.\npublish_to: none\nresolution: workspace\nenvironment:\n  sdk: \">=3.11.0 <4.0.0\"\ndependencies:\n  analyzer: ^13.0.0\n  build: ^4.0.0\n  build_config: ^1.0.0\n  code_builder: ^4.0.0\n  file: ^7.0.0\n  path: ^1.8.0\n  jael3: ^8.0.0\n  jael3_preprocessor: ^8.0.0\n  source_gen: ^4.0.0\ndev_dependencies:\n  build_runner: ^2.6.0\n  build_web_compilers: ^4.0.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/jinja/.gitignore",
    "content": "# Files and directories created by pub\n.dart_tool/\n.packages\n# Remove the following pattern if you wish to check in your lock file\npubspec.lock\n\n# Conventional directory for build outputs\nbuild/\n\n# Directory created by dartdoc\ndoc/api/\n"
  },
  {
    "path": "packages/jinja/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/jinja/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.6.0\n\n* Require Dart >= 3.11\n\n## 8.5.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.4.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.3.1\n\n* Updated dependencies\n\n## 8.3.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.2.1\n\n* Updated repository link\n\n## 8.2.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.1.0\n\n* Update `jinja`  to 0.5.0\n\n## 8.0.0\n\n* Require Dart >= 3.0\n* Update `jinja`  to 0.4.2\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0\n\n* Skipped release\n\n## 2.0.1\n\n* Fixed Jinja view rendering issue\n* Upgraded to `lints` linter\n\n## 2.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 1.0.0\n\n* Initial version, created by Stagehand\n"
  },
  {
    "path": "packages/jinja/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/jinja/README.md",
    "content": "# Jinja View Template for Angel3\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_jinja?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/jinja/LICENSE)\n\nA service that renders Jinja2 view template into HTML for [Angel3](https://angel3-framework.web.app) framework. Ported from Python to Dart.\n\n## Example\n\n```dart\nimport 'dart:io';\nimport 'package:angel_framework/angel_framework.dart';\nimport 'package:angel_framework/http.dart';\nimport 'package:angel_jinja/angel_jinja.dart';\nimport 'package:path/path.dart' as p;\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n  var viewsDir = p.join(\n    p.dirname(\n      p.fromUri(Platform.script),\n    ),\n    'views',\n  );\n\n  // Enable Jinja2 views\n  await app.configure(jinja(path: viewsDir));\n\n  // Add routes.\n  // See: https://github.com/ykmnkmi/jinja.dart/blob/master/example/bin/server.dart\n\n  app\n    ..get('/', (req, res) => res.render('index.html'))\n    ..get('/hello', (req, res) => res.render('hello.html', {'name': 'user'}))\n    ..get('/hello/:name', (req, res) => res.render('hello.html', req.params));\n\n  app.fallback((req, res) {\n    res\n      ..statusCode = 404\n      ..write('404 Not Found :(');\n  });\n\n  // Start the server\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n}\n```\n"
  },
  {
    "path": "packages/jinja/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/jinja/example/main.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_jinja/angel3_jinja.dart';\nimport 'package:path/path.dart' as p;\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n  var viewsDir = p.join(p.dirname(p.fromUri(Platform.script)), 'views');\n\n  // Enable Jinja2 views\n  await app.configure(jinja(path: viewsDir));\n\n  // Add routes.\n  // See: https://github.com/ykmnkmi/jinja.dart/blob/master/example/bin/server.dart\n\n  app\n    ..get('/', (req, res) => res.render('index.html'))\n    ..get('/hello', (req, res) => res.render('hello.html', {'name': 'user'}))\n    ..get('/hello/:name', (req, res) => res.render('hello.html', req.params));\n\n  app.fallback((req, res) {\n    res\n      ..statusCode = 404\n      ..write('404 Not Found :(');\n  });\n\n  // Start the server\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/jinja/example/views/hello.html",
    "content": "{% extends \"layout.html\" %}\n{% block title %}hello {{ name }}!{% endblock %}\n{% block body %}\n  <p>hello {{ name }}!</p>\n{% endblock %}"
  },
  {
    "path": "packages/jinja/example/views/index.html",
    "content": "{% extends \"layout.html\" %}\n{% block title %}Jinja.Dart!{% endblock %}\n{% block body %}\n  <p>hello Jinja.Dart!</p>\n  <a href=\"/hello/Joe\">hello Joe!</a>\n{% endblock %}"
  },
  {
    "path": "packages/jinja/example/views/layout.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <title>{% block title %}{% endblock %}</title>\n  </head>\n  <body>\n    {% block body %}{% endblock %}\n  </body>\n</html>\n"
  },
  {
    "path": "packages/jinja/lib/angel3_jinja.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:jinja/jinja.dart';\nimport 'package:jinja/loaders.dart';\n\n/// Configures an Angel server to use Jinja2 to render templates.\n///\n/// By default, templates are loaded from the filesystem;\n/// pass your own [createLoader] callback to override this.\n///\n/// All options other than [createLoader] are passed to either [FileSystemLoader]\n/// or [Environment].\nAngelConfigurer jinja({\n  Set<String> ext = const {'html'},\n  String path = 'lib/src/templates',\n  bool followLinks = true,\n  String blockStart = '{%',\n  String blockEnd = '%}',\n  String varOpen = '{{',\n  String varClose = '}}',\n  String commentStart = '{#',\n  String commentEnd = '#}',\n  defaultValue,\n  //bool autoReload = true,\n  Map<String, Function> filters = const <String, Function>{},\n  Map<String, Function> tests = const <String, Function>{},\n  Loader Function()? createLoader,\n}) {\n  return (app) {\n    createLoader ??= () {\n      return FileSystemLoader(\n        extensions: ext,\n        paths: [path],\n        followLinks: followLinks,\n      );\n    };\n    var env = Environment(\n      loader: createLoader!(),\n      blockStart: blockStart,\n      blockEnd: blockEnd,\n      variableStart: varOpen,\n      variableEnd: varClose,\n      commentStart: commentStart,\n      commentEnd: commentEnd,\n      //defaultValue: defaultValue,\n      //autoReload: autoReload,\n      filters: filters,\n      tests: tests,\n    );\n\n    app.viewGenerator = (path, [values]) {\n      return env.getTemplate(path).render(values);\n    };\n  };\n}\n"
  },
  {
    "path": "packages/jinja/melos_angel3_jinja.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/jinja/pubspec.yaml",
    "content": "name: angel3_jinja\nversion: 8.6.0\ndescription: A service that renders Jinja2 template into HTML view for Angel3. Ported from Python to Dart.\nhomepage: https://github.com/dart-backend/angel/tree/master/packages/jinja\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  jinja: ^0.6.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  path: ^1.9.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/markdown/.gitignore",
    "content": "# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n.dart_tool\n.idea"
  },
  {
    "path": "packages/markdown/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/markdown/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n* Updated `markdown` to 6.0.x\n\n## 6.1.0\n\n* Updated `markdown` to 5.x.x\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.0\n\n* Updated linter to `package:lints`\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n  \n## 3.0.0\n\n* Migrated to support Dart >= 2.12 Non NNBD\n\n## 2.0.0\n\n* Angel 2 + Dart 2 updates.\n* Use `package:file`.\n"
  },
  {
    "path": "packages/markdown/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/markdown/README.md",
    "content": "# Angel3 Markdown\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_markdown?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/markdown/LICENSE)\n\nMarkdown view generator for Angel3.\n\nWith this plug-in, you can easily serve static sites without doing more than writing simple Markdown. Thus, it is a friendly choice for writing API documentation or other tedious HTML-writing tasks.\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_framework: ^8.0.0\n  angel3_markdown: ^8.0.0\n```\n\n## Usage\n\nIt's very straightforward to configure an Angel server to use Markdown. Keep in mind to use `package:file` instead of `dart:io`:\n\n```dart\nconfigureServer(Angel app) async {\n  var fs = LocalFileSystem();\n  await app.configure(markdown(\n    // The directory where your views are located.\n    fs.directory('views'),\n  ));\n}\n```\n\nYou can then generate HTML on-the-fly in a request handler. Assuming your view directory contained a file named `hello.md`, the following would render it as an HTML response:\n\n```dart\nconfigureServer(Angel app) async {\n  app.get('/hello', (res) => res.render('hello'));\n}\n```\n\n`package:angel3_markdown` by default searches for files with a `.md` extension; however,\nyou can easily override this.\n\n## Interpolation\n\n`angel3_markdown` can interpolate the values of data from `locals` before building the Markdown. For example, with the following template `species.md`:\n\n```markdown\n# Species: {{species.name}}\nThe species *{{species.genus.name}} {{species.name}}* is fascinating...\n```\n\nYou can render as follows:\n\n```dart\nrequestHandler(ResponseContext res) {\n  return res.render('species', {\n    'species': new Species('sapiens', genius: 'homo')\n  });\n}\n```\n\nTo disable interpolation for a single bracket, prefix it with an `@`, ex: `@{{raw | not_interpolated | angular}}`.\n\n## Templates\n\nMarkdown is frequently used to build the *content* of sites, but not the templates.\nYou might want to wrap the content of pages in a custom template to apply pretty\nCSS and JS, etc:\n\n```dart\nconfigureServer(Angel app) async {\n  await app.configure(\n    markdown(\n        // The directory where your views are located.\n        fs.directory('views'), template: (content, Map locals) {\n      return '''<!DOCTYPE html>\n<html>\n    <head>\n        <title>${locals['title']} - My Site</title>\n    </head>\n    <body>\n      $content\n    </body>\n</html>\n        ''';\n    }),\n  );\n}\n```\n\nThe `template` function will have access to whatever values were passed to the renderer, or an empty `Map`.\n\n## Enhancing Markdown\n\nYou can pass an `extensionSet` to add additional features to the Markdown renderer. By default, this plug-in configures it to enable Github-flavored Markdown.\n"
  },
  {
    "path": "packages/markdown/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/markdown/example/main.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_markdown/angel3_markdown.dart';\nimport 'package:file/local.dart';\n\nvoid main() async {\n  var app = await createServer();\n  var http = AngelHttp(app);\n  var server = await http.startServer(InternetAddress.loopbackIPv4, 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n\nFuture<Angel> createServer() async {\n  // Create a new server, and install the Markdown renderer.\n  var app = Angel();\n  var fs = LocalFileSystem();\n  await app.configure(\n    markdown(\n      fs.directory('views'),\n      template: (content, locals) {\n        return '''\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">\n    <title>${locals['title'] ?? 'Example Site'} - Example Site</title>\n    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css\">\n  </head>\n  <body>\n    <div class=\"ui top fixed menu\">\n      <a class=\"header item\" href=\"/\">\n        <i class=\"home icon\"></i>\n        Home\n      </a>\n    </div>\n    <div class=\"ui container\" style=\"margin-top: 5em;\">\n      $content\n    </div>\n  </body>\n</html>\n    ''';\n      },\n    ),\n  );\n\n  // Compile a landing page\n  app.get('/', (req, res) => res.render('hello', {'title': 'Welcome'}));\n\n  return app;\n}\n"
  },
  {
    "path": "packages/markdown/example/views/hello.md",
    "content": "# Welcome\n\nWelcome to a *simple* Markdown-gen site!\n\nDo you mind **starring** the\n[Angel3 repository](https://github.com/dart-backend/angel)?\n\n```text\nLook, a code block!!!\n```\n"
  },
  {
    "path": "packages/markdown/lib/angel3_markdown.dart",
    "content": "import 'dart:async';\nimport 'dart:mirrors';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:file/file.dart';\nimport 'package:markdown/markdown.dart';\n\nfinal RegExp _braces = RegExp(r'@?{{(((\\\\})|([^}]))+)}}');\n\n/// Configures an [Angel] instance to render Markdown templates from the specified [viewsDirectory].\n///\n/// The default [extension] is `.md`. To search for a different file extension, provide a new one.\n/// By default, an [extensionSet] is provided that renders Github-flavored Markdown. This can also be overridden.\n///\n/// In many cases, Markdown content will be rendered within a larger [template] that styles the entire website.\n/// To wrap generated Markdown content in a template, provide a function that accepts a generated HTML String,\n/// and returns a String, or a `Future<String>`.\nAngelConfigurer markdown(\n  Directory viewsDirectory, {\n  String? extension,\n  ExtensionSet? extensionSet,\n  FutureOr<String> Function(String content, Map<String, dynamic> locals)?\n  template,\n}) {\n  extension ??= '.md';\n  extensionSet ??= ExtensionSet.gitHubWeb;\n\n  return (Angel app) async {\n    app.viewGenerator = (String name, [Map<String, dynamic>? locals]) async {\n      var file = viewsDirectory.childFile(\n        viewsDirectory.fileSystem.path.setExtension(name, extension!),\n      );\n      var contents = await file.readAsString();\n\n      contents = contents.replaceAllMapped(_braces, (m) {\n        var text = m[0]!;\n\n        if (text.startsWith('@')) {\n          // Raw braces\n          return text.substring(1);\n        } else {\n          var expr = m[1]!;\n          var split = expr.split('.');\n          var root = split[0];\n\n          if (locals?.containsKey(root) != true) {\n            throw UnimplementedError(\n              'Expected a local named \"$root\", but none was provided. Expression text: \"$text\"',\n            );\n          }\n\n          return _resolveDotNotation(split, locals![root]).toString();\n        }\n      });\n\n      var html = markdownToHtml(contents, extensionSet: extensionSet);\n      if (template != null) html = await template(html, locals ?? {});\n      return html;\n    };\n  };\n}\n\ndynamic _resolveDotNotation(List<String> split, target) {\n  if (split.length == 1) return target;\n\n  var mirror = reflect(target);\n\n  for (var i = 1; i < split.length; i++) {\n    mirror = mirror.getField(Symbol(split[i]));\n  }\n\n  return mirror.reflectee;\n}\n"
  },
  {
    "path": "packages/markdown/melos_angel3_markdown.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/markdown/pubspec.yaml",
    "content": "name: angel3_markdown\nversion: 8.5.0\ndescription: Angel3 Markdown view generator. Write static sites, with no build step.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/markdown\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  file: ^7.0.0\n  markdown: ^7.1.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  lints: ^6.0.0\n  test: ^1.24.0\n"
  },
  {
    "path": "packages/oauth2/.gitignore",
    "content": "# Created by .ignore support plugin (hsz.mobi)\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# CMake\ncmake-build-debug/\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\nout/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Cursive Clojure plugin\n.idea/replstate.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n### Dart template\n# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n.dart_tool"
  },
  {
    "path": "packages/oauth2/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/oauth2/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n* Updated to `uuid`\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.1\n\n* Fixed AngelHttpException error\n* [Breaking] Renamed `error` to `authError` for `AuthorizationException`\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.1\n\n* Updated README\n\n## 4.1.0\n\n* Updated linter to `package:lints`\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.3.0\n\n* Remove `implicitGrant`, and inline it into `requestAuthorizationCode`.\n\n## 2.2.0+1\n\n* Parse+verify client for `authorization_code`.\n\n## 2.2.0\n\n* Pass `client` to `exchangeAuthorizationCodeForToken`.\n* Apply `package:pedantic`.\n\n## 2.1.0\n\n* Updates\n* Support `device_code` grants.\n* Add support for [PKCE](https://tools.ietf.org/html/rfc7636).\n\n## 2.0.0\n\n* Angel 2 support.\n\n## 1.0.0+1\n\n* Dart2 updates + backwards compatibility assurance.\n"
  },
  {
    "path": "packages/oauth2/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/oauth2/README.md",
    "content": "# Angel3 OAuth2 Server\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_oauth2?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/oauth2/LICENSE)\n\nA class containing handlers that can be used within [Angel](https://angel3-framework.web.app/) to build a spec-compliant OAuth 2.0 server, including PKCE support.\n\n- [Angel3 OAuth2 Server](#angel3-oauth2-server)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Other Grants](#other-grants)\n  - [PKCE](#pkce)\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_framework: ^8.0.0\n  angel3_oauth2: ^8.0.0\n```\n\n## Usage\n\nYour server needs to have definitions of at least two types:\n\n- One model that represents a third-party application (client) trying to access a user's profile.\n- One that represents a user logged into the application.\n\nDefine a server class as such:\n\n```dart\nimport 'package:angel3_oauth2/angel3_oauth2.dart' as oauth2;\n\nclass MyServer extends oauth2.AuthorizationServer<Client, User> {}\n```\n\nThen, implement the `findClient` and `verifyClient` to ensure that the server class can not only identify a client application via a `client_id`, but that it can also verify its identity via a `client_secret`.\n\n```dart\nclass _Server extends AuthorizationServer<PseudoApplication, Map> {\n  final Uuid _uuid = Uuid();\n\n  @override\n  FutureOr<PseudoApplication> findClient(String clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n      PseudoApplication client, String clientSecret) async {\n    return client.secret == clientSecret;\n  }\n}\n```\n\nNext, write some logic to be executed whenever a user visits the authorization endpoint. In many cases, you will want to show a dialog:\n\n```dart\n@override\nFuture requestAuthorizationCode(\n  PseudoApplication client,\n  String redirectUri,\n  Iterable<String> scopes,\n  String state,\n  RequestContext req,\n  ResponseContext res) async {\n  res.render('dialog');\n}\n```\n\nNow, write logic that exchanges an authorization code for an access token, and optionally, a refresh token.\n\n```dart\n@override\nFuture<AuthorizationCodeResponse> exchangeAuthCodeForAccessToken(\n  String authCode,\n  String redirectUri,\n  RequestContext req,\n  ResponseContext res) async {\n    return AuthorizationCodeResponse('foo', refreshToken: 'bar');\n}\n```\n\nNow, set up some routes to point the server.\n\n```dart\nvoid pseudoCode() {\n  app.group('/oauth2', (router) {\n    router\n      ..get('/authorize', server.authorizationEndpoint)\n      ..post('/token', server.tokenEndpoint);\n  });\n}\n```\n\nThe `authorizationEndpoint` and `tokenEndpoint` handle all OAuth2 grant types.\n\n## Other Grants\n\nBy default, all OAuth2 grant methods will throw a `405 Method Not Allowed` error. To support any specific grant type, all you need to do is implement the method. The following are available, not including authorization code grant support (mentioned above):\n\n- `implicitGrant`\n- `resourceOwnerPasswordCredentialsGrant`\n- `clientCredentialsGrant`\n- `deviceCodeGrant`\n\nRead the [OAuth2 specification](https://tools.ietf.org/html/rfc6749) for in-depth information on each grant type.\n\n## PKCE\n\nIn some cases, you will be using OAuth2 on a mobile device, or on some other\npublic client, where the client cannot have a client\nsecret.\n\nIn such a case, you may consider using [PKCE](https://tools.ietf.org/html/rfc7636).\n\nBoth the `authorizationEndpoint` and `tokenEndpoint` inject a `Pkce` factory into the request, so it\ncan be used as follows:\n\n```dart\n@override\nFuture requestAuthorizationCode(\n    PseudoApplication client,\n    String redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res) async {\n  // Automatically throws an error if the request doesn't contain the\n  // necessary information.\n  var pkce = req.container.make<Pkce>();\n\n  // At this point, store `pkce.codeChallenge` and `pkce.codeChallengeMethod`,\n  // so that when it's time to exchange the auth code for a token, we can\n  // create a [Pkce] object, and verify the client.\n  return await getAuthCodeSomehow(client, pkce.codeChallenge, pkce.codeChallengeMethod); \n}\n\n@override\nFuture<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(\n    String authCode,\n    String redirectUri,\n    RequestContext req,\n    ResponseContext res) async {\n  // When exchanging the authorization code for a token, we'll need\n  // a `code_verifier` from the client, so that we can ensure\n  // that the correct client is trying to use the auth code.\n  //\n  // If none is present, an OAuth2 exception is thrown.\n  var codeVerifier = await getPkceCodeVerifier(req);\n\n  // Next, we'll need to retrieve the code challenge and code challenge method\n  // from earlier.\n  var codeChallenge = await getTheChallenge();\n  var codeChallengeMethod = await getTheChallengeMethod();\n\n  // Make a [Pkce] object.\n  var pkce = Pkce(codeChallengeMethod, codeChallenge);\n\n  // Call `validate`. If the client is invalid, it throws an OAuth2 exception.\n  pkce.validate(codeVerifier);\n\n  // If we reach here, we know that the `code_verifier` was valid,\n  // so we can return our authorization token as per usual.\n  return AuthorizationTokenResponse('...');\n}\n```\n"
  },
  {
    "path": "packages/oauth2/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/oauth2/example/example1.dart",
    "content": "import 'dart:async';\n\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:logging/logging.dart';\n\nimport '../test/common.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL;\n  Logger.root.onRecord.listen((record) {\n    print(\n      '${record.time} ${record.level.name.padLeft(6, ' ')} [${record.loggerName}] : ${record.message}',\n    );\n    if (record.error != null) print(record.error);\n    if (record.stackTrace != null) print(record.stackTrace);\n  });\n\n  // Declae the function\n  void setUp() async {\n    var app = Angel(reflector: MirrorsReflector());\n    var oauth2 = _AuthorizationServer();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', oauth2.authorizationEndpoint)\n        ..post('/token', oauth2.tokenEndpoint);\n    });\n\n    //app.logger.level = Level.ALL;\n    app.logger = Logger(\"oauth2\")\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    app.errorHandler = (e, req, res) async {\n      res.json(e.toJson());\n    };\n  }\n\n  setUp();\n}\n\nclass _AuthorizationServer\n    extends AuthorizationServer<PseudoApplication, PseudoUser> {\n  var logger = Logger('AuthorizationServer');\n\n  @override\n  PseudoApplication? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  FutureOr<DeviceCodeResponse> requestDeviceCode(\n    PseudoApplication client,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    return DeviceCodeResponse(\n      'foo',\n      'bar',\n      Uri.parse(\n        'https://regiostech.com',\n      ).replace(queryParameters: {'scopes': scopes.join(',')}),\n      3600,\n    );\n  }\n\n  @override\n  FutureOr<AuthorizationTokenResponse> exchangeDeviceCodeForToken(\n    PseudoApplication client,\n    String? deviceCode,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    print(\"[Server] exchangeDeviceCodeForToken\");\n    print(\"[Server] $deviceCode\");\n    print(\"[Server] $client\");\n\n    if (deviceCode == 'brute') {\n      print(\"[Server] Throws AuthorizationException\");\n\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.slowDown,\n          'Ho, brother! Ho, whoa, whoa, whoa now! You got too much dip on your chip!',\n          state,\n        ),\n      );\n    }\n\n    return AuthorizationTokenResponse('foo');\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/example/main.dart",
    "content": "// ignore_for_file: todo\nimport 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\n\nvoid main() async {\n  var app = Angel();\n  var oauth2 = _ExampleAuthorizationServer();\n  var rgxBearer = RegExp(r'^[Bb]earer ([^\\n\\s]+)$');\n\n  app.group('/auth', (router) {\n    router\n      ..get('/authorize', oauth2.authorizationEndpoint)\n      ..post('/token', oauth2.tokenEndpoint);\n  });\n\n  // Assume that all other requests must be authenticated...\n  app.fallback((req, res) {\n    var authToken = req.headers!\n        .value('authorization')\n        ?.replaceAll(rgxBearer, '')\n        .trim();\n\n    if (authToken == null) {\n      throw AngelHttpException.forbidden();\n    } else {\n      // TODO: The user has a token, now verify it.\n      // It is up to you how to store and retrieve auth tokens within your application.\n      // The purpose of `package:angel_oauth2` is to provide the transport\n      // across which you distribute these tokens in the first place.\n    }\n  });\n}\n\nclass ThirdPartyApp {}\n\nclass User {}\n\n/// A [ThirdPartyApp] can act on behalf of a [User].\nclass _ExampleAuthorizationServer\n    extends AuthorizationServer<ThirdPartyApp, User> {\n  @override\n  FutureOr<ThirdPartyApp> findClient(String? clientId) {\n    // TODO: Add your code to find the app associated with a client ID.\n    throw UnimplementedError();\n  }\n\n  @override\n  FutureOr<bool> verifyClient(ThirdPartyApp client, String? clientSecret) {\n    // TODO: Add your code to verify a client secret, if given one.\n    throw UnimplementedError();\n  }\n\n  @override\n  FutureOr requestAuthorizationCode(\n    ThirdPartyApp client,\n    String? redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n    bool implicit,\n  ) {\n    // TODO: In many cases, here you will render a view displaying to the user which scopes are being requested.\n    throw UnimplementedError();\n  }\n\n  @override\n  FutureOr<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(\n    ThirdPartyApp? client,\n    String? authCode,\n    String? redirectUri,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    // TODO: Here, you'll convert the auth code into a full-fledged token.\n    // You might have the auth code stored in a database somewhere.\n    throw UnimplementedError();\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/lib/angel3_oauth2.dart",
    "content": "export 'src/exception.dart';\nexport 'src/pkce.dart';\nexport 'src/response.dart';\nexport 'src/server.dart';\nexport 'src/token_type.dart';\n"
  },
  {
    "path": "packages/oauth2/lib/src/exception.dart",
    "content": "import 'package:angel3_http_exception/angel3_http_exception.dart';\n\n/// An Angel-friendly wrapper around OAuth2 [ErrorResponse] instances.\nclass AuthorizationException extends AngelHttpException {\n  final ErrorResponse errorResponse;\n\n  AuthorizationException(\n    this.errorResponse, {\n    super.stackTrace,\n    int? statusCode,\n    super.error,\n  }) : super(message: '', statusCode: statusCode ?? 400);\n\n  @override\n  Map toJson() {\n    var m = {\n      'error': errorResponse.code,\n      'error_description': errorResponse.description,\n    };\n\n    if (errorResponse.uri != null) {\n      m['error_uri'] = errorResponse.uri.toString();\n    }\n\n    return m;\n  }\n}\n\n/// Represents an OAuth2 authentication error.\nclass ErrorResponse {\n  /// The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.\n  static const String invalidRequest = 'invalid_request';\n\n  /// The `code_verifier` given by the client does not match the expected value.\n  static const String invalidGrant = 'invalid_grant';\n\n  /// The client is not authorized to request an authorization code using this method.\n  static const String unauthorizedClient = 'unauthorized_client';\n\n  /// The resource owner or authorization server denied the request.\n  static const String accessDenied = 'access_denied';\n\n  /// The authorization server does not support obtaining an authorization code using this method.\n  static const String unsupportedResponseType = 'unsupported_response_type';\n\n  /// The requested scope is invalid, unknown, or malformed.\n  static const String invalidScope = 'invalid_scope';\n\n  /// The authorization server encountered an unexpected condition that prevented it from fulfilling the request.\n  static const String serverError = 'server_error';\n\n  /// The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.\n  static const String temporarilyUnavailable = 'temporarily_unavailable';\n\n  /// The authorization request is still pending as the end user hasn't\n  /// yet completed the user interaction steps (Section 3.3).  The\n  /// client SHOULD repeat the Access Token Request to the token\n  /// endpoint (a process known as polling).  Before each request\n  /// the client MUST wait at least the number of seconds specified by\n  /// the \"interval\" parameter of the Device Authorization Response (see\n  /// Section 3.2), or 5 seconds if none was provided, and respect any\n  /// increase in the polling interval required by the \"slow_down\"\n  /// error.\n  static const String authorizationPending = 'authorization_pending';\n\n  /// A variant of \"authorization_pending\", the authorization request is\n  /// still pending and polling should continue, but the interval MUST\n  /// be increased by 5 seconds for this and all subsequent requests.\n  static const String slowDown = 'slow_down';\n\n  /// The \"device_code\" has expired and the device flow authorization\n  /// session has concluded.  The client MAY commence a Device\n  /// Authorization Request but SHOULD wait for user interaction before\n  /// restarting to avoid unnecessary polling.\n  static const String expiredToken = 'expired_token';\n\n  /// A short string representing the error.\n  final String code;\n\n  /// A relatively detailed description of the source of the error.\n  final String description;\n\n  /// An optional [Uri] directing users to more information about the error.\n  final Uri? uri;\n\n  /// The exact value received from the client, if a \"state\" parameter was present in the client authorization request.\n  final String? state;\n\n  const ErrorResponse(this.code, this.description, this.state, {this.uri});\n\n  @override\n  String toString() => 'OAuth2 error ($code): $description';\n}\n"
  },
  {
    "path": "packages/oauth2/lib/src/pkce.dart",
    "content": "import 'dart:convert';\nimport 'package:crypto/crypto.dart';\nimport 'exception.dart';\n\n/// A class that facilitates verification of challenges for\n/// [Proof Key for Code Exchange](https://oauth.net/2/pkce/).\nclass Pkce {\n  /// A [String] defining how to handle the [codeChallenge].\n  final String codeChallengeMethod;\n\n  /// The proof key that is used to secure public clients.\n  final String? codeChallenge;\n\n  Pkce(this.codeChallengeMethod, this.codeChallenge) {\n    assert(\n      codeChallengeMethod == 'plain' || codeChallengeMethod == 's256',\n      \"The `code_challenge_method` parameter must be either 'plain' or 's256'.\",\n    );\n  }\n\n  /// Attempts to parse a [codeChallenge] and [codeChallengeMethod] from a [Map].\n  factory Pkce.fromJson(Map data, {String? state, Uri? uri}) {\n    var codeChallenge = data['code_challenge']?.toString();\n    var codeChallengeMethod =\n        data['code_challenge_method']?.toString() ?? 'plain';\n\n    if (codeChallengeMethod != 'plain' && codeChallengeMethod != 's256') {\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          \"The `code_challenge_method` parameter must be either 'plain' or 's256'.\",\n          state,\n          uri: uri,\n        ),\n      );\n    } else if (codeChallenge?.isNotEmpty != true) {\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          'Missing `code_challenge` parameter.',\n          state,\n          uri: uri,\n        ),\n      );\n    }\n\n    return Pkce(codeChallengeMethod, codeChallenge);\n  }\n\n  /// Returns [true] if the [codeChallengeMethod] is `plain`.\n  bool get isPlain => codeChallengeMethod == 'plain';\n\n  /// Returns [true] if the [codeChallengeMethod] is `s256`.\n  bool get isS256 => codeChallengeMethod == 's256';\n\n  /// Determines if a given [codeVerifier] is valid.\n  void validate(String codeVerifier, {String? state, Uri? uri}) {\n    String foreignChallenge;\n\n    if (isS256) {\n      foreignChallenge = base64Url.encode(\n        sha256.convert(ascii.encode(codeVerifier)).bytes,\n      );\n    } else {\n      foreignChallenge = codeVerifier;\n    }\n\n    if (foreignChallenge != codeChallenge) {\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidGrant,\n          'The given `code_verifier` parameter is invalid.',\n          state,\n          uri: uri,\n        ),\n      );\n    }\n  }\n\n  /// Creates a JSON-serializable representation of this instance.\n  Map<String, dynamic> toJson() {\n    return {\n      'code_challenge': codeChallenge,\n      'code_challenge_method': codeChallengeMethod,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/lib/src/response.dart",
    "content": "/// Represents an OAuth2 authorization token.\nclass AuthorizationTokenResponse {\n  /// The string that third parties should use to act on behalf of the user in question.\n  final String accessToken;\n\n  /// An optional key that can be used to refresh the [accessToken] past its expiration.\n  final String? refreshToken;\n\n  /// An optional, but recommended integer that signifies the time left until the [accessToken] expires.\n  final int? expiresIn;\n\n  /// Optional, if identical to the scope requested by the client; otherwise, required.\n  final Iterable<String>? scope;\n\n  const AuthorizationTokenResponse(\n    this.accessToken, {\n    this.refreshToken,\n    this.expiresIn,\n    this.scope,\n  });\n\n  Map<String, dynamic> toJson() {\n    var map = <String, dynamic>{'access_token': accessToken};\n    if (refreshToken?.isNotEmpty == true) map['refresh_token'] = refreshToken;\n    if (expiresIn != null) map['expires_in'] = expiresIn;\n    if (scope != null) map['scope'] = scope!.toList();\n    return map;\n  }\n}\n\n/// Represents the response for an OAuth2 `device_code` request.\nclass DeviceCodeResponse {\n  /// REQUIRED. The device verification code.\n  final String deviceCode;\n\n  /// REQUIRED. The end-user verification code.\n  final String userCode;\n\n  /// REQUIRED. The end-user verification URI on the authorization\n  /// server. The URI should be short and easy to remember as end users\n  /// will be asked to manually type it into their user-agent.\n  final Uri verificationUri;\n\n  /// OPTIONAL.  A verification URI that includes the [userCode] (or\n  /// other information with the same function as the [userCode]),\n  /// designed for non-textual transmission.\n  final Uri? verificationUriComplete;\n\n  /// OPTIONAL.  The minimum amount of time in seconds that the client\n  /// SHOULD wait between polling requests to the token endpoint.  If no\n  /// value is provided, clients MUST use 5 as the default.\n  final int? interval;\n\n  /// The lifetime, in *seconds* of the [deviceCode] and [userCode].\n  final int expiresIn;\n\n  const DeviceCodeResponse(\n    this.deviceCode,\n    this.userCode,\n    this.verificationUri,\n    this.expiresIn, {\n    this.verificationUriComplete,\n    this.interval,\n  });\n\n  Map<String, dynamic> toJson() {\n    var out = <String, dynamic>{\n      'device_code': deviceCode,\n      'user_code': userCode,\n      'verification_uri': verificationUri.toString(),\n    };\n\n    if (verificationUriComplete != null) {\n      out['verification_uri_complete'] = verificationUriComplete.toString();\n    }\n\n    if (interval != null) out['interval'] = interval;\n    out['expires_in'] = expiresIn;\n\n    return out;\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/lib/src/server.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:logging/logging.dart';\nimport 'exception.dart';\nimport 'pkce.dart';\nimport 'response.dart';\nimport 'token_type.dart';\n\n/// A request handler that performs an arbitrary authorization token grant.\ntypedef ExtensionGrant =\n    FutureOr<AuthorizationTokenResponse> Function(\n      RequestContext req,\n      ResponseContext res,\n    );\n\nFuture<String?> _getParam(\n  RequestContext req,\n  String name,\n  String state, {\n  bool body = false,\n  bool throwIfEmpty = true,\n}) async {\n  Map<String, dynamic> data;\n\n  if (body == true) {\n    data = await req.parseBody().then((_) => req.bodyAsMap);\n  } else {\n    data = req.queryParameters;\n  }\n\n  var value = data.containsKey(name) ? data[name]?.toString() : null;\n\n  if (value?.isNotEmpty != true && throwIfEmpty) {\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.invalidRequest,\n        'Missing required parameter \"$name\".',\n        state,\n      ),\n      statusCode: 400,\n    );\n  }\n\n  return value;\n}\n\nFuture<Iterable<String>> _getScopes(\n  RequestContext req, {\n  bool body = false,\n}) async {\n  Map<String, dynamic> data;\n\n  if (body == true) {\n    data = await req.parseBody().then((_) => req.bodyAsMap);\n  } else {\n    data = req.queryParameters;\n  }\n\n  return data['scope']?.toString().split(' ') ?? [];\n}\n\n/// An OAuth2 authorization server, which issues access tokens to third parties.\nabstract class AuthorizationServer<Client, User> {\n  static Logger logger = Logger('AuthorizationServer');\n\n  const AuthorizationServer();\n\n  static const String _internalServerError =\n      'An internal server error occurred.';\n\n  /// A [Map] of custom authorization token grants. Use this to handle custom grant types, perhaps even your own.\n  Map<String, ExtensionGrant> get extensionGrants => {};\n\n  /// Finds the [Client] application associated with the given [clientId].\n  FutureOr<Client>? findClient(String? clientId);\n\n  /// Verify that a [client] is the one identified by the [clientSecret].\n  FutureOr<bool> verifyClient(Client client, String? clientSecret);\n\n  /// Retrieves the PKCE `code_verifier` parameter from a [RequestContext], or throws.\n  Future<String> getPkceCodeVerifier(\n    RequestContext req, {\n    bool body = true,\n    String? state,\n    Uri? uri,\n  }) async {\n    var data = body\n        ? await req.parseBody().then((_) => req.bodyAsMap)\n        : req.queryParameters;\n    var codeVerifier = data['code_verifier'];\n\n    if (codeVerifier == null) {\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          'Missing `code_verifier` parameter.',\n          state,\n          uri: uri,\n        ),\n      );\n    } else if (codeVerifier is! String) {\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          'The `code_verifier` parameter must be a string.',\n          state,\n          uri: uri,\n        ),\n      );\n    } else {\n      return codeVerifier;\n    }\n  }\n\n  /// Prompt the currently logged-in user to grant or deny access to the [client].\n  ///\n  /// In many applications, this will entail showing a dialog to the user in question.\n  ///\n  /// If [implicit] is `true`, then the client is requesting an *implicit grant*.\n  /// Be aware of the security implications of this - do not handle them exactly\n  /// the same.\n  FutureOr<void> requestAuthorizationCode(\n    Client client,\n    String? redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n    bool implicit,\n  ) {\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Authorization code grants are not supported.',\n        state,\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Exchanges an authorization code for an authorization token.\n  FutureOr<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(\n    Client? client,\n    String? authCode,\n    String? redirectUri,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Authorization code grants are not supported.',\n        req.uri!.queryParameters['state'] ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Refresh an authorization token.\n  FutureOr<AuthorizationTokenResponse> refreshAuthorizationToken(\n    Client? client,\n    String? refreshToken,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Refreshing authorization tokens is not supported.',\n        body['state']?.toString() ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Issue an authorization token to a user after authenticating them via [username] and [password].\n  FutureOr<AuthorizationTokenResponse> resourceOwnerPasswordCredentialsGrant(\n    Client? client,\n    String? username,\n    String? password,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Resource owner password credentials grants are not supported.',\n        body['state']?.toString() ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Performs a client credentials grant. Only use this in situations where the client is 100% trusted.\n  FutureOr<AuthorizationTokenResponse> clientCredentialsGrant(\n    Client? client,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Client credentials grants are not supported.',\n        body['state']?.toString() ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Performs a device code grant.\n  FutureOr<DeviceCodeResponse> requestDeviceCode(\n    Client client,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Device code grants are not supported.',\n        body['state']?.toString() ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Produces an authorization token from a given device code.\n  FutureOr<AuthorizationTokenResponse> exchangeDeviceCodeForToken(\n    Client client,\n    String? deviceCode,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var body = await req.parseBody().then((_) => req.bodyAsMap);\n    throw AuthorizationException(\n      ErrorResponse(\n        ErrorResponse.unsupportedResponseType,\n        'Device code grants are not supported.',\n        body['state']?.toString() ?? '',\n      ),\n      statusCode: 400,\n    );\n  }\n\n  /// Returns the [Uri] that a client can be redirected to in the case of an implicit grant.\n  Uri completeImplicitGrant(\n    AuthorizationTokenResponse token,\n    Uri redirectUri, {\n    String? state,\n  }) {\n    var queryParameters = <String, String>{};\n\n    queryParameters.addAll({\n      'access_token': token.accessToken,\n      'token_type': 'bearer',\n    });\n\n    if (state != null) queryParameters['state'] = state;\n\n    if (token.expiresIn != null) {\n      queryParameters['expires_in'] = token.expiresIn.toString();\n    }\n\n    if (token.scope != null) queryParameters['scope'] = token.scope!.join(' ');\n\n    var fragment = queryParameters.keys.fold<StringBuffer>(StringBuffer(), (\n      buf,\n      k,\n    ) {\n      if (buf.isNotEmpty) buf.write('&');\n      return buf..write('$k=${Uri.encodeComponent(queryParameters[k]!)}');\n    }).toString();\n\n    return redirectUri.replace(fragment: fragment);\n  }\n\n  /// A request handler that invokes the correct logic, depending on which type\n  /// of grant the client is requesting.\n  Future<void> authorizationEndpoint(\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var state = '';\n\n    try {\n      var query = req.queryParameters;\n      state = query['state']?.toString() ?? '';\n      var responseType = await _getParam(req, 'response_type', state);\n\n      req.container!.registerLazySingleton<Pkce>((_) {\n        return Pkce.fromJson(req.queryParameters, state: state);\n      });\n\n      if (responseType == 'code' || responseType == 'token') {\n        // Ensure client ID\n        var clientId = await _getParam(req, 'client_id', state);\n\n        // Find client\n        var client = await findClient(clientId)!;\n\n        if (client == null) {\n          throw AuthorizationException(\n            ErrorResponse(\n              ErrorResponse.unauthorizedClient,\n              'Unknown client \"$clientId\".',\n              state,\n            ),\n          );\n        }\n\n        // Grab redirect URI\n        var redirectUri = await _getParam(req, 'redirect_uri', state);\n\n        // Grab scopes\n        var scopes = await _getScopes(req);\n\n        return await requestAuthorizationCode(\n          client,\n          redirectUri,\n          scopes,\n          state,\n          req,\n          res,\n          responseType == 'token',\n        );\n      }\n\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          'Invalid or no \"response_type\" parameter provided',\n          state,\n        ),\n        statusCode: 400,\n      );\n    } on AngelHttpException {\n      rethrow;\n    } catch (e, st) {\n      throw AuthorizationException(\n        ErrorResponse(ErrorResponse.serverError, _internalServerError, state),\n        error: e,\n        statusCode: 500,\n        stackTrace: st,\n      );\n    }\n  }\n\n  static final RegExp _rgxBasic = RegExp(r'Basic ([^$]+)');\n  static final RegExp _rgxBasicAuth = RegExp(r'([^:]*):([^$]*)');\n\n  /// A request handler that either exchanges authorization codes for authorization tokens,\n  /// or refreshes authorization tokens.\n  Future tokenEndpoint(RequestContext req, ResponseContext res) async {\n    var state = '';\n    Client? client;\n\n    try {\n      AuthorizationTokenResponse? response;\n      var body = await req.parseBody().then((_) => req.bodyAsMap);\n\n      state = body['state']?.toString() ?? '';\n\n      req.container!.registerLazySingleton<Pkce>((_) {\n        return Pkce.fromJson(req.bodyAsMap, state: state);\n      });\n\n      var grantType = await _getParam(\n        req,\n        'grant_type',\n        state,\n        body: true,\n        throwIfEmpty: false,\n      );\n\n      if (grantType != 'urn:ietf:params:oauth:grant-type:device_code' &&\n          grantType != null) {\n        var match = _rgxBasic.firstMatch(\n          req.headers!.value('authorization') ?? '',\n        );\n\n        if (match != null) {\n          match = _rgxBasicAuth.firstMatch(\n            String.fromCharCodes(base64Url.decode(match[1]!)),\n          );\n        }\n\n        if (match == null) {\n          throw AuthorizationException(\n            ErrorResponse(\n              ErrorResponse.unauthorizedClient,\n              'Invalid or no \"Authorization\" header.',\n              state,\n            ),\n            statusCode: 400,\n          );\n        } else {\n          var clientId = match[1], clientSecret = match[2];\n          client = await findClient(clientId);\n\n          if (client == null) {\n            throw AuthorizationException(\n              ErrorResponse(\n                ErrorResponse.unauthorizedClient,\n                'Invalid \"client_id\" parameter.',\n                state,\n              ),\n              statusCode: 400,\n            );\n          }\n\n          if (!await verifyClient(client, clientSecret)) {\n            throw AuthorizationException(\n              ErrorResponse(\n                ErrorResponse.unauthorizedClient,\n                'Invalid \"client_secret\" parameter.',\n                state,\n              ),\n              statusCode: 400,\n            );\n          }\n        }\n      }\n\n      if (grantType == 'authorization_code') {\n        var code = await _getParam(req, 'code', state, body: true);\n        var redirectUri = await _getParam(\n          req,\n          'redirect_uri',\n          state,\n          body: true,\n        );\n        response = await exchangeAuthorizationCodeForToken(\n          client,\n          code,\n          redirectUri,\n          req,\n          res,\n        );\n      } else if (grantType == 'refresh_token') {\n        var refreshToken = await _getParam(\n          req,\n          'refresh_token',\n          state,\n          body: true,\n        );\n        var scopes = await _getScopes(req);\n        response = await refreshAuthorizationToken(\n          client,\n          refreshToken,\n          scopes,\n          req,\n          res,\n        );\n      } else if (grantType == 'password') {\n        var username = await _getParam(req, 'username', state, body: true);\n        var password = await _getParam(req, 'password', state, body: true);\n        var scopes = await _getScopes(req);\n        response = await resourceOwnerPasswordCredentialsGrant(\n          client,\n          username,\n          password,\n          scopes,\n          req,\n          res,\n        );\n      } else if (grantType == 'client_credentials') {\n        response = await clientCredentialsGrant(client, req, res);\n\n        if (response.refreshToken != null) {\n          // Remove refresh token\n          response = AuthorizationTokenResponse(\n            response.accessToken,\n            expiresIn: response.expiresIn,\n            scope: response.scope,\n          );\n        }\n      } else if (extensionGrants.containsKey(grantType)) {\n        response = await extensionGrants[grantType!]!(req, res);\n      } else if (grantType == null) {\n        // This is a device code grant.\n        var clientId = await _getParam(req, 'client_id', state, body: true);\n        client = await findClient(clientId);\n\n        if (client == null) {\n          throw AuthorizationException(\n            ErrorResponse(\n              ErrorResponse.unauthorizedClient,\n              'Invalid \"client_id\" parameter.',\n              state,\n            ),\n            statusCode: 400,\n          );\n        }\n\n        var scopes = await _getScopes(req, body: true);\n        var deviceCodeResponse = await requestDeviceCode(\n          client,\n          scopes,\n          req,\n          res,\n        );\n        return deviceCodeResponse.toJson();\n      } else if (grantType == 'urn:ietf:params:oauth:grant-type:device_code') {\n        var clientId = await _getParam(req, 'client_id', state, body: true);\n        client = await findClient(clientId);\n\n        if (client == null) {\n          throw AuthorizationException(\n            ErrorResponse(\n              ErrorResponse.unauthorizedClient,\n              'Invalid \"client_id\" parameter.',\n              state,\n            ),\n            statusCode: 400,\n          );\n        }\n\n        var deviceCode = await _getParam(req, 'device_code', state, body: true);\n        response = await exchangeDeviceCodeForToken(\n          client,\n          deviceCode,\n          state,\n          req,\n          res,\n        );\n      }\n\n      if (response != null) {\n        return <String, dynamic>{'token_type': AuthorizationTokenType.bearer}\n          ..addAll(response.toJson());\n      }\n\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.invalidRequest,\n          'Invalid or no \"grant_type\" parameter provided',\n          state,\n        ),\n        statusCode: 400,\n      );\n    } on AngelHttpException {\n      rethrow;\n    } catch (e, st) {\n      throw AuthorizationException(\n        ErrorResponse(ErrorResponse.serverError, _internalServerError, state),\n        error: e,\n        statusCode: 500,\n        stackTrace: st,\n      );\n    }\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/lib/src/token_type.dart",
    "content": "/// The various types of OAuth2 authorization tokens.\nabstract class AuthorizationTokenType {\n  static const String bearer = 'bearer', mac = 'mac';\n}\n"
  },
  {
    "path": "packages/oauth2/melos_angel3_oauth2.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/oauth2/pubspec.yaml",
    "content": "name: angel3_oauth2\nversion: 8.5.0\ndescription: A class containing handlers that can be used within Angel to build a spec-compliant OAuth 2.0 server.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/oauth2\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies: \n  angel3_framework: ^8.4.0\n  angel3_http_exception: ^8.0.0\n  crypto: ^3.0.1\n  collection: ^1.17.0\n  logging: ^1.2.0\ndev_dependencies: \n  angel3_validate: ^8.2.0\n  angel3_test: ^8.2.0\n  angel3_container: ^8.0.0\n  oauth2: ^2.0.0\n  lints: ^6.0.0\n  test: ^1.24.0\n  uuid: ^4.0.0\n"
  },
  {
    "path": "packages/oauth2/test/auth_code_test.dart",
    "content": "import 'dart:async';\nimport 'dart:collection';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:logging/logging.dart';\nimport 'package:oauth2/oauth2.dart' as oauth2;\nimport 'package:test/test.dart';\nimport 'package:uuid/uuid.dart';\nimport 'common.dart';\n\nvoid main() {\n  Angel app;\n  late Uri authorizationEndpoint, tokenEndpoint, redirectUri;\n  late TestClient testClient;\n\n  setUp(() async {\n    app = Angel();\n    app.configuration['properties'] = app.configuration;\n    app.container.registerSingleton(AuthCodes());\n\n    var server = _Server();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', server.authorizationEndpoint)\n        ..post('/token', server.tokenEndpoint);\n    });\n\n    app.logger = Logger('angel')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    var http = AngelHttp(app);\n    var s = await http.startServer();\n    var url = 'http://${s.address.address}:${s.port}';\n    authorizationEndpoint = Uri.parse('$url/oauth2/authorize');\n    tokenEndpoint = Uri.parse('$url/oauth2/token');\n    redirectUri = Uri.parse('http://foo.bar/baz');\n\n    testClient = await connectTo(app);\n  });\n\n  tearDown(() async {\n    await testClient.close();\n  });\n\n  group('auth code', () {\n    oauth2.AuthorizationCodeGrant createGrant() =>\n        oauth2.AuthorizationCodeGrant(\n          pseudoApplication.id,\n          authorizationEndpoint,\n          tokenEndpoint,\n          secret: pseudoApplication.secret,\n        );\n\n    test('show authorization form', () async {\n      var grant = createGrant();\n      var url = grant.getAuthorizationUrl(redirectUri, state: 'hello');\n      var response = await testClient.client.get(url);\n      print('Body: ${response.body}');\n      expect(\n        response.body,\n        json.encode(\n          'Hello ${pseudoApplication.id}:${pseudoApplication.secret}',\n        ),\n      );\n    });\n\n    test('preserves state', () async {\n      var grant = createGrant();\n      var url = grant.getAuthorizationUrl(redirectUri, state: 'goodbye');\n      var response = await testClient.client.get(url);\n      print('Body: ${response.body}');\n      expect(json.decode(response.body)['state'], 'goodbye');\n    });\n\n    test('sends auth code', () async {\n      var grant = createGrant();\n      var url = grant.getAuthorizationUrl(redirectUri);\n      var response = await testClient.client.get(url);\n      print('Body: ${response.body}');\n      expect(\n        json.decode(response.body),\n        allOf(\n          isMap,\n          predicate((Map m) => m.containsKey('code'), 'contains \"code\"'),\n        ),\n      );\n    });\n\n    test('exchange code for token', () async {\n      var grant = createGrant();\n      var url = grant.getAuthorizationUrl(redirectUri);\n      var response = await testClient.client.get(url);\n      print('Body: ${response.body}');\n\n      var authCode = json.decode(response.body)['code'].toString();\n      var client = await grant.handleAuthorizationCode(authCode);\n      expect(client.credentials.accessToken, '${authCode}_access');\n    });\n\n    test('can send refresh token', () async {\n      var grant = createGrant();\n      var url = grant.getAuthorizationUrl(redirectUri, state: 'can_refresh');\n      var response = await testClient.client.get(url);\n      print('Body: ${response.body}');\n\n      var authCode = json.decode(response.body)['code'].toString();\n      var client = await grant.handleAuthorizationCode(authCode);\n      expect(client.credentials.accessToken, '${authCode}_access');\n      expect(client.credentials.canRefresh, isTrue);\n      expect(client.credentials.refreshToken, '${authCode}_refresh');\n    });\n  });\n}\n\nclass _Server extends AuthorizationServer<PseudoApplication, Map> {\n  final Uuid _uuid = Uuid();\n\n  @override\n  FutureOr<PseudoApplication>? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  Future requestAuthorizationCode(\n    PseudoApplication client,\n    String? redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n    bool implicit,\n  ) async {\n    if (implicit) {\n      // Throw the default error on an implicit grant attempt.\n      return super.requestAuthorizationCode(\n        client,\n        redirectUri,\n        scopes,\n        state,\n        req,\n        res,\n        implicit,\n      );\n    }\n\n    if (state == 'hello') {\n      return 'Hello ${pseudoApplication.id}:${pseudoApplication.secret}';\n    }\n\n    var authCode = _uuid.v4();\n    var authCodes = req.container!.make<AuthCodes>();\n    authCodes[authCode] = state;\n\n    res.headers['content-type'] = 'application/json';\n    var result = {'code': authCode};\n    if (state.isNotEmpty == true) result['state'] = state;\n    return result;\n  }\n\n  @override\n  Future<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(\n    PseudoApplication? client,\n    String? authCode,\n    String? redirectUri,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var authCodes = req.container!.make<AuthCodes>();\n    var state = authCodes[authCode!];\n    var refreshToken = state == 'can_refresh' ? '${authCode}_refresh' : null;\n    return AuthorizationTokenResponse(\n      '${authCode}_access',\n      refreshToken: refreshToken,\n    );\n  }\n}\n\nclass AuthCodes with MapMixin<String, String> {\n  var inner = <String, String>{};\n\n  @override\n  String? operator [](Object? key) => inner[key as String];\n\n  @override\n  void operator []=(String key, String value) => inner[key] = value;\n\n  @override\n  void clear() => inner.clear();\n\n  @override\n  Iterable<String> get keys => inner.keys;\n\n  @override\n  String? remove(Object? key) => inner.remove(key);\n}\n"
  },
  {
    "path": "packages/oauth2/test/client_credentials_test.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel();\n    var oauth2 = _AuthorizationServer();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', oauth2.authorizationEndpoint)\n        ..post('/token', oauth2.tokenEndpoint);\n    });\n\n    app.errorHandler = (e, req, res) async {\n      res.json(e.toJson());\n    };\n\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  test('authenticate via client credentials', () async {\n    var response = await client.post(\n      Uri.parse('oauth2/token'),\n      headers: {\n        'Authorization': 'Basic ${base64Url.encode('foo:bar'.codeUnits)}',\n      },\n      body: {'grant_type': 'client_credentials'},\n    );\n\n    print('Response: ${response.body}');\n\n    // TODO: Incorrect Validators\n    /*\n    expect(\n        response,\n        allOf(\n          hasStatus(200),\n          hasContentType('application/json'),\n          hasValidBody(Validator({\n            'token_type': equals('bearer'),\n            'access_token': equals('foo'),\n          })),\n        ));\n        */\n  });\n\n  test('force correct id', () async {\n    var response = await client.post(\n      Uri.parse('/oauth2/token'),\n      headers: {\n        'Authorization': 'Basic ${base64Url.encode('fooa:bar'.codeUnits)}',\n      },\n      body: {'grant_type': 'client_credentials'},\n    );\n\n    print('Response: ${response.body}');\n    expect(response, hasStatus(400));\n  });\n\n  test('force correct secret', () async {\n    var response = await client.post(\n      Uri.parse('/oauth2/token'),\n      headers: {\n        'Authorization': 'Basic ${base64Url.encode('foo:bara'.codeUnits)}',\n      },\n      body: {'grant_type': 'client_credentials'},\n    );\n\n    print('Response: ${response.body}');\n    expect(response, hasStatus(400));\n  });\n}\n\nclass _AuthorizationServer\n    extends AuthorizationServer<PseudoApplication, PseudoUser> {\n  @override\n  PseudoApplication? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  Future<AuthorizationTokenResponse> clientCredentialsGrant(\n    PseudoApplication? client,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    return AuthorizationTokenResponse('foo');\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/test/common.dart",
    "content": "const PseudoApplication pseudoApplication = PseudoApplication(\n  'foo',\n  'bar',\n  'http://foo.bar/baz',\n);\n\nclass PseudoApplication {\n  final String id, secret, redirectUri;\n\n  const PseudoApplication(this.id, this.secret, this.redirectUri);\n}\n\nconst List<PseudoUser> pseudoUsers = [\n  PseudoUser(username: 'foo', password: 'bar'),\n  PseudoUser(username: 'michael', password: 'jackson'),\n  PseudoUser(username: 'jon', password: 'skeet'),\n];\n\nclass PseudoUser {\n  final String? username, password;\n\n  const PseudoUser({this.username, this.password});\n}\n"
  },
  {
    "path": "packages/oauth2/test/device_code_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel(reflector: MirrorsReflector());\n    var oauth2 = _AuthorizationServer();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', oauth2.authorizationEndpoint)\n        ..post('/token', oauth2.tokenEndpoint);\n    });\n\n    //app.logger.level = Level.ALL;\n    app.logger = Logger(\"oauth2\")\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    app.errorHandler = (e, req, res) async {\n      res.json(e.toJson());\n    };\n\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  group('get initial code', () {\n    test('invalid client id', () async {\n      var response = await client.post(\n        Uri.parse('/oauth2/token'),\n        body: {'client_id': 'barr'},\n      );\n      print(response.body);\n      expect(response, hasStatus(400));\n    });\n\n    test('valid client id, no scopes', () async {\n      var response = await client.post(\n        Uri.parse('/oauth2/token'),\n        body: {'client_id': 'foo'},\n      );\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(200),\n          isJson({\n            'device_code': 'foo',\n            'user_code': 'bar',\n            'verification_uri': 'https://regiostech.com?scopes',\n            'expires_in': 3600,\n          }),\n        ),\n      );\n    });\n\n    test('valid client id, with scopes', () async {\n      var response = await client.post(\n        Uri.parse('/oauth2/token'),\n        body: {'client_id': 'foo', 'scope': 'bar baz quux'},\n      );\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(200),\n          isJson({\n            'device_code': 'foo',\n            'user_code': 'bar',\n            'verification_uri': Uri.parse(\n              'https://regiostech.com',\n            ).replace(queryParameters: {'scopes': 'bar,baz,quux'}).toString(),\n            'expires_in': 3600,\n          }),\n        ),\n      );\n    });\n  });\n\n  group('get token', () {\n    test('valid device code + timing', () async {\n      var response = await client.post(\n        Uri.parse('/oauth2/token'),\n        body: {\n          'grant_type': 'urn:ietf:params:oauth:grant-type:device_code',\n          'client_id': 'foo',\n          'device_code': 'bar',\n        },\n      );\n\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(200),\n          isJson({'token_type': 'bearer', 'access_token': 'foo'}),\n        ),\n      );\n    });\n\n    // The rationale for only testing one possible error response is that\n    // they all only differ in terms of the `code` string sent down,\n    // which is chosen by the end user.\n    //\n    // The logic for throwing errors and turning them into responses\n    // has already been tested.\n    test('failure', () async {\n      var response = await client.post(\n        Uri.parse('/oauth2/token'),\n        body: {\n          'grant_type': 'urn:ietf:params:oauth:grant-type:device_code',\n          'client_id': 'foo',\n          'device_code': 'brute',\n        },\n      );\n\n      print(\"[Client] ${response.headers}\");\n      print(\"[Client] ${response.body}\");\n      expect(\n        response,\n        allOf(\n          hasStatus(400),\n          isJson({\n            'error': 'slow_down',\n            'error_description':\n                'Ho, brother! Ho, whoa, whoa, whoa now! You got too much dip on your chip!',\n          }),\n        ),\n      );\n    });\n  });\n}\n\nclass _AuthorizationServer\n    extends AuthorizationServer<PseudoApplication, PseudoUser> {\n  var logger = Logger('AuthorizationServer');\n\n  @override\n  PseudoApplication? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  FutureOr<DeviceCodeResponse> requestDeviceCode(\n    PseudoApplication client,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    return DeviceCodeResponse(\n      'foo',\n      'bar',\n      Uri.parse(\n        'https://regiostech.com',\n      ).replace(queryParameters: {'scopes': scopes.join(',')}),\n      3600,\n    );\n  }\n\n  @override\n  FutureOr<AuthorizationTokenResponse> exchangeDeviceCodeForToken(\n    PseudoApplication client,\n    String? deviceCode,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    print(\"[Server] exchangeDeviceCodeForToken\");\n    print(\"[Server] $deviceCode\");\n    print(\"[Server] $client\");\n\n    if (deviceCode == 'brute') {\n      print(\"[Server] Throws AuthorizationException\");\n\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.slowDown,\n          'Ho, brother! Ho, whoa, whoa, whoa now! You got too much dip on your chip!',\n          state,\n        ),\n      );\n    }\n\n    return AuthorizationTokenResponse('foo');\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/test/implicit_grant_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel();\n    var oauth2 = _AuthorizationServer();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', oauth2.authorizationEndpoint)\n        ..post('/token', oauth2.tokenEndpoint);\n    });\n\n    app.errorHandler = (e, req, res) async {\n      res.json(e.toJson());\n    };\n\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  test('authenticate via implicit grant', () async {\n    var response = await client.get(\n      Uri.parse(\n        '/oauth2/authorize?response_type=token&client_id=foo&redirect_uri=http://foo.com&state=bar',\n      ),\n    );\n\n    print('Headers: ${response.headers}');\n    expect(\n      response,\n      allOf(\n        hasStatus(302),\n        hasHeader(\n          'location',\n          'http://foo.com#access_token=foo&token_type=bearer&state=bar',\n        ),\n      ),\n    );\n  });\n}\n\nclass _AuthorizationServer\n    extends AuthorizationServer<PseudoApplication, PseudoUser> {\n  @override\n  PseudoApplication? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  Future<void> requestAuthorizationCode(\n    PseudoApplication client,\n    String? redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n    bool implicit,\n  ) async {\n    var tok = AuthorizationTokenResponse('foo');\n    var uri = completeImplicitGrant(tok, Uri.parse(redirectUri!), state: state);\n    return res.redirect(uri);\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/test/password_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:logging/logging.dart';\nimport 'package:oauth2/oauth2.dart' as oauth2;\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  late Angel app;\n  late Uri tokenEndpoint;\n\n  setUp(() async {\n    app = Angel();\n    var auth = _AuthorizationServer();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', auth.authorizationEndpoint)\n        ..post('/token', auth.tokenEndpoint);\n    });\n\n    app.errorHandler = (e, req, res) async {\n      res.json(e.toJson());\n    };\n\n    app.logger = Logger('password_test')..onRecord.listen(print);\n\n    var http = AngelHttp(app);\n    var server = await http.startServer();\n    var url = 'http://${server.address.address}:${server.port}';\n    tokenEndpoint = Uri.parse('$url/oauth2/token');\n  });\n\n  tearDown(() => app.close());\n\n  test('authenticate via username+password', () async {\n    var client = await oauth2.resourceOwnerPasswordGrant(\n      tokenEndpoint,\n      'michael',\n      'jackson',\n      identifier: 'foo',\n      secret: 'bar',\n    );\n    print(client.credentials.toJson());\n    client.close();\n    expect(client.credentials.accessToken, 'foo');\n    expect(client.credentials.refreshToken, 'bar');\n  });\n\n  test('force correct username+password', () async {\n    oauth2.Client? client;\n\n    try {\n      client = await oauth2.resourceOwnerPasswordGrant(\n        tokenEndpoint,\n        'michael',\n        'jordan',\n        identifier: 'foo',\n        secret: 'bar',\n      );\n\n      throw StateError('should fail');\n    } on oauth2.AuthorizationException catch (e) {\n      expect(e.error, ErrorResponse.accessDenied);\n    } finally {\n      client?.close();\n    }\n  });\n\n  test('can refresh token', () async {\n    var client = await oauth2.resourceOwnerPasswordGrant(\n      tokenEndpoint,\n      'michael',\n      'jackson',\n      identifier: 'foo',\n      secret: 'bar',\n    );\n    client = await client.refreshCredentials();\n    print(client.credentials.toJson());\n    client.close();\n    expect(client.credentials.accessToken, 'baz');\n    expect(client.credentials.refreshToken, 'bar');\n  });\n}\n\nclass _AuthorizationServer\n    extends AuthorizationServer<PseudoApplication, PseudoUser> {\n  @override\n  PseudoApplication? findClient(String? clientId) {\n    return clientId == pseudoApplication.id ? pseudoApplication : null;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  Future<AuthorizationTokenResponse> refreshAuthorizationToken(\n    PseudoApplication? client,\n    String? refreshToken,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    return AuthorizationTokenResponse('baz', refreshToken: 'bar');\n  }\n\n  @override\n  Future<AuthorizationTokenResponse> resourceOwnerPasswordCredentialsGrant(\n    PseudoApplication? client,\n    String? username,\n    String? password,\n    Iterable<String> scopes,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var user = pseudoUsers.firstWhereOrNull(\n      (u) => u.username == username && u.password == password,\n    );\n\n    if (user == null) {\n      var body = await req.parseBody().then((_) => req.bodyAsMap);\n      throw AuthorizationException(\n        ErrorResponse(\n          ErrorResponse.accessDenied,\n          'Invalid username or password.',\n          body['state']?.toString() ?? '',\n        ),\n        statusCode: 401,\n      );\n    }\n\n    return AuthorizationTokenResponse('foo', refreshToken: 'bar');\n  }\n}\n"
  },
  {
    "path": "packages/oauth2/test/pkce_test.dart",
    "content": "import 'dart:async';\nimport 'dart:collection';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_oauth2/angel3_oauth2.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\n\nvoid main() {\n  Angel app;\n  late Uri authorizationEndpoint, tokenEndpoint;\n  late TestClient testClient;\n\n  setUp(() async {\n    app = Angel(reflector: MirrorsReflector());\n    app.container.registerSingleton(AuthCodes());\n\n    var server = _Server();\n\n    app.group('/oauth2', (router) {\n      router\n        ..get('/authorize', server.authorizationEndpoint)\n        ..post('/token', server.tokenEndpoint);\n    });\n\n    app.logger = Logger('angel')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    var http = AngelHttp(app);\n    var s = await http.startServer();\n    var url = 'http://${s.address.address}:${s.port}';\n    authorizationEndpoint = Uri.parse('$url/oauth2/authorize');\n    tokenEndpoint = Uri.parse('$url/oauth2/token');\n\n    testClient = await connectTo(app);\n  });\n\n  tearDown(() async {\n    await testClient.close();\n  });\n\n  group('get auth code', () {\n    test('with challenge + implied plain', () async {\n      var url = authorizationEndpoint.replace(\n        queryParameters: {\n          'response_type': 'code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code_challenge': 'foo',\n        },\n      );\n      var response = await testClient.get(\n        url,\n        headers: {'accept': 'application/json'},\n      );\n      print(response.body);\n      expect(response, allOf(hasStatus(200), isJson({'code': 'ok'})));\n    });\n\n    test('with challenge + plain', () async {\n      var url = authorizationEndpoint.replace(\n        queryParameters: {\n          'response_type': 'code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code_challenge': 'foo',\n          'code_challenge_method': 'plain',\n        },\n      );\n      var response = await testClient.get(\n        url,\n        headers: {'accept': 'application/json'},\n      );\n      print(response.body);\n      expect(response, allOf(hasStatus(200), isJson({'code': 'ok'})));\n    });\n\n    test('with challenge + s256', () async {\n      var url = authorizationEndpoint.replace(\n        queryParameters: {\n          'response_type': 'code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code_challenge': 'foo',\n          'code_challenge_method': 's256',\n        },\n      );\n      var response = await testClient.get(\n        url,\n        headers: {'accept': 'application/json'},\n      );\n      print(response.body);\n      expect(response, allOf(hasStatus(200), isJson({'code': 'ok'})));\n    });\n\n    test('with challenge + wrong method', () async {\n      var url = authorizationEndpoint.replace(\n        queryParameters: {\n          'response_type': 'code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code_challenge': 'foo',\n          'code_challenge_method': 'bar',\n        },\n      );\n      var response = await testClient.get(\n        url,\n        headers: {'accept': 'application/json'},\n      );\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(400),\n          isJson({\n            'error': 'invalid_request',\n            'error_description':\n                \"The `code_challenge_method` parameter must be either 'plain' or 's256'.\",\n          }),\n        ),\n      );\n    });\n\n    test('with no challenge', () async {\n      var url = authorizationEndpoint.replace(\n        queryParameters: {\n          'response_type': 'code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n        },\n      );\n      var response = await testClient.get(\n        url,\n        headers: {'accept': 'application/json'},\n      );\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(400),\n          isJson({\n            'error': 'invalid_request',\n            'error_description': 'Missing `code_challenge` parameter.',\n          }),\n        ),\n      );\n    });\n  });\n\n  group('get token', () {\n    test('with correct verifier', () async {\n      var url = tokenEndpoint.replace(\n        userInfo: '${pseudoApplication.id}:${pseudoApplication.secret}',\n      );\n      var response = await testClient.post(\n        url,\n        headers: {\n          'accept': 'application/json',\n          // 'authorization': 'Basic ' + base64Url.encode(ascii.encode(url.userInfo))\n        },\n        body: {\n          'grant_type': 'authorization_code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code': 'ok',\n          'code_verifier': 'hello',\n        },\n      );\n\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(200),\n          isJson({'token_type': 'bearer', 'access_token': 'yes'}),\n        ),\n      );\n    });\n    test('with incorrect verifier', () async {\n      var url = tokenEndpoint.replace(\n        userInfo: '${pseudoApplication.id}:${pseudoApplication.secret}',\n      );\n      var response = await testClient.post(\n        url,\n        headers: {\n          'accept': 'application/json',\n          // 'authorization': 'Basic ' + base64Url.encode(ascii.encode(url.userInfo))\n        },\n        body: {\n          'grant_type': 'authorization_code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code': 'ok',\n          'code_verifier': 'foo',\n        },\n      );\n\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(400),\n          isJson({\n            'error': 'invalid_grant',\n            'error_description':\n                'The given `code_verifier` parameter is invalid.',\n          }),\n        ),\n      );\n    });\n\n    test('with missing verifier', () async {\n      var url = tokenEndpoint.replace(\n        userInfo: '${pseudoApplication.id}:${pseudoApplication.secret}',\n      );\n      var response = await testClient.post(\n        url,\n        headers: {\n          'accept': 'application/json',\n          // 'authorization': 'Basic ' + base64Url.encode(ascii.encode(url.userInfo))\n        },\n        body: {\n          'grant_type': 'authorization_code',\n          'client_id': 'freddie mercury',\n          'redirect_uri': 'https://freddie.mercu.ry',\n          'code': 'ok',\n        },\n      );\n\n      print(response.body);\n      expect(\n        response,\n        allOf(\n          hasStatus(400),\n          isJson({\n            'error': 'invalid_request',\n            'error_description': 'Missing `code_verifier` parameter.',\n          }),\n        ),\n      );\n    });\n  });\n}\n\nclass _Server extends AuthorizationServer<PseudoApplication, Map> {\n  @override\n  FutureOr<PseudoApplication> findClient(String? clientId) {\n    return pseudoApplication;\n  }\n\n  @override\n  Future<bool> verifyClient(\n    PseudoApplication client,\n    String? clientSecret,\n  ) async {\n    return client.secret == clientSecret;\n  }\n\n  @override\n  Future requestAuthorizationCode(\n    PseudoApplication client,\n    String? redirectUri,\n    Iterable<String> scopes,\n    String state,\n    RequestContext req,\n    ResponseContext res,\n    bool implicit,\n  ) async {\n    req.container!.make<Pkce>();\n    return {'code': 'ok'};\n  }\n\n  @override\n  Future<AuthorizationTokenResponse> exchangeAuthorizationCodeForToken(\n    PseudoApplication? client,\n    String? authCode,\n    String? redirectUri,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    var codeVerifier = await getPkceCodeVerifier(req);\n    var pkce = Pkce('plain', 'hello');\n    pkce.validate(codeVerifier);\n    return AuthorizationTokenResponse('yes');\n  }\n}\n\nclass AuthCodes with MapMixin<String, String> {\n  var inner = <String, String>{};\n\n  @override\n  String? operator [](Object? key) => inner[key as String];\n\n  @override\n  void operator []=(String key, String value) => inner[key] = value;\n\n  @override\n  void clear() => inner.clear();\n\n  @override\n  Iterable<String> get keys => inner.keys;\n\n  @override\n  String? remove(Object? key) => inner.remove(key);\n}\n"
  },
  {
    "path": "packages/orm/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/orm/README.md",
    "content": "# Angel3 ORM\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/orm/LICENSE)\n\nSource-generated ORM for use with the [Angel3 framework](https://github.com/dart-backend/angel). Now you can combine the power and flexibility of Angel3 with a strongly-typed ORM.\n\nDocumentation for migrations can be found here:\n[ORM Migration](https://angel3-docs.dukefirehawk.com/guides/orm/migrations)\n\n- [Angel3 ORM](#angel3-orm)\n  - [Usage](#usage)\n  - [Models](#models)\n  - [Example](#example)\n  - [Relations](#relations)\n    - [Many to Many Relations](#many-to-many-relations)\n  - [Columns](#columns)\n    - [Column Types](#column-types)\n    - [Indices](#indices)\n    - [Default Values](#default-values)\n\n## Usage\n\nYou'll need these dependencies in your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_orm: ^8.0.0\ndev_dependencies:\n  angel3_orm_generator: ^8.0.0\n  build_runner: ^2.0.0\n```\n\n`package:angel3_orm_generator` exports a class that you can include in a `package:build` flow:\n\n- `PostgresOrmGenerator` - Fueled by `package:source_gen`; include this within a `SharedPartBuilder`.\n\nHowever, it also includes a `build.yaml` that builds ORM files automatically, so you shouldn't\nhave to do any configuration at all.\n\n## Models\n\nThe ORM works best when used with `package:angel3_serialize`:\n\n```dart\nlibrary angel_orm.test.models.car;\n\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_model/angel3_model.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\npart 'car.g.dart';\n\n@serializable\n@orm\nabstract class _Car extends Model {\n  String get make;\n\n  String get description;\n\n  bool get familyFriendly;\n\n  DateTime get recalledAt;\n}\n\n// You can disable migration generation.\n@Orm(generateMigrations: false)\nabstract class _NoMigrations extends Model {}\n```\n\nModels can use the `@SerializableField()` annotation; `package:angel3_orm` obeys it.\n\nAfter building, you'll have access to a `Query` class with strongly-typed methods that\nallow to run asynchronous queries without a headache.\n\nRemember that if you don't need automatic id-and-date fields, you can\nsimply just not extend `Model`:\n\n```dart\n@Serializable\nabstract class _ThisIsNotAnAngelModel {\n  @primaryKey\n  String get username;\n}\n```\n\n## Example\n\nMVC just got a whole lot easier:\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'car.dart';\nimport 'car.orm.g.dart';\n\n/// Returns an Angel plug-in that connects to a database, and sets up a controller connected to it...\nAngelConfigurer connectToCarsTable(QueryExecutor executor) {\n  return (Angel app) async {\n    // Register the connection with Angel's dependency injection system.\n    // \n    // This means that we can use it as a parameter in routes and controllers.\n    app.container.registerSingleton(executor);\n    \n    // Attach the controller we create below\n    await app.mountController<CarController>();\n  };\n}\n\n@Expose('/cars')\nclass CarController extends Controller {\n  // The `executor` will be injected.\n  @Expose('/recalled_since_2008')\n  carsRecalledSince2008(QueryExecutor executor) {\n    // Instantiate a Car query, which is auto-generated. This class helps us build fluent queries easily.\n    var query = CarQuery();\n    query.where\n      ..familyFriendly.equals(false)\n      ..recalledAt.year.greaterThanOrEqualTo(2008);\n    \n    // Shorter syntax we could use instead...\n    query.where.recalledAt.year <= 2008;\n    \n    // `get()` returns a Future<List<Car>>.\n    var cars = await query.get(executor);\n    \n    return cars;\n  }\n  \n  @Expose('/create', method: 'POST')\n  createCar(QueryExecutor executor) async {\n    // `package:angel3_orm` generates a strongly-typed `insert` function on the query class.\n    // Say goodbye to typos!!!\n    var query = CarQuery();\n    query.values\n      ..familyFriendly = true\n      ..make 'Honda';\n    var car = query.insert(executor);\n    \n    // Auto-serialized using code generated by `package:angel_serialize`\n    return car;\n  }\n}\n```\n\n## Relations\n\n`angel3_orm` supports the following relationships:\n\n- `@HasOne()` (one-to-one)\n- `@HasMany()` (one-to-many)\n- `@BelongsTo()` (one-to-one)\n- `@ManyToMany()` (many-to-many, using a \"pivot\" table)\n\nThe annotations can be abbreviated with the default options (ex. `@hasOne`), or supplied\nwith custom parameters (ex. `@HasOne(foreignKey: 'foreign_id')`).\n\n```dart\n@serializable\n@orm\nabstract class _Author extends Model {\n  @HasMany // Use the defaults, and auto-compute `foreignKey`\n  List<_Book> books;\n  \n  // Also supports parameters...\n  @HasMany(localKey: 'id', foreignKey: 'author_id', cascadeOnDelete: true)\n  List<_Book> books;\n  \n  @SerializableField(alias: 'writing_utensil')\n  @hasOne\n  _Pen pen;\n}\n```\n\nThe relationships will \"just work\" out-of-the-box, following any operation. For example, after fetching an `Author` from the database in the above example, the `books` field would be populated with a set of deserialized `Book` objects, also fetched from the database.\n\nRelationships use joins when possible, but in the case of `@HasMany()`, two queries are used:\n\n- One to fetch the object itself\n- One to fetch a list of related objects\n\n### Many to Many Relations\n\nA many-to-many relationship can now be modeled like so. `RoleUser` in this case is a pivot table joining `User` and `Role`.\n\nNote that in this case, the models must reference the private classes (`_User`, etc.), because the canonical versions (`User`, etc.) are not-yet-generated:\n\n```dart\n@serializable\n@orm\nabstract class _User extends Model {\n  String get username;\n  String get password;\n  String get email;\n\n  @ManyToMany(_RoleUser)\n  List<_Role> get roles;\n}\n\n@serializable\n@orm\nabstract class _RoleUser {\n  @belongsTo\n  _Role get role;\n\n  @belongsTo\n  _User get user;\n}\n\n@serializable\n@orm\nabstract class _Role extends Model {\n  String name;\n\n  @ManyToMany(_RoleUser)\n  List<_User> get users;\n}\n```\n\nTLDR:\n\n1. Make a pivot table, C, between two tables, table A and B\n2. C should `@belongsTo` both A and B. C *should not* extend `Model`.\n3. A should have a field: `@ManyToMany(_C) List<_B> get b;`\n4. B should have a field: `@ManyToMany(_C) List<_A> get a;`\n\nTest: <https://raw.githubusercontent.com/angel-dart/orm/master/angel_orm_generator/test/many_to_many_test.dart>\n\n## Columns\n\nUse a `@Column()` annotation to change how a given field is handled within the ORM.\n\n### Column Types\n\nUsing the `@Column()` annotation, it is possible to explicitly declare the data type of any given field:\n\n```dart\n@serializable\n@orm\nabstract class _Foo extends Model {\n  @Column(type: ColumnType.bigInt)\n  int bar;\n}\n```\n\n### Indices\n\nColumns can also have an `index`:\n\n```dart\n@serializable\n@orm\nabstract class _Foo extends Model {\n  @Column(index: IndexType.primaryKey)\n  String bar;\n}\n```\n\n### Default Values\n\nIt is also possible to specify the default value of a field.\n**Note that this only works with primitive objects.**\n\nIf a default value is supplied, the `SqlMigrationBuilder` will include it in the generated schema. The `PostgresOrmGenerator` ignores default values; it does not need them to function properly.\n\n```dart\n@serializable\n@orm\nabstract class _Foo extends Model {\n  @Column(defaultValue: 'baz')\n  String bar;\n}\n```\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project."
  },
  {
    "path": "packages/orm/angel_orm_mysql/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.6.0\n\n* Require Dart >= 3.11\n\n## 8.5.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n* Changed `_` prefix in the models to `Entity` suffix. `_` prefix is still maintained for backward compatibility.\n\n## 8.4.0\n\n* Added support for `<Class>Entity` and `Entity<Class>` as data model\n* Updated test cases to use `<Class>Entity` as data model\n\n## 8.3.1\n\n* Updated test cases\n* Updated deletion to return deleted record(s)\n* Fixed select and insert query returning incorrect data when the joined tables have same field names\n* Fixed issues due to breaking changes in `analyzer` 7.3.0\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest releases\n* Fixed issue #98: Take `@SerializableField` properties into account when generating `Query.parseRow`\n* Migrated test cases from `angel3_orm_test` into the package\n* Removed dependency on `angel3_orm_test`\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.1.0-beta.1\n\n* [Breaking] Require Dart >= 2.19\n* Added type check on \"batch\" column\n\n## 7.0.1\n\n* Reduced debugging verbosity\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Fixed temporal data type\n* Fixed `MariaDbExcutor` transaction\n* Updated to `lints` 2.0.0\n\n## 6.0.0-beta.3\n\n* Fixed transaction for `MariaDbExecutor`\n* Fixed transaction for `MySqlExecutor`\n* Fixed error for non `id` primary key\n* Changed test cases to use tables instead of temporary tables to overcome limitations\n\n## 6.0.0-beta.2\n\n* Updated README\n\n## 6.0.0-beta.1\n\n* Require Dart >= 2.16\n* Added support for MariaDB 10.2.x with `mysql1` driver\n* Added support for MySQL 8.x.x with `mysql_client` driver\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0\n\n* Skipped release\n\n## 2.0.0\n\n* Skipped release\n\n## 2.0.0-beta.3\n\n* Updated linter to `package:lints`\n\n## 2.0.0-beta.2\n\n* Fixed NNBD issues\n\n## 2.0.0-beta.1\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 1.0.0\n\n* First version.\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/LICENSE",
    "content": "\nBSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/README.md",
    "content": "# Angel3 ORM for MySQL\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm_mysql?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_mysql/LICENSE)\n\nThis package contains the SQL executor required by Angel3 ORM to work with MySQL or MariaDB databases. In order to better support both MySQL and MariaDB, two different flavors of drives have been included; `mysql_client` and `mysql1`. They are implmented as `MySqlExecutor` and `MariaDbExecutor` respectively.\n\n## Supported databases\n\n* MariaDD 10.2.x or later\n* MySQL 8.x or later\n\n**Note** MySQL below version 8.0 and MariaDB below version 10.2.0 are not supported as Angel3 ORM requires common table expressions (CTE) to work.\n\n## Usage\n\n1. Create a model with `Entity` suffix, i.e. `CarEntity` in a `car.dart`\n\n   ```dart\n    import 'package:angel3_migration/angel3_migration.dart';\n    import 'package:angel3_orm/angel3_orm.dart';\n    import 'package:angel3_serialize/angel3_serialize.dart';\n    import 'package:optional/optional.dart';\n    \n    part 'car.g.dart';\n\n    @serializable\n    @orm\n    class CarEntity extends Model {\n        String? make;\n        String? description;\n        bool? familyFriendly;\n        DateTime? recalledAt;\n        double? price;\n    }\n   ```\n\n2. Run the following command to generate the required `.g.dart` file for the model.\n\n    ```bash\n    dart run build_runner build\n    ```\n\n3. Write the query program. i.e. `CarPersistence.dart`\n\n    ```dart\n    import 'package:angel3_migration_runner/angel3_migration_runner.dart';\n    import 'package:angel3_orm/angel3_orm.dart';\n    import 'package:logging/logging.dart';\n    import 'package:mysql_client/mysql_client.dart';\n    import 'models/car.dart';\n\n    void main() async {\n    \n        // Setup the connections\n        var conn = await MySQLConnection.createConnection(\n            databaseName: 'orm_test',\n            port: 3306,\n            host: \"localhost\",\n            userName: 'test',\n            password: 'Test123',\n            secure: true);\n        await conn.connect(timeoutMs: 10000);\n\n        var executor = MySqlExecutor(conn);\n\n        // Create the `Car` table\n        var runner = MysqlMigrationRunner(conn, migrations: [CarMigration()]);\n        await runner.up();\n\n        var query = CarQuery();\n        query.values\n            ..make = 'Ferrari'\n            ..description = 'Vroom vroom!'\n            ..price = 1200000.00\n            ..familyFriendly = false;\n        \n        // insert a new record into the `cars` table\n        var ferrari = (await query.insert(executor)).value;\n    }\n    ```\n\n## MySqlExecutor\n\nThis SQL executor is implemented using [`mysql_client`](https://pub.dev/packages?q=mysql_client) driver. It works with both `MySQL` 8.0+ and `MariaDB` 10.2+ database.\n\n### Connecting to MySQL or MariaDB\n\n```dart\n    import 'package:mysql_client/mysql_client.dart';\n\n    var connection = await MySQLConnection.createConnection(\n        host: \"localhost\",\n        port: 3306,\n        databaseName: \"orm_test\",\n        userName: \"test\",\n        password: \"test123\",\n        secure: true);\n\n    var logger = Logger('orm_mysql');\n    await connection.connect(timeoutMs: 10000);\n    var executor = MySqlExecutor(connection, logger: logger);\n```\n\n### Known Limitation for MySqlExecutor\n\n* `Blob` data type mapping is not support.\n* `timestamp` data type mapping is not supported. Use `datetime` instead.\n* UTC datetime is not supported.\n\n## MariaDBExecutor\n\nThis SQL executor is implemented using [`mysql1`](https://pub.dev/packages?q=mysql1) driver. It only works with `MariaDB` 10.2+ database. Do not use this for `MySQL` 8.0+ database.\n\n### Connecting to MariaDB\n\n```dart\n    import 'package:mysql1/mysql1.dart';\n\n    var settings = ConnectionSettings(\n        host: 'localhost',\n        port: 3306,\n        db: 'orm_test',\n        user: 'test',\n        password: 'test123');\n    var connection = await MySqlConnection.connect(settings);\n\n    var logger = Logger('orm_mariadb');\n    var executor = MariaDbExecutor(connection, logger: logger);\n```\n\n### Known Limitation for MariaDBExecutor\n\n* `Blob` type mapping is not supported.\n* `timestamp` mapping is not supported. Use `datetime` instead.\n* Only UTC datetime is supported. None UTC datetime will be automatically converted into UTC datetime.\n\n## Compatibility Matrix\n\n### MariaDB 10.2+\n\n|                 | Create |  Read  | Update | Delete |\n|-----------------|--------|--------|--------|--------|\n| MySqlExecutor   |    Y   |   Y    |    Y   |    Y   |\n| MariaDBExecutor |    Y   |   Y    |    Y   |    Y   |\n\n### MySQL 8.0+\n\n|                 | Create |  Read  | Update | Delete |\n|-----------------|--------|--------|--------|--------|\n| MySqlExecutor   |    Y   |   Y    |    Y   |    Y   |\n| MariaDBExecutor |    N   |   N    |    N   |    N   |\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml\nlinter:\n  rules:\n    overridden_fields: false"
  },
  {
    "path": "packages/orm/angel_orm_mysql/example/example2.dart",
    "content": "import 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\n\nvoid main() async {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n  var logger = Logger('mysql');\n\n  var connection = await MySQLConnection.createConnection(\n    host: \"localhost\",\n    port: 3306,\n    databaseName: \"orm_test\",\n    userName: \"test\",\n    password: \"Test123\",\n    secure: true,\n  );\n\n  await connection.connect(timeoutMs: 10000);\n  logger.fine(\"Connected to MySQL\");\n\n  var result = await connection.execute(\n    \"SELECT id, created_at, updated_at, make, description, family_friendly, recalled_at, price FROM cars order by cars.id desc limit 1\",\n  );\n\n  /*\n  // Not working\n  var result1 = await connection.execute(\n      \"SELECT roles.id, roles.created_at, roles.updated_at, roles.name, a0.id, a0.created_at, a0.updated_at, a0.username, a0.password, a0.email FROM roles  LEFT JOIN (SELECT role_users.role_id, users.id, users.created_at, users.updated_at, users.username, users.password, users.email FROM users LEFT JOIN role_users ON role_users.user_id=users.id) a0 ON roles.id=a0.role_id order by roles.id desc limit 1\");\n\n  // Not working\n  var result2 = await connection.execute(\n      \"SELECT * FROM roles LEFT JOIN (SELECT role_users.role_id, users.id, users.created_at, users.updated_at, users.username, users.password, users.email FROM users LEFT JOIN role_users ON role_users.user_id=users.id) a0 ON roles.id=a0.role_id order by roles.id desc limit 1\");\n\n  // Working\n  var result3 = await connection\n      .execute(\"SELECT * FROM roles order by roles.id desc limit 1\");\n\n  var result4 = await connection.execute(\n      \"SELECT * FROM roles LEFT JOIN role_users ON role_users.role_id=roles.id LEFT JOIN users ON users.id=role_users.user_id order by roles.id desc limit 1\");\n  */\n\n  //logger.fine(rowResult.assoc());\n  //logger.fine(rowResult.typedAssoc());\n  /*\n  Map<String, dynamic> parseSQLNamedResult(IResultSet res) {\n    var colNames = [];\n    var columns = [];\n    var prefix = \"1__\";\n    for (var c in res.cols) {\n      if (colNames.contains(c.name)) {\n        // If collumn name is duplicated, add \"1_\" as prefix\n        var tmpColName = \"$prefix${c.name}\";\n        while (colNames.contains(tmpColName)) {\n          tmpColName = \"$prefix$tmpColName\";\n        }\n        columns.add((name: tmpColName, type: c.type));\n        colNames.add(tmpColName);\n      } else {\n        columns.add((name: c.name, type: c.type));\n        colNames.add(c.name);\n      }\n    }\n\n    logger.fine(colNames);\n\n    var row = res.rows.first;\n\n    Map<String, dynamic> retResult = {};\n    for (var i = 0; i < row.numOfColumns; i++) {\n      var val = row.typedColAt(i);\n      var colName = columns[i].name;\n      logger.fine(\"$colName $val\");\n\n      retResult[colName] = val;\n    }\n\n    return retResult;\n  }\n  */\n  List<List<dynamic>> parseSQLResult(IResultSet res) {\n    var colTypes = res.cols.map((col) => col.type).toList();\n\n    var mappedResult = <List>[];\n    for (var row in res.rows) {\n      List<dynamic> retResult = [];\n      for (var i = 0; i < row.numOfColumns; i++) {\n        var val = row.typedColAt(i);\n        /*\n        switch (colTypes[i].convertStringValueToProvidedType(value)) {\n          case int:\n            decodedValue = int.parse(value);\n            break;\n          case double:\n            decodedValue = double.parse(value);\n            break;\n          case num:\n            decodedValue = num.parse(value);\n            break;\n          case bool:\n            decodedValue = int.parse(value) > 0;\n            break;\n          case String:\n            decodedValue = value;\n            break;\n          default:\n            decodedValue = value;\n            break;\n        }\n        */\n        //colTypes[i].intVal = MySQLColumnType.\n        var tmp = colTypes[i].convertStringValueToProvidedType(val);\n        retResult.add(tmp);\n      }\n      mappedResult.add(retResult);\n    }\n\n    return mappedResult;\n  }\n\n  var sqlResult = parseSQLResult(result);\n  logger.fine(sqlResult);\n\n  if (connection.connected) {\n    await connection.close();\n  }\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/example/main.dart",
    "content": "import 'dart:io';\n\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_orm_mysql/angel3_orm_mysql.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:mysql1/mysql1.dart';\nimport 'package:logging/logging.dart';\nimport 'package:optional/optional.dart';\npart 'main.g.dart';\n\nvoid main() async {\n  //hierarchicalLoggingEnabled = true;\n\n  //await mariaDBExample();\n  await mysqlExample();\n\n  exit(0);\n}\n\nFuture<void> mariaDBExample() async {\n  Logger.root\n    ..level = Level.ALL\n    ..onRecord.listen(print);\n\n  var settings = ConnectionSettings(\n    host: 'localhost',\n    port: 3306,\n    db: 'orm_test',\n    user: 'test',\n    password: 'test123',\n  );\n  var connection = await MySqlConnection.connect(settings);\n\n  print(\"Connected to MariaDb\");\n  var logger = Logger('orm_mysql');\n  var executor = MariaDbExecutor(connection, logger: logger);\n\n  var query = TodoQuery();\n  query.values\n    ..text = 'Clean your room!'\n    ..updatedAt = DateTime.now().toUtc()\n    ..isComplete = false;\n\n  var todo = await query.insert(executor);\n  print(todo.value.toJson());\n\n  var query2 = TodoQuery()..where!.id.equals(todo.value.idAsInt);\n  var todo2 = await query2.getOne(executor);\n  print(todo2.value.toJson());\n  print(todo == todo2);\n}\n\nFuture<void> mysqlExample() async {\n  Logger.root\n    ..level = Level.ALL\n    ..onRecord.listen(print);\n\n  var connection = await MySQLConnection.createConnection(\n    host: \"localhost\",\n    port: 3306,\n    databaseName: \"orm_test\",\n    userName: \"test\",\n    password: \"test123\",\n    secure: true,\n  );\n\n  print(\"Connected to MySQL\");\n  var logger = Logger('orm_mysql');\n  await connection.connect(timeoutMs: 10000);\n  var executor = MySqlExecutor(connection, logger: logger);\n\n  var query = TodoQuery();\n  query.values\n    ..text = 'Clean your room!'\n    ..updatedAt = DateTime.now().toUtc()\n    ..isComplete = false;\n\n  var todo = await query.insert(executor);\n  print(todo.value.toJson());\n\n  var query2 = TodoQuery()..where!.id.equals(todo.value.idAsInt);\n  var todo2 = await query2.getOne(executor);\n  print(todo2.value.toJson());\n  print(todo == todo2);\n}\n\n@serializable\n@orm\nabstract class TodoEntity extends Model {\n  String? get text;\n\n  @DefaultsTo(false)\n  bool? isComplete;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/example/main.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'main.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass TodoMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('todos', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('text', length: 255);\n      table.boolean('is_complete').defaultsTo(false);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('todos');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass TodoQuery extends Query<Todo, TodoQueryWhere> {\n  TodoQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = TodoQueryWhere(this);\n  }\n\n  @override\n  final TodoQueryValues values = TodoQueryValues();\n\n  List<String> _selectedFields = [];\n\n  TodoQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'todos';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'text',\n      'is_complete',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  TodoQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  TodoQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  TodoQueryWhere newWhereClause() {\n    return TodoQueryWhere(this);\n  }\n\n  Optional<Todo> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Todo(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      text: fields.contains('text') ? (row[3] as String?) : null,\n      isComplete: fields.contains('is_complete') ? mapToBool(row[4]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Todo> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass TodoQueryWhere extends QueryWhere {\n  TodoQueryWhere(TodoQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      text = StringSqlExpressionBuilder(query, 'text'),\n      isComplete = BooleanSqlExpressionBuilder(query, 'is_complete');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder text;\n\n  final BooleanSqlExpressionBuilder isComplete;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, text, isComplete];\n  }\n}\n\nclass TodoQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get text {\n    return (values['text'] as String?);\n  }\n\n  set text(String? value) => values['text'] = value;\n\n  bool? get isComplete {\n    return (values['is_complete'] as bool?);\n  }\n\n  set isComplete(bool? value) => values['is_complete'] = value;\n\n  void copyFrom(Todo model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    text = model.text;\n    isComplete = model.isComplete;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Todo extends TodoEntity {\n  Todo({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.text,\n    this.isComplete = false,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? text;\n\n  @override\n  bool? isComplete;\n\n  Todo copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? text,\n    bool? isComplete,\n  }) {\n    return Todo(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      text: text ?? this.text,\n      isComplete: isComplete ?? this.isComplete,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is TodoEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.text == text &&\n        other.isComplete == isComplete;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, text, isComplete]);\n  }\n\n  @override\n  String toString() {\n    return 'Todo(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, text=$text, isComplete=$isComplete)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return TodoSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst TodoSerializer todoSerializer = TodoSerializer();\n\nclass TodoEncoder extends Converter<Todo, Map> {\n  const TodoEncoder();\n\n  @override\n  Map convert(Todo model) => TodoSerializer.toMap(model);\n}\n\nclass TodoDecoder extends Converter<Map, Todo> {\n  const TodoDecoder();\n\n  @override\n  Todo convert(Map map) => TodoSerializer.fromMap(map);\n}\n\nclass TodoSerializer extends Codec<Todo, Map> {\n  const TodoSerializer();\n\n  @override\n  TodoEncoder get encoder => const TodoEncoder();\n\n  @override\n  TodoDecoder get decoder => const TodoDecoder();\n\n  static Todo fromMap(Map map) {\n    return Todo(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      text: map['text'] as String?,\n      isComplete: map['is_complete'] as bool? ?? false,\n    );\n  }\n\n  static Map<String, dynamic> toMap(TodoEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'text': model.text,\n      'is_complete': model.isComplete,\n    };\n  }\n}\n\nabstract class TodoFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    text,\n    isComplete,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String text = 'text';\n\n  static const String isComplete = 'is_complete';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/lib/angel3_orm_mysql.dart",
    "content": "export 'src/orm_mariadb.dart';\nexport 'src/orm_mysql.dart';\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/lib/src/orm_mariadb.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql1/mysql1.dart';\n\nclass MariaDbExecutor extends QueryExecutor {\n  /// An optional [Logger] print information to. A default logger will be used if not set\n  late Logger logger;\n\n  final MySqlConnection _connection;\n\n  //TransactionContext? _transactionContext;\n\n  MariaDbExecutor(this._connection, {Logger? logger}) {\n    this.logger = logger ?? Logger('MariaDbExecutor');\n  }\n\n  final Dialect _dialect = const MySQLDialect();\n\n  @override\n  Dialect get dialect => _dialect;\n\n  Future<void> close() {\n    return _connection.close();\n  }\n\n  @override\n  Future<List<List>> query(\n    String tableName,\n    String query,\n    Map<String, dynamic> substitutionValues, {\n    String returningQuery = '',\n    String resultQuery = '',\n    List<String> returningFields = const [],\n  }) async {\n    // Change @id -> ?\n    for (var name in substitutionValues.keys) {\n      query = query.replaceAll('@$name', '?');\n    }\n\n    var params = substitutionValues.values.toList();\n    for (var i = 0; i < params.length; i++) {\n      var v = params[i];\n\n      if (v is DateTime) {\n        if (!v.isUtc) {\n          params[i] = v.toUtc();\n        }\n      }\n    }\n\n    //logger.warning('Query: $query');\n    //logger.warning('Values: $params');\n    //logger.warning('Returning Query: $returningQuery');\n\n    if (returningQuery.isNotEmpty) {\n      // Handle insert, update and delete\n      // Retrieve back the inserted record\n      if (query.startsWith(\"INSERT\")) {\n        var result = await _connection.query(query, params);\n\n        query = returningQuery;\n        // logger?.warning('Result.insertId: ${result.insertId}');\n        // Has primary key\n        if (returningQuery.endsWith('.id=?')) {\n          params = [result.insertId];\n        }\n      } else if (query.startsWith(\"UPDATE\")) {\n        await _connection.query(query, params);\n        query = returningQuery;\n        params = [];\n      }\n    }\n\n    // Handle select\n    return _connection.query(query, params).then((results) {\n      return results.map((r) => r.toList()).toList();\n    });\n  }\n\n  @override\n  Future<T> transaction<T>(FutureOr<T> Function(QueryExecutor) f) async {\n    T? returnValue = await _connection.transaction((ctx) async {\n      try {\n        // TODO: To be refactored\n        //logger.fine('Entering transaction');\n        //var tx = MariaDbExecutor(conn, logger: logger);\n        //TransactionContext transactionContext = ctx;\n        return await f(this);\n      } catch (e) {\n        logger.severe('Failed to run transaction', e);\n        rethrow;\n      }\n    });\n\n    return returnValue!;\n  }\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/lib/src/orm_mysql.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\n\nclass MySqlExecutor extends QueryExecutor {\n  /// An optional [Logger] to write to. A default logger will be used if not set\n  late Logger _logger;\n\n  final MySQLConnection _connection;\n\n  MySqlExecutor(this._connection, {Logger? logger}) {\n    _logger = logger ?? Logger('MySqlExecutor');\n  }\n\n  final Dialect _dialect = const MySQLDialect();\n\n  @override\n  Dialect get dialect => _dialect;\n\n  Future<void> close() {\n    return _connection.close();\n  }\n\n  MySQLConnection get rawConnection => _connection;\n\n  /*\n  Future<Transaction> _startTransaction() {\n    if (_connection is Transaction) {\n      return Future.value(_connection as Transaction?);\n    } else if (_connection is MySqlConnection) {\n      return (_connection as MySqlConnection).begin();\n    } else {\n      throw StateError('Connection must be transaction or connection');\n    }\n  }\n \n  @override\n  Future<List<List>> query(\n      String tableName, String query, Map<String, dynamic> substitutionValues,\n      [List<String> returningFields = const []]) {\n    // Change @id -> ?\n    for (var name in substitutionValues.keys) {\n      query = query.replaceAll('@$name', '?');\n    }\n\n    logger?.fine('Query: $query');\n    logger?.fine('Values: $substitutionValues');\n\n    if (returningFields.isNotEmpty != true) {\n      return _connection!\n          .prepared(query, substitutionValues.values)\n          .then((results) => results.map((r) => r.toList()).toList());\n    } else {\n      return Future(() async {\n        var tx = await _startTransaction();\n\n        try {\n          var writeResults =\n              await tx.prepared(query, substitutionValues.values);\n          var fieldSet = returningFields.map((s) => '`$s`').join(',');\n          var fetchSql = 'select $fieldSet from $tableName where id = ?;';\n          logger?.fine(fetchSql);\n          var readResults =\n              await tx.prepared(fetchSql, [writeResults.insertId]);\n          var mapped = readResults.map((r) => r.toList()).toList();\n          await tx.commit();\n          return mapped;\n        } catch (_) {\n          await tx.rollback();\n          rethrow;\n        }\n      });\n    }\n  }\n */\n\n  @override\n  Future<List<List>> query(\n    String tableName,\n    String query,\n    Map<String, dynamic> substitutionValues, {\n    String returningQuery = '',\n    String resultQuery = '',\n    List<String> returningFields = const [],\n  }) async {\n    // Change @id -> ?\n    for (var name in substitutionValues.keys) {\n      query = query.replaceAll('@$name', ':$name');\n\n      // Convert UTC time to local time\n      var value = substitutionValues[name];\n      if (value is DateTime && value.isUtc) {\n        var t = value.toLocal();\n        //_logger.fine('Datetime deteted: $name');\n        //_logger.fine('Datetime: UTC -> $value, Local -> $t');\n\n        substitutionValues[name] = t;\n      }\n    }\n\n    //_logger.fine('Query: $query');\n    //_logger.fine('Values: $substitutionValues');\n    //_logger.fine('Returning Query: $returningQuery');\n\n    if (returningQuery.isNotEmpty) {\n      // Handle insert, update and delete\n      // Retrieve back the inserted record\n      if (query.startsWith(\"INSERT\")) {\n        var result = await _connection.execute(query, substitutionValues);\n\n        //logger.fine(result.lastInsertID);\n\n        query = returningQuery;\n        //logger.fine('Result.insertId: ${result.insertId}');\n        // Has primary key\n        if (returningQuery.endsWith('.id=?')) {\n          query = query.replaceAll(\"?\", \":id\");\n          substitutionValues.clear();\n          substitutionValues['id'] = result.lastInsertID;\n        } else {\n          query = _convertSQL(query, substitutionValues);\n        }\n      } else if (query.startsWith(\"UPDATE\")) {\n        await _connection.execute(query, substitutionValues);\n        query = returningQuery;\n      }\n    }\n\n    // Select the deleted records prior to being delete\n    var isDeleteQuery = query.startsWith(\"DELETE\");\n    List<List<dynamic>> deletedResults = [];\n    if (isDeleteQuery) {\n      var selectQuery = query.replaceFirst(\"DELETE\", \"SELECT *\");\n      //_logger.fine('Select query for delete: $selectQuery');\n\n      deletedResults = await _connection\n          .execute(selectQuery, substitutionValues)\n          .then((results) {\n            return results.rows\n                .map((r) => r.typedAssoc().values.toList())\n                .toList();\n          });\n    }\n\n    //_logger.fine('Query 2: $query');\n    //_logger.fine('Values 2: $substitutionValues');\n\n    // Handle select\n    return _connection.execute(query, substitutionValues).then((results) {\n      if (isDeleteQuery) {\n        return deletedResults;\n      } else {\n        //return results.rows.map((r) => r.typedAssoc().values.toList()).toList();\n        return parseSQLResult(results);\n      }\n    });\n  }\n\n  String _convertSQL(String query, Map<String, dynamic> substitutionValues) {\n    var newQuery = query;\n    for (var k in substitutionValues.keys) {\n      var fromPattern = '.$k = ?';\n      var toPattern = '.$k = :$k';\n      newQuery = newQuery.replaceFirst(fromPattern, toPattern);\n    }\n\n    return newQuery;\n  }\n\n  List<List<dynamic>> parseSQLResult(IResultSet res) {\n    //var colTypes = res.cols.map((col) => col.type).toList();\n\n    var mappedResult = <List>[];\n    for (var row in res.rows) {\n      List<dynamic> retResult = [];\n      for (var i = 0; i < row.numOfColumns; i++) {\n        var val = row.typedColAt(i);\n\n        //retResult.add(colTypes[i].convertStringValueToProvidedType(val));\n        retResult.add(val);\n      }\n      mappedResult.add(retResult);\n    }\n\n    return mappedResult;\n  }\n\n  /*\n  Map<String, dynamic> parseSQLNamedResult(IResultSet res) {\n    var colNames = [];\n    var columns = [];\n    var prefix = \"1__\";\n    for (var c in res.cols) {\n      if (colNames.contains(c.name)) {\n        // If collumn name is duplicated, add \"1_\" as prefix\n        var tmpColName = \"$prefix${c.name}\";\n        while (colNames.contains(tmpColName)) {\n          tmpColName = \"$prefix$tmpColName\";\n        }\n        columns.add((name: tmpColName, type: c.type));\n        colNames.add(tmpColName);\n      } else {\n        columns.add((name: c.name, type: c.type));\n        colNames.add(c.name);\n      }\n    }\n\n    var row = res.rows.first;\n\n    Map<String, dynamic> retResult = {};\n    for (var i = 0; i < row.numOfColumns; i++) {\n      var val = row.typedColAt(i);\n      var colName = columns[i].name;\n\n      retResult[colName] = val;\n    }\n\n    return retResult;\n  }\n  */\n\n  @override\n  Future<T> transaction<T>(FutureOr<T> Function(QueryExecutor) f) async {\n    //logger.warning(\"Transaction\");\n\n    T? returnValue = await _connection.transactional((ctx) async {\n      try {\n        //logger.fine('Entering transaction');\n        var tx = MySqlExecutor(ctx, logger: _logger);\n        return await f(tx);\n      } catch (e) {\n        _logger.severe('Failed to run transaction', e);\n        rethrow;\n      }\n    });\n\n    return returnValue!;\n  }\n\n  /*\n  @override\n  Future<T> transaction<T>(FutureOr<T> Function(QueryExecutor) f) async {\n    if (_connection is Transaction) {\n      return await f(this);\n    }\n\n    Transaction? tx;\n    try {\n      tx = await _startTransaction();\n      var executor = MySqlExecutor(tx, logger: logger);\n      var result = await f(executor);\n      await tx.commit();\n      return result;\n    } catch (_) {\n      await tx?.rollback();\n      rethrow;\n    }\n  }\n  */\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/melos_angel3_orm_mysql.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/orm/angel_orm_mysql/pubspec.yaml",
    "content": "name: angel3_orm_mysql\nversion: 8.6.0\ndescription: MySQL support for Angel3 ORM. Includes functionality for querying and transactions.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_mysql\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_orm: ^8.2.0\n  logging: ^1.2.0\n  mysql1: ^0.20.0\n  mysql_client: ^0.0.27\n  optional: ^6.1.0\ndev_dependencies:\n  belatuk_pretty_logging: ^6.1.0\n  angel3_orm_generator: ^8.0.0\n  angel3_serialize: ^8.0.0\n  angel3_migration: ^8.0.0\n  angel3_migration_runner: ^8.0.0\n  test: ^1.24.0\n  lints: ^6.0.0\n  io: ^1.0.4\n  build_runner: ^2.4.0\n\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/belongs_to_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/book.dart';\n\nimport 'util.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n  Author? jkRowling;\n  Author? jameson;\n  Book? deathlyHallows;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [AuthorMigration(), BookMigration()]);\n\n    // Insert an author\n    var query = AuthorQuery()..values.name = 'J.K. Rowling';\n    jkRowling = (await query.insert(executor)).value;\n\n    query.values.name = 'J.K. Jameson';\n    jameson = (await query.insert(executor)).value;\n\n    // And a book\n    var bookQuery = BookQuery();\n    bookQuery.values\n      ..authorId = jkRowling?.idAsInt ?? 0\n      ..partnerAuthorId = jameson?.idAsInt ?? 0\n      ..name = 'Deathly Hallows';\n\n    deathlyHallows = (await bookQuery.insert(executor)).value;\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  group('selects', () {\n    test('select all', () async {\n      var query = BookQuery();\n      var books = await query.get(executor);\n      expect(books, hasLength(1));\n\n      var book = books.first;\n      //print(book.toJson());\n      expect(book.id, deathlyHallows!.id);\n      expect(book.name, deathlyHallows!.name);\n\n      var author = book.author!;\n      //print(AuthorSerializer.toMap(author));\n      expect(author.id, jkRowling!.id);\n      expect(author.name, jkRowling!.name);\n    });\n\n    test('select one', () async {\n      var query = BookQuery();\n      query.where!.id.equals(int.parse(deathlyHallows!.id!));\n      //print(query.compile({}));\n\n      var bookOpt = await query.getOne(executor);\n      expect(bookOpt.isPresent, true);\n      bookOpt.ifPresent((book) {\n        //print(book.toJson());\n        expect(book.id, deathlyHallows!.id);\n        expect(book.name, deathlyHallows!.name);\n\n        var author = book.author!;\n        //print(AuthorSerializer.toMap(author));\n        expect(author.id, jkRowling!.id);\n        expect(author.name, jkRowling!.name);\n      });\n    });\n\n    test('where clause', () async {\n      var query = BookQuery()\n        ..where!.name.equals('Goblet of Fire')\n        ..orWhere((w) => w.authorId.equals(int.parse(jkRowling!.id!)));\n      //print(query.compile({}));\n\n      var books = await query.get(executor);\n      expect(books, hasLength(1));\n\n      var book = books.first;\n      //print(book.toJson());\n      expect(book.id, deathlyHallows!.id);\n      expect(book.name, deathlyHallows!.name);\n\n      var author = book.author!;\n      //print(AuthorSerializer.toMap(author));\n      expect(author.id, jkRowling!.id);\n      expect(author.name, jkRowling!.name);\n    });\n\n    test('union', () async {\n      var query1 = BookQuery()..where!.name.like('Deathly%');\n      var query2 = BookQuery()..where!.authorId.equals(-1);\n      var query3 = BookQuery()\n        ..where!.name.isIn(['Goblet of Fire', 'Order of the Phoenix']);\n      query1\n        ..union(query2)\n        ..unionAll(query3);\n      //print(query1.compile({}));\n\n      var books = await query1.get(executor);\n      expect(books, hasLength(1));\n\n      var book = books.first;\n      //print(book.toJson());\n      expect(book.id, deathlyHallows!.id);\n      expect(book.name, deathlyHallows!.name);\n\n      var author = book.author!;\n      //print(AuthorSerializer.toMap(author));\n      expect(author.id, jkRowling!.id);\n      expect(author.name, jkRowling!.name);\n    });\n\n    test('order by', () async {\n      var query = AuthorQuery()..orderBy(AuthorFields.name, descending: true);\n      var authors = await query.get(executor);\n      expect(authors, [jkRowling, jameson]);\n    });\n  });\n\n  test('insert sets relationship', () {\n    expect(deathlyHallows!.author, jkRowling);\n    //expect(deathlyHallows.author, isNotNull);\n    //expect(deathlyHallows.author.name, rowling.name);\n  });\n\n  test('delete stream', () async {\n    //printSeparator('Delete stream test');\n    var query = BookQuery()..where!.name.equals(deathlyHallows!.name!);\n    //print(query.compile({}, preamble: 'DELETE', withFields: false));\n    var books = await query.delete(executor);\n    expect(books, hasLength(1));\n\n    var book = books.first;\n    expect(book.id, deathlyHallows?.id);\n    expect(book.author, isNotNull);\n    expect(book.author!.name, jkRowling!.name);\n  });\n\n  test('update book', () async {\n    var cloned = deathlyHallows!.copyWith(name: \"Sorcerer's Stone\");\n    var query = BookQuery()\n      ..where?.id.equals(int.parse(cloned.id!))\n      ..values.copyFrom(cloned);\n    var bookOpt = await (query.updateOne(executor));\n    expect(bookOpt.isPresent, true);\n    bookOpt.ifPresent((book) {\n      //print(book.toJson());\n      expect(book.name, cloned.name);\n      expect(book.author, isNotNull);\n      expect(book.author!.name, jkRowling!.name);\n    });\n  });\n\n  group('joined subquery', () {\n    // To verify that the joined subquery is correct,\n    // we test both a query that return empty, and one\n    // that should return correctly.\n    test('returns empty on false subquery', () async {\n      printSeparator('False subquery test');\n      var query = BookQuery()..author.where!.name.equals('Billie Jean');\n      expect(await query.get(executor), isEmpty);\n    });\n\n    test('returns values on true subquery', () async {\n      printSeparator('True subquery test');\n      var query = BookQuery()..author.where!.name.like('%Rowling%');\n      expect(await query.get(executor), [deathlyHallows]);\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/common.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_migration_runner/mysql.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_orm_mysql/angel3_orm_mysql.dart';\nimport 'package:logging/logging.dart';\n//import 'package:mysql1/mysql1.dart';\nimport 'package:mysql_client/mysql_client.dart';\n\nList tmpTables = [];\n\n// MySQL and MariaDB has some differences in the ordering of the results\n// Update this according to either 'mysql' or 'mariadb'\nconst targetTestDatabase = 'mariadb';\n\n// For MySQL/MariaDB using `mysql_client` driver\nFuture<MySQLConnection> openMySqlConnection() async {\n  var connection = await MySQLConnection.createConnection(\n    databaseName: 'orm_test',\n    port: 3306,\n    host: \"localhost\",\n    userName: Platform.environment['MYSQL_USERNAME'] ?? 'test',\n    password: Platform.environment['MYSQL_PASSWORD'] ?? 'Test123',\n    secure: !('false' == Platform.environment['MYSQL_SECURE']),\n  );\n\n  await connection.connect(timeoutMs: 10000);\n\n  return connection;\n}\n\nFuture<QueryExecutor> createExecutor(MySQLConnection conn) async {\n  var logger = Logger('orm_mysql');\n\n  return MySqlExecutor(conn, logger: logger);\n}\n\nFuture<MigrationRunner> createTables(\n  MySQLConnection conn,\n  List<Migration> models,\n) async {\n  var runner = MySqlMigrationRunner(conn, migrations: models);\n  await runner.up();\n\n  return runner;\n}\n\nFuture<void> dropTables(MigrationRunner runner) async {\n  await runner.reset();\n}\n\n// For MariaDB\nFuture<void> dropTables2(QueryExecutor executor) {\n  var sqlExecutor = (executor as MariaDbExecutor);\n  for (var tableName in tmpTables.reversed) {\n    print('DROP TABLE $tableName');\n    sqlExecutor.query(tableName, 'DROP TABLE $tableName', {});\n  }\n  return sqlExecutor.close();\n}\n\nString extractTableName(String createQuery) {\n  var start = createQuery.indexOf('EXISTS');\n  var end = createQuery.indexOf('(');\n\n  if (start == -1 || end == -1) {\n    return '';\n  }\n\n  return createQuery.substring(start + 6, end).trim();\n}\n\n// Executor for MySQL/MariaDB using `mysql1` driver\n/* Future<MariaDbExecutor> _connectToMysqlDb(List<String> schemas) async {\n  var settings = ConnectionSettings(\n      host: 'localhost',\n      port: 3306,\n      db: 'orm_test',\n      user: 'test',\n      password: 'test123');\n  var connection = await MySqlConnection.connect(settings);\n\n  var logger = Logger('orm_mariadb');\n\n  tmpTables.clear();\n\n  for (var s in schemas) {\n    // MySQL driver does not support multiple sql queries\n    var data = await File('test/migrations/$s.sql').readAsString();\n    var queries = data.split(\";\");\n    for (var q in queries) {\n      print(\"Table: [$q]\");\n      if (q.trim().isNotEmpty) {\n        //await connection.execute(q);\n        await connection.query(q);\n\n        var tableName = extractTableName(q);\n        if (tableName != '') {\n          tmpTables.add(tableName);\n        }\n      }\n    }\n  }\n\n  return MysqlDbExecutor(connection, logger: logger);\n} \n*/\n\n/*\n// Executor for MySQL\n//   create user 'test'@'localhost' identified by 'test123';\n//   GRANT ALL PRIVILEGES ON orm_test.* to 'test'@'localhost' WITH GRANT OPTION;\nFuture<MySqlExecutor> _connectToMySql(List<Migration> models) async {\n  var connection = await MySQLConnection.createConnection(\n      databaseName: 'orm_test',\n      port: 3306,\n      host: \"localhost\",\n      userName: Platform.environment['MYSQL_USERNAME'] ?? 'test',\n      password: Platform.environment['MYSQL_PASSWORD'] ?? 'test123',\n      secure: !('false' == Platform.environment['MYSQL_SECURE']));\n\n  await connection.connect(timeoutMs: 10000);\n\n  var logger = Logger('orm_mysql');\n\n  tmpTables.clear();\n\n  var runner = MySqlMigrationRunner(connection, migrations: models);\n  await runner.up();\n\n  for (var s in schemas) {\n    // MySQL driver does not support multiple sql queries\n    var data = await File('test/migrations/$s.sql').readAsString();\n    var queries = data.split(\";\");\n    for (var q in queries) {\n      //print(\"Table: [$q]\");\n      if (q.trim().isNotEmpty) {\n        await connection.execute(q);\n\n        var tableName = extractTableName(q);\n        if (tableName != '') {\n          tmpTables.add(tableName);\n        }\n      }\n    }\n  }\n\n  return MySqlExecutor(connection, logger: logger);\n}\n*/\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/custom_expr_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/custom_expr.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n  late Number numbersModel;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [NumberMigration(), AlphabetMigration()]);\n\n    var now = DateTime.now();\n    var nQuery = NumberQuery();\n    nQuery.values\n      ..createdAt = now\n      ..updatedAt = now;\n    var numbersModelOpt = await nQuery.insert(executor);\n    numbersModelOpt.ifPresent((v) {\n      numbersModel = v;\n    });\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('fetches correct result', () async {\n    expect(numbersModel.two, 2);\n  });\n\n  test('in relation', () async {\n    var abcQuery = AlphabetQuery();\n    abcQuery.values\n      ..value = 'abc'\n      ..numbersId = numbersModel.idAsInt\n      ..createdAt = numbersModel.createdAt\n      ..updatedAt = numbersModel.updatedAt;\n    var abcOpt = await (abcQuery.insert(executor));\n    expect(abcOpt.isPresent, true);\n    abcOpt.ifPresent((abc) {\n      expect(abc.numbers, numbersModel);\n      expect(abc.numbers?.two, 2);\n      expect(abc.value, 'abc');\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/edge_case_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/book.dart';\nimport 'models/unorthodox.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [\n      UnorthodoxMigration(),\n      WeirdJoinMigration(),\n      SongMigration(),\n      NumbaMigration(),\n      AuthorMigration(),\n      FooMigration(),\n      FooPivotMigration(),\n      BookMigration(),\n    ]);\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('can create object with no id', () async {\n    var query = UnorthodoxQuery()..values.name = 'World';\n    var modelOpt = await query.insert(executor);\n    expect(modelOpt.isPresent, true);\n    modelOpt.ifPresent((model) {\n      expect(model, Unorthodox(name: 'World'));\n    });\n  }, skip: \"Primary key cannot be null\");\n\n  group('relations on non-model', () {\n    Unorthodox? unorthodox;\n\n    setUp(() async {\n      //if (unorthodox == null) {\n      var query = UnorthodoxQuery()..values.name = 'Hey';\n\n      var unorthodoxOpt = await query.insert(executor);\n      unorthodoxOpt.ifPresent((value) {\n        unorthodox = value;\n      });\n      //}\n    });\n\n    test('belongs to', () async {\n      var query = WeirdJoinQuery()..values.joinName = unorthodox!.name;\n      var modelOpt = await query.insert(executor);\n      expect(modelOpt.isPresent, true);\n      modelOpt.ifPresent((model) {\n        //print(model.toJson());\n        expect(model.id, isNotNull);\n        expect(model.unorthodox, unorthodox);\n      });\n    });\n\n    group('layered', () {\n      WeirdJoin? weirdJoin;\n      Song? girlBlue;\n\n      setUp(() async {\n        var wjQuery = WeirdJoinQuery()..values.joinName = unorthodox!.name;\n\n        var weirdJoinOpt = await wjQuery.insert(executor);\n        //weirdJoin = (await wjQuery.insert(executor)).value;\n        weirdJoinOpt.ifPresent((value1) async {\n          weirdJoin = value1;\n          var gbQuery = SongQuery()\n            ..values.weirdJoinId = value1.id\n            ..values.title = 'Girl Blue';\n\n          var girlBlueOpt = await gbQuery.insert(executor);\n          girlBlueOpt.ifPresent((value2) {\n            girlBlue = value2;\n          });\n        });\n      });\n\n      test('has one', () async {\n        var query = WeirdJoinQuery()..where!.id.equals(weirdJoin!.id);\n        var wjOpt = await query.getOne(executor);\n        expect(wjOpt.isPresent, true);\n        wjOpt.ifPresent((wj) {\n          //print(wj.toJson());\n          expect(wj.song, girlBlue);\n        });\n      });\n\n      test('has many', () async {\n        var numbas = <Numba>[];\n\n        for (var i = 0; i < 15; i++) {\n          var query = NumbaQuery()\n            ..values.parent = weirdJoin!.id\n            ..values.i = i;\n          var modelObj = await query.insert(executor);\n          print(\"$i = $modelObj\");\n          expect(modelObj.isPresent, true);\n          modelObj.ifPresent((model) {\n            numbas.add(model);\n          });\n        }\n\n        var query = WeirdJoinQuery()..where!.id.equals(weirdJoin!.id);\n        var wjObj = await query.getOne(executor);\n        expect(wjObj.isPresent, true);\n        wjObj.ifPresent((wj) {\n          if (targetTestDatabase == 'mysql') {\n            expect(wj.numbas, numbas.reversed);\n          } else {\n            expect(wj.numbas, numbas);\n          }\n        });\n      });\n\n      test('many to many', () async {\n        var fooQuery = FooQuery()..values.bar = 'baz';\n        var fooBar = await fooQuery\n            .insert(executor)\n            .then((foo) => foo.value.bar);\n        var pivotQuery = FooPivotQuery()\n          ..values.weirdJoinId = weirdJoin!.id\n          ..values.fooBar = fooBar;\n        await pivotQuery.insert(executor);\n        fooQuery = FooQuery()..where!.bar.equals('baz');\n\n        var fooOpt = await fooQuery.getOne(executor);\n        expect(fooOpt.isPresent, true);\n        fooOpt.ifPresent((foo) {\n          //print(foo.toJson());\n          //print(weirdJoin!.toJson());\n          expect(foo.weirdJoins[0].id, weirdJoin!.id);\n        });\n      }, skip: \"Primary key cannot be null\");\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/enum_and_nested_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/has_car.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [HasCarMigration()]);\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('insert', () async {\n    var query = HasCarQuery()\n      ..values.type = CarType.sedan\n      ..values.color = Color.red;\n    var resultOpt = await (query.insert(executor));\n    expect(resultOpt.isPresent, true);\n    resultOpt.ifPresent((result) {\n      expect(result.type, CarType.sedan);\n      expect(result.color, Color.red);\n    });\n  });\n\n  group('query', () {\n    HasCar? initialValue;\n\n    setUp(() async {\n      var query = HasCarQuery();\n      query.values.type = CarType.sedan;\n      initialValue = (await query.insert(executor)).value;\n    });\n\n    test('query by enum', () async {\n      // Check for mismatched type\n      var query = HasCarQuery()..where!.type.equals(CarType.atv);\n      var result = await query.get(executor);\n      expect(result, isEmpty);\n\n      query = HasCarQuery()..where!.type.equals(initialValue!.type);\n      var oneResult = await query.getOne(executor);\n      expect(oneResult.value, initialValue);\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/enum_test.dart",
    "content": "import 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nimport 'models/has_car.dart';\n\nvoid main() async {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  /// See https://github.com/dart-backend/angel/pull/98\n  test('enum field with custom deserializer should be parsed consistently', () {\n    final query = HasCarQuery();\n    final hasCar = query.parseRow([null, null, null, null, 'R']).value;\n    expect(hasCar.color, equals(Color.red));\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/has_many_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/tree.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n  Tree? appleTree;\n  late int treeId;\n\n  setUp(() async {\n    var query = TreeQuery()..values.rings = 10;\n\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [TreeMigration(), FruitMigration()]);\n    appleTree = (await query.insert(executor)).value;\n    treeId = int.parse(appleTree!.id!);\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('list is empty if there is nothing', () {\n    expect(appleTree!.rings, 10);\n    expect(appleTree!.fruits, isEmpty);\n  });\n\n  group('mutations', () {\n    Fruit? apple, banana;\n\n    void verify(Tree tree) {\n      //print(tree.fruits!.map(FruitSerializer.toMap).toList());\n      expect(tree.fruits, hasLength(2));\n      expect(tree.fruits[0].commonName, apple!.commonName);\n      expect(tree.fruits[1].commonName, banana!.commonName);\n    }\n\n    setUp(() async {\n      var appleQuery = FruitQuery()\n        ..values.treeId = treeId\n        ..values.commonName = 'Apple';\n\n      var bananaQuery = FruitQuery()\n        ..values.treeId = treeId\n        ..values.commonName = 'Banana';\n      var appleOpt = await appleQuery.insert(executor);\n      var bananaOpt = await bananaQuery.insert(executor);\n      appleOpt.ifPresent((a) {\n        apple = a;\n      });\n      bananaOpt.ifPresent((a) {\n        banana = a;\n      });\n    });\n\n    test('can fetch any children', () async {\n      var query = TreeQuery()..where!.id.equals(treeId);\n      var treeOpt = await (query.getOne(executor));\n      expect(treeOpt.isPresent, true);\n      treeOpt.ifPresent((tree) {\n        verify(tree);\n      });\n    });\n\n    test('sets on update', () async {\n      var tq = TreeQuery()\n        ..where!.id.equals(treeId)\n        ..values.rings = 24;\n      var treeOpt = await (tq.updateOne(executor));\n      expect(treeOpt.isPresent, true);\n      treeOpt.ifPresent((tree) {\n        verify(tree);\n        expect(tree.rings, 24);\n      });\n    });\n\n    test('sets on delete', () async {\n      var tq = TreeQuery()..where!.id.equals(treeId);\n      var treeOpt = await (tq.deleteOne(executor));\n      expect(treeOpt.isPresent, true);\n      treeOpt.ifPresent((tree) {\n        verify(tree);\n      });\n    });\n\n    test('returns empty on false subquery', () async {\n      var tq = TreeQuery()\n        ..where!.id.equals(treeId)\n        ..fruits.where!.commonName.equals('Kiwi');\n      var treeOpt = await (tq.getOne(executor));\n      expect(treeOpt.isPresent, true);\n      treeOpt.ifPresent((tree) {\n        expect(tree.fruits, isEmpty);\n      });\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/has_map_test.dart",
    "content": "@Skip(\"Jsonb data type is not supported\")\nlibrary;\n\nimport 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/has_map.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [HasMapMigration()]);\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('insert', () async {\n    var query = HasMapQuery();\n    query.values\n      ..value = {'foo': 'bar'}\n      ..list = ['1', 2, 3.0];\n    var modelOpt = await (query.insert(executor));\n    expect(modelOpt.isPresent, true);\n    modelOpt.ifPresent((model) {\n      //print(model.toString());\n\n      var data = HasMap(value: {'foo': 'bar'}, list: ['1', 2, 3.0]);\n      //print(data.toString());\n\n      expect(model, data);\n    });\n  });\n\n  test('update', () async {\n    var query = HasMapQuery();\n    query.values\n      ..value = {'foo': 'bar'}\n      ..list = ['1', 2, 3.0];\n    var modelOpt = await (query.insert(executor));\n    expect(modelOpt.isPresent, true);\n    if (modelOpt.isPresent) {\n      var model = modelOpt.value;\n      //print(model.toJson());\n      query = HasMapQuery()..values.copyFrom(model);\n      var result = await query.updateOne(executor);\n      expect(result.isPresent, true);\n      result.ifPresent((m) {\n        expect(m, model);\n      });\n    }\n  });\n\n  group('query', () {\n    HasMap? initialValue;\n\n    setUp(() async {\n      var query = HasMapQuery();\n      query.values\n        ..value = {'foo': 'bar'}\n        ..list = ['1', 2, 3.0];\n      initialValue = (await query.insert(executor)).value;\n    });\n\n    /*\n    test('get all', () async {\n      var query = HasMapQuery();\n      expect(await query.get(executor), [initialValue]);\n    });\n\n    test('map equals', () async {\n      var query = HasMapQuery();\n      query.where!.value.equals({'foo': 'bar'});\n      expect(await query.get(executor), [initialValue]);\n\n      query = HasMapQuery();\n      query.where?.value.equals({'foo': 'baz'});\n      expect(await query.get(executor), isEmpty);\n    });\n    */\n\n    test('list equals', () async {\n      var query = HasMapQuery();\n\n      query.where?.list.equals(['1', 2, 3.0]);\n\n      //print(query.substitutionValues);\n\n      var result = await query.get(executor);\n      expect(result, [initialValue]);\n\n      query = HasMapQuery();\n      query.where?.list.equals(['10', 20, 30.0]);\n      var result2 = await query.get(executor);\n      expect(result2, isEmpty);\n    });\n\n    /*\n    test('property equals', () async {\n      var query = HasMapQuery()..where?.value['foo'].asString?.equals('bar');\n      expect(await query.get(executor), [initialValue]);\n\n      query = HasMapQuery()..where?.value['foo'].asString?.equals('baz');\n      expect(await query.get(executor), []);\n    });\n\n    test('index equals', () async {\n      var query = HasMapQuery()..where?.list[0].asString?.equals('1');\n      expect(await query.get(executor), [initialValue]);\n\n      query = HasMapQuery()..where?.list[1].asInt?.equals(3);\n      expect(await query.get(executor), []);\n    });\n    */\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/has_one_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/leg.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n  Leg? originalLeg;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [LegMigration(), FootMigration()]);\n    var query = LegQuery()..values.name = 'Left';\n    originalLeg = (await query.insert(executor)).value;\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('sets to null if no child', () async {\n    //print(LegQuery().compile({}));\n    var query = LegQuery()..where!.id.equals(int.parse(originalLeg!.id!));\n    var legOpt = await (query.getOne(executor));\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      //print(leg.toJson());\n      expect(leg.name, originalLeg?.name);\n      expect(leg.id, originalLeg?.id);\n      expect(leg.foot, isNull);\n    });\n  });\n\n  test('can fetch one foot', () async {\n    var footQuery = FootQuery()\n      ..values.legId = int.parse(originalLeg!.id!)\n      ..values.nToes = 5.64;\n    var legQuery = LegQuery()..where!.id.equals(int.parse(originalLeg!.id!));\n    var footOpt = await (footQuery.insert(executor));\n    var legOpt = await (legQuery.getOne(executor));\n    expect(footOpt.isPresent, true);\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      expect(leg.name, originalLeg!.name);\n      expect(leg.id, originalLeg!.id);\n      footOpt.ifPresent((foot) {\n        expect(leg.foot, isNotNull);\n        expect(leg.foot!.id, foot.id);\n        expect(leg.foot!.nToes, foot.nToes);\n      });\n    });\n  });\n\n  test('only fetches one foot even if there are multiple', () async {\n    var footQuery = FootQuery()\n      ..values.legId = int.parse(originalLeg!.id!)\n      ..values.nToes = 24;\n    var legQuery = LegQuery()..where!.id.equals(int.parse(originalLeg!.id!));\n    var footOpt = await (footQuery.insert(executor));\n    var legOpt = await (legQuery.getOne(executor));\n    expect(footOpt.isPresent, true);\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      expect(leg.name, originalLeg!.name);\n      expect(leg.id, originalLeg!.id);\n      expect(leg.foot, isNotNull);\n      footOpt.ifPresent((foot) {\n        expect(leg.foot!.id, foot.id);\n        expect(leg.foot!.nToes, foot.nToes);\n      });\n    });\n  });\n\n  test('sets foot on update', () async {\n    var footQuery = FootQuery()\n      ..values.legId = int.parse(originalLeg!.id!)\n      ..values.nToes = 5.64;\n    var legQuery = LegQuery()\n      ..where!.id.equals(int.parse(originalLeg!.id!))\n      ..values.copyFrom(originalLeg!.copyWith(name: 'Right'));\n    var footOpt = await (footQuery.insert(executor));\n    var legOpt = await (legQuery.updateOne(executor));\n    expect(footOpt.isPresent, true);\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      //print(leg.toJson());\n      expect(leg.name, 'Right');\n      expect(leg.foot, isNotNull);\n      footOpt.ifPresent((foot) {\n        expect(leg.foot!.id, foot.id);\n        expect(leg.foot!.nToes, foot.nToes);\n      });\n    });\n  });\n\n  test('sets foot on delete', () async {\n    var footQuery = FootQuery()\n      ..values.legId = int.parse(originalLeg!.id!)\n      ..values.nToes = 5.64;\n    var legQuery = LegQuery()..where!.id.equals(int.parse(originalLeg!.id!));\n    var footOpt = await (footQuery.insert(executor));\n    var legOpt = await (legQuery.deleteOne(executor));\n    expect(footOpt.isPresent, true);\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      //print(leg.toJson());\n      expect(leg.name, originalLeg?.name);\n      expect(leg.foot, isNotNull);\n      footOpt.ifPresent((foot) {\n        expect(leg.foot!.id, foot.id);\n        expect(leg.foot!.nToes, foot.nToes);\n      });\n    });\n  });\n\n  test('sets null on false subquery', () async {\n    var legQuery = LegQuery()\n      ..where!.id.equals(originalLeg!.idAsInt)\n      ..foot.where!.legId.equals(originalLeg!.idAsInt + 1024);\n    var legOpt = await (legQuery.getOne(executor));\n    expect(legOpt.isPresent, true);\n    legOpt.ifPresent((leg) {\n      expect(leg.foot, isNull);\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/join_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\n\nimport 'common.dart';\nimport 'models/person.dart';\nimport 'models/person_order.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  Person? originalPerson;\n  PersonOrder? originalOrder1;\n  PersonOrder? originalOrder2;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [\n      PersonMigration(),\n      PersonOrderMigration(),\n    ]);\n    var query = PersonQuery()\n      ..values.name = 'DebuggerX'\n      ..values.age = 29;\n    originalPerson = (await query.insert(executor)).value;\n\n    var orderQuery = PersonOrderQuery()\n      ..values.personId = originalPerson!.idAsInt\n      ..values.name = 'Order1'\n      ..values.price = 128\n      ..values.deleted = false;\n\n    originalOrder1 = (await orderQuery.insert(executor)).value;\n\n    orderQuery = PersonOrderQuery()\n      ..values.personId = originalPerson!.idAsInt\n      ..values.name = 'Order2'\n      ..values.price = 256\n      ..values.deleted = true;\n\n    originalOrder2 = (await orderQuery.insert(executor)).value;\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  test('select person with last order info', () async {\n    var orderQuery = PersonOrderQuery();\n    var query = PersonWithLastOrderQuery();\n    query.join(\n      orderQuery.tableName,\n      PersonFields.id,\n      PersonOrderFields.personId,\n      alias: 'po',\n    );\n    query.where?.name.equals(originalPerson!.name!);\n    query.orderBy('po.id', descending: true);\n    var personWithOrderInfo = await query.getOne(executor);\n    expect(personWithOrderInfo.value.lastOrderName, originalOrder2?.name);\n  });\n\n  test('select person with last valid order info', () async {\n    var orderQuery = PersonOrderQuery();\n    var query = PersonWithLastOrderQuery();\n    query.join(\n      orderQuery.tableName,\n      PersonFields.id,\n      PersonOrderFields.personId,\n      alias: 'po',\n    );\n    query.where?.name.equals(originalPerson!.name!);\n    query.orderBy('po.id', descending: true);\n    query.where?.raw('po.deleted = false');\n    var personWithOrderInfo = await query.getOne(executor);\n    expect(personWithOrderInfo.value.lastOrderName, originalOrder1?.name);\n  });\n\n  test('select orders with person info', () async {\n    var personQuery = PersonQuery();\n    var query = OrderWithPersonInfoQuery();\n    query.join(\n      personQuery.tableName,\n      PersonOrderFields.personId,\n      PersonFields.id,\n      alias: 'p',\n    );\n    query.where?.raw(\"p.name = '${originalPerson?.name}'\");\n    var orders = await query.get(executor);\n    expect(\n      orders.every(\n        (element) =>\n            element.personName == originalPerson?.name &&\n            element.personAge == originalPerson?.age,\n      ),\n      true,\n    );\n  });\n\n  test('select orders with multi order by fields', () async {\n    var query = PersonOrderQuery();\n    query.orderBy(PersonOrderFields.id, descending: true);\n    query.orderBy(PersonOrderFields.personId, descending: true);\n    var orders = await query.get(executor);\n    expect(orders.first.idAsInt > orders.last.idAsInt, true);\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/many_to_many_test.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/user.dart';\nimport 'util.dart';\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  Role? canPub, canSub;\n  User? thosakwe;\n\n  /*\n  Future<void> dumpQuery(String query) async {\n    if (Platform.environment.containsKey('STFU')) return;\n    print('\\n');\n    print('==================================================');\n    print('                  DUMPING QUERY');\n    print(query);\n    //var rows = await executor.query(null, query, {});\n    var rows = await executor.query('', query, {});\n    print('\\n${rows.length} row(s):');\n    for (var r in rows) {\n      print('  * $r');\n    }\n    print('==================================================\\n\\n');\n  }\n  */\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [\n      UserMigration(),\n      RoleMigration(),\n      RoleUserMigration(),\n      RoleUserMigration(),\n    ]);\n\n    var canPubQuery = RoleQuery()..values.name = 'can_pub';\n    var canSubQuery = RoleQuery()..values.name = 'can_sub';\n\n    canPub = (await canPubQuery.insert(executor)).value;\n    print(canPub);\n    //print('=== CANPUB: ${canPub?.toJson()}');\n    // await dumpQuery(canPubQuery.compile(Set()));\n    canSub = (await canSubQuery.insert(executor)).value;\n    print(canSub);\n    //print('=== CANSUB: ${canSub?.toJson()}');\n\n    var thosakweQuery = UserQuery();\n    thosakweQuery.values\n      ..username = 'thosakwe'\n      ..password = 'Hahahahayoureallythoughtiwasstupidenoughtotypethishere'\n      ..email = 'thosakwe AT gmail.com';\n    var result = await thosakweQuery.insert(executor);\n    thosakwe = result.value;\n    print('=== THOSAKWE: ${thosakwe?.toJson()}');\n\n    // Allow thosakwe to publish...\n    printSeparator('Allow thosakwe to publish');\n    var thosakwePubQuery = RoleUserQuery();\n    thosakwePubQuery.values\n      ..userId = int.parse(thosakwe!.id!)\n      ..roleId = int.parse(canPub!.id!);\n    await thosakwePubQuery.insert(executor);\n\n    // Allow thosakwe to subscribe...\n    printSeparator('Allow thosakwe to subscribe');\n    var thosakweSubQuery = RoleUserQuery();\n    thosakweSubQuery.values\n      ..userId = int.parse(thosakwe!.id!)\n      ..roleId = int.parse(canSub!.id!);\n    await thosakweSubQuery.insert(executor);\n\n    // Print all users...\n    // await dumpQuery('select * from users;');\n    // await dumpQuery('select * from roles;');\n    // await dumpQuery('select * from role_users;');\n    // var query = RoleQuery()..where.id.equals(canPub.idAsInt);\n    // await dumpQuery(query.compile(Set()));\n\n    print('\\n');\n    print('==================================================');\n    print('              GOOD STUFF BEGINS HERE              ');\n    print('==================================================\\n\\n');\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  Future<User?> fetchThosakwe() async {\n    var query = UserQuery()..where!.id.equals(int.parse(thosakwe!.id!));\n    var userOpt = await query.getOne(executor);\n    expect(userOpt.isPresent, true);\n    if (userOpt.isPresent) {\n      return userOpt.value;\n    } else {\n      return null;\n    }\n  }\n\n  test('fetch roles for user', () async {\n    printSeparator('Fetch roles for user test');\n    var user = await fetchThosakwe();\n\n    expect(user?.roles, hasLength(2));\n    expect(user?.roles, contains(canPub));\n    expect(user?.roles, contains(canSub));\n  });\n\n  test('fetch users for role', () async {\n    for (var role in [canPub, canSub]) {\n      var query = RoleQuery()..where!.id.equals(role!.idAsInt);\n      var rOpt = await query.getOne(executor);\n      expect(rOpt.isPresent, true);\n      rOpt.ifPresent((r) async {\n        expect(r.users.toList(), [thosakwe]);\n      });\n    }\n  });\n\n  test('only fetches linked', () async {\n    // Create a new user. The roles list should be empty,\n    // be there are no related rules.\n    var userQuery = UserQuery();\n    userQuery.values\n      ..username = 'Prince'\n      ..password = 'Rogers'\n      ..email = 'Nelson';\n    var userOpt = await userQuery.insert(executor);\n    expect(userOpt.isPresent, true);\n    if (userOpt.isPresent) {\n      var user = userOpt.value;\n      expect(user.roles, isEmpty);\n\n      // Fetch again, just to be doubly sure.\n      var query = UserQuery()..where!.id.equals(user.idAsInt);\n      var fetchedOpt = await query.getOne(executor);\n      expect(fetchedOpt.isPresent, true);\n      fetchedOpt.ifPresent((fetched) {\n        expect(fetched.roles, isEmpty);\n      });\n    }\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/asset.dart",
    "content": "import 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:optional/optional.dart';\n\npart 'asset.g.dart';\n\n@serializable\n@orm\nabstract class ItemEntity extends Model {\n  String get description;\n}\n\n@serializable\n@orm\nabstract class AssetEntity extends Model {\n  String get description;\n\n  String get name;\n\n  @Column(type: ColumnType.numeric, precision: 17, scale: 3)\n  double get price;\n\n  @hasMany\n  List<ItemEntity> get items;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/asset.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'asset.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass ItemMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('items', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('description', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('items');\n  }\n}\n\nclass AssetMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('assets', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('description', length: 255);\n      table.varChar('name', length: 255);\n      table.double('price');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('assets', cascade: true);\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass ItemQuery extends Query<Item, ItemQueryWhere> {\n  ItemQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = ItemQueryWhere(this);\n  }\n\n  @override\n  final ItemQueryValues values = ItemQueryValues();\n\n  List<String> _selectedFields = [];\n\n  ItemQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'items';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'description'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  ItemQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  ItemQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  ItemQueryWhere newWhereClause() {\n    return ItemQueryWhere(this);\n  }\n\n  Optional<Item> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Item(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      description: fields.contains('description') ? (row[3] as String) : '',\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Item> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass ItemQueryWhere extends QueryWhere {\n  ItemQueryWhere(ItemQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      description = StringSqlExpressionBuilder(query, 'description');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder description;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, description];\n  }\n}\n\nclass ItemQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String get description {\n    return (values['description'] as String);\n  }\n\n  set description(String value) => values['description'] = value;\n\n  void copyFrom(Item model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    description = model.description;\n  }\n}\n\nclass AssetQuery extends Query<Asset, AssetQueryWhere> {\n  AssetQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = AssetQueryWhere(this);\n    leftJoin(\n      _items = ItemQuery(trampoline: trampoline, parent: this),\n      'id',\n      'asset_id',\n      additionalFields: const ['id', 'created_at', 'updated_at', 'description'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final AssetQueryValues values = AssetQueryValues();\n\n  List<String> _selectedFields = [];\n\n  AssetQueryWhere? _where;\n\n  late ItemQuery _items;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'assets';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'description',\n      'name',\n      'price',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  AssetQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  AssetQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  AssetQueryWhere newWhereClause() {\n    return AssetQueryWhere(this);\n  }\n\n  Optional<Asset> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Asset(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      description: fields.contains('description') ? (row[3] as String) : '',\n      name: fields.contains('name') ? (row[4] as String) : '',\n      price: fields.contains('price') ? mapToDouble(row[5]) : 0.0,\n    );\n    if (row.length > 6) {\n      var modelOpt = ItemQuery().parseRow(row.skip(6).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(items: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Asset> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  ItemQuery get items {\n    return _items;\n  }\n\n  @override\n  Future<List<Asset>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<Asset>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              items: List<ItemEntity>.from(l.items)..addAll(model.items),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Asset>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<Asset>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              items: List<ItemEntity>.from(l.items)..addAll(model.items),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Asset>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<Asset>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              items: List<ItemEntity>.from(l.items)..addAll(model.items),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass AssetQueryWhere extends QueryWhere {\n  AssetQueryWhere(AssetQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      description = StringSqlExpressionBuilder(query, 'description'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder description;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, description, name, price];\n  }\n}\n\nclass AssetQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String get description {\n    return (values['description'] as String);\n  }\n\n  set description(String value) => values['description'] = value;\n\n  String get name {\n    return (values['name'] as String);\n  }\n\n  set name(String value) => values['name'] = value;\n\n  double get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double value) => values['price'] = value;\n\n  void copyFrom(Asset model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    description = model.description;\n    name = model.name;\n    price = model.price;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Item extends ItemEntity {\n  Item({this.id, this.createdAt, this.updatedAt, required this.description});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String description;\n\n  Item copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? description,\n  }) {\n    return Item(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      description: description ?? this.description,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is ItemEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.description == description;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, description]);\n  }\n\n  @override\n  String toString() {\n    return 'Item(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, description=$description)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return ItemSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Asset extends AssetEntity {\n  Asset({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    required this.description,\n    required this.name,\n    required this.price,\n    List<ItemEntity> items = const [],\n  }) : items = List.unmodifiable(items);\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String description;\n\n  @override\n  String name;\n\n  @override\n  double price;\n\n  @override\n  List<ItemEntity> items;\n\n  Asset copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? description,\n    String? name,\n    double? price,\n    List<ItemEntity>? items,\n  }) {\n    return Asset(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      description: description ?? this.description,\n      name: name ?? this.name,\n      price: price ?? this.price,\n      items: items ?? this.items,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is AssetEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.description == description &&\n        other.name == name &&\n        other.price == price &&\n        ListEquality<ItemEntity>(\n          DefaultEquality<ItemEntity>(),\n        ).equals(other.items, items);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      description,\n      name,\n      price,\n      items,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Asset(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, description=$description, name=$name, price=$price, items=$items)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return AssetSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst ItemSerializer itemSerializer = ItemSerializer();\n\nclass ItemEncoder extends Converter<Item, Map> {\n  const ItemEncoder();\n\n  @override\n  Map convert(Item model) => ItemSerializer.toMap(model);\n}\n\nclass ItemDecoder extends Converter<Map, Item> {\n  const ItemDecoder();\n\n  @override\n  Item convert(Map map) => ItemSerializer.fromMap(map);\n}\n\nclass ItemSerializer extends Codec<Item, Map> {\n  const ItemSerializer();\n\n  @override\n  ItemEncoder get encoder => const ItemEncoder();\n\n  @override\n  ItemDecoder get decoder => const ItemDecoder();\n\n  static Item fromMap(Map map) {\n    return Item(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      description: map['description'] as String,\n    );\n  }\n\n  static Map<String, dynamic> toMap(ItemEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'description': model.description,\n    };\n  }\n}\n\nabstract class ItemFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    description,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String description = 'description';\n}\n\nconst AssetSerializer assetSerializer = AssetSerializer();\n\nclass AssetEncoder extends Converter<Asset, Map> {\n  const AssetEncoder();\n\n  @override\n  Map convert(Asset model) => AssetSerializer.toMap(model);\n}\n\nclass AssetDecoder extends Converter<Map, Asset> {\n  const AssetDecoder();\n\n  @override\n  Asset convert(Map map) => AssetSerializer.fromMap(map);\n}\n\nclass AssetSerializer extends Codec<Asset, Map> {\n  const AssetSerializer();\n\n  @override\n  AssetEncoder get encoder => const AssetEncoder();\n\n  @override\n  AssetDecoder get decoder => const AssetDecoder();\n\n  static Asset fromMap(Map map) {\n    return Asset(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      description: map['description'] as String,\n      name: map['name'] as String,\n      price: map['price'] as double,\n      items: map['items'] is Iterable\n          ? List.unmodifiable(\n              ((map['items'] as Iterable).whereType<Map>()).map(\n                ItemSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(AssetEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'description': model.description,\n      'name': model.name,\n      'price': model.price,\n      'items': model.items.map((m) => ItemSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class AssetFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    description,\n    name,\n    price,\n    items,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String description = 'description';\n\n  static const String name = 'name';\n\n  static const String price = 'price';\n\n  static const String items = 'items';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/bike.dart",
    "content": "import 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:optional/optional.dart';\n\npart 'bike.g.dart';\n\n@serializable\n@orm\nabstract class EntityBike extends Model {\n  String get make;\n\n  String get description;\n\n  bool get familyFriendly;\n\n  DateTime get recalledAt;\n\n  double get price;\n\n  int get width;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/bike.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'bike.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass BikeMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('bikes', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('make', length: 255);\n      table.varChar('description', length: 255);\n      table.boolean('family_friendly');\n      table.timeStamp('recalled_at');\n      table.double('price');\n      table.integer('width');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('bikes');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass BikeQuery extends Query<Bike, BikeQueryWhere> {\n  BikeQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = BikeQueryWhere(this);\n  }\n\n  @override\n  final BikeQueryValues values = BikeQueryValues();\n\n  List<String> _selectedFields = [];\n\n  BikeQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'bikes';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'make',\n      'description',\n      'family_friendly',\n      'recalled_at',\n      'price',\n      'width',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  BikeQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  BikeQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  BikeQueryWhere newWhereClause() {\n    return BikeQueryWhere(this);\n  }\n\n  Optional<Bike> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Bike(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      make: fields.contains('make') ? (row[3] as String) : '',\n      description: fields.contains('description') ? (row[4] as String) : '',\n      familyFriendly: fields.contains('family_friendly')\n          ? mapToBool(row[5])\n          : false,\n      recalledAt: fields.contains('recalled_at')\n          ? mapToDateTime(row[6])\n          : DateTime.parse(\"1970-01-01 00:00:00\"),\n      price: fields.contains('price') ? mapToDouble(row[7]) : 0.0,\n      width: fields.contains('width') ? mapToInt(row[8]) : 0,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Bike> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass BikeQueryWhere extends QueryWhere {\n  BikeQueryWhere(BikeQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      make = StringSqlExpressionBuilder(query, 'make'),\n      description = StringSqlExpressionBuilder(query, 'description'),\n      familyFriendly = BooleanSqlExpressionBuilder(query, 'family_friendly'),\n      recalledAt = DateTimeSqlExpressionBuilder(query, 'recalled_at'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price'),\n      width = NumericSqlExpressionBuilder<int>(query, 'width');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder make;\n\n  final StringSqlExpressionBuilder description;\n\n  final BooleanSqlExpressionBuilder familyFriendly;\n\n  final DateTimeSqlExpressionBuilder recalledAt;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  final NumericSqlExpressionBuilder<int> width;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n      width,\n    ];\n  }\n}\n\nclass BikeQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String get make {\n    return (values['make'] as String);\n  }\n\n  set make(String value) => values['make'] = value;\n\n  String get description {\n    return (values['description'] as String);\n  }\n\n  set description(String value) => values['description'] = value;\n\n  bool get familyFriendly {\n    return (values['family_friendly'] as bool);\n  }\n\n  set familyFriendly(bool value) => values['family_friendly'] = value;\n\n  DateTime get recalledAt {\n    return (values['recalled_at'] as DateTime);\n  }\n\n  set recalledAt(DateTime value) => values['recalled_at'] = value;\n\n  double get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double value) => values['price'] = value;\n\n  int get width {\n    return (values['width'] as int);\n  }\n\n  set width(int value) => values['width'] = value;\n\n  void copyFrom(Bike model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    make = model.make;\n    description = model.description;\n    familyFriendly = model.familyFriendly;\n    recalledAt = model.recalledAt;\n    price = model.price;\n    width = model.width;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Bike extends EntityBike {\n  Bike({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    required this.make,\n    required this.description,\n    required this.familyFriendly,\n    required this.recalledAt,\n    required this.price,\n    required this.width,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String make;\n\n  @override\n  String description;\n\n  @override\n  bool familyFriendly;\n\n  @override\n  DateTime recalledAt;\n\n  @override\n  double price;\n\n  @override\n  int width;\n\n  Bike copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? make,\n    String? description,\n    bool? familyFriendly,\n    DateTime? recalledAt,\n    double? price,\n    int? width,\n  }) {\n    return Bike(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      make: make ?? this.make,\n      description: description ?? this.description,\n      familyFriendly: familyFriendly ?? this.familyFriendly,\n      recalledAt: recalledAt ?? this.recalledAt,\n      price: price ?? this.price,\n      width: width ?? this.width,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is EntityBike &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.make == make &&\n        other.description == description &&\n        other.familyFriendly == familyFriendly &&\n        other.recalledAt == recalledAt &&\n        other.price == price &&\n        other.width == width;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n      width,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Bike(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, make=$make, description=$description, familyFriendly=$familyFriendly, recalledAt=$recalledAt, price=$price, width=$width)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return BikeSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst BikeSerializer bikeSerializer = BikeSerializer();\n\nclass BikeEncoder extends Converter<Bike, Map> {\n  const BikeEncoder();\n\n  @override\n  Map convert(Bike model) => BikeSerializer.toMap(model);\n}\n\nclass BikeDecoder extends Converter<Map, Bike> {\n  const BikeDecoder();\n\n  @override\n  Bike convert(Map map) => BikeSerializer.fromMap(map);\n}\n\nclass BikeSerializer extends Codec<Bike, Map> {\n  const BikeSerializer();\n\n  @override\n  BikeEncoder get encoder => const BikeEncoder();\n\n  @override\n  BikeDecoder get decoder => const BikeDecoder();\n\n  static Bike fromMap(Map map) {\n    return Bike(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      make: map['make'] as String,\n      description: map['description'] as String,\n      familyFriendly: map['family_friendly'] as bool,\n      recalledAt: map['recalled_at'] != null\n          ? (map['recalled_at'] is DateTime\n                ? (map['recalled_at'] as DateTime)\n                : DateTime.parse(map['recalled_at'].toString()))\n          : DateTime.parse(\"1970-01-01 00:00:00\"),\n      price: map['price'] as double,\n      width: map['width'] as int,\n    );\n  }\n\n  static Map<String, dynamic> toMap(EntityBike? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'make': model.make,\n      'description': model.description,\n      'family_friendly': model.familyFriendly,\n      'recalled_at': model.recalledAt.toIso8601String(),\n      'price': model.price,\n      'width': model.width,\n    };\n  }\n}\n\nabstract class BikeFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    make,\n    description,\n    familyFriendly,\n    recalledAt,\n    price,\n    width,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String make = 'make';\n\n  static const String description = 'description';\n\n  static const String familyFriendly = 'family_friendly';\n\n  static const String recalledAt = 'recalled_at';\n\n  static const String price = 'price';\n\n  static const String width = 'width';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/boat.d.ts",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\ndeclare module 'angel3_orm_mysql' {\n  interface Boat {\n    id?: string;\n    created_at?: any;\n    updated_at?: any;\n    make?: string;\n    description?: string;\n    family_friendly?: boolean;\n    recalled_at?: any;\n    price?: number;\n    width?: number;\n  }\n}"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/boat.dart",
    "content": "import 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:optional/optional.dart';\n\npart 'boat.g.dart';\n\n@Serializable(serializers: Serializers.all)\n@orm\nabstract class BoatEntity extends Model {\n  @Column(defaultValue: '')\n  String get make;\n\n  @Column(defaultValue: 'none')\n  String get description;\n\n  @Column(defaultValue: false)\n  bool get familyFriendly;\n\n  //@SerializableField(defaultValue: '1970-01-01 00:00:01')\n  DateTime get recalledAt;\n\n  @Column(defaultValue: 0.0)\n  double get price;\n\n  @Column(defaultValue: 0)\n  int get width;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/boat.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'boat.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass BoatMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('boats', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('make', length: 255).defaultsTo('');\n      table.varChar('description', length: 255).defaultsTo('none');\n      table.boolean('family_friendly').defaultsTo(false);\n      table.timeStamp('recalled_at');\n      table.double('price').defaultsTo(0.0);\n      table.integer('width').defaultsTo(0);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('boats');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass BoatQuery extends Query<Boat, BoatQueryWhere> {\n  BoatQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = BoatQueryWhere(this);\n  }\n\n  @override\n  final BoatQueryValues values = BoatQueryValues();\n\n  List<String> _selectedFields = [];\n\n  BoatQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'boats';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'make',\n      'description',\n      'family_friendly',\n      'recalled_at',\n      'price',\n      'width',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  BoatQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  BoatQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  BoatQueryWhere newWhereClause() {\n    return BoatQueryWhere(this);\n  }\n\n  Optional<Boat> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Boat(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      make: fields.contains('make') ? (row[3] as String) : '',\n      description: fields.contains('description') ? (row[4] as String) : '',\n      familyFriendly: fields.contains('family_friendly')\n          ? mapToBool(row[5])\n          : false,\n      recalledAt: fields.contains('recalled_at')\n          ? mapToDateTime(row[6])\n          : DateTime.parse(\"1970-01-01 00:00:00\"),\n      price: fields.contains('price') ? mapToDouble(row[7]) : 0.0,\n      width: fields.contains('width') ? mapToInt(row[8]) : 0,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Boat> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass BoatQueryWhere extends QueryWhere {\n  BoatQueryWhere(BoatQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      make = StringSqlExpressionBuilder(query, 'make'),\n      description = StringSqlExpressionBuilder(query, 'description'),\n      familyFriendly = BooleanSqlExpressionBuilder(query, 'family_friendly'),\n      recalledAt = DateTimeSqlExpressionBuilder(query, 'recalled_at'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price'),\n      width = NumericSqlExpressionBuilder<int>(query, 'width');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder make;\n\n  final StringSqlExpressionBuilder description;\n\n  final BooleanSqlExpressionBuilder familyFriendly;\n\n  final DateTimeSqlExpressionBuilder recalledAt;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  final NumericSqlExpressionBuilder<int> width;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n      width,\n    ];\n  }\n}\n\nclass BoatQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String get make {\n    return (values['make'] as String);\n  }\n\n  set make(String value) => values['make'] = value;\n\n  String get description {\n    return (values['description'] as String);\n  }\n\n  set description(String value) => values['description'] = value;\n\n  bool get familyFriendly {\n    return (values['family_friendly'] as bool);\n  }\n\n  set familyFriendly(bool value) => values['family_friendly'] = value;\n\n  DateTime get recalledAt {\n    return (values['recalled_at'] as DateTime);\n  }\n\n  set recalledAt(DateTime value) => values['recalled_at'] = value;\n\n  double get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double value) => values['price'] = value;\n\n  int get width {\n    return (values['width'] as int);\n  }\n\n  set width(int value) => values['width'] = value;\n\n  void copyFrom(Boat model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    make = model.make;\n    description = model.description;\n    familyFriendly = model.familyFriendly;\n    recalledAt = model.recalledAt;\n    price = model.price;\n    width = model.width;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Boat extends BoatEntity {\n  Boat({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    required this.make,\n    required this.description,\n    required this.familyFriendly,\n    required this.recalledAt,\n    required this.price,\n    required this.width,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String make;\n\n  @override\n  String description;\n\n  @override\n  bool familyFriendly;\n\n  @override\n  DateTime recalledAt;\n\n  @override\n  double price;\n\n  @override\n  int width;\n\n  Boat copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? make,\n    String? description,\n    bool? familyFriendly,\n    DateTime? recalledAt,\n    double? price,\n    int? width,\n  }) {\n    return Boat(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      make: make ?? this.make,\n      description: description ?? this.description,\n      familyFriendly: familyFriendly ?? this.familyFriendly,\n      recalledAt: recalledAt ?? this.recalledAt,\n      price: price ?? this.price,\n      width: width ?? this.width,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is BoatEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.make == make &&\n        other.description == description &&\n        other.familyFriendly == familyFriendly &&\n        other.recalledAt == recalledAt &&\n        other.price == price &&\n        other.width == width;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n      width,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Boat(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, make=$make, description=$description, familyFriendly=$familyFriendly, recalledAt=$recalledAt, price=$price, width=$width)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return BoatSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst BoatSerializer boatSerializer = BoatSerializer();\n\nclass BoatEncoder extends Converter<Boat, Map> {\n  const BoatEncoder();\n\n  @override\n  Map convert(Boat model) => BoatSerializer.toMap(model);\n}\n\nclass BoatDecoder extends Converter<Map, Boat> {\n  const BoatDecoder();\n\n  @override\n  Boat convert(Map map) => BoatSerializer.fromMap(map);\n}\n\nclass BoatSerializer extends Codec<Boat, Map> {\n  const BoatSerializer();\n\n  @override\n  BoatEncoder get encoder => const BoatEncoder();\n\n  @override\n  BoatDecoder get decoder => const BoatDecoder();\n\n  static Boat fromMap(Map map) {\n    return Boat(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      make: map['make'] as String,\n      description: map['description'] as String,\n      familyFriendly: map['family_friendly'] as bool,\n      recalledAt: map['recalled_at'] != null\n          ? (map['recalled_at'] is DateTime\n                ? (map['recalled_at'] as DateTime)\n                : DateTime.parse(map['recalled_at'].toString()))\n          : DateTime.parse(\"1970-01-01 00:00:00\"),\n      price: map['price'] as double,\n      width: map['width'] as int,\n    );\n  }\n\n  static Map<String, dynamic> toMap(BoatEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'make': model.make,\n      'description': model.description,\n      'family_friendly': model.familyFriendly,\n      'recalled_at': model.recalledAt.toIso8601String(),\n      'price': model.price,\n      'width': model.width,\n    };\n  }\n}\n\nabstract class BoatFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    make,\n    description,\n    familyFriendly,\n    recalledAt,\n    price,\n    width,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String make = 'make';\n\n  static const String description = 'description';\n\n  static const String familyFriendly = 'family_friendly';\n\n  static const String recalledAt = 'recalled_at';\n\n  static const String price = 'price';\n\n  static const String width = 'width';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/book.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'book.g.dart';\n\n@serializable\n@orm\nabstract class EntityBook extends Model {\n  @BelongsTo(joinType: JoinType.inner)\n  EntityAuthor? get author;\n\n  @BelongsTo(localKey: 'partner_author_id', joinType: JoinType.inner)\n  EntityAuthor? partnerAuthor;\n\n  String? name;\n}\n\n@serializable\n@orm\nabstract class EntityAuthor extends Model {\n  @Column(length: 255, indexType: IndexType.unique)\n  @SerializableField(defaultValue: 'Tobe Osakwe')\n  String? get name;\n\n  @Column(name: \"pub\")\n  String? publisher;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/book.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'book.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass BookMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('books', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('name', length: 255);\n      table.declare('author_id', ColumnType('int')).references('authors', 'id');\n      table\n          .declare('partner_author_id', ColumnType('int'))\n          .references('authors', 'id');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('books');\n  }\n}\n\nclass AuthorMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('authors', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('name', length: 255)\n        ..defaultsTo('Tobe Osakwe')\n        ..unique();\n      table.varChar('publisher', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('authors');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass BookQuery extends Query<Book, BookQueryWhere> {\n  BookQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = BookQueryWhere(this);\n    join(\n      _author = AuthorQuery(trampoline: trampoline, parent: this),\n      'author_id',\n      'id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'name',\n        'publisher',\n      ],\n      trampoline: trampoline,\n    );\n    join(\n      _partnerAuthor = AuthorQuery(trampoline: trampoline, parent: this),\n      'partner_author_id',\n      'id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'name',\n        'publisher',\n      ],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final BookQueryValues values = BookQueryValues();\n\n  List<String> _selectedFields = [];\n\n  BookQueryWhere? _where;\n\n  late AuthorQuery _author;\n\n  late AuthorQuery _partnerAuthor;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'books';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'author_id',\n      'partner_author_id',\n      'name',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  BookQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  BookQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  BookQueryWhere newWhereClause() {\n    return BookQueryWhere(this);\n  }\n\n  Optional<Book> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Book(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[5] as String?) : null,\n    );\n    if (row.length > 6) {\n      var modelOpt = AuthorQuery().parseRow(row.skip(6).take(5).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(author: m);\n      });\n    }\n    if (row.length > 11) {\n      var modelOpt = AuthorQuery().parseRow(row.skip(11).take(5).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(partnerAuthor: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Book> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  AuthorQuery get author {\n    return _author;\n  }\n\n  AuthorQuery get partnerAuthor {\n    return _partnerAuthor;\n  }\n}\n\nclass BookQueryWhere extends QueryWhere {\n  BookQueryWhere(BookQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      authorId = NumericSqlExpressionBuilder<int>(query, 'author_id'),\n      partnerAuthorId = NumericSqlExpressionBuilder<int>(\n        query,\n        'partner_author_id',\n      ),\n      name = StringSqlExpressionBuilder(query, 'name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> authorId;\n\n  final NumericSqlExpressionBuilder<int> partnerAuthorId;\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, authorId, partnerAuthorId, name];\n  }\n}\n\nclass BookQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int get authorId {\n    return (values['author_id'] as int);\n  }\n\n  set authorId(int value) => values['author_id'] = value;\n\n  int get partnerAuthorId {\n    return (values['partner_author_id'] as int);\n  }\n\n  set partnerAuthorId(int value) => values['partner_author_id'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  void copyFrom(Book model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n    if (model.author != null) {\n      values['author_id'] = model.author?.id;\n    }\n    if (model.partnerAuthor != null) {\n      values['partner_author_id'] = model.partnerAuthor?.id;\n    }\n  }\n}\n\nclass AuthorQuery extends Query<Author, AuthorQueryWhere> {\n  AuthorQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = AuthorQueryWhere(this);\n  }\n\n  @override\n  final AuthorQueryValues values = AuthorQueryValues();\n\n  List<String> _selectedFields = [];\n\n  AuthorQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'authors';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'name', 'publisher'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  AuthorQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  AuthorQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  AuthorQueryWhere newWhereClause() {\n    return AuthorQueryWhere(this);\n  }\n\n  Optional<Author> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Author(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[3] as String?) : null,\n      publisher: fields.contains('publisher') ? (row[4] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Author> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass AuthorQueryWhere extends QueryWhere {\n  AuthorQueryWhere(AuthorQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      publisher = StringSqlExpressionBuilder(query, 'publisher');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder name;\n\n  final StringSqlExpressionBuilder publisher;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, name, publisher];\n  }\n}\n\nclass AuthorQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  String? get publisher {\n    return (values['publisher'] as String?);\n  }\n\n  set publisher(String? value) => values['publisher'] = value;\n\n  void copyFrom(Author model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n    publisher = model.publisher;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Book extends EntityBook {\n  Book({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.author,\n    this.partnerAuthor,\n    this.name,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  EntityAuthor? author;\n\n  @override\n  EntityAuthor? partnerAuthor;\n\n  @override\n  String? name;\n\n  Book copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    EntityAuthor? author,\n    EntityAuthor? partnerAuthor,\n    String? name,\n  }) {\n    return Book(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      author: author ?? this.author,\n      partnerAuthor: partnerAuthor ?? this.partnerAuthor,\n      name: name ?? this.name,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is EntityBook &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.author == author &&\n        other.partnerAuthor == partnerAuthor &&\n        other.name == name;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, author, partnerAuthor, name]);\n  }\n\n  @override\n  String toString() {\n    return 'Book(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, author=$author, partnerAuthor=$partnerAuthor, name=$name)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return BookSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Author extends EntityAuthor {\n  Author({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.name = 'Tobe Osakwe',\n    this.publisher,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? name;\n\n  @override\n  String? publisher;\n\n  Author copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? name,\n    String? publisher,\n  }) {\n    return Author(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      name: name ?? this.name,\n      publisher: publisher ?? this.publisher,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is EntityAuthor &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.name == name &&\n        other.publisher == publisher;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, name, publisher]);\n  }\n\n  @override\n  String toString() {\n    return 'Author(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, name=$name, publisher=$publisher)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return AuthorSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst BookSerializer bookSerializer = BookSerializer();\n\nclass BookEncoder extends Converter<Book, Map> {\n  const BookEncoder();\n\n  @override\n  Map convert(Book model) => BookSerializer.toMap(model);\n}\n\nclass BookDecoder extends Converter<Map, Book> {\n  const BookDecoder();\n\n  @override\n  Book convert(Map map) => BookSerializer.fromMap(map);\n}\n\nclass BookSerializer extends Codec<Book, Map> {\n  const BookSerializer();\n\n  @override\n  BookEncoder get encoder => const BookEncoder();\n\n  @override\n  BookDecoder get decoder => const BookDecoder();\n\n  static Book fromMap(Map map) {\n    return Book(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      author: map['author'] != null\n          ? AuthorSerializer.fromMap(map['author'] as Map)\n          : null,\n      partnerAuthor: map['partner_author'] != null\n          ? AuthorSerializer.fromMap(map['partner_author'] as Map)\n          : null,\n      name: map['name'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(EntityBook? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'author': AuthorSerializer.toMap(model.author),\n      'partner_author': AuthorSerializer.toMap(model.partnerAuthor),\n      'name': model.name,\n    };\n  }\n}\n\nabstract class BookFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    author,\n    partnerAuthor,\n    name,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String author = 'author';\n\n  static const String partnerAuthor = 'partner_author';\n\n  static const String name = 'name';\n}\n\nconst AuthorSerializer authorSerializer = AuthorSerializer();\n\nclass AuthorEncoder extends Converter<Author, Map> {\n  const AuthorEncoder();\n\n  @override\n  Map convert(Author model) => AuthorSerializer.toMap(model);\n}\n\nclass AuthorDecoder extends Converter<Map, Author> {\n  const AuthorDecoder();\n\n  @override\n  Author convert(Map map) => AuthorSerializer.fromMap(map);\n}\n\nclass AuthorSerializer extends Codec<Author, Map> {\n  const AuthorSerializer();\n\n  @override\n  AuthorEncoder get encoder => const AuthorEncoder();\n\n  @override\n  AuthorDecoder get decoder => const AuthorDecoder();\n\n  static Author fromMap(Map map) {\n    return Author(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      name: map['name'] as String? ?? 'Tobe Osakwe',\n      publisher: map['publisher'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(EntityAuthor? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'name': model.name,\n      'publisher': model.publisher,\n    };\n  }\n}\n\nabstract class AuthorFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    name,\n    publisher,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String name = 'name';\n\n  static const String publisher = 'publisher';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/car.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\npart 'car.g.dart';\n\n@serializable\n@orm\nclass CarEntity extends Model {\n  String? make;\n  String? description;\n  bool? familyFriendly;\n  DateTime? recalledAt;\n  double? price;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/car.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'car.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass CarMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('cars', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('make', length: 255);\n      table.varChar('description', length: 255);\n      table.boolean('family_friendly');\n      table.timeStamp('recalled_at');\n      table.double('price');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('cars');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass CarQuery extends Query<Car, CarQueryWhere> {\n  CarQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = CarQueryWhere(this);\n  }\n\n  @override\n  final CarQueryValues values = CarQueryValues();\n\n  List<String> _selectedFields = [];\n\n  CarQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'cars';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'make',\n      'description',\n      'family_friendly',\n      'recalled_at',\n      'price',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  CarQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  CarQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  CarQueryWhere newWhereClause() {\n    return CarQueryWhere(this);\n  }\n\n  Optional<Car> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Car(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      make: fields.contains('make') ? (row[3] as String?) : null,\n      description: fields.contains('description') ? (row[4] as String?) : null,\n      familyFriendly: fields.contains('family_friendly')\n          ? mapToBool(row[5])\n          : null,\n      recalledAt: fields.contains('recalled_at')\n          ? mapToNullableDateTime(row[6])\n          : null,\n      price: fields.contains('price') ? mapToDouble(row[7]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Car> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass CarQueryWhere extends QueryWhere {\n  CarQueryWhere(CarQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      make = StringSqlExpressionBuilder(query, 'make'),\n      description = StringSqlExpressionBuilder(query, 'description'),\n      familyFriendly = BooleanSqlExpressionBuilder(query, 'family_friendly'),\n      recalledAt = DateTimeSqlExpressionBuilder(query, 'recalled_at'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder make;\n\n  final StringSqlExpressionBuilder description;\n\n  final BooleanSqlExpressionBuilder familyFriendly;\n\n  final DateTimeSqlExpressionBuilder recalledAt;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n    ];\n  }\n}\n\nclass CarQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get make {\n    return (values['make'] as String?);\n  }\n\n  set make(String? value) => values['make'] = value;\n\n  String? get description {\n    return (values['description'] as String?);\n  }\n\n  set description(String? value) => values['description'] = value;\n\n  bool? get familyFriendly {\n    return (values['family_friendly'] as bool?);\n  }\n\n  set familyFriendly(bool? value) => values['family_friendly'] = value;\n\n  DateTime? get recalledAt {\n    return (values['recalled_at'] as DateTime?);\n  }\n\n  set recalledAt(DateTime? value) => values['recalled_at'] = value;\n\n  double? get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double? value) => values['price'] = value;\n\n  void copyFrom(Car model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    make = model.make;\n    description = model.description;\n    familyFriendly = model.familyFriendly;\n    recalledAt = model.recalledAt;\n    price = model.price;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Car extends CarEntity {\n  Car({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.make,\n    this.description,\n    this.familyFriendly,\n    this.recalledAt,\n    this.price,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? make;\n\n  @override\n  String? description;\n\n  @override\n  bool? familyFriendly;\n\n  @override\n  DateTime? recalledAt;\n\n  @override\n  double? price;\n\n  Car copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? make,\n    String? description,\n    bool? familyFriendly,\n    DateTime? recalledAt,\n    double? price,\n  }) {\n    return Car(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      make: make ?? this.make,\n      description: description ?? this.description,\n      familyFriendly: familyFriendly ?? this.familyFriendly,\n      recalledAt: recalledAt ?? this.recalledAt,\n      price: price ?? this.price,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is CarEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.make == make &&\n        other.description == description &&\n        other.familyFriendly == familyFriendly &&\n        other.recalledAt == recalledAt &&\n        other.price == price;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      make,\n      description,\n      familyFriendly,\n      recalledAt,\n      price,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Car(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, make=$make, description=$description, familyFriendly=$familyFriendly, recalledAt=$recalledAt, price=$price)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return CarSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst CarSerializer carSerializer = CarSerializer();\n\nclass CarEncoder extends Converter<Car, Map> {\n  const CarEncoder();\n\n  @override\n  Map convert(Car model) => CarSerializer.toMap(model);\n}\n\nclass CarDecoder extends Converter<Map, Car> {\n  const CarDecoder();\n\n  @override\n  Car convert(Map map) => CarSerializer.fromMap(map);\n}\n\nclass CarSerializer extends Codec<Car, Map> {\n  const CarSerializer();\n\n  @override\n  CarEncoder get encoder => const CarEncoder();\n\n  @override\n  CarDecoder get decoder => const CarDecoder();\n\n  static Car fromMap(Map map) {\n    return Car(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      make: map['make'] as String?,\n      description: map['description'] as String?,\n      familyFriendly: map['family_friendly'] as bool?,\n      recalledAt: map['recalled_at'] != null\n          ? (map['recalled_at'] is DateTime\n                ? (map['recalled_at'] as DateTime)\n                : DateTime.parse(map['recalled_at'].toString()))\n          : null,\n      price: map['price'] as double?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(CarEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'make': model.make,\n      'description': model.description,\n      'family_friendly': model.familyFriendly,\n      'recalled_at': model.recalledAt?.toIso8601String(),\n      'price': model.price,\n    };\n  }\n}\n\nabstract class CarFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    make,\n    description,\n    familyFriendly,\n    recalledAt,\n    price,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String make = 'make';\n\n  static const String description = 'description';\n\n  static const String familyFriendly = 'family_friendly';\n\n  static const String recalledAt = 'recalled_at';\n\n  static const String price = 'price';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/custom_expr.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'custom_expr.g.dart';\n\n@serializable\n@orm\nclass NumberEntity extends Model {\n  @Column(expression: 'SELECT 2')\n  int? two;\n}\n\n@serializable\n@orm\nclass AlphabetEntity extends Model {\n  String? value;\n\n  @belongsTo\n  NumberEntity? numbers;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/custom_expr.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'custom_expr.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass NumberMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('numbers', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('numbers');\n  }\n}\n\nclass AlphabetMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('alphabets', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('value', length: 255);\n      table\n          .declare('numbers_id', ColumnType('int'))\n          .references('numbers', 'id');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('alphabets');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass NumberQuery extends Query<Number, NumberQueryWhere> {\n  NumberQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    expressions['two'] = 'SELECT 2';\n    _where = NumberQueryWhere(this);\n  }\n\n  @override\n  final NumberQueryValues values = NumberQueryValues();\n\n  List<String> _selectedFields = [];\n\n  NumberQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'numbers';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'two'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  NumberQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  NumberQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  NumberQueryWhere newWhereClause() {\n    return NumberQueryWhere(this);\n  }\n\n  Optional<Number> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Number(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      two: fields.contains('two') ? mapToInt(row[3]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Number> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass NumberQueryWhere extends QueryWhere {\n  NumberQueryWhere(NumberQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt];\n  }\n}\n\nclass NumberQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  void copyFrom(Number model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n  }\n}\n\nclass AlphabetQuery extends Query<Alphabet, AlphabetQueryWhere> {\n  AlphabetQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = AlphabetQueryWhere(this);\n    leftJoin(\n      _numbers = NumberQuery(trampoline: trampoline, parent: this),\n      'numbers_id',\n      'id',\n      additionalFields: const ['id', 'created_at', 'updated_at', 'two'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final AlphabetQueryValues values = AlphabetQueryValues();\n\n  List<String> _selectedFields = [];\n\n  AlphabetQueryWhere? _where;\n\n  late NumberQuery _numbers;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'alphabets';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'value',\n      'numbers_id',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  AlphabetQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  AlphabetQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  AlphabetQueryWhere newWhereClause() {\n    return AlphabetQueryWhere(this);\n  }\n\n  Optional<Alphabet> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Alphabet(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      value: fields.contains('value') ? (row[3] as String?) : null,\n    );\n    if (row.length > 5) {\n      var modelOpt = NumberQuery().parseRow(row.skip(5).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(numbers: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Alphabet> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  NumberQuery get numbers {\n    return _numbers;\n  }\n}\n\nclass AlphabetQueryWhere extends QueryWhere {\n  AlphabetQueryWhere(AlphabetQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      value = StringSqlExpressionBuilder(query, 'value'),\n      numbersId = NumericSqlExpressionBuilder<int>(query, 'numbers_id');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder value;\n\n  final NumericSqlExpressionBuilder<int> numbersId;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, value, numbersId];\n  }\n}\n\nclass AlphabetQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get value {\n    return (values['value'] as String?);\n  }\n\n  set value(String? value) => values['value'] = value;\n\n  int get numbersId {\n    return (values['numbers_id'] as int);\n  }\n\n  set numbersId(int value) => values['numbers_id'] = value;\n\n  void copyFrom(Alphabet model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    value = model.value;\n    if (model.numbers != null) {\n      values['numbers_id'] = model.numbers?.id;\n    }\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Number extends NumberEntity {\n  Number({this.id, this.createdAt, this.updatedAt, this.two});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? two;\n\n  Number copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? two,\n  }) {\n    return Number(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      two: two ?? this.two,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is NumberEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.two == two;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, two]);\n  }\n\n  @override\n  String toString() {\n    return 'Number(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, two=$two)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return NumberSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Alphabet extends AlphabetEntity {\n  Alphabet({this.id, this.createdAt, this.updatedAt, this.value, this.numbers});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? value;\n\n  @override\n  NumberEntity? numbers;\n\n  Alphabet copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? value,\n    NumberEntity? numbers,\n  }) {\n    return Alphabet(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      value: value ?? this.value,\n      numbers: numbers ?? this.numbers,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is AlphabetEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.value == value &&\n        other.numbers == numbers;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, value, numbers]);\n  }\n\n  @override\n  String toString() {\n    return 'Alphabet(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, value=$value, numbers=$numbers)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return AlphabetSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst NumberSerializer numberSerializer = NumberSerializer();\n\nclass NumberEncoder extends Converter<Number, Map> {\n  const NumberEncoder();\n\n  @override\n  Map convert(Number model) => NumberSerializer.toMap(model);\n}\n\nclass NumberDecoder extends Converter<Map, Number> {\n  const NumberDecoder();\n\n  @override\n  Number convert(Map map) => NumberSerializer.fromMap(map);\n}\n\nclass NumberSerializer extends Codec<Number, Map> {\n  const NumberSerializer();\n\n  @override\n  NumberEncoder get encoder => const NumberEncoder();\n\n  @override\n  NumberDecoder get decoder => const NumberDecoder();\n\n  static Number fromMap(Map map) {\n    return Number(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      two: map['two'] as int?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(NumberEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'two': model.two,\n    };\n  }\n}\n\nabstract class NumberFields {\n  static const List<String> allFields = <String>[id, createdAt, updatedAt, two];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String two = 'two';\n}\n\nconst AlphabetSerializer alphabetSerializer = AlphabetSerializer();\n\nclass AlphabetEncoder extends Converter<Alphabet, Map> {\n  const AlphabetEncoder();\n\n  @override\n  Map convert(Alphabet model) => AlphabetSerializer.toMap(model);\n}\n\nclass AlphabetDecoder extends Converter<Map, Alphabet> {\n  const AlphabetDecoder();\n\n  @override\n  Alphabet convert(Map map) => AlphabetSerializer.fromMap(map);\n}\n\nclass AlphabetSerializer extends Codec<Alphabet, Map> {\n  const AlphabetSerializer();\n\n  @override\n  AlphabetEncoder get encoder => const AlphabetEncoder();\n\n  @override\n  AlphabetDecoder get decoder => const AlphabetDecoder();\n\n  static Alphabet fromMap(Map map) {\n    return Alphabet(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      value: map['value'] as String?,\n      numbers: map['numbers'] != null\n          ? NumberSerializer.fromMap(map['numbers'] as Map)\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(AlphabetEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'value': model.value,\n      'numbers': NumberSerializer.toMap(model.numbers),\n    };\n  }\n}\n\nabstract class AlphabetFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    value,\n    numbers,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String value = 'value';\n\n  static const String numbers = 'numbers';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/email_indexed.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'email_indexed.g.dart';\n\n// * https://github.com/angel-dart/angel/issues/116\n\n@serializable\n@orm\nabstract class RoleEntity {\n  @PrimaryKey(columnType: ColumnType.varChar)\n  String? get role;\n\n  @ManyToMany(RoleUserEntity)\n  List<UserEntity> get users;\n}\n\n@serializable\n@orm\nabstract class RoleUserEntity {\n  @belongsTo\n  RoleEntity? get role;\n\n  @belongsTo\n  UserEntity? get user;\n}\n\n@serializable\n@orm\nabstract class UserEntity {\n  // @PrimaryKey(columnType: ColumnType.varChar)\n  @primaryKey\n  String? get email;\n  String? get name;\n  String? get password;\n\n  @ManyToMany(RoleUserEntity)\n  List<RoleEntity> get roles;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/email_indexed.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'email_indexed.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass RoleMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('roles', (table) {\n      table.varChar('role', length: 255).primaryKey();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('roles', cascade: true);\n  }\n}\n\nclass RoleUserMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('role_users', (table) {\n      table\n          .declare('role_role', ColumnType('varchar'))\n          .references('roles', 'role');\n      table\n          .declare('user_email', ColumnType('varchar'))\n          .references('users', 'email');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('role_users');\n  }\n}\n\nclass UserMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('users', (table) {\n      table.varChar('email', length: 255).primaryKey();\n      table.varChar('name', length: 255);\n      table.varChar('password', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('users', cascade: true);\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass RoleQuery extends Query<Role, RoleQueryWhere> {\n  RoleQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = RoleQueryWhere(this);\n    leftJoin(\n      '(SELECT role_users.role_role, users.email, users.name, users.password FROM users LEFT JOIN role_users ON role_users.user_email=users.email)',\n      'role',\n      'role_role',\n      additionalFields: const ['email', 'name', 'password'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final RoleQueryValues values = RoleQueryValues();\n\n  List<String> _selectedFields = [];\n\n  RoleQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'roles';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['role'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  RoleQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  RoleQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  RoleQueryWhere newWhereClause() {\n    return RoleQueryWhere(this);\n  }\n\n  Optional<Role> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Role(\n      role: fields.contains('role') ? (row[0] as String?) : null,\n    );\n    if (row.length > 1) {\n      var modelOpt = UserQuery().parseRow(row.skip(1).take(3).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(users: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Role> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('roles') &&\n        trampoline.contains('role_users')));\n  }\n\n  @override\n  Future<List<Role>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.role == model.role);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Role>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.role == model.role);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Role>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.role == model.role);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass RoleQueryWhere extends QueryWhere {\n  RoleQueryWhere(RoleQuery query)\n    : role = StringSqlExpressionBuilder(query, 'role');\n\n  final StringSqlExpressionBuilder role;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [role];\n  }\n}\n\nclass RoleQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get role {\n    return (values['role'] as String?);\n  }\n\n  set role(String? value) => values['role'] = value;\n\n  void copyFrom(Role model) {\n    role = model.role;\n  }\n}\n\nclass RoleUserQuery extends Query<RoleUser, RoleUserQueryWhere> {\n  RoleUserQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = RoleUserQueryWhere(this);\n    leftJoin(\n      _role = RoleQuery(trampoline: trampoline, parent: this),\n      'role_role',\n      'role',\n      additionalFields: const ['role'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _user = UserQuery(trampoline: trampoline, parent: this),\n      'user_email',\n      'email',\n      additionalFields: const ['email', 'name', 'password'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final RoleUserQueryValues values = RoleUserQueryValues();\n\n  List<String> _selectedFields = [];\n\n  RoleUserQueryWhere? _where;\n\n  late RoleQuery _role;\n\n  late UserQuery _user;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'role_users';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['role_role', 'user_email'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  RoleUserQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  RoleUserQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  RoleUserQueryWhere newWhereClause() {\n    return RoleUserQueryWhere(this);\n  }\n\n  Optional<RoleUser> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = RoleUser();\n    if (row.length > 2) {\n      var modelOpt = RoleQuery().parseRow(row.skip(2).take(1).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(role: m);\n      });\n    }\n    if (row.length > 3) {\n      var modelOpt = UserQuery().parseRow(row.skip(3).take(3).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(user: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<RoleUser> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  RoleQuery get role {\n    return _role;\n  }\n\n  UserQuery get user {\n    return _user;\n  }\n}\n\nclass RoleUserQueryWhere extends QueryWhere {\n  RoleUserQueryWhere(RoleUserQuery query)\n    : roleRole = StringSqlExpressionBuilder(query, 'role_role'),\n      userEmail = StringSqlExpressionBuilder(query, 'user_email');\n\n  final StringSqlExpressionBuilder roleRole;\n\n  final StringSqlExpressionBuilder userEmail;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [roleRole, userEmail];\n  }\n}\n\nclass RoleUserQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get roleRole {\n    return (values['role_role'] as String?);\n  }\n\n  set roleRole(String? value) => values['role_role'] = value;\n\n  String? get userEmail {\n    return (values['user_email'] as String?);\n  }\n\n  set userEmail(String? value) => values['user_email'] = value;\n\n  void copyFrom(RoleUser model) {\n    if (model.role != null) {\n      values['role_role'] = model.role?.role;\n    }\n    if (model.user != null) {\n      values['user_email'] = model.user?.email;\n    }\n  }\n}\n\nclass UserQuery extends Query<User, UserQueryWhere> {\n  UserQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UserQueryWhere(this);\n    leftJoin(\n      '(SELECT role_users.user_email, roles.role FROM roles LEFT JOIN role_users ON role_users.role_role=roles.role)',\n      'email',\n      'user_email',\n      additionalFields: const ['role'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final UserQueryValues values = UserQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UserQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'users';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['email', 'name', 'password'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UserQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UserQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UserQueryWhere newWhereClause() {\n    return UserQueryWhere(this);\n  }\n\n  Optional<User> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = User(\n      email: fields.contains('email') ? (row[0] as String?) : null,\n      name: fields.contains('name') ? (row[1] as String?) : null,\n      password: fields.contains('password') ? (row[2] as String?) : null,\n    );\n    if (row.length > 3) {\n      var modelOpt = RoleQuery().parseRow(row.skip(3).take(1).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(roles: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<User> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('users') &&\n        trampoline.contains('role_users')));\n  }\n\n  @override\n  Future<List<User>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.email == model.email);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.email == model.email);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.email == model.email);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass UserQueryWhere extends QueryWhere {\n  UserQueryWhere(UserQuery query)\n    : email = StringSqlExpressionBuilder(query, 'email'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      password = StringSqlExpressionBuilder(query, 'password');\n\n  final StringSqlExpressionBuilder email;\n\n  final StringSqlExpressionBuilder name;\n\n  final StringSqlExpressionBuilder password;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [email, name, password];\n  }\n}\n\nclass UserQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get email {\n    return (values['email'] as String?);\n  }\n\n  set email(String? value) => values['email'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  String? get password {\n    return (values['password'] as String?);\n  }\n\n  set password(String? value) => values['password'] = value;\n\n  void copyFrom(User model) {\n    email = model.email;\n    name = model.name;\n    password = model.password;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Role implements RoleEntity {\n  Role({this.role, this.users = const []});\n\n  @override\n  String? role;\n\n  @override\n  List<UserEntity> users;\n\n  Role copyWith({String? role, List<UserEntity>? users}) {\n    return Role(role: role ?? this.role, users: users ?? this.users);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is RoleEntity &&\n        other.role == role &&\n        ListEquality<UserEntity>(\n          DefaultEquality<UserEntity>(),\n        ).equals(other.users, users);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([role, users]);\n  }\n\n  @override\n  String toString() {\n    return 'Role(role=$role, users=$users)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return RoleSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass RoleUser implements RoleUserEntity {\n  RoleUser({this.role, this.user});\n\n  @override\n  RoleEntity? role;\n\n  @override\n  UserEntity? user;\n\n  RoleUser copyWith({RoleEntity? role, UserEntity? user}) {\n    return RoleUser(role: role ?? this.role, user: user ?? this.user);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is RoleUserEntity && other.role == role && other.user == user;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([role, user]);\n  }\n\n  @override\n  String toString() {\n    return 'RoleUser(role=$role, user=$user)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return RoleUserSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass User implements UserEntity {\n  User({this.email, this.name, this.password, this.roles = const []});\n\n  @override\n  String? email;\n\n  @override\n  String? name;\n\n  @override\n  String? password;\n\n  @override\n  List<RoleEntity> roles;\n\n  User copyWith({\n    String? email,\n    String? name,\n    String? password,\n    List<RoleEntity>? roles,\n  }) {\n    return User(\n      email: email ?? this.email,\n      name: name ?? this.name,\n      password: password ?? this.password,\n      roles: roles ?? this.roles,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UserEntity &&\n        other.email == email &&\n        other.name == name &&\n        other.password == password &&\n        ListEquality<RoleEntity>(\n          DefaultEquality<RoleEntity>(),\n        ).equals(other.roles, roles);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([email, name, password, roles]);\n  }\n\n  @override\n  String toString() {\n    return 'User(email=$email, name=$name, password=$password, roles=$roles)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UserSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst RoleSerializer roleSerializer = RoleSerializer();\n\nclass RoleEncoder extends Converter<Role, Map> {\n  const RoleEncoder();\n\n  @override\n  Map convert(Role model) => RoleSerializer.toMap(model);\n}\n\nclass RoleDecoder extends Converter<Map, Role> {\n  const RoleDecoder();\n\n  @override\n  Role convert(Map map) => RoleSerializer.fromMap(map);\n}\n\nclass RoleSerializer extends Codec<Role, Map> {\n  const RoleSerializer();\n\n  @override\n  RoleEncoder get encoder => const RoleEncoder();\n\n  @override\n  RoleDecoder get decoder => const RoleDecoder();\n\n  static Role fromMap(Map map) {\n    return Role(\n      role: map['role'] as String?,\n      users: map['users'] is Iterable\n          ? List.unmodifiable(\n              ((map['users'] as Iterable).whereType<Map>()).map(\n                UserSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(RoleEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'role': model.role,\n      'users': model.users.map((m) => UserSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class RoleFields {\n  static const List<String> allFields = <String>[role, users];\n\n  static const String role = 'role';\n\n  static const String users = 'users';\n}\n\nconst RoleUserSerializer roleUserSerializer = RoleUserSerializer();\n\nclass RoleUserEncoder extends Converter<RoleUser, Map> {\n  const RoleUserEncoder();\n\n  @override\n  Map convert(RoleUser model) => RoleUserSerializer.toMap(model);\n}\n\nclass RoleUserDecoder extends Converter<Map, RoleUser> {\n  const RoleUserDecoder();\n\n  @override\n  RoleUser convert(Map map) => RoleUserSerializer.fromMap(map);\n}\n\nclass RoleUserSerializer extends Codec<RoleUser, Map> {\n  const RoleUserSerializer();\n\n  @override\n  RoleUserEncoder get encoder => const RoleUserEncoder();\n\n  @override\n  RoleUserDecoder get decoder => const RoleUserDecoder();\n\n  static RoleUser fromMap(Map map) {\n    return RoleUser(\n      role: map['role'] != null\n          ? RoleSerializer.fromMap(map['role'] as Map)\n          : null,\n      user: map['user'] != null\n          ? UserSerializer.fromMap(map['user'] as Map)\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(RoleUserEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'role': RoleSerializer.toMap(model.role),\n      'user': UserSerializer.toMap(model.user),\n    };\n  }\n}\n\nabstract class RoleUserFields {\n  static const List<String> allFields = <String>[role, user];\n\n  static const String role = 'role';\n\n  static const String user = 'user';\n}\n\nconst UserSerializer userSerializer = UserSerializer();\n\nclass UserEncoder extends Converter<User, Map> {\n  const UserEncoder();\n\n  @override\n  Map convert(User model) => UserSerializer.toMap(model);\n}\n\nclass UserDecoder extends Converter<Map, User> {\n  const UserDecoder();\n\n  @override\n  User convert(Map map) => UserSerializer.fromMap(map);\n}\n\nclass UserSerializer extends Codec<User, Map> {\n  const UserSerializer();\n\n  @override\n  UserEncoder get encoder => const UserEncoder();\n\n  @override\n  UserDecoder get decoder => const UserDecoder();\n\n  static User fromMap(Map map) {\n    return User(\n      email: map['email'] as String?,\n      name: map['name'] as String?,\n      password: map['password'] as String?,\n      roles: map['roles'] is Iterable\n          ? List.unmodifiable(\n              ((map['roles'] as Iterable).whereType<Map>()).map(\n                RoleSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(UserEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'email': model.email,\n      'name': model.name,\n      'password': model.password,\n      'roles': model.roles.map((m) => RoleSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class UserFields {\n  static const List<String> allFields = <String>[email, name, password, roles];\n\n  static const String email = 'email';\n\n  static const String name = 'name';\n\n  static const String password = 'password';\n\n  static const String roles = 'roles';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/fortune.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:optional/optional.dart';\n\npart 'fortune.g.dart';\n\n@serializable\n@Orm(tableName: 'fortune')\nabstract class FortuneEntity {\n  @primaryKey\n  int? id;\n\n  @Column(length: 2048)\n  String? message;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/fortune.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'fortune.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass FortuneMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('fortune', (table) {\n      table.integer('id').primaryKey();\n      table.varChar('message', length: 2048);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('fortune');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass FortuneQuery extends Query<Fortune, FortuneQueryWhere> {\n  FortuneQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = FortuneQueryWhere(this);\n  }\n\n  @override\n  final FortuneQueryValues values = FortuneQueryValues();\n\n  List<String> _selectedFields = [];\n\n  FortuneQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'fortune';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'message'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  FortuneQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  FortuneQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  FortuneQueryWhere newWhereClause() {\n    return FortuneQueryWhere(this);\n  }\n\n  Optional<Fortune> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Fortune(\n      id: fields.contains('id') ? mapToInt(row[0]) : null,\n      message: fields.contains('message') ? (row[1] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Fortune> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass FortuneQueryWhere extends QueryWhere {\n  FortuneQueryWhere(FortuneQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      message = StringSqlExpressionBuilder(query, 'message');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder message;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, message];\n  }\n}\n\nclass FortuneQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int? get id {\n    return (values['id'] as int?);\n  }\n\n  set id(int? value) => values['id'] = value;\n\n  String? get message {\n    return (values['message'] as String?);\n  }\n\n  set message(String? value) => values['message'] = value;\n\n  void copyFrom(Fortune model) {\n    id = model.id;\n    message = model.message;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Fortune extends FortuneEntity {\n  Fortune({this.id, this.message});\n\n  @override\n  int? id;\n\n  @override\n  String? message;\n\n  Fortune copyWith({int? id, String? message}) {\n    return Fortune(id: id ?? this.id, message: message ?? this.message);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is FortuneEntity && other.id == id && other.message == message;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, message]);\n  }\n\n  @override\n  String toString() {\n    return 'Fortune(id=$id, message=$message)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return FortuneSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst FortuneSerializer fortuneSerializer = FortuneSerializer();\n\nclass FortuneEncoder extends Converter<Fortune, Map> {\n  const FortuneEncoder();\n\n  @override\n  Map convert(Fortune model) => FortuneSerializer.toMap(model);\n}\n\nclass FortuneDecoder extends Converter<Map, Fortune> {\n  const FortuneDecoder();\n\n  @override\n  Fortune convert(Map map) => FortuneSerializer.fromMap(map);\n}\n\nclass FortuneSerializer extends Codec<Fortune, Map> {\n  const FortuneSerializer();\n\n  @override\n  FortuneEncoder get encoder => const FortuneEncoder();\n\n  @override\n  FortuneDecoder get decoder => const FortuneDecoder();\n\n  static Fortune fromMap(Map map) {\n    return Fortune(id: map['id'] as int?, message: map['message'] as String?);\n  }\n\n  static Map<String, dynamic> toMap(FortuneEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'id': model.id, 'message': model.message};\n  }\n}\n\nabstract class FortuneFields {\n  static const List<String> allFields = <String>[id, message];\n\n  static const String id = 'id';\n\n  static const String message = 'message';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/has_car.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'has_car.g.dart';\n\n// Map _carToMap(Car car) => car.toJson();\n\n// Car _carFromMap(map) => CarSerializer.fromMap(map as Map);\n\nenum CarType { sedan, suv, atv }\n\nColor? codeToColor(String? code) => code == null\n    ? null\n    : Color.values.firstWhere((color) => color.code == code);\n\nString? colorToCode(Color? color) => color?.code;\n\nenum Color {\n  red('R'),\n  green('G'),\n  blue('B');\n\n  const Color(this.code);\n\n  final String code;\n}\n\n@orm\n@serializable\nabstract class HasCarEntity extends Model {\n  // TODO: Do this without explicit serializers\n  // @SerializableField(\n  //     serializesTo: Map, serializer: #_carToMap, deserializer: #_carFromMap)\n  // Car get car;\n\n  @SerializableField(isNullable: false, defaultValue: CarType.sedan)\n  CarType? get type;\n\n  @SerializableField(\n    serializesTo: String,\n    serializer: #colorToCode,\n    deserializer: #codeToColor,\n  )\n  @Column(type: ColumnType.varChar, length: 1)\n  Color? color;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/has_car.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'has_car.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass HasCarMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('has_cars', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('type').defaultsTo(0);\n      table.declareColumn(\n        'color',\n        Column(type: ColumnType('varchar'), length: 1),\n      );\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('has_cars');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass HasCarQuery extends Query<HasCar, HasCarQueryWhere> {\n  HasCarQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = HasCarQueryWhere(this);\n  }\n\n  @override\n  final HasCarQueryValues values = HasCarQueryValues();\n\n  List<String> _selectedFields = [];\n\n  HasCarQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'has_cars';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'type', 'color'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  HasCarQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  HasCarQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  HasCarQueryWhere newWhereClause() {\n    return HasCarQueryWhere(this);\n  }\n\n  Optional<HasCar> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = HasCar(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      type: fields.contains('type')\n          ? row[3] == null\n                ? null\n                : CarType.values[mapToInt(row[3])]\n          : null,\n      color: fields.contains('color')\n          ? row[4] == null\n                ? null\n                : codeToColor((row[4] as String))\n          : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<HasCar> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass HasCarQueryWhere extends QueryWhere {\n  HasCarQueryWhere(HasCarQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      type = EnumSqlExpressionBuilder<CarType?>(\n        query,\n        'type',\n        (v) => v?.index as int,\n      ),\n      color = StringSqlExpressionBuilder(query, 'color');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final EnumSqlExpressionBuilder<CarType?> type;\n\n  final StringSqlExpressionBuilder color;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, type, color];\n  }\n}\n\nclass HasCarQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  CarType? get type {\n    return CarType.values[mapToInt(values['type'])];\n  }\n\n  set type(CarType? value) => values['type'] = value?.index;\n\n  Color? get color {\n    return codeToColor((values['color'] as String));\n  }\n\n  set color(Color? value) => values['color'] = colorToCode(value);\n\n  void copyFrom(HasCar model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    type = model.type;\n    color = model.color;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass HasCar extends HasCarEntity {\n  HasCar({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.type = CarType.sedan,\n    this.color,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  CarType? type;\n\n  @override\n  Color? color;\n\n  HasCar copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    CarType? type,\n    Color? color,\n  }) {\n    return HasCar(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      type: type ?? this.type,\n      color: color ?? this.color,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is HasCarEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.type == type &&\n        other.color == color;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, type, color]);\n  }\n\n  @override\n  String toString() {\n    return 'HasCar(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, type=$type, color=$color)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return HasCarSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst HasCarSerializer hasCarSerializer = HasCarSerializer();\n\nclass HasCarEncoder extends Converter<HasCar, Map> {\n  const HasCarEncoder();\n\n  @override\n  Map convert(HasCar model) => HasCarSerializer.toMap(model);\n}\n\nclass HasCarDecoder extends Converter<Map, HasCar> {\n  const HasCarDecoder();\n\n  @override\n  HasCar convert(Map map) => HasCarSerializer.fromMap(map);\n}\n\nclass HasCarSerializer extends Codec<HasCar, Map> {\n  const HasCarSerializer();\n\n  @override\n  HasCarEncoder get encoder => const HasCarEncoder();\n\n  @override\n  HasCarDecoder get decoder => const HasCarDecoder();\n\n  static HasCar fromMap(Map map) {\n    if (map['type'] == null) {\n      throw FormatException(\"Missing required field 'type' on HasCar.\");\n    }\n\n    return HasCar(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      type: map['type'] as CarType? ?? CarType.sedan,\n      color: codeToColor(map['color']),\n    );\n  }\n\n  static Map<String, dynamic> toMap(HasCarEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'type': model.type,\n      'color': colorToCode(model.color),\n    };\n  }\n}\n\nabstract class HasCarFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    type,\n    color,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String type = 'type';\n\n  static const String color = 'color';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/has_map.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'has_map.g.dart';\n\n// String _boolToCustom(bool v) => v ? 'yes' : 'no';\n// bool _customToBool(v) => v == 'yes';\n\n@orm\n@serializable\nabstract class HasMapEntity {\n  Map? get value;\n\n  List? get list;\n\n  // TODO: Support custom serializers\n  // @SerializableField(\n  //     serializer: #_boolToCustom,\n  //     deserializer: #_customToBool,\n  //     serializesTo: String)\n  // bool get customBool;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/has_map.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'has_map.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass HasMapMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('has_maps', (table) {\n      table.declareColumn(\n        'value',\n        Column(type: ColumnType('jsonb'), length: 255),\n      );\n      table.declareColumn(\n        'list',\n        Column(type: ColumnType('jsonb'), length: 255),\n      );\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('has_maps');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass HasMapQuery extends Query<HasMap, HasMapQueryWhere> {\n  HasMapQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = HasMapQueryWhere(this);\n  }\n\n  @override\n  final HasMapQueryValues values = HasMapQueryValues();\n\n  List<String> _selectedFields = [];\n\n  HasMapQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'has_maps';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['value', 'list'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  HasMapQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  HasMapQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  HasMapQueryWhere newWhereClause() {\n    return HasMapQueryWhere(this);\n  }\n\n  Optional<HasMap> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = HasMap(\n      value: fields.contains('value')\n          ? (row[0] as Map<dynamic, dynamic>?)\n          : null,\n      list: fields.contains('list') ? (row[1] as List<dynamic>?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<HasMap> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass HasMapQueryWhere extends QueryWhere {\n  HasMapQueryWhere(HasMapQuery query)\n    : value = MapSqlExpressionBuilder(query, 'value'),\n      list = ListSqlExpressionBuilder(query, 'list');\n\n  final MapSqlExpressionBuilder value;\n\n  final ListSqlExpressionBuilder list;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [value, list];\n  }\n}\n\nclass HasMapQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {'list': 'jsonb'};\n  }\n\n  Map<dynamic, dynamic>? get value {\n    return (values['value'] as Map<dynamic, dynamic>?);\n  }\n\n  set value(Map<dynamic, dynamic>? value) => values['value'] = value;\n\n  List<dynamic>? get list {\n    return json.decode((values['list'] as String)).cast();\n  }\n\n  set list(List<dynamic>? value) => values['list'] = json.encode(value);\n\n  void copyFrom(HasMap model) {\n    value = model.value;\n    list = model.list;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass HasMap implements HasMapEntity {\n  HasMap({this.value, this.list = const []});\n\n  @override\n  Map<dynamic, dynamic>? value;\n\n  @override\n  List<dynamic>? list;\n\n  HasMap copyWith({Map<dynamic, dynamic>? value, List<dynamic>? list}) {\n    return HasMap(value: value ?? this.value, list: list ?? this.list);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is HasMapEntity &&\n        MapEquality<dynamic, dynamic>(\n          keys: DefaultEquality(),\n          values: DefaultEquality(),\n        ).equals(other.value, value) &&\n        ListEquality<dynamic>(DefaultEquality()).equals(other.list, list);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([value, list]);\n  }\n\n  @override\n  String toString() {\n    return 'HasMap(value=$value, list=$list)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return HasMapSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst HasMapSerializer hasMapSerializer = HasMapSerializer();\n\nclass HasMapEncoder extends Converter<HasMap, Map> {\n  const HasMapEncoder();\n\n  @override\n  Map convert(HasMap model) => HasMapSerializer.toMap(model);\n}\n\nclass HasMapDecoder extends Converter<Map, HasMap> {\n  const HasMapDecoder();\n\n  @override\n  HasMap convert(Map map) => HasMapSerializer.fromMap(map);\n}\n\nclass HasMapSerializer extends Codec<HasMap, Map> {\n  const HasMapSerializer();\n\n  @override\n  HasMapEncoder get encoder => const HasMapEncoder();\n\n  @override\n  HasMapDecoder get decoder => const HasMapDecoder();\n\n  static HasMap fromMap(Map map) {\n    return HasMap(\n      value: map['value'] is Map\n          ? (map['value'] as Map).cast<dynamic, dynamic>()\n          : {},\n      list: map['list'] is Iterable\n          ? (map['list'] as Iterable).cast<dynamic>().toList()\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(HasMapEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'value': model.value, 'list': model.list};\n  }\n}\n\nabstract class HasMapFields {\n  static const List<String> allFields = <String>[value, list];\n\n  static const String value = 'value';\n\n  static const String list = 'list';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/leg.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'leg.g.dart';\n\n@serializable\n@orm\nclass LegEntity extends Model {\n  @hasOne\n  FootEntity? foot;\n\n  String? name;\n}\n\n@serializable\n@Orm(tableName: 'feet')\nclass FootEntity extends Model {\n  int? legId;\n\n  double? nToes;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/leg.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'leg.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass LegMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('legs', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('name', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('legs', cascade: true);\n  }\n}\n\nclass FootMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('feet', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('leg_id');\n      table.double('n_toes');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('feet');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass LegQuery extends Query<Leg, LegQueryWhere> {\n  LegQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = LegQueryWhere(this);\n    leftJoin(\n      _foot = FootQuery(trampoline: trampoline, parent: this),\n      'id',\n      'leg_id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'leg_id',\n        'n_toes',\n      ],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final LegQueryValues values = LegQueryValues();\n\n  List<String> _selectedFields = [];\n\n  LegQueryWhere? _where;\n\n  late FootQuery _foot;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'legs';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'name'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  LegQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  LegQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  LegQueryWhere newWhereClause() {\n    return LegQueryWhere(this);\n  }\n\n  Optional<Leg> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Leg(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[3] as String?) : null,\n    );\n    if (row.length > 4) {\n      var modelOpt = FootQuery().parseRow(row.skip(4).take(5).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(foot: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Leg> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  FootQuery get foot {\n    return _foot;\n  }\n}\n\nclass LegQueryWhere extends QueryWhere {\n  LegQueryWhere(LegQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      name = StringSqlExpressionBuilder(query, 'name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, name];\n  }\n}\n\nclass LegQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  void copyFrom(Leg model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n  }\n}\n\nclass FootQuery extends Query<Foot, FootQueryWhere> {\n  FootQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = FootQueryWhere(this);\n  }\n\n  @override\n  final FootQueryValues values = FootQueryValues();\n\n  List<String> _selectedFields = [];\n\n  FootQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'feet';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'leg_id', 'n_toes'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  FootQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  FootQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  FootQueryWhere newWhereClause() {\n    return FootQueryWhere(this);\n  }\n\n  Optional<Foot> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Foot(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      legId: fields.contains('leg_id') ? mapToInt(row[3]) : null,\n      nToes: fields.contains('n_toes') ? mapToDouble(row[4]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Foot> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass FootQueryWhere extends QueryWhere {\n  FootQueryWhere(FootQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      legId = NumericSqlExpressionBuilder<int>(query, 'leg_id'),\n      nToes = NumericSqlExpressionBuilder<double>(query, 'n_toes');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> legId;\n\n  final NumericSqlExpressionBuilder<double> nToes;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, legId, nToes];\n  }\n}\n\nclass FootQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int? get legId {\n    return (values['leg_id'] as int?);\n  }\n\n  set legId(int? value) => values['leg_id'] = value;\n\n  double? get nToes {\n    return (values['n_toes'] as double?) ?? 0.0;\n  }\n\n  set nToes(double? value) => values['n_toes'] = value;\n\n  void copyFrom(Foot model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    legId = model.legId;\n    nToes = model.nToes;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Leg extends LegEntity {\n  Leg({this.id, this.createdAt, this.updatedAt, this.foot, this.name});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  FootEntity? foot;\n\n  @override\n  String? name;\n\n  Leg copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    FootEntity? foot,\n    String? name,\n  }) {\n    return Leg(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      foot: foot ?? this.foot,\n      name: name ?? this.name,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is LegEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.foot == foot &&\n        other.name == name;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, foot, name]);\n  }\n\n  @override\n  String toString() {\n    return 'Leg(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, foot=$foot, name=$name)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return LegSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Foot extends FootEntity {\n  Foot({this.id, this.createdAt, this.updatedAt, this.legId, this.nToes});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? legId;\n\n  @override\n  double? nToes;\n\n  Foot copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? legId,\n    double? nToes,\n  }) {\n    return Foot(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      legId: legId ?? this.legId,\n      nToes: nToes ?? this.nToes,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is FootEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.legId == legId &&\n        other.nToes == nToes;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, legId, nToes]);\n  }\n\n  @override\n  String toString() {\n    return 'Foot(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, legId=$legId, nToes=$nToes)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return FootSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst LegSerializer legSerializer = LegSerializer();\n\nclass LegEncoder extends Converter<Leg, Map> {\n  const LegEncoder();\n\n  @override\n  Map convert(Leg model) => LegSerializer.toMap(model);\n}\n\nclass LegDecoder extends Converter<Map, Leg> {\n  const LegDecoder();\n\n  @override\n  Leg convert(Map map) => LegSerializer.fromMap(map);\n}\n\nclass LegSerializer extends Codec<Leg, Map> {\n  const LegSerializer();\n\n  @override\n  LegEncoder get encoder => const LegEncoder();\n\n  @override\n  LegDecoder get decoder => const LegDecoder();\n\n  static Leg fromMap(Map map) {\n    return Leg(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      foot: map['foot'] != null\n          ? FootSerializer.fromMap(map['foot'] as Map)\n          : null,\n      name: map['name'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(LegEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'foot': FootSerializer.toMap(model.foot),\n      'name': model.name,\n    };\n  }\n}\n\nabstract class LegFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    foot,\n    name,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String foot = 'foot';\n\n  static const String name = 'name';\n}\n\nconst FootSerializer footSerializer = FootSerializer();\n\nclass FootEncoder extends Converter<Foot, Map> {\n  const FootEncoder();\n\n  @override\n  Map convert(Foot model) => FootSerializer.toMap(model);\n}\n\nclass FootDecoder extends Converter<Map, Foot> {\n  const FootDecoder();\n\n  @override\n  Foot convert(Map map) => FootSerializer.fromMap(map);\n}\n\nclass FootSerializer extends Codec<Foot, Map> {\n  const FootSerializer();\n\n  @override\n  FootEncoder get encoder => const FootEncoder();\n\n  @override\n  FootDecoder get decoder => const FootDecoder();\n\n  static Foot fromMap(Map map) {\n    return Foot(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      legId: map['leg_id'] as int?,\n      nToes: map['n_toes'] as double?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(FootEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'leg_id': model.legId,\n      'n_toes': model.nToes,\n    };\n  }\n}\n\nabstract class FootFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    legId,\n    nToes,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String legId = 'leg_id';\n\n  static const String nToes = 'n_toes';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/order.dart",
    "content": "library;\n\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'order.g.dart';\n\n@orm\n@serializable\nabstract class EntityOrder extends Model {\n  @belongsTo\n  EntityCustomer? get customer;\n\n  int? get employeeId;\n\n  DateTime? get orderDate;\n\n  int? get shipperId;\n}\n\n@orm\n@serializable\nclass EntityCustomer extends Model {}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/order.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'order.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass OrderMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('orders', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('employee_id');\n      table.timeStamp('order_date');\n      table.integer('shipper_id');\n      table\n          .declare('customer_id', ColumnType('int'))\n          .references('customers', 'id');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('orders');\n  }\n}\n\nclass CustomerMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('customers', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('customers');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass OrderQuery extends Query<Order, OrderQueryWhere> {\n  OrderQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = OrderQueryWhere(this);\n    leftJoin(\n      _customer = CustomerQuery(trampoline: trampoline, parent: this),\n      'customer_id',\n      'id',\n      additionalFields: const ['id', 'created_at', 'updated_at'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final OrderQueryValues values = OrderQueryValues();\n\n  List<String> _selectedFields = [];\n\n  OrderQueryWhere? _where;\n\n  late CustomerQuery _customer;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'orders';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'customer_id',\n      'employee_id',\n      'order_date',\n      'shipper_id',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  OrderQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  OrderQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  OrderQueryWhere newWhereClause() {\n    return OrderQueryWhere(this);\n  }\n\n  Optional<Order> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Order(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      employeeId: fields.contains('employee_id') ? mapToInt(row[4]) : null,\n      orderDate: fields.contains('order_date')\n          ? mapToNullableDateTime(row[5])\n          : null,\n      shipperId: fields.contains('shipper_id') ? mapToInt(row[6]) : null,\n    );\n    if (row.length > 7) {\n      var modelOpt = CustomerQuery().parseRow(row.skip(7).take(3).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(customer: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Order> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  CustomerQuery get customer {\n    return _customer;\n  }\n}\n\nclass OrderQueryWhere extends QueryWhere {\n  OrderQueryWhere(OrderQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      customerId = NumericSqlExpressionBuilder<int>(query, 'customer_id'),\n      employeeId = NumericSqlExpressionBuilder<int>(query, 'employee_id'),\n      orderDate = DateTimeSqlExpressionBuilder(query, 'order_date'),\n      shipperId = NumericSqlExpressionBuilder<int>(query, 'shipper_id');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> customerId;\n\n  final NumericSqlExpressionBuilder<int> employeeId;\n\n  final DateTimeSqlExpressionBuilder orderDate;\n\n  final NumericSqlExpressionBuilder<int> shipperId;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [\n      id,\n      createdAt,\n      updatedAt,\n      customerId,\n      employeeId,\n      orderDate,\n      shipperId,\n    ];\n  }\n}\n\nclass OrderQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int get customerId {\n    return (values['customer_id'] as int);\n  }\n\n  set customerId(int value) => values['customer_id'] = value;\n\n  int? get employeeId {\n    return (values['employee_id'] as int?);\n  }\n\n  set employeeId(int? value) => values['employee_id'] = value;\n\n  DateTime? get orderDate {\n    return (values['order_date'] as DateTime?);\n  }\n\n  set orderDate(DateTime? value) => values['order_date'] = value;\n\n  int? get shipperId {\n    return (values['shipper_id'] as int?);\n  }\n\n  set shipperId(int? value) => values['shipper_id'] = value;\n\n  void copyFrom(Order model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    employeeId = model.employeeId;\n    orderDate = model.orderDate;\n    shipperId = model.shipperId;\n    if (model.customer != null) {\n      values['customer_id'] = model.customer?.id;\n    }\n  }\n}\n\nclass CustomerQuery extends Query<Customer, CustomerQueryWhere> {\n  CustomerQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = CustomerQueryWhere(this);\n  }\n\n  @override\n  final CustomerQueryValues values = CustomerQueryValues();\n\n  List<String> _selectedFields = [];\n\n  CustomerQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'customers';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  CustomerQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  CustomerQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  CustomerQueryWhere newWhereClause() {\n    return CustomerQueryWhere(this);\n  }\n\n  Optional<Customer> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Customer(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Customer> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass CustomerQueryWhere extends QueryWhere {\n  CustomerQueryWhere(CustomerQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt];\n  }\n}\n\nclass CustomerQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  void copyFrom(Customer model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Order extends EntityOrder {\n  Order({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.customer,\n    this.employeeId,\n    this.orderDate,\n    this.shipperId,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  EntityCustomer? customer;\n\n  @override\n  int? employeeId;\n\n  @override\n  DateTime? orderDate;\n\n  @override\n  int? shipperId;\n\n  Order copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    EntityCustomer? customer,\n    int? employeeId,\n    DateTime? orderDate,\n    int? shipperId,\n  }) {\n    return Order(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      customer: customer ?? this.customer,\n      employeeId: employeeId ?? this.employeeId,\n      orderDate: orderDate ?? this.orderDate,\n      shipperId: shipperId ?? this.shipperId,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is EntityOrder &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.customer == customer &&\n        other.employeeId == employeeId &&\n        other.orderDate == orderDate &&\n        other.shipperId == shipperId;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      customer,\n      employeeId,\n      orderDate,\n      shipperId,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Order(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, customer=$customer, employeeId=$employeeId, orderDate=$orderDate, shipperId=$shipperId)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return OrderSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Customer extends EntityCustomer {\n  Customer({this.id, this.createdAt, this.updatedAt});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  Customer copyWith({String? id, DateTime? createdAt, DateTime? updatedAt}) {\n    return Customer(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is EntityCustomer &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt]);\n  }\n\n  @override\n  String toString() {\n    return 'Customer(id=$id, createdAt=$createdAt, updatedAt=$updatedAt)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return CustomerSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst OrderSerializer orderSerializer = OrderSerializer();\n\nclass OrderEncoder extends Converter<Order, Map> {\n  const OrderEncoder();\n\n  @override\n  Map convert(Order model) => OrderSerializer.toMap(model);\n}\n\nclass OrderDecoder extends Converter<Map, Order> {\n  const OrderDecoder();\n\n  @override\n  Order convert(Map map) => OrderSerializer.fromMap(map);\n}\n\nclass OrderSerializer extends Codec<Order, Map> {\n  const OrderSerializer();\n\n  @override\n  OrderEncoder get encoder => const OrderEncoder();\n\n  @override\n  OrderDecoder get decoder => const OrderDecoder();\n\n  static Order fromMap(Map map) {\n    return Order(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      customer: map['customer'] != null\n          ? CustomerSerializer.fromMap(map['customer'] as Map)\n          : null,\n      employeeId: map['employee_id'] as int?,\n      orderDate: map['order_date'] != null\n          ? (map['order_date'] is DateTime\n                ? (map['order_date'] as DateTime)\n                : DateTime.parse(map['order_date'].toString()))\n          : null,\n      shipperId: map['shipper_id'] as int?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(EntityOrder? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'customer': CustomerSerializer.toMap(model.customer),\n      'employee_id': model.employeeId,\n      'order_date': model.orderDate?.toIso8601String(),\n      'shipper_id': model.shipperId,\n    };\n  }\n}\n\nabstract class OrderFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    customer,\n    employeeId,\n    orderDate,\n    shipperId,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String customer = 'customer';\n\n  static const String employeeId = 'employee_id';\n\n  static const String orderDate = 'order_date';\n\n  static const String shipperId = 'shipper_id';\n}\n\nconst CustomerSerializer customerSerializer = CustomerSerializer();\n\nclass CustomerEncoder extends Converter<Customer, Map> {\n  const CustomerEncoder();\n\n  @override\n  Map convert(Customer model) => CustomerSerializer.toMap(model);\n}\n\nclass CustomerDecoder extends Converter<Map, Customer> {\n  const CustomerDecoder();\n\n  @override\n  Customer convert(Map map) => CustomerSerializer.fromMap(map);\n}\n\nclass CustomerSerializer extends Codec<Customer, Map> {\n  const CustomerSerializer();\n\n  @override\n  CustomerEncoder get encoder => const CustomerEncoder();\n\n  @override\n  CustomerDecoder get decoder => const CustomerDecoder();\n\n  static Customer fromMap(Map map) {\n    return Customer(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(EntityCustomer? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n    };\n  }\n}\n\nabstract class CustomerFields {\n  static const List<String> allFields = <String>[id, createdAt, updatedAt];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/person.dart",
    "content": "library;\n\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\npart 'person.g.dart';\n\n@serializable\n@Orm(tableName: 'persons')\nclass PersonEntity extends Model {\n  String? name;\n  int? age;\n}\n\n@serializable\n@Orm(tableName: 'persons', generateMigrations: false)\nclass PersonWithLastOrderEntity {\n  String? name;\n\n  @Column(expression: 'po.name')\n  String? lastOrderName;\n\n  @Column(expression: 'po.price')\n  double? lastOrderPrice;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/person.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'person.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass PersonMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('persons', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('name', length: 255);\n      table.integer('age');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('persons');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass PersonQuery extends Query<Person, PersonQueryWhere> {\n  PersonQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = PersonQueryWhere(this);\n  }\n\n  @override\n  final PersonQueryValues values = PersonQueryValues();\n\n  List<String> _selectedFields = [];\n\n  PersonQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'persons';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'name', 'age'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  PersonQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  PersonQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  PersonQueryWhere newWhereClause() {\n    return PersonQueryWhere(this);\n  }\n\n  Optional<Person> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Person(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[3] as String?) : null,\n      age: fields.contains('age') ? mapToInt(row[4]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Person> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass PersonQueryWhere extends QueryWhere {\n  PersonQueryWhere(PersonQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      age = NumericSqlExpressionBuilder<int>(query, 'age');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<int> age;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, name, age];\n  }\n}\n\nclass PersonQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  int? get age {\n    return (values['age'] as int?);\n  }\n\n  set age(int? value) => values['age'] = value;\n\n  void copyFrom(Person model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n    age = model.age;\n  }\n}\n\nclass PersonWithLastOrderQuery\n    extends Query<PersonWithLastOrder, PersonWithLastOrderQueryWhere> {\n  PersonWithLastOrderQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    expressions['last_order_name'] = 'po.name';\n    expressions['last_order_price'] = 'po.price';\n    _where = PersonWithLastOrderQueryWhere(this);\n  }\n\n  @override\n  final PersonWithLastOrderQueryValues values =\n      PersonWithLastOrderQueryValues();\n\n  List<String> _selectedFields = [];\n\n  PersonWithLastOrderQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'persons';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['name', 'last_order_name', 'last_order_price'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  PersonWithLastOrderQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  PersonWithLastOrderQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  PersonWithLastOrderQueryWhere newWhereClause() {\n    return PersonWithLastOrderQueryWhere(this);\n  }\n\n  Optional<PersonWithLastOrder> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = PersonWithLastOrder(\n      name: fields.contains('name') ? (row[0] as String?) : null,\n      lastOrderName: fields.contains('last_order_name')\n          ? (row[1] as String?)\n          : null,\n      lastOrderPrice: fields.contains('last_order_price')\n          ? mapToDouble(row[2])\n          : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<PersonWithLastOrder> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass PersonWithLastOrderQueryWhere extends QueryWhere {\n  PersonWithLastOrderQueryWhere(PersonWithLastOrderQuery query)\n    : name = StringSqlExpressionBuilder(query, 'name');\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [name];\n  }\n}\n\nclass PersonWithLastOrderQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  void copyFrom(PersonWithLastOrder model) {\n    name = model.name;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Person extends PersonEntity {\n  Person({this.id, this.createdAt, this.updatedAt, this.name, this.age});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? name;\n\n  @override\n  int? age;\n\n  Person copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? name,\n    int? age,\n  }) {\n    return Person(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      name: name ?? this.name,\n      age: age ?? this.age,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is PersonEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.name == name &&\n        other.age == age;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, name, age]);\n  }\n\n  @override\n  String toString() {\n    return 'Person(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, name=$name, age=$age)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return PersonSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass PersonWithLastOrder extends PersonWithLastOrderEntity {\n  PersonWithLastOrder({this.name, this.lastOrderName, this.lastOrderPrice});\n\n  @override\n  String? name;\n\n  @override\n  String? lastOrderName;\n\n  @override\n  double? lastOrderPrice;\n\n  PersonWithLastOrder copyWith({\n    String? name,\n    String? lastOrderName,\n    double? lastOrderPrice,\n  }) {\n    return PersonWithLastOrder(\n      name: name ?? this.name,\n      lastOrderName: lastOrderName ?? this.lastOrderName,\n      lastOrderPrice: lastOrderPrice ?? this.lastOrderPrice,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is PersonWithLastOrderEntity &&\n        other.name == name &&\n        other.lastOrderName == lastOrderName &&\n        other.lastOrderPrice == lastOrderPrice;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([name, lastOrderName, lastOrderPrice]);\n  }\n\n  @override\n  String toString() {\n    return 'PersonWithLastOrder(name=$name, lastOrderName=$lastOrderName, lastOrderPrice=$lastOrderPrice)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return PersonWithLastOrderSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst PersonSerializer personSerializer = PersonSerializer();\n\nclass PersonEncoder extends Converter<Person, Map> {\n  const PersonEncoder();\n\n  @override\n  Map convert(Person model) => PersonSerializer.toMap(model);\n}\n\nclass PersonDecoder extends Converter<Map, Person> {\n  const PersonDecoder();\n\n  @override\n  Person convert(Map map) => PersonSerializer.fromMap(map);\n}\n\nclass PersonSerializer extends Codec<Person, Map> {\n  const PersonSerializer();\n\n  @override\n  PersonEncoder get encoder => const PersonEncoder();\n\n  @override\n  PersonDecoder get decoder => const PersonDecoder();\n\n  static Person fromMap(Map map) {\n    return Person(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      name: map['name'] as String?,\n      age: map['age'] as int?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(PersonEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'name': model.name,\n      'age': model.age,\n    };\n  }\n}\n\nabstract class PersonFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    name,\n    age,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String name = 'name';\n\n  static const String age = 'age';\n}\n\nconst PersonWithLastOrderSerializer personWithLastOrderSerializer =\n    PersonWithLastOrderSerializer();\n\nclass PersonWithLastOrderEncoder extends Converter<PersonWithLastOrder, Map> {\n  const PersonWithLastOrderEncoder();\n\n  @override\n  Map convert(PersonWithLastOrder model) =>\n      PersonWithLastOrderSerializer.toMap(model);\n}\n\nclass PersonWithLastOrderDecoder extends Converter<Map, PersonWithLastOrder> {\n  const PersonWithLastOrderDecoder();\n\n  @override\n  PersonWithLastOrder convert(Map map) =>\n      PersonWithLastOrderSerializer.fromMap(map);\n}\n\nclass PersonWithLastOrderSerializer extends Codec<PersonWithLastOrder, Map> {\n  const PersonWithLastOrderSerializer();\n\n  @override\n  PersonWithLastOrderEncoder get encoder => const PersonWithLastOrderEncoder();\n\n  @override\n  PersonWithLastOrderDecoder get decoder => const PersonWithLastOrderDecoder();\n\n  static PersonWithLastOrder fromMap(Map map) {\n    return PersonWithLastOrder(\n      name: map['name'] as String?,\n      lastOrderName: map['last_order_name'] as String?,\n      lastOrderPrice: map['last_order_price'] as double?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(PersonWithLastOrderEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'name': model.name,\n      'last_order_name': model.lastOrderName,\n      'last_order_price': model.lastOrderPrice,\n    };\n  }\n}\n\nabstract class PersonWithLastOrderFields {\n  static const List<String> allFields = <String>[\n    name,\n    lastOrderName,\n    lastOrderPrice,\n  ];\n\n  static const String name = 'name';\n\n  static const String lastOrderName = 'last_order_name';\n\n  static const String lastOrderPrice = 'last_order_price';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/person_order.dart",
    "content": "library;\n\nimport 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'person_order.g.dart';\n\n@orm\n@serializable\nabstract class PersonOrderEntity extends Model {\n  int? get personId;\n\n  String? get name;\n\n  double? get price;\n\n  bool? get deleted;\n}\n\n@serializable\n@Orm(tableName: 'person_orders', generateMigrations: false)\nabstract class OrderWithPersonInfoEntity extends Model {\n  String? get name;\n\n  double? get price;\n\n  bool? get deleted;\n\n  @Column(expression: 'p.name')\n  String? get personName;\n\n  @Column(expression: 'p.age')\n  int? get personAge;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/person_order.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'person_order.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass PersonOrderMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('person_orders', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('person_id');\n      table.varChar('name', length: 255);\n      table.double('price');\n      table.boolean('deleted');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('person_orders');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass PersonOrderQuery extends Query<PersonOrder, PersonOrderQueryWhere> {\n  PersonOrderQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = PersonOrderQueryWhere(this);\n  }\n\n  @override\n  final PersonOrderQueryValues values = PersonOrderQueryValues();\n\n  List<String> _selectedFields = [];\n\n  PersonOrderQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'person_orders';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'person_id',\n      'name',\n      'price',\n      'deleted',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  PersonOrderQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  PersonOrderQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  PersonOrderQueryWhere newWhereClause() {\n    return PersonOrderQueryWhere(this);\n  }\n\n  Optional<PersonOrder> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = PersonOrder(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      personId: fields.contains('person_id') ? mapToInt(row[3]) : null,\n      name: fields.contains('name') ? (row[4] as String?) : null,\n      price: fields.contains('price') ? mapToDouble(row[5]) : null,\n      deleted: fields.contains('deleted') ? mapToBool(row[6]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<PersonOrder> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass PersonOrderQueryWhere extends QueryWhere {\n  PersonOrderQueryWhere(PersonOrderQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      personId = NumericSqlExpressionBuilder<int>(query, 'person_id'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price'),\n      deleted = BooleanSqlExpressionBuilder(query, 'deleted');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> personId;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  final BooleanSqlExpressionBuilder deleted;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, personId, name, price, deleted];\n  }\n}\n\nclass PersonOrderQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int? get personId {\n    return (values['person_id'] as int?);\n  }\n\n  set personId(int? value) => values['person_id'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  double? get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double? value) => values['price'] = value;\n\n  bool? get deleted {\n    return (values['deleted'] as bool?);\n  }\n\n  set deleted(bool? value) => values['deleted'] = value;\n\n  void copyFrom(PersonOrder model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    personId = model.personId;\n    name = model.name;\n    price = model.price;\n    deleted = model.deleted;\n  }\n}\n\nclass OrderWithPersonInfoQuery\n    extends Query<OrderWithPersonInfo, OrderWithPersonInfoQueryWhere> {\n  OrderWithPersonInfoQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    expressions['person_name'] = 'p.name';\n    expressions['person_age'] = 'p.age';\n    _where = OrderWithPersonInfoQueryWhere(this);\n  }\n\n  @override\n  final OrderWithPersonInfoQueryValues values =\n      OrderWithPersonInfoQueryValues();\n\n  List<String> _selectedFields = [];\n\n  OrderWithPersonInfoQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'person_orders';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'name',\n      'price',\n      'deleted',\n      'person_name',\n      'person_age',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  OrderWithPersonInfoQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  OrderWithPersonInfoQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  OrderWithPersonInfoQueryWhere newWhereClause() {\n    return OrderWithPersonInfoQueryWhere(this);\n  }\n\n  Optional<OrderWithPersonInfo> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = OrderWithPersonInfo(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[3] as String?) : null,\n      price: fields.contains('price') ? mapToDouble(row[4]) : null,\n      deleted: fields.contains('deleted') ? mapToBool(row[5]) : null,\n      personName: fields.contains('person_name') ? (row[6] as String?) : null,\n      personAge: fields.contains('person_age') ? mapToInt(row[7]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<OrderWithPersonInfo> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass OrderWithPersonInfoQueryWhere extends QueryWhere {\n  OrderWithPersonInfoQueryWhere(OrderWithPersonInfoQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price'),\n      deleted = BooleanSqlExpressionBuilder(query, 'deleted');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  final BooleanSqlExpressionBuilder deleted;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, name, price, deleted];\n  }\n}\n\nclass OrderWithPersonInfoQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  double? get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double? value) => values['price'] = value;\n\n  bool? get deleted {\n    return (values['deleted'] as bool?);\n  }\n\n  set deleted(bool? value) => values['deleted'] = value;\n\n  void copyFrom(OrderWithPersonInfo model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n    price = model.price;\n    deleted = model.deleted;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass PersonOrder extends PersonOrderEntity {\n  PersonOrder({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.personId,\n    this.name,\n    this.price,\n    this.deleted,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? personId;\n\n  @override\n  String? name;\n\n  @override\n  double? price;\n\n  @override\n  bool? deleted;\n\n  PersonOrder copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? personId,\n    String? name,\n    double? price,\n    bool? deleted,\n  }) {\n    return PersonOrder(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      personId: personId ?? this.personId,\n      name: name ?? this.name,\n      price: price ?? this.price,\n      deleted: deleted ?? this.deleted,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is PersonOrderEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.personId == personId &&\n        other.name == name &&\n        other.price == price &&\n        other.deleted == deleted;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      personId,\n      name,\n      price,\n      deleted,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'PersonOrder(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, personId=$personId, name=$name, price=$price, deleted=$deleted)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return PersonOrderSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass OrderWithPersonInfo extends OrderWithPersonInfoEntity {\n  OrderWithPersonInfo({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.name,\n    this.price,\n    this.deleted,\n    this.personName,\n    this.personAge,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? name;\n\n  @override\n  double? price;\n\n  @override\n  bool? deleted;\n\n  @override\n  String? personName;\n\n  @override\n  int? personAge;\n\n  OrderWithPersonInfo copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? name,\n    double? price,\n    bool? deleted,\n    String? personName,\n    int? personAge,\n  }) {\n    return OrderWithPersonInfo(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      name: name ?? this.name,\n      price: price ?? this.price,\n      deleted: deleted ?? this.deleted,\n      personName: personName ?? this.personName,\n      personAge: personAge ?? this.personAge,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is OrderWithPersonInfoEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.name == name &&\n        other.price == price &&\n        other.deleted == deleted &&\n        other.personName == personName &&\n        other.personAge == personAge;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      name,\n      price,\n      deleted,\n      personName,\n      personAge,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'OrderWithPersonInfo(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, name=$name, price=$price, deleted=$deleted, personName=$personName, personAge=$personAge)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return OrderWithPersonInfoSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst PersonOrderSerializer personOrderSerializer = PersonOrderSerializer();\n\nclass PersonOrderEncoder extends Converter<PersonOrder, Map> {\n  const PersonOrderEncoder();\n\n  @override\n  Map convert(PersonOrder model) => PersonOrderSerializer.toMap(model);\n}\n\nclass PersonOrderDecoder extends Converter<Map, PersonOrder> {\n  const PersonOrderDecoder();\n\n  @override\n  PersonOrder convert(Map map) => PersonOrderSerializer.fromMap(map);\n}\n\nclass PersonOrderSerializer extends Codec<PersonOrder, Map> {\n  const PersonOrderSerializer();\n\n  @override\n  PersonOrderEncoder get encoder => const PersonOrderEncoder();\n\n  @override\n  PersonOrderDecoder get decoder => const PersonOrderDecoder();\n\n  static PersonOrder fromMap(Map map) {\n    return PersonOrder(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      personId: map['person_id'] as int?,\n      name: map['name'] as String?,\n      price: map['price'] as double?,\n      deleted: map['deleted'] as bool?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(PersonOrderEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'person_id': model.personId,\n      'name': model.name,\n      'price': model.price,\n      'deleted': model.deleted,\n    };\n  }\n}\n\nabstract class PersonOrderFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    personId,\n    name,\n    price,\n    deleted,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String personId = 'person_id';\n\n  static const String name = 'name';\n\n  static const String price = 'price';\n\n  static const String deleted = 'deleted';\n}\n\nconst OrderWithPersonInfoSerializer orderWithPersonInfoSerializer =\n    OrderWithPersonInfoSerializer();\n\nclass OrderWithPersonInfoEncoder extends Converter<OrderWithPersonInfo, Map> {\n  const OrderWithPersonInfoEncoder();\n\n  @override\n  Map convert(OrderWithPersonInfo model) =>\n      OrderWithPersonInfoSerializer.toMap(model);\n}\n\nclass OrderWithPersonInfoDecoder extends Converter<Map, OrderWithPersonInfo> {\n  const OrderWithPersonInfoDecoder();\n\n  @override\n  OrderWithPersonInfo convert(Map map) =>\n      OrderWithPersonInfoSerializer.fromMap(map);\n}\n\nclass OrderWithPersonInfoSerializer extends Codec<OrderWithPersonInfo, Map> {\n  const OrderWithPersonInfoSerializer();\n\n  @override\n  OrderWithPersonInfoEncoder get encoder => const OrderWithPersonInfoEncoder();\n\n  @override\n  OrderWithPersonInfoDecoder get decoder => const OrderWithPersonInfoDecoder();\n\n  static OrderWithPersonInfo fromMap(Map map) {\n    return OrderWithPersonInfo(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      name: map['name'] as String?,\n      price: map['price'] as double?,\n      deleted: map['deleted'] as bool?,\n      personName: map['person_name'] as String?,\n      personAge: map['person_age'] as int?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(OrderWithPersonInfoEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'name': model.name,\n      'price': model.price,\n      'deleted': model.deleted,\n      'person_name': model.personName,\n      'person_age': model.personAge,\n    };\n  }\n}\n\nabstract class OrderWithPersonInfoFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    name,\n    price,\n    deleted,\n    personName,\n    personAge,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String name = 'name';\n\n  static const String price = 'price';\n\n  static const String deleted = 'deleted';\n\n  static const String personName = 'person_name';\n\n  static const String personAge = 'person_age';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/quotation.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'quotation.g.dart';\n\n@serializable\n@orm\nabstract class QuotationEntity {\n  @PrimaryKey(columnType: ColumnType.varChar)\n  String? get id;\n\n  String? get name;\n\n  double? get price;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/quotation.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'quotation.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass QuotationMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('quotations', (table) {\n      table.varChar('id', length: 255).primaryKey();\n      table.varChar('name', length: 255);\n      table.double('price');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('quotations');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass QuotationQuery extends Query<Quotation, QuotationQueryWhere> {\n  QuotationQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = QuotationQueryWhere(this);\n  }\n\n  @override\n  final QuotationQueryValues values = QuotationQueryValues();\n\n  List<String> _selectedFields = [];\n\n  QuotationQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'quotations';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'name', 'price'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  QuotationQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  QuotationQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  QuotationQueryWhere newWhereClause() {\n    return QuotationQueryWhere(this);\n  }\n\n  Optional<Quotation> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Quotation(\n      id: fields.contains('id') ? (row[0] as String?) : null,\n      name: fields.contains('name') ? (row[1] as String?) : null,\n      price: fields.contains('price') ? mapToDouble(row[2]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Quotation> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass QuotationQueryWhere extends QueryWhere {\n  QuotationQueryWhere(QuotationQuery query)\n    : id = StringSqlExpressionBuilder(query, 'id'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      price = NumericSqlExpressionBuilder<double>(query, 'price');\n\n  final StringSqlExpressionBuilder id;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<double> price;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, name, price];\n  }\n}\n\nclass QuotationQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  double? get price {\n    return (values['price'] as double?) ?? 0.0;\n  }\n\n  set price(double? value) => values['price'] = value;\n\n  void copyFrom(Quotation model) {\n    id = model.id;\n    name = model.name;\n    price = model.price;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Quotation implements QuotationEntity {\n  Quotation({this.id, this.name, this.price});\n\n  @override\n  String? id;\n\n  @override\n  String? name;\n\n  @override\n  double? price;\n\n  Quotation copyWith({String? id, String? name, double? price}) {\n    return Quotation(\n      id: id ?? this.id,\n      name: name ?? this.name,\n      price: price ?? this.price,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is QuotationEntity &&\n        other.id == id &&\n        other.name == name &&\n        other.price == price;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, name, price]);\n  }\n\n  @override\n  String toString() {\n    return 'Quotation(id=$id, name=$name, price=$price)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return QuotationSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst QuotationSerializer quotationSerializer = QuotationSerializer();\n\nclass QuotationEncoder extends Converter<Quotation, Map> {\n  const QuotationEncoder();\n\n  @override\n  Map convert(Quotation model) => QuotationSerializer.toMap(model);\n}\n\nclass QuotationDecoder extends Converter<Map, Quotation> {\n  const QuotationDecoder();\n\n  @override\n  Quotation convert(Map map) => QuotationSerializer.fromMap(map);\n}\n\nclass QuotationSerializer extends Codec<Quotation, Map> {\n  const QuotationSerializer();\n\n  @override\n  QuotationEncoder get encoder => const QuotationEncoder();\n\n  @override\n  QuotationDecoder get decoder => const QuotationDecoder();\n\n  static Quotation fromMap(Map map) {\n    return Quotation(\n      id: map['id'] as String?,\n      name: map['name'] as String?,\n      price: map['price'] as double?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(QuotationEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'id': model.id, 'name': model.name, 'price': model.price};\n  }\n}\n\nabstract class QuotationFields {\n  static const List<String> allFields = <String>[id, name, price];\n\n  static const String id = 'id';\n\n  static const String name = 'name';\n\n  static const String price = 'price';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/todo.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'todo.g.dart';\n\n@serializable\n@Orm(tableName: 'user_acc', generateMigrations: true)\nabstract class UserEntity {\n  @Column(type: ColumnType.serial, indexType: IndexType.primaryKey)\n  @PrimaryKey()\n  int get id;\n\n  @Column(type: ColumnType.varChar, length: 255)\n  String get name;\n\n  // Not supported\n  @HasMany(localKey: 'id', foreignKey: 'user_id')\n  List<UserTodoEntity> get todos;\n\n  @HasMany(localKey: 'id', foreignKey: 'user_id')\n  List<UserAddressEntity> get address;\n}\n\n@Orm(tableName: 'user_addr', generateMigrations: true)\n@serializable\nabstract class UserAddressEntity {\n  @Column(\n    type: ColumnType.serial,\n    indexType: IndexType.primaryKey,\n    isNullable: false,\n  )\n  int get id;\n\n  @Column(type: ColumnType.int, isNullable: false)\n  int get userId;\n\n  @Column(type: ColumnType.varChar, length: 255, isNullable: false)\n  String get address;\n}\n\n@Orm(tableName: 'user_todo', generateMigrations: true)\n@serializable\nabstract class UserTodoEntity {\n  @Column(\n    type: ColumnType.serial,\n    indexType: IndexType.primaryKey,\n    isNullable: false,\n  )\n  int get id;\n\n  @Column(type: ColumnType.int, isNullable: false)\n  int get userId;\n\n  @Column(type: ColumnType.varChar, length: 255, isNullable: false)\n  String get title;\n\n  @HasMany(localKey: 'id', foreignKey: 'todo_value_id')\n  List<TodoValueEntity> get todoValues;\n\n  @HasMany(localKey: 'id', foreignKey: 'todo_note_id')\n  List<TodoNoteEntity> get todoNotes;\n}\n\n@Orm(tableName: 'todo_value', generateMigrations: true)\n@serializable\nabstract class TodoValueEntity {\n  @Column(type: ColumnType.serial, indexType: IndexType.primaryKey)\n  int get id;\n\n  @Column(type: ColumnType.varChar, length: 255)\n  String get value;\n\n  @Column(type: ColumnType.int)\n  int get todoId;\n\n  String? get description;\n}\n\n@Orm(tableName: 'todo_note', generateMigrations: true)\n@serializable\nabstract class TodoNoteEntity {\n  @Column(type: ColumnType.serial, indexType: IndexType.primaryKey)\n  int get id;\n\n  @Column(type: ColumnType.varChar, length: 255)\n  String get note;\n\n  @Column(type: ColumnType.int)\n  int get todoId;\n\n  String? get description;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/todo.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'todo.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass UserMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('user_acc', (table) {\n      table.integer('id').primaryKey();\n      table.varChar('name', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('user_acc', cascade: true);\n  }\n}\n\nclass UserAddressMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('user_addr', (table) {\n      table.integer('id')\n        ..primaryKey()\n        ..notNull();\n      table.integer('user_id').notNull();\n      table.varChar('address', length: 255).notNull();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('user_addr');\n  }\n}\n\nclass UserTodoMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('user_todo', (table) {\n      table.integer('id')\n        ..primaryKey()\n        ..notNull();\n      table.integer('user_id').notNull();\n      table.varChar('title', length: 255).notNull();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('user_todo', cascade: true);\n  }\n}\n\nclass TodoValueMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('todo_value', (table) {\n      table.integer('id').primaryKey();\n      table.varChar('value', length: 255);\n      table.integer('todo_id');\n      table.varChar('description', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('todo_value');\n  }\n}\n\nclass TodoNoteMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('todo_note', (table) {\n      table.integer('id').primaryKey();\n      table.varChar('note', length: 255);\n      table.integer('todo_id');\n      table.varChar('description', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('todo_note');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass UserQuery extends Query<User, UserQueryWhere> {\n  UserQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UserQueryWhere(this);\n    leftJoin(\n      _todos = UserTodoQuery(trampoline: trampoline, parent: this),\n      'id',\n      'user_id',\n      additionalFields: const ['id', 'user_id', 'title'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _address = UserAddressQuery(trampoline: trampoline, parent: this),\n      'id',\n      'user_id',\n      additionalFields: const ['id', 'user_id', 'address'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final UserQueryValues values = UserQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UserQueryWhere? _where;\n\n  late UserTodoQuery _todos;\n\n  late UserAddressQuery _address;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'user_acc';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'name'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UserQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UserQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UserQueryWhere newWhereClause() {\n    return UserQueryWhere(this);\n  }\n\n  Optional<User> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = User(\n      id: fields.contains('id') ? mapToInt(row[0]) : 0,\n      name: fields.contains('name') ? (row[1] as String) : '',\n    );\n    if (row.length > 2) {\n      var modelOpt = UserTodoQuery().parseRow(row.skip(2).take(3).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(todos: [m]);\n      });\n    }\n    if (row.length > 5) {\n      var modelOpt = UserAddressQuery().parseRow(row.skip(5).take(3).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(address: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<User> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  UserTodoQuery get todos {\n    return _todos;\n  }\n\n  UserAddressQuery get address {\n    return _address;\n  }\n\n  @override\n  Future<List<User>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todos: List<UserTodoEntity>.from(l.todos)..addAll(model.todos),\n              address: List<UserAddressEntity>.from(l.address)\n                ..addAll(model.address),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todos: List<UserTodoEntity>.from(l.todos)..addAll(model.todos),\n              address: List<UserAddressEntity>.from(l.address)\n                ..addAll(model.address),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todos: List<UserTodoEntity>.from(l.todos)..addAll(model.todos),\n              address: List<UserAddressEntity>.from(l.address)\n                ..addAll(model.address),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass UserQueryWhere extends QueryWhere {\n  UserQueryWhere(UserQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      name = StringSqlExpressionBuilder(query, 'name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, name];\n  }\n}\n\nclass UserQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  String get name {\n    return (values['name'] as String);\n  }\n\n  set name(String value) => values['name'] = value;\n\n  void copyFrom(User model) {\n    id = model.id;\n    name = model.name;\n  }\n}\n\nclass UserAddressQuery extends Query<UserAddress, UserAddressQueryWhere> {\n  UserAddressQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UserAddressQueryWhere(this);\n  }\n\n  @override\n  final UserAddressQueryValues values = UserAddressQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UserAddressQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'user_addr';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'user_id', 'address'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UserAddressQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UserAddressQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UserAddressQueryWhere newWhereClause() {\n    return UserAddressQueryWhere(this);\n  }\n\n  Optional<UserAddress> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = UserAddress(\n      id: fields.contains('id') ? mapToInt(row[0]) : 0,\n      userId: fields.contains('user_id') ? mapToInt(row[1]) : 0,\n      address: fields.contains('address') ? (row[2] as String) : '',\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<UserAddress> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass UserAddressQueryWhere extends QueryWhere {\n  UserAddressQueryWhere(UserAddressQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      userId = NumericSqlExpressionBuilder<int>(query, 'user_id'),\n      address = StringSqlExpressionBuilder(query, 'address');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final NumericSqlExpressionBuilder<int> userId;\n\n  final StringSqlExpressionBuilder address;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, userId, address];\n  }\n}\n\nclass UserAddressQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  int get userId {\n    return (values['user_id'] as int);\n  }\n\n  set userId(int value) => values['user_id'] = value;\n\n  String get address {\n    return (values['address'] as String);\n  }\n\n  set address(String value) => values['address'] = value;\n\n  void copyFrom(UserAddress model) {\n    id = model.id;\n    userId = model.userId;\n    address = model.address;\n  }\n}\n\nclass UserTodoQuery extends Query<UserTodo, UserTodoQueryWhere> {\n  UserTodoQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UserTodoQueryWhere(this);\n    leftJoin(\n      _todoValues = TodoValueQuery(trampoline: trampoline, parent: this),\n      'id',\n      'todo_value_id',\n      additionalFields: const ['id', 'value', 'todo_id', 'description'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _todoNotes = TodoNoteQuery(trampoline: trampoline, parent: this),\n      'id',\n      'todo_note_id',\n      additionalFields: const ['id', 'note', 'todo_id', 'description'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final UserTodoQueryValues values = UserTodoQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UserTodoQueryWhere? _where;\n\n  late TodoValueQuery _todoValues;\n\n  late TodoNoteQuery _todoNotes;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'user_todo';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'user_id', 'title'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UserTodoQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UserTodoQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UserTodoQueryWhere newWhereClause() {\n    return UserTodoQueryWhere(this);\n  }\n\n  Optional<UserTodo> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = UserTodo(\n      id: fields.contains('id') ? mapToInt(row[0]) : 0,\n      userId: fields.contains('user_id') ? mapToInt(row[1]) : 0,\n      title: fields.contains('title') ? (row[2] as String) : '',\n    );\n    if (row.length > 3) {\n      var modelOpt = TodoValueQuery().parseRow(row.skip(3).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(todoValues: [m]);\n      });\n    }\n    if (row.length > 7) {\n      var modelOpt = TodoNoteQuery().parseRow(row.skip(7).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(todoNotes: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<UserTodo> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  TodoValueQuery get todoValues {\n    return _todoValues;\n  }\n\n  TodoNoteQuery get todoNotes {\n    return _todoNotes;\n  }\n\n  @override\n  Future<List<UserTodo>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<UserTodo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todoValues: List<TodoValueEntity>.from(l.todoValues)\n                ..addAll(model.todoValues),\n              todoNotes: List<TodoNoteEntity>.from(l.todoNotes)\n                ..addAll(model.todoNotes),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<UserTodo>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<UserTodo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todoValues: List<TodoValueEntity>.from(l.todoValues)\n                ..addAll(model.todoValues),\n              todoNotes: List<TodoNoteEntity>.from(l.todoNotes)\n                ..addAll(model.todoNotes),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<UserTodo>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<UserTodo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              todoValues: List<TodoValueEntity>.from(l.todoValues)\n                ..addAll(model.todoValues),\n              todoNotes: List<TodoNoteEntity>.from(l.todoNotes)\n                ..addAll(model.todoNotes),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass UserTodoQueryWhere extends QueryWhere {\n  UserTodoQueryWhere(UserTodoQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      userId = NumericSqlExpressionBuilder<int>(query, 'user_id'),\n      title = StringSqlExpressionBuilder(query, 'title');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final NumericSqlExpressionBuilder<int> userId;\n\n  final StringSqlExpressionBuilder title;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, userId, title];\n  }\n}\n\nclass UserTodoQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  int get userId {\n    return (values['user_id'] as int);\n  }\n\n  set userId(int value) => values['user_id'] = value;\n\n  String get title {\n    return (values['title'] as String);\n  }\n\n  set title(String value) => values['title'] = value;\n\n  void copyFrom(UserTodo model) {\n    id = model.id;\n    userId = model.userId;\n    title = model.title;\n  }\n}\n\nclass TodoValueQuery extends Query<TodoValue, TodoValueQueryWhere> {\n  TodoValueQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = TodoValueQueryWhere(this);\n  }\n\n  @override\n  final TodoValueQueryValues values = TodoValueQueryValues();\n\n  List<String> _selectedFields = [];\n\n  TodoValueQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'todo_value';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'value', 'todo_id', 'description'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  TodoValueQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  TodoValueQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  TodoValueQueryWhere newWhereClause() {\n    return TodoValueQueryWhere(this);\n  }\n\n  Optional<TodoValue> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = TodoValue(\n      id: fields.contains('id') ? mapToInt(row[0]) : 0,\n      value: fields.contains('value') ? (row[1] as String) : '',\n      todoId: fields.contains('todo_id') ? mapToInt(row[2]) : 0,\n      description: fields.contains('description') ? (row[3] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<TodoValue> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass TodoValueQueryWhere extends QueryWhere {\n  TodoValueQueryWhere(TodoValueQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      value = StringSqlExpressionBuilder(query, 'value'),\n      todoId = NumericSqlExpressionBuilder<int>(query, 'todo_id'),\n      description = StringSqlExpressionBuilder(query, 'description');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder value;\n\n  final NumericSqlExpressionBuilder<int> todoId;\n\n  final StringSqlExpressionBuilder description;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, value, todoId, description];\n  }\n}\n\nclass TodoValueQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  String get value {\n    return (values['value'] as String);\n  }\n\n  set value(String value) => values['value'] = value;\n\n  int get todoId {\n    return (values['todo_id'] as int);\n  }\n\n  set todoId(int value) => values['todo_id'] = value;\n\n  String? get description {\n    return (values['description'] as String?);\n  }\n\n  set description(String? value) => values['description'] = value;\n\n  void copyFrom(TodoValue model) {\n    id = model.id;\n    value = model.value;\n    todoId = model.todoId;\n    description = model.description;\n  }\n}\n\nclass TodoNoteQuery extends Query<TodoNote, TodoNoteQueryWhere> {\n  TodoNoteQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = TodoNoteQueryWhere(this);\n  }\n\n  @override\n  final TodoNoteQueryValues values = TodoNoteQueryValues();\n\n  List<String> _selectedFields = [];\n\n  TodoNoteQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'todo_note';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'note', 'todo_id', 'description'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  TodoNoteQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  TodoNoteQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  TodoNoteQueryWhere newWhereClause() {\n    return TodoNoteQueryWhere(this);\n  }\n\n  Optional<TodoNote> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = TodoNote(\n      id: fields.contains('id') ? mapToInt(row[0]) : 0,\n      note: fields.contains('note') ? (row[1] as String) : '',\n      todoId: fields.contains('todo_id') ? mapToInt(row[2]) : 0,\n      description: fields.contains('description') ? (row[3] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<TodoNote> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass TodoNoteQueryWhere extends QueryWhere {\n  TodoNoteQueryWhere(TodoNoteQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      note = StringSqlExpressionBuilder(query, 'note'),\n      todoId = NumericSqlExpressionBuilder<int>(query, 'todo_id'),\n      description = StringSqlExpressionBuilder(query, 'description');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder note;\n\n  final NumericSqlExpressionBuilder<int> todoId;\n\n  final StringSqlExpressionBuilder description;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, note, todoId, description];\n  }\n}\n\nclass TodoNoteQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  String get note {\n    return (values['note'] as String);\n  }\n\n  set note(String value) => values['note'] = value;\n\n  int get todoId {\n    return (values['todo_id'] as int);\n  }\n\n  set todoId(int value) => values['todo_id'] = value;\n\n  String? get description {\n    return (values['description'] as String?);\n  }\n\n  set description(String? value) => values['description'] = value;\n\n  void copyFrom(TodoNote model) {\n    id = model.id;\n    note = model.note;\n    todoId = model.todoId;\n    description = model.description;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass User implements UserEntity {\n  User({\n    required this.id,\n    required this.name,\n    this.todos = const [],\n    this.address = const [],\n  });\n\n  @override\n  int id;\n\n  @override\n  String name;\n\n  @override\n  List<UserTodoEntity> todos;\n\n  @override\n  List<UserAddressEntity> address;\n\n  User copyWith({\n    int? id,\n    String? name,\n    List<UserTodoEntity>? todos,\n    List<UserAddressEntity>? address,\n  }) {\n    return User(\n      id: id ?? this.id,\n      name: name ?? this.name,\n      todos: todos ?? this.todos,\n      address: address ?? this.address,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UserEntity &&\n        other.id == id &&\n        other.name == name &&\n        ListEquality<UserTodoEntity>(\n          DefaultEquality<UserTodoEntity>(),\n        ).equals(other.todos, todos) &&\n        ListEquality<UserAddressEntity>(\n          DefaultEquality<UserAddressEntity>(),\n        ).equals(other.address, address);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, name, todos, address]);\n  }\n\n  @override\n  String toString() {\n    return 'User(id=$id, name=$name, todos=$todos, address=$address)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UserSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass UserAddress implements UserAddressEntity {\n  UserAddress({required this.id, required this.userId, required this.address});\n\n  @override\n  int id;\n\n  @override\n  int userId;\n\n  @override\n  String address;\n\n  UserAddress copyWith({int? id, int? userId, String? address}) {\n    return UserAddress(\n      id: id ?? this.id,\n      userId: userId ?? this.userId,\n      address: address ?? this.address,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UserAddressEntity &&\n        other.id == id &&\n        other.userId == userId &&\n        other.address == address;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, userId, address]);\n  }\n\n  @override\n  String toString() {\n    return 'UserAddress(id=$id, userId=$userId, address=$address)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UserAddressSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass UserTodo implements UserTodoEntity {\n  UserTodo({\n    required this.id,\n    required this.userId,\n    required this.title,\n    this.todoValues = const [],\n    this.todoNotes = const [],\n  });\n\n  @override\n  int id;\n\n  @override\n  int userId;\n\n  @override\n  String title;\n\n  @override\n  List<TodoValueEntity> todoValues;\n\n  @override\n  List<TodoNoteEntity> todoNotes;\n\n  UserTodo copyWith({\n    int? id,\n    int? userId,\n    String? title,\n    List<TodoValueEntity>? todoValues,\n    List<TodoNoteEntity>? todoNotes,\n  }) {\n    return UserTodo(\n      id: id ?? this.id,\n      userId: userId ?? this.userId,\n      title: title ?? this.title,\n      todoValues: todoValues ?? this.todoValues,\n      todoNotes: todoNotes ?? this.todoNotes,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UserTodoEntity &&\n        other.id == id &&\n        other.userId == userId &&\n        other.title == title &&\n        ListEquality<TodoValueEntity>(\n          DefaultEquality<TodoValueEntity>(),\n        ).equals(other.todoValues, todoValues) &&\n        ListEquality<TodoNoteEntity>(\n          DefaultEquality<TodoNoteEntity>(),\n        ).equals(other.todoNotes, todoNotes);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, userId, title, todoValues, todoNotes]);\n  }\n\n  @override\n  String toString() {\n    return 'UserTodo(id=$id, userId=$userId, title=$title, todoValues=$todoValues, todoNotes=$todoNotes)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UserTodoSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass TodoValue implements TodoValueEntity {\n  TodoValue({\n    required this.id,\n    required this.value,\n    required this.todoId,\n    this.description,\n  });\n\n  @override\n  int id;\n\n  @override\n  String value;\n\n  @override\n  int todoId;\n\n  @override\n  String? description;\n\n  TodoValue copyWith({\n    int? id,\n    String? value,\n    int? todoId,\n    String? description,\n  }) {\n    return TodoValue(\n      id: id ?? this.id,\n      value: value ?? this.value,\n      todoId: todoId ?? this.todoId,\n      description: description ?? this.description,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is TodoValueEntity &&\n        other.id == id &&\n        other.value == value &&\n        other.todoId == todoId &&\n        other.description == description;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, value, todoId, description]);\n  }\n\n  @override\n  String toString() {\n    return 'TodoValue(id=$id, value=$value, todoId=$todoId, description=$description)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return TodoValueSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass TodoNote implements TodoNoteEntity {\n  TodoNote({\n    required this.id,\n    required this.note,\n    required this.todoId,\n    this.description,\n  });\n\n  @override\n  int id;\n\n  @override\n  String note;\n\n  @override\n  int todoId;\n\n  @override\n  String? description;\n\n  TodoNote copyWith({int? id, String? note, int? todoId, String? description}) {\n    return TodoNote(\n      id: id ?? this.id,\n      note: note ?? this.note,\n      todoId: todoId ?? this.todoId,\n      description: description ?? this.description,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is TodoNoteEntity &&\n        other.id == id &&\n        other.note == note &&\n        other.todoId == todoId &&\n        other.description == description;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, note, todoId, description]);\n  }\n\n  @override\n  String toString() {\n    return 'TodoNote(id=$id, note=$note, todoId=$todoId, description=$description)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return TodoNoteSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst UserSerializer userSerializer = UserSerializer();\n\nclass UserEncoder extends Converter<User, Map> {\n  const UserEncoder();\n\n  @override\n  Map convert(User model) => UserSerializer.toMap(model);\n}\n\nclass UserDecoder extends Converter<Map, User> {\n  const UserDecoder();\n\n  @override\n  User convert(Map map) => UserSerializer.fromMap(map);\n}\n\nclass UserSerializer extends Codec<User, Map> {\n  const UserSerializer();\n\n  @override\n  UserEncoder get encoder => const UserEncoder();\n\n  @override\n  UserDecoder get decoder => const UserDecoder();\n\n  static User fromMap(Map map) {\n    return User(\n      id: map['id'] as int,\n      name: map['name'] as String,\n      todos: map['todos'] is Iterable\n          ? List.unmodifiable(\n              ((map['todos'] as Iterable).whereType<Map>()).map(\n                UserTodoSerializer.fromMap,\n              ),\n            )\n          : [],\n      address: map['address'] is Iterable\n          ? List.unmodifiable(\n              ((map['address'] as Iterable).whereType<Map>()).map(\n                UserAddressSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(UserEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'name': model.name,\n      'todos': model.todos.map((m) => UserTodoSerializer.toMap(m)).toList(),\n      'address': model.address\n          .map((m) => UserAddressSerializer.toMap(m))\n          .toList(),\n    };\n  }\n}\n\nabstract class UserFields {\n  static const List<String> allFields = <String>[id, name, todos, address];\n\n  static const String id = 'id';\n\n  static const String name = 'name';\n\n  static const String todos = 'todos';\n\n  static const String address = 'address';\n}\n\nconst UserAddressSerializer userAddressSerializer = UserAddressSerializer();\n\nclass UserAddressEncoder extends Converter<UserAddress, Map> {\n  const UserAddressEncoder();\n\n  @override\n  Map convert(UserAddress model) => UserAddressSerializer.toMap(model);\n}\n\nclass UserAddressDecoder extends Converter<Map, UserAddress> {\n  const UserAddressDecoder();\n\n  @override\n  UserAddress convert(Map map) => UserAddressSerializer.fromMap(map);\n}\n\nclass UserAddressSerializer extends Codec<UserAddress, Map> {\n  const UserAddressSerializer();\n\n  @override\n  UserAddressEncoder get encoder => const UserAddressEncoder();\n\n  @override\n  UserAddressDecoder get decoder => const UserAddressDecoder();\n\n  static UserAddress fromMap(Map map) {\n    return UserAddress(\n      id: map['id'] as int,\n      userId: map['user_id'] as int,\n      address: map['address'] as String,\n    );\n  }\n\n  static Map<String, dynamic> toMap(UserAddressEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'id': model.id, 'user_id': model.userId, 'address': model.address};\n  }\n}\n\nabstract class UserAddressFields {\n  static const List<String> allFields = <String>[id, userId, address];\n\n  static const String id = 'id';\n\n  static const String userId = 'user_id';\n\n  static const String address = 'address';\n}\n\nconst UserTodoSerializer userTodoSerializer = UserTodoSerializer();\n\nclass UserTodoEncoder extends Converter<UserTodo, Map> {\n  const UserTodoEncoder();\n\n  @override\n  Map convert(UserTodo model) => UserTodoSerializer.toMap(model);\n}\n\nclass UserTodoDecoder extends Converter<Map, UserTodo> {\n  const UserTodoDecoder();\n\n  @override\n  UserTodo convert(Map map) => UserTodoSerializer.fromMap(map);\n}\n\nclass UserTodoSerializer extends Codec<UserTodo, Map> {\n  const UserTodoSerializer();\n\n  @override\n  UserTodoEncoder get encoder => const UserTodoEncoder();\n\n  @override\n  UserTodoDecoder get decoder => const UserTodoDecoder();\n\n  static UserTodo fromMap(Map map) {\n    return UserTodo(\n      id: map['id'] as int,\n      userId: map['user_id'] as int,\n      title: map['title'] as String,\n      todoValues: map['todo_values'] is Iterable\n          ? List.unmodifiable(\n              ((map['todo_values'] as Iterable).whereType<Map>()).map(\n                TodoValueSerializer.fromMap,\n              ),\n            )\n          : [],\n      todoNotes: map['todo_notes'] is Iterable\n          ? List.unmodifiable(\n              ((map['todo_notes'] as Iterable).whereType<Map>()).map(\n                TodoNoteSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(UserTodoEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'user_id': model.userId,\n      'title': model.title,\n      'todo_values': model.todoValues\n          .map((m) => TodoValueSerializer.toMap(m))\n          .toList(),\n      'todo_notes': model.todoNotes\n          .map((m) => TodoNoteSerializer.toMap(m))\n          .toList(),\n    };\n  }\n}\n\nabstract class UserTodoFields {\n  static const List<String> allFields = <String>[\n    id,\n    userId,\n    title,\n    todoValues,\n    todoNotes,\n  ];\n\n  static const String id = 'id';\n\n  static const String userId = 'user_id';\n\n  static const String title = 'title';\n\n  static const String todoValues = 'todo_values';\n\n  static const String todoNotes = 'todo_notes';\n}\n\nconst TodoValueSerializer todoValueSerializer = TodoValueSerializer();\n\nclass TodoValueEncoder extends Converter<TodoValue, Map> {\n  const TodoValueEncoder();\n\n  @override\n  Map convert(TodoValue model) => TodoValueSerializer.toMap(model);\n}\n\nclass TodoValueDecoder extends Converter<Map, TodoValue> {\n  const TodoValueDecoder();\n\n  @override\n  TodoValue convert(Map map) => TodoValueSerializer.fromMap(map);\n}\n\nclass TodoValueSerializer extends Codec<TodoValue, Map> {\n  const TodoValueSerializer();\n\n  @override\n  TodoValueEncoder get encoder => const TodoValueEncoder();\n\n  @override\n  TodoValueDecoder get decoder => const TodoValueDecoder();\n\n  static TodoValue fromMap(Map map) {\n    return TodoValue(\n      id: map['id'] as int,\n      value: map['value'] as String,\n      todoId: map['todo_id'] as int,\n      description: map['description'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(TodoValueEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'value': model.value,\n      'todo_id': model.todoId,\n      'description': model.description,\n    };\n  }\n}\n\nabstract class TodoValueFields {\n  static const List<String> allFields = <String>[\n    id,\n    value,\n    todoId,\n    description,\n  ];\n\n  static const String id = 'id';\n\n  static const String value = 'value';\n\n  static const String todoId = 'todo_id';\n\n  static const String description = 'description';\n}\n\nconst TodoNoteSerializer todoNoteSerializer = TodoNoteSerializer();\n\nclass TodoNoteEncoder extends Converter<TodoNote, Map> {\n  const TodoNoteEncoder();\n\n  @override\n  Map convert(TodoNote model) => TodoNoteSerializer.toMap(model);\n}\n\nclass TodoNoteDecoder extends Converter<Map, TodoNote> {\n  const TodoNoteDecoder();\n\n  @override\n  TodoNote convert(Map map) => TodoNoteSerializer.fromMap(map);\n}\n\nclass TodoNoteSerializer extends Codec<TodoNote, Map> {\n  const TodoNoteSerializer();\n\n  @override\n  TodoNoteEncoder get encoder => const TodoNoteEncoder();\n\n  @override\n  TodoNoteDecoder get decoder => const TodoNoteDecoder();\n\n  static TodoNote fromMap(Map map) {\n    return TodoNote(\n      id: map['id'] as int,\n      note: map['note'] as String,\n      todoId: map['todo_id'] as int,\n      description: map['description'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(TodoNoteEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'note': model.note,\n      'todo_id': model.todoId,\n      'description': model.description,\n    };\n  }\n}\n\nabstract class TodoNoteFields {\n  static const List<String> allFields = <String>[id, note, todoId, description];\n\n  static const String id = 'id';\n\n  static const String note = 'note';\n\n  static const String todoId = 'todo_id';\n\n  static const String description = 'description';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/tree.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'tree.g.dart';\n\n@serializable\n@orm\nclass TreeEntity extends Model {\n  @Column(indexType: IndexType.unique, type: ColumnType.smallInt)\n  int? rings;\n\n  @hasMany\n  List<FruitEntity> fruits = [];\n}\n\n@serializable\n@orm\nclass FruitEntity extends Model {\n  int? treeId;\n  String? commonName;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/tree.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'tree.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass TreeMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('trees', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('rings').unique();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('trees', cascade: true);\n  }\n}\n\nclass FruitMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('fruits', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('tree_id');\n      table.varChar('common_name', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('fruits');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass TreeQuery extends Query<Tree, TreeQueryWhere> {\n  TreeQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = TreeQueryWhere(this);\n    leftJoin(\n      _fruits = FruitQuery(trampoline: trampoline, parent: this),\n      'id',\n      'tree_id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'tree_id',\n        'common_name',\n      ],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final TreeQueryValues values = TreeQueryValues();\n\n  List<String> _selectedFields = [];\n\n  TreeQueryWhere? _where;\n\n  late FruitQuery _fruits;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'trees';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'rings'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  TreeQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  TreeQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  TreeQueryWhere newWhereClause() {\n    return TreeQueryWhere(this);\n  }\n\n  Optional<Tree> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Tree(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      rings: fields.contains('rings') ? mapToInt(row[3]) : null,\n    );\n    if (row.length > 4) {\n      var modelOpt = FruitQuery().parseRow(row.skip(4).take(5).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(fruits: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Tree> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  FruitQuery get fruits {\n    return _fruits;\n  }\n\n  @override\n  Future<List<Tree>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<Tree>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              fruits: List<FruitEntity>.from(l.fruits)..addAll(model.fruits),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Tree>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<Tree>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              fruits: List<FruitEntity>.from(l.fruits)..addAll(model.fruits),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Tree>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<Tree>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              fruits: List<FruitEntity>.from(l.fruits)..addAll(model.fruits),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass TreeQueryWhere extends QueryWhere {\n  TreeQueryWhere(TreeQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      rings = NumericSqlExpressionBuilder<int>(query, 'rings');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> rings;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, rings];\n  }\n}\n\nclass TreeQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int? get rings {\n    return (values['rings'] as int?);\n  }\n\n  set rings(int? value) => values['rings'] = value;\n\n  void copyFrom(Tree model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    rings = model.rings;\n  }\n}\n\nclass FruitQuery extends Query<Fruit, FruitQueryWhere> {\n  FruitQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = FruitQueryWhere(this);\n  }\n\n  @override\n  final FruitQueryValues values = FruitQueryValues();\n\n  List<String> _selectedFields = [];\n\n  FruitQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'fruits';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'tree_id',\n      'common_name',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  FruitQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  FruitQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  FruitQueryWhere newWhereClause() {\n    return FruitQueryWhere(this);\n  }\n\n  Optional<Fruit> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Fruit(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      treeId: fields.contains('tree_id') ? mapToInt(row[3]) : null,\n      commonName: fields.contains('common_name') ? (row[4] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Fruit> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass FruitQueryWhere extends QueryWhere {\n  FruitQueryWhere(FruitQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      treeId = NumericSqlExpressionBuilder<int>(query, 'tree_id'),\n      commonName = StringSqlExpressionBuilder(query, 'common_name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> treeId;\n\n  final StringSqlExpressionBuilder commonName;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, treeId, commonName];\n  }\n}\n\nclass FruitQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int? get treeId {\n    return (values['tree_id'] as int?);\n  }\n\n  set treeId(int? value) => values['tree_id'] = value;\n\n  String? get commonName {\n    return (values['common_name'] as String?);\n  }\n\n  set commonName(String? value) => values['common_name'] = value;\n\n  void copyFrom(Fruit model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    treeId = model.treeId;\n    commonName = model.commonName;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Tree extends TreeEntity {\n  Tree({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.rings,\n    List<FruitEntity> fruits = const [],\n  }) : fruits = List.unmodifiable(fruits);\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? rings;\n\n  @override\n  List<FruitEntity> fruits;\n\n  Tree copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? rings,\n    List<FruitEntity>? fruits,\n  }) {\n    return Tree(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      rings: rings ?? this.rings,\n      fruits: fruits ?? this.fruits,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is TreeEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.rings == rings &&\n        ListEquality<FruitEntity>(\n          DefaultEquality<FruitEntity>(),\n        ).equals(other.fruits, fruits);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, rings, fruits]);\n  }\n\n  @override\n  String toString() {\n    return 'Tree(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, rings=$rings, fruits=$fruits)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return TreeSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Fruit extends FruitEntity {\n  Fruit({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.treeId,\n    this.commonName,\n  });\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? treeId;\n\n  @override\n  String? commonName;\n\n  Fruit copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? treeId,\n    String? commonName,\n  }) {\n    return Fruit(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      treeId: treeId ?? this.treeId,\n      commonName: commonName ?? this.commonName,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is FruitEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.treeId == treeId &&\n        other.commonName == commonName;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, treeId, commonName]);\n  }\n\n  @override\n  String toString() {\n    return 'Fruit(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, treeId=$treeId, commonName=$commonName)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return FruitSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst TreeSerializer treeSerializer = TreeSerializer();\n\nclass TreeEncoder extends Converter<Tree, Map> {\n  const TreeEncoder();\n\n  @override\n  Map convert(Tree model) => TreeSerializer.toMap(model);\n}\n\nclass TreeDecoder extends Converter<Map, Tree> {\n  const TreeDecoder();\n\n  @override\n  Tree convert(Map map) => TreeSerializer.fromMap(map);\n}\n\nclass TreeSerializer extends Codec<Tree, Map> {\n  const TreeSerializer();\n\n  @override\n  TreeEncoder get encoder => const TreeEncoder();\n\n  @override\n  TreeDecoder get decoder => const TreeDecoder();\n\n  static Tree fromMap(Map map) {\n    return Tree(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      rings: map['rings'] as int?,\n      fruits: map['fruits'] is Iterable\n          ? List.unmodifiable(\n              ((map['fruits'] as Iterable).whereType<Map>()).map(\n                FruitSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(TreeEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'rings': model.rings,\n      'fruits': model.fruits.map((m) => FruitSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class TreeFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    rings,\n    fruits,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String rings = 'rings';\n\n  static const String fruits = 'fruits';\n}\n\nconst FruitSerializer fruitSerializer = FruitSerializer();\n\nclass FruitEncoder extends Converter<Fruit, Map> {\n  const FruitEncoder();\n\n  @override\n  Map convert(Fruit model) => FruitSerializer.toMap(model);\n}\n\nclass FruitDecoder extends Converter<Map, Fruit> {\n  const FruitDecoder();\n\n  @override\n  Fruit convert(Map map) => FruitSerializer.fromMap(map);\n}\n\nclass FruitSerializer extends Codec<Fruit, Map> {\n  const FruitSerializer();\n\n  @override\n  FruitEncoder get encoder => const FruitEncoder();\n\n  @override\n  FruitDecoder get decoder => const FruitDecoder();\n\n  static Fruit fromMap(Map map) {\n    return Fruit(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      treeId: map['tree_id'] as int?,\n      commonName: map['common_name'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(FruitEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'tree_id': model.treeId,\n      'common_name': model.commonName,\n    };\n  }\n}\n\nabstract class FruitFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    treeId,\n    commonName,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String treeId = 'tree_id';\n\n  static const String commonName = 'common_name';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/unorthodox.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'unorthodox.g.dart';\n\n@serializable\n@orm\nabstract class UnorthodoxEntity {\n  @Column(indexType: IndexType.primaryKey)\n  String? get name;\n}\n\n@serializable\n@orm\nabstract class WeirdJoinEntity {\n  @primaryKey\n  int get id;\n\n  @BelongsTo(localKey: 'join_name', foreignKey: 'name')\n  UnorthodoxEntity? get unorthodox;\n\n  @hasOne\n  SongEntity? get song;\n\n  @HasMany(foreignKey: 'parent')\n  List<NumbaEntity> get numbas;\n\n  @ManyToMany(FooPivotEntity)\n  List<FooEntity> get foos;\n}\n\n@serializable\n@orm\nabstract class SongEntity extends Model {\n  int? get weirdJoinId;\n\n  String? get title;\n}\n\n@serializable\n@orm\nclass NumbaEntity implements Comparable<NumbaEntity> {\n  //@primaryKey\n  //int i = -1;\n  int? i;\n\n  int? parent;\n\n  @override\n  int compareTo(NumbaEntity other) => i!.compareTo(other.i!);\n}\n\n@serializable\n@orm\nabstract class FooEntity {\n  @primaryKey\n  String? get bar;\n\n  @ManyToMany(FooPivotEntity)\n  List<WeirdJoinEntity> get weirdJoins;\n}\n\n@serializable\n@orm\nabstract class FooPivotEntity {\n  @belongsTo\n  WeirdJoinEntity? get weirdJoin;\n\n  @belongsTo\n  FooEntity? get foo;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/unorthodox.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'unorthodox.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass UnorthodoxMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('unorthodoxes', (table) {\n      table.varChar('name', length: 255).primaryKey();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('unorthodoxes');\n  }\n}\n\nclass WeirdJoinMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('weird_joins', (table) {\n      table.integer('id').primaryKey();\n      table\n          .declare('join_name', ColumnType('varchar'))\n          .references('unorthodoxes', 'name');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('weird_joins', cascade: true);\n  }\n}\n\nclass SongMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('songs', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.integer('weird_join_id');\n      table.varChar('title', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('songs');\n  }\n}\n\nclass NumbaMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('numbas', (table) {\n      table.integer('i');\n      table.integer('parent');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('numbas');\n  }\n}\n\nclass FooMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('foos', (table) {\n      table.varChar('bar', length: 255).primaryKey();\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('foos', cascade: true);\n  }\n}\n\nclass FooPivotMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('foo_pivots', (table) {\n      table\n          .declare('weird_join_id', ColumnType('int'))\n          .references('weird_joins', 'id');\n      table.declare('foo_bar', ColumnType('varchar')).references('foos', 'bar');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('foo_pivots');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass UnorthodoxQuery extends Query<Unorthodox, UnorthodoxQueryWhere> {\n  UnorthodoxQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UnorthodoxQueryWhere(this);\n  }\n\n  @override\n  final UnorthodoxQueryValues values = UnorthodoxQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UnorthodoxQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'unorthodoxes';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['name'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UnorthodoxQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UnorthodoxQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UnorthodoxQueryWhere newWhereClause() {\n    return UnorthodoxQueryWhere(this);\n  }\n\n  Optional<Unorthodox> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Unorthodox(\n      name: fields.contains('name') ? (row[0] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Unorthodox> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass UnorthodoxQueryWhere extends QueryWhere {\n  UnorthodoxQueryWhere(UnorthodoxQuery query)\n    : name = StringSqlExpressionBuilder(query, 'name');\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [name];\n  }\n}\n\nclass UnorthodoxQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  void copyFrom(Unorthodox model) {\n    name = model.name;\n  }\n}\n\nclass WeirdJoinQuery extends Query<WeirdJoin, WeirdJoinQueryWhere> {\n  WeirdJoinQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = WeirdJoinQueryWhere(this);\n    leftJoin(\n      _unorthodox = UnorthodoxQuery(trampoline: trampoline, parent: this),\n      'join_name',\n      'name',\n      additionalFields: const ['name'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _song = SongQuery(trampoline: trampoline, parent: this),\n      'id',\n      'weird_join_id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'weird_join_id',\n        'title',\n      ],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _numbas = NumbaQuery(trampoline: trampoline, parent: this),\n      'id',\n      'parent',\n      additionalFields: const ['i', 'parent'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      '(SELECT foo_pivots.weird_join_id, foos.bar FROM foos LEFT JOIN foo_pivots ON foo_pivots.foo_bar=foos.bar)',\n      'id',\n      'weird_join_id',\n      additionalFields: const ['bar'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final WeirdJoinQueryValues values = WeirdJoinQueryValues();\n\n  List<String> _selectedFields = [];\n\n  WeirdJoinQueryWhere? _where;\n\n  late UnorthodoxQuery _unorthodox;\n\n  late SongQuery _song;\n\n  late NumbaQuery _numbas;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'weird_joins';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'join_name'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  WeirdJoinQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  WeirdJoinQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  WeirdJoinQueryWhere newWhereClause() {\n    return WeirdJoinQueryWhere(this);\n  }\n\n  Optional<WeirdJoin> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = WeirdJoin(id: fields.contains('id') ? mapToInt(row[0]) : 0);\n    if (row.length > 2) {\n      var modelOpt = UnorthodoxQuery().parseRow(row.skip(2).take(1).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(unorthodox: m);\n      });\n    }\n    if (row.length > 3) {\n      var modelOpt = SongQuery().parseRow(row.skip(3).take(5).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(song: m);\n      });\n    }\n    if (row.length > 8) {\n      var modelOpt = NumbaQuery().parseRow(row.skip(8).take(2).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(numbas: [m]);\n      });\n    }\n    if (row.length > 10) {\n      var modelOpt = FooQuery().parseRow(row.skip(10).take(1).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(foos: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<WeirdJoin> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  UnorthodoxQuery get unorthodox {\n    return _unorthodox;\n  }\n\n  SongQuery get song {\n    return _song;\n  }\n\n  NumbaQuery get numbas {\n    return _numbas;\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('weird_joins') &&\n        trampoline.contains('foo_pivots')));\n  }\n\n  @override\n  Future<List<WeirdJoin>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<WeirdJoin>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              numbas: List<NumbaEntity>.from(l.numbas)..addAll(model.numbas),\n              foos: List<FooEntity>.from(l.foos)..addAll(model.foos),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<WeirdJoin>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<WeirdJoin>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              numbas: List<NumbaEntity>.from(l.numbas)..addAll(model.numbas),\n              foos: List<FooEntity>.from(l.foos)..addAll(model.foos),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<WeirdJoin>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<WeirdJoin>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              numbas: List<NumbaEntity>.from(l.numbas)..addAll(model.numbas),\n              foos: List<FooEntity>.from(l.foos)..addAll(model.foos),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass WeirdJoinQueryWhere extends QueryWhere {\n  WeirdJoinQueryWhere(WeirdJoinQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      joinName = StringSqlExpressionBuilder(query, 'join_name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder joinName;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, joinName];\n  }\n}\n\nclass WeirdJoinQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get id {\n    return (values['id'] as int);\n  }\n\n  set id(int value) => values['id'] = value;\n\n  String? get joinName {\n    return (values['join_name'] as String?);\n  }\n\n  set joinName(String? value) => values['join_name'] = value;\n\n  void copyFrom(WeirdJoin model) {\n    id = model.id;\n    if (model.unorthodox != null) {\n      values['join_name'] = model.unorthodox?.name;\n    }\n  }\n}\n\nclass SongQuery extends Query<Song, SongQueryWhere> {\n  SongQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = SongQueryWhere(this);\n  }\n\n  @override\n  final SongQueryValues values = SongQueryValues();\n\n  List<String> _selectedFields = [];\n\n  SongQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'songs';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'weird_join_id',\n      'title',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  SongQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  SongQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  SongQueryWhere newWhereClause() {\n    return SongQueryWhere(this);\n  }\n\n  Optional<Song> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Song(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      weirdJoinId: fields.contains('weird_join_id') ? mapToInt(row[3]) : null,\n      title: fields.contains('title') ? (row[4] as String?) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Song> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass SongQueryWhere extends QueryWhere {\n  SongQueryWhere(SongQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      weirdJoinId = NumericSqlExpressionBuilder<int>(query, 'weird_join_id'),\n      title = StringSqlExpressionBuilder(query, 'title');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final NumericSqlExpressionBuilder<int> weirdJoinId;\n\n  final StringSqlExpressionBuilder title;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, weirdJoinId, title];\n  }\n}\n\nclass SongQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  int? get weirdJoinId {\n    return (values['weird_join_id'] as int?);\n  }\n\n  set weirdJoinId(int? value) => values['weird_join_id'] = value;\n\n  String? get title {\n    return (values['title'] as String?);\n  }\n\n  set title(String? value) => values['title'] = value;\n\n  void copyFrom(Song model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    weirdJoinId = model.weirdJoinId;\n    title = model.title;\n  }\n}\n\nclass NumbaQuery extends Query<Numba, NumbaQueryWhere> {\n  NumbaQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = NumbaQueryWhere(this);\n  }\n\n  @override\n  final NumbaQueryValues values = NumbaQueryValues();\n\n  List<String> _selectedFields = [];\n\n  NumbaQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'numbas';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['i', 'parent'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  NumbaQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  NumbaQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  NumbaQueryWhere newWhereClause() {\n    return NumbaQueryWhere(this);\n  }\n\n  Optional<Numba> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Numba(\n      i: fields.contains('i') ? mapToInt(row[0]) : null,\n      parent: fields.contains('parent') ? mapToInt(row[1]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Numba> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass NumbaQueryWhere extends QueryWhere {\n  NumbaQueryWhere(NumbaQuery query)\n    : i = NumericSqlExpressionBuilder<int>(query, 'i'),\n      parent = NumericSqlExpressionBuilder<int>(query, 'parent');\n\n  final NumericSqlExpressionBuilder<int> i;\n\n  final NumericSqlExpressionBuilder<int> parent;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [i, parent];\n  }\n}\n\nclass NumbaQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int? get i {\n    return (values['i'] as int?);\n  }\n\n  set i(int? value) => values['i'] = value;\n\n  int? get parent {\n    return (values['parent'] as int?);\n  }\n\n  set parent(int? value) => values['parent'] = value;\n\n  void copyFrom(Numba model) {\n    i = model.i;\n    parent = model.parent;\n  }\n}\n\nclass FooQuery extends Query<Foo, FooQueryWhere> {\n  FooQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = FooQueryWhere(this);\n    leftJoin(\n      '(SELECT foo_pivots.foo_bar, weird_joins.id, weird_joins.join_name FROM weird_joins LEFT JOIN foo_pivots ON foo_pivots.weird_join_id=weird_joins.id)',\n      'bar',\n      'foo_bar',\n      additionalFields: const ['id', 'join_name'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final FooQueryValues values = FooQueryValues();\n\n  List<String> _selectedFields = [];\n\n  FooQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'foos';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['bar'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  FooQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  FooQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  FooQueryWhere newWhereClause() {\n    return FooQueryWhere(this);\n  }\n\n  Optional<Foo> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Foo(bar: fields.contains('bar') ? (row[0] as String?) : null);\n    if (row.length > 1) {\n      var modelOpt = WeirdJoinQuery().parseRow(row.skip(1).take(2).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(weirdJoins: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Foo> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('foos') &&\n        trampoline.contains('foo_pivots')));\n  }\n\n  @override\n  Future<List<Foo>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<Foo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.bar == model.bar);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              weirdJoins: List<WeirdJoinEntity>.from(l.weirdJoins)\n                ..addAll(model.weirdJoins),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Foo>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<Foo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.bar == model.bar);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              weirdJoins: List<WeirdJoinEntity>.from(l.weirdJoins)\n                ..addAll(model.weirdJoins),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Foo>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<Foo>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.bar == model.bar);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              weirdJoins: List<WeirdJoinEntity>.from(l.weirdJoins)\n                ..addAll(model.weirdJoins),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass FooQueryWhere extends QueryWhere {\n  FooQueryWhere(FooQuery query)\n    : bar = StringSqlExpressionBuilder(query, 'bar');\n\n  final StringSqlExpressionBuilder bar;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [bar];\n  }\n}\n\nclass FooQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get bar {\n    return (values['bar'] as String?);\n  }\n\n  set bar(String? value) => values['bar'] = value;\n\n  void copyFrom(Foo model) {\n    bar = model.bar;\n  }\n}\n\nclass FooPivotQuery extends Query<FooPivot, FooPivotQueryWhere> {\n  FooPivotQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = FooPivotQueryWhere(this);\n    leftJoin(\n      _weirdJoin = WeirdJoinQuery(trampoline: trampoline, parent: this),\n      'weird_join_id',\n      'id',\n      additionalFields: const ['id', 'join_name'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _foo = FooQuery(trampoline: trampoline, parent: this),\n      'foo_bar',\n      'bar',\n      additionalFields: const ['bar'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final FooPivotQueryValues values = FooPivotQueryValues();\n\n  List<String> _selectedFields = [];\n\n  FooPivotQueryWhere? _where;\n\n  late WeirdJoinQuery _weirdJoin;\n\n  late FooQuery _foo;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'foo_pivots';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['weird_join_id', 'foo_bar'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  FooPivotQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  FooPivotQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  FooPivotQueryWhere newWhereClause() {\n    return FooPivotQueryWhere(this);\n  }\n\n  Optional<FooPivot> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = FooPivot();\n    if (row.length > 2) {\n      var modelOpt = WeirdJoinQuery().parseRow(row.skip(2).take(2).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(weirdJoin: m);\n      });\n    }\n    if (row.length > 4) {\n      var modelOpt = FooQuery().parseRow(row.skip(4).take(1).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(foo: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<FooPivot> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  WeirdJoinQuery get weirdJoin {\n    return _weirdJoin;\n  }\n\n  FooQuery get foo {\n    return _foo;\n  }\n}\n\nclass FooPivotQueryWhere extends QueryWhere {\n  FooPivotQueryWhere(FooPivotQuery query)\n    : weirdJoinId = NumericSqlExpressionBuilder<int>(query, 'weird_join_id'),\n      fooBar = StringSqlExpressionBuilder(query, 'foo_bar');\n\n  final NumericSqlExpressionBuilder<int> weirdJoinId;\n\n  final StringSqlExpressionBuilder fooBar;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [weirdJoinId, fooBar];\n  }\n}\n\nclass FooPivotQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get weirdJoinId {\n    return (values['weird_join_id'] as int);\n  }\n\n  set weirdJoinId(int value) => values['weird_join_id'] = value;\n\n  String? get fooBar {\n    return (values['foo_bar'] as String?);\n  }\n\n  set fooBar(String? value) => values['foo_bar'] = value;\n\n  void copyFrom(FooPivot model) {\n    if (model.weirdJoin != null) {\n      values['weird_join_id'] = model.weirdJoin?.id;\n    }\n    if (model.foo != null) {\n      values['foo_bar'] = model.foo?.bar;\n    }\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Unorthodox implements UnorthodoxEntity {\n  Unorthodox({this.name});\n\n  @override\n  String? name;\n\n  Unorthodox copyWith({String? name}) {\n    return Unorthodox(name: name ?? this.name);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UnorthodoxEntity && other.name == name;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([name]);\n  }\n\n  @override\n  String toString() {\n    return 'Unorthodox(name=$name)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UnorthodoxSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass WeirdJoin implements WeirdJoinEntity {\n  WeirdJoin({\n    required this.id,\n    this.unorthodox,\n    this.song,\n    this.numbas = const [],\n    this.foos = const [],\n  });\n\n  @override\n  int id;\n\n  @override\n  UnorthodoxEntity? unorthodox;\n\n  @override\n  SongEntity? song;\n\n  @override\n  List<NumbaEntity> numbas;\n\n  @override\n  List<FooEntity> foos;\n\n  WeirdJoin copyWith({\n    int? id,\n    UnorthodoxEntity? unorthodox,\n    SongEntity? song,\n    List<NumbaEntity>? numbas,\n    List<FooEntity>? foos,\n  }) {\n    return WeirdJoin(\n      id: id ?? this.id,\n      unorthodox: unorthodox ?? this.unorthodox,\n      song: song ?? this.song,\n      numbas: numbas ?? this.numbas,\n      foos: foos ?? this.foos,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is WeirdJoinEntity &&\n        other.id == id &&\n        other.unorthodox == unorthodox &&\n        other.song == song &&\n        ListEquality<NumbaEntity>(\n          DefaultEquality<NumbaEntity>(),\n        ).equals(other.numbas, numbas) &&\n        ListEquality<FooEntity>(\n          DefaultEquality<FooEntity>(),\n        ).equals(other.foos, foos);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, unorthodox, song, numbas, foos]);\n  }\n\n  @override\n  String toString() {\n    return 'WeirdJoin(id=$id, unorthodox=$unorthodox, song=$song, numbas=$numbas, foos=$foos)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return WeirdJoinSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Song extends SongEntity {\n  Song({this.id, this.createdAt, this.updatedAt, this.weirdJoinId, this.title});\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  int? weirdJoinId;\n\n  @override\n  String? title;\n\n  Song copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    int? weirdJoinId,\n    String? title,\n  }) {\n    return Song(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      weirdJoinId: weirdJoinId ?? this.weirdJoinId,\n      title: title ?? this.title,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is SongEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.weirdJoinId == weirdJoinId &&\n        other.title == title;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, weirdJoinId, title]);\n  }\n\n  @override\n  String toString() {\n    return 'Song(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, weirdJoinId=$weirdJoinId, title=$title)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return SongSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Numba extends NumbaEntity {\n  Numba({this.i, this.parent});\n\n  @override\n  int? i;\n\n  @override\n  int? parent;\n\n  Numba copyWith({int? i, int? parent}) {\n    return Numba(i: i ?? this.i, parent: parent ?? this.parent);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is NumbaEntity && other.i == i && other.parent == parent;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([i, parent]);\n  }\n\n  @override\n  String toString() {\n    return 'Numba(i=$i, parent=$parent)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return NumbaSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Foo implements FooEntity {\n  Foo({this.bar, this.weirdJoins = const []});\n\n  @override\n  String? bar;\n\n  @override\n  List<WeirdJoinEntity> weirdJoins;\n\n  Foo copyWith({String? bar, List<WeirdJoinEntity>? weirdJoins}) {\n    return Foo(bar: bar ?? this.bar, weirdJoins: weirdJoins ?? this.weirdJoins);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is FooEntity &&\n        other.bar == bar &&\n        ListEquality<WeirdJoinEntity>(\n          DefaultEquality<WeirdJoinEntity>(),\n        ).equals(other.weirdJoins, weirdJoins);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([bar, weirdJoins]);\n  }\n\n  @override\n  String toString() {\n    return 'Foo(bar=$bar, weirdJoins=$weirdJoins)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return FooSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass FooPivot implements FooPivotEntity {\n  FooPivot({this.weirdJoin, this.foo});\n\n  @override\n  WeirdJoinEntity? weirdJoin;\n\n  @override\n  FooEntity? foo;\n\n  FooPivot copyWith({WeirdJoinEntity? weirdJoin, FooEntity? foo}) {\n    return FooPivot(\n      weirdJoin: weirdJoin ?? this.weirdJoin,\n      foo: foo ?? this.foo,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is FooPivotEntity &&\n        other.weirdJoin == weirdJoin &&\n        other.foo == foo;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([weirdJoin, foo]);\n  }\n\n  @override\n  String toString() {\n    return 'FooPivot(weirdJoin=$weirdJoin, foo=$foo)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return FooPivotSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst UnorthodoxSerializer unorthodoxSerializer = UnorthodoxSerializer();\n\nclass UnorthodoxEncoder extends Converter<Unorthodox, Map> {\n  const UnorthodoxEncoder();\n\n  @override\n  Map convert(Unorthodox model) => UnorthodoxSerializer.toMap(model);\n}\n\nclass UnorthodoxDecoder extends Converter<Map, Unorthodox> {\n  const UnorthodoxDecoder();\n\n  @override\n  Unorthodox convert(Map map) => UnorthodoxSerializer.fromMap(map);\n}\n\nclass UnorthodoxSerializer extends Codec<Unorthodox, Map> {\n  const UnorthodoxSerializer();\n\n  @override\n  UnorthodoxEncoder get encoder => const UnorthodoxEncoder();\n\n  @override\n  UnorthodoxDecoder get decoder => const UnorthodoxDecoder();\n\n  static Unorthodox fromMap(Map map) {\n    return Unorthodox(name: map['name'] as String?);\n  }\n\n  static Map<String, dynamic> toMap(UnorthodoxEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'name': model.name};\n  }\n}\n\nabstract class UnorthodoxFields {\n  static const List<String> allFields = <String>[name];\n\n  static const String name = 'name';\n}\n\nconst WeirdJoinSerializer weirdJoinSerializer = WeirdJoinSerializer();\n\nclass WeirdJoinEncoder extends Converter<WeirdJoin, Map> {\n  const WeirdJoinEncoder();\n\n  @override\n  Map convert(WeirdJoin model) => WeirdJoinSerializer.toMap(model);\n}\n\nclass WeirdJoinDecoder extends Converter<Map, WeirdJoin> {\n  const WeirdJoinDecoder();\n\n  @override\n  WeirdJoin convert(Map map) => WeirdJoinSerializer.fromMap(map);\n}\n\nclass WeirdJoinSerializer extends Codec<WeirdJoin, Map> {\n  const WeirdJoinSerializer();\n\n  @override\n  WeirdJoinEncoder get encoder => const WeirdJoinEncoder();\n\n  @override\n  WeirdJoinDecoder get decoder => const WeirdJoinDecoder();\n\n  static WeirdJoin fromMap(Map map) {\n    return WeirdJoin(\n      id: map['id'] as int,\n      unorthodox: map['unorthodox'] != null\n          ? UnorthodoxSerializer.fromMap(map['unorthodox'] as Map)\n          : null,\n      song: map['song'] != null\n          ? SongSerializer.fromMap(map['song'] as Map)\n          : null,\n      numbas: map['numbas'] is Iterable\n          ? List.unmodifiable(\n              ((map['numbas'] as Iterable).whereType<Map>()).map(\n                NumbaSerializer.fromMap,\n              ),\n            )\n          : [],\n      foos: map['foos'] is Iterable\n          ? List.unmodifiable(\n              ((map['foos'] as Iterable).whereType<Map>()).map(\n                FooSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(WeirdJoinEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'unorthodox': UnorthodoxSerializer.toMap(model.unorthodox),\n      'song': SongSerializer.toMap(model.song),\n      'numbas': model.numbas.map((m) => NumbaSerializer.toMap(m)).toList(),\n      'foos': model.foos.map((m) => FooSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class WeirdJoinFields {\n  static const List<String> allFields = <String>[\n    id,\n    unorthodox,\n    song,\n    numbas,\n    foos,\n  ];\n\n  static const String id = 'id';\n\n  static const String unorthodox = 'unorthodox';\n\n  static const String song = 'song';\n\n  static const String numbas = 'numbas';\n\n  static const String foos = 'foos';\n}\n\nconst SongSerializer songSerializer = SongSerializer();\n\nclass SongEncoder extends Converter<Song, Map> {\n  const SongEncoder();\n\n  @override\n  Map convert(Song model) => SongSerializer.toMap(model);\n}\n\nclass SongDecoder extends Converter<Map, Song> {\n  const SongDecoder();\n\n  @override\n  Song convert(Map map) => SongSerializer.fromMap(map);\n}\n\nclass SongSerializer extends Codec<Song, Map> {\n  const SongSerializer();\n\n  @override\n  SongEncoder get encoder => const SongEncoder();\n\n  @override\n  SongDecoder get decoder => const SongDecoder();\n\n  static Song fromMap(Map map) {\n    return Song(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      weirdJoinId: map['weird_join_id'] as int?,\n      title: map['title'] as String?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(SongEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'weird_join_id': model.weirdJoinId,\n      'title': model.title,\n    };\n  }\n}\n\nabstract class SongFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    weirdJoinId,\n    title,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String weirdJoinId = 'weird_join_id';\n\n  static const String title = 'title';\n}\n\nconst NumbaSerializer numbaSerializer = NumbaSerializer();\n\nclass NumbaEncoder extends Converter<Numba, Map> {\n  const NumbaEncoder();\n\n  @override\n  Map convert(Numba model) => NumbaSerializer.toMap(model);\n}\n\nclass NumbaDecoder extends Converter<Map, Numba> {\n  const NumbaDecoder();\n\n  @override\n  Numba convert(Map map) => NumbaSerializer.fromMap(map);\n}\n\nclass NumbaSerializer extends Codec<Numba, Map> {\n  const NumbaSerializer();\n\n  @override\n  NumbaEncoder get encoder => const NumbaEncoder();\n\n  @override\n  NumbaDecoder get decoder => const NumbaDecoder();\n\n  static Numba fromMap(Map map) {\n    return Numba(i: map['i'] as int?, parent: map['parent'] as int?);\n  }\n\n  static Map<String, dynamic> toMap(NumbaEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'i': model.i, 'parent': model.parent};\n  }\n}\n\nabstract class NumbaFields {\n  static const List<String> allFields = <String>[i, parent];\n\n  static const String i = 'i';\n\n  static const String parent = 'parent';\n}\n\nconst FooSerializer fooSerializer = FooSerializer();\n\nclass FooEncoder extends Converter<Foo, Map> {\n  const FooEncoder();\n\n  @override\n  Map convert(Foo model) => FooSerializer.toMap(model);\n}\n\nclass FooDecoder extends Converter<Map, Foo> {\n  const FooDecoder();\n\n  @override\n  Foo convert(Map map) => FooSerializer.fromMap(map);\n}\n\nclass FooSerializer extends Codec<Foo, Map> {\n  const FooSerializer();\n\n  @override\n  FooEncoder get encoder => const FooEncoder();\n\n  @override\n  FooDecoder get decoder => const FooDecoder();\n\n  static Foo fromMap(Map map) {\n    return Foo(\n      bar: map['bar'] as String?,\n      weirdJoins: map['weird_joins'] is Iterable\n          ? List.unmodifiable(\n              ((map['weird_joins'] as Iterable).whereType<Map>()).map(\n                WeirdJoinSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(FooEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'bar': model.bar,\n      'weird_joins': model.weirdJoins\n          .map((m) => WeirdJoinSerializer.toMap(m))\n          .toList(),\n    };\n  }\n}\n\nabstract class FooFields {\n  static const List<String> allFields = <String>[bar, weirdJoins];\n\n  static const String bar = 'bar';\n\n  static const String weirdJoins = 'weird_joins';\n}\n\nconst FooPivotSerializer fooPivotSerializer = FooPivotSerializer();\n\nclass FooPivotEncoder extends Converter<FooPivot, Map> {\n  const FooPivotEncoder();\n\n  @override\n  Map convert(FooPivot model) => FooPivotSerializer.toMap(model);\n}\n\nclass FooPivotDecoder extends Converter<Map, FooPivot> {\n  const FooPivotDecoder();\n\n  @override\n  FooPivot convert(Map map) => FooPivotSerializer.fromMap(map);\n}\n\nclass FooPivotSerializer extends Codec<FooPivot, Map> {\n  const FooPivotSerializer();\n\n  @override\n  FooPivotEncoder get encoder => const FooPivotEncoder();\n\n  @override\n  FooPivotDecoder get decoder => const FooPivotDecoder();\n\n  static FooPivot fromMap(Map map) {\n    return FooPivot(\n      weirdJoin: map['weird_join'] != null\n          ? WeirdJoinSerializer.fromMap(map['weird_join'] as Map)\n          : null,\n      foo: map['foo'] != null ? FooSerializer.fromMap(map['foo'] as Map) : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(FooPivotEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'weird_join': WeirdJoinSerializer.toMap(model.weirdJoin),\n      'foo': FooSerializer.toMap(model.foo),\n    };\n  }\n}\n\nabstract class FooPivotFields {\n  static const List<String> allFields = <String>[weirdJoin, foo];\n\n  static const String weirdJoin = 'weird_join';\n\n  static const String foo = 'foo';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/user.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:optional/optional.dart';\n\npart 'user.g.dart';\n\n@serializable\n@orm\nabstract class UserEntity extends Model {\n  String? get username;\n  String? get password;\n  String? get email;\n\n  @ManyToMany(RoleUserEntity)\n  List<RoleEntity> get roles;\n}\n\n@serializable\n@orm\nabstract class RoleUserEntity {\n  @belongsTo\n  RoleEntity? get role;\n\n  @belongsTo\n  UserEntity? get user;\n}\n\n@serializable\n@orm\nabstract class RoleEntity extends Model {\n  String? name;\n\n  @ManyToMany(RoleUserEntity)\n  List<UserEntity> get users;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/user.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'user.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass UserMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('users', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('username', length: 255);\n      table.varChar('password', length: 255);\n      table.varChar('email', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('users', cascade: true);\n  }\n}\n\nclass RoleUserMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('role_users', (table) {\n      table.declare('role_id', ColumnType('int')).references('roles', 'id');\n      table.declare('user_id', ColumnType('int')).references('users', 'id');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('role_users');\n  }\n}\n\nclass RoleMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('roles', (table) {\n      table.serial('id').primaryKey();\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n      table.varChar('name', length: 255);\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('roles', cascade: true);\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass UserQuery extends Query<User, UserQueryWhere> {\n  UserQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = UserQueryWhere(this);\n    leftJoin(\n      '(SELECT role_users.user_id, roles.id, roles.created_at, roles.updated_at, roles.name FROM roles LEFT JOIN role_users ON role_users.role_id=roles.id)',\n      'id',\n      'user_id',\n      additionalFields: const ['id', 'created_at', 'updated_at', 'name'],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final UserQueryValues values = UserQueryValues();\n\n  List<String> _selectedFields = [];\n\n  UserQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'users';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = [\n      'id',\n      'created_at',\n      'updated_at',\n      'username',\n      'password',\n      'email',\n    ];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  UserQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  UserQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  UserQueryWhere newWhereClause() {\n    return UserQueryWhere(this);\n  }\n\n  Optional<User> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = User(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      username: fields.contains('username') ? (row[3] as String?) : null,\n      password: fields.contains('password') ? (row[4] as String?) : null,\n      email: fields.contains('email') ? (row[5] as String?) : null,\n    );\n    if (row.length > 6) {\n      var modelOpt = RoleQuery().parseRow(row.skip(6).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(roles: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<User> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('users') &&\n        trampoline.contains('role_users')));\n  }\n\n  @override\n  Future<List<User>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<User>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<User>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              roles: List<RoleEntity>.from(l.roles)..addAll(model.roles),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass UserQueryWhere extends QueryWhere {\n  UserQueryWhere(UserQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      username = StringSqlExpressionBuilder(query, 'username'),\n      password = StringSqlExpressionBuilder(query, 'password'),\n      email = StringSqlExpressionBuilder(query, 'email');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder username;\n\n  final StringSqlExpressionBuilder password;\n\n  final StringSqlExpressionBuilder email;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, username, password, email];\n  }\n}\n\nclass UserQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get username {\n    return (values['username'] as String?);\n  }\n\n  set username(String? value) => values['username'] = value;\n\n  String? get password {\n    return (values['password'] as String?);\n  }\n\n  set password(String? value) => values['password'] = value;\n\n  String? get email {\n    return (values['email'] as String?);\n  }\n\n  set email(String? value) => values['email'] = value;\n\n  void copyFrom(User model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    username = model.username;\n    password = model.password;\n    email = model.email;\n  }\n}\n\nclass RoleUserQuery extends Query<RoleUser, RoleUserQueryWhere> {\n  RoleUserQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = RoleUserQueryWhere(this);\n    leftJoin(\n      _role = RoleQuery(trampoline: trampoline, parent: this),\n      'role_id',\n      'id',\n      additionalFields: const ['id', 'created_at', 'updated_at', 'name'],\n      trampoline: trampoline,\n    );\n    leftJoin(\n      _user = UserQuery(trampoline: trampoline, parent: this),\n      'user_id',\n      'id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'username',\n        'password',\n        'email',\n      ],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final RoleUserQueryValues values = RoleUserQueryValues();\n\n  List<String> _selectedFields = [];\n\n  RoleUserQueryWhere? _where;\n\n  late RoleQuery _role;\n\n  late UserQuery _user;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'role_users';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['role_id', 'user_id'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  RoleUserQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  RoleUserQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  RoleUserQueryWhere newWhereClause() {\n    return RoleUserQueryWhere(this);\n  }\n\n  Optional<RoleUser> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = RoleUser();\n    if (row.length > 2) {\n      var modelOpt = RoleQuery().parseRow(row.skip(2).take(4).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(role: m);\n      });\n    }\n    if (row.length > 6) {\n      var modelOpt = UserQuery().parseRow(row.skip(6).take(6).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(user: m);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<RoleUser> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  RoleQuery get role {\n    return _role;\n  }\n\n  UserQuery get user {\n    return _user;\n  }\n}\n\nclass RoleUserQueryWhere extends QueryWhere {\n  RoleUserQueryWhere(RoleUserQuery query)\n    : roleId = NumericSqlExpressionBuilder<int>(query, 'role_id'),\n      userId = NumericSqlExpressionBuilder<int>(query, 'user_id');\n\n  final NumericSqlExpressionBuilder<int> roleId;\n\n  final NumericSqlExpressionBuilder<int> userId;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [roleId, userId];\n  }\n}\n\nclass RoleUserQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int get roleId {\n    return (values['role_id'] as int);\n  }\n\n  set roleId(int value) => values['role_id'] = value;\n\n  int get userId {\n    return (values['user_id'] as int);\n  }\n\n  set userId(int value) => values['user_id'] = value;\n\n  void copyFrom(RoleUser model) {\n    if (model.role != null) {\n      values['role_id'] = model.role?.id;\n    }\n    if (model.user != null) {\n      values['user_id'] = model.user?.id;\n    }\n  }\n}\n\nclass RoleQuery extends Query<Role, RoleQueryWhere> {\n  RoleQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = RoleQueryWhere(this);\n    leftJoin(\n      '(SELECT role_users.role_id, users.id, users.created_at, users.updated_at, users.username, users.password, users.email FROM users LEFT JOIN role_users ON role_users.user_id=users.id)',\n      'id',\n      'role_id',\n      additionalFields: const [\n        'id',\n        'created_at',\n        'updated_at',\n        'username',\n        'password',\n        'email',\n      ],\n      trampoline: trampoline,\n    );\n  }\n\n  @override\n  final RoleQueryValues values = RoleQueryValues();\n\n  List<String> _selectedFields = [];\n\n  RoleQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'roles';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'created_at', 'updated_at', 'name'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  RoleQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  RoleQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  RoleQueryWhere newWhereClause() {\n    return RoleQueryWhere(this);\n  }\n\n  Optional<Role> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = Role(\n      id: fields.contains('id') ? row[0].toString() : null,\n      createdAt: fields.contains('created_at')\n          ? mapToNullableDateTime(row[1])\n          : null,\n      updatedAt: fields.contains('updated_at')\n          ? mapToNullableDateTime(row[2])\n          : null,\n      name: fields.contains('name') ? (row[3] as String?) : null,\n    );\n    if (row.length > 4) {\n      var modelOpt = UserQuery().parseRow(row.skip(4).take(6).toList());\n      modelOpt.ifPresent((m) {\n        model = model.copyWith(users: [m]);\n      });\n    }\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<Role> deserialize(List row) {\n    return parseRow(row);\n  }\n\n  @override\n  bool canCompile(trampoline) {\n    return (!(trampoline.contains('roles') &&\n        trampoline.contains('role_users')));\n  }\n\n  @override\n  Future<List<Role>> get(QueryExecutor executor) {\n    return super.get(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Role>> update(QueryExecutor executor) {\n    return super.update(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n\n  @override\n  Future<List<Role>> delete(QueryExecutor executor) {\n    return super.delete(executor).then((result) {\n      return result.fold<List<Role>>([], (out, model) {\n        var idx = out.indexWhere((m) => m.id == model.id);\n\n        if (idx == -1) {\n          return out..add(model);\n        } else {\n          var l = out[idx];\n          return out\n            ..[idx] = l.copyWith(\n              users: List<UserEntity>.from(l.users)..addAll(model.users),\n            );\n        }\n      });\n    });\n  }\n}\n\nclass RoleQueryWhere extends QueryWhere {\n  RoleQueryWhere(RoleQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at'),\n      name = StringSqlExpressionBuilder(query, 'name');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  final StringSqlExpressionBuilder name;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, createdAt, updatedAt, name];\n  }\n}\n\nclass RoleQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n\n  void copyFrom(Role model) {\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n    name = model.name;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass User extends UserEntity {\n  User({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.username,\n    this.password,\n    this.email,\n    List<RoleEntity> roles = const [],\n  }) : roles = List.unmodifiable(roles);\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? username;\n\n  @override\n  String? password;\n\n  @override\n  String? email;\n\n  @override\n  List<RoleEntity> roles;\n\n  User copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? username,\n    String? password,\n    String? email,\n    List<RoleEntity>? roles,\n  }) {\n    return User(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      username: username ?? this.username,\n      password: password ?? this.password,\n      email: email ?? this.email,\n      roles: roles ?? this.roles,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is UserEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.username == username &&\n        other.password == password &&\n        other.email == email &&\n        ListEquality<RoleEntity>(\n          DefaultEquality<RoleEntity>(),\n        ).equals(other.roles, roles);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      createdAt,\n      updatedAt,\n      username,\n      password,\n      email,\n      roles,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'User(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, username=$username, password=$password, email=$email, roles=$roles)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return UserSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass RoleUser implements RoleUserEntity {\n  RoleUser({this.role, this.user});\n\n  @override\n  RoleEntity? role;\n\n  @override\n  UserEntity? user;\n\n  RoleUser copyWith({RoleEntity? role, UserEntity? user}) {\n    return RoleUser(role: role ?? this.role, user: user ?? this.user);\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is RoleUserEntity && other.role == role && other.user == user;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([role, user]);\n  }\n\n  @override\n  String toString() {\n    return 'RoleUser(role=$role, user=$user)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return RoleUserSerializer.toMap(this);\n  }\n}\n\n@generatedSerializable\nclass Role extends RoleEntity {\n  Role({\n    this.id,\n    this.createdAt,\n    this.updatedAt,\n    this.name,\n    List<UserEntity> users = const [],\n  }) : users = List.unmodifiable(users);\n\n  /// A unique identifier corresponding to this item.\n  @override\n  String? id;\n\n  /// The time at which this item was created.\n  @override\n  DateTime? createdAt;\n\n  /// The last time at which this item was updated.\n  @override\n  DateTime? updatedAt;\n\n  @override\n  String? name;\n\n  @override\n  List<UserEntity> users;\n\n  Role copyWith({\n    String? id,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n    String? name,\n    List<UserEntity>? users,\n  }) {\n    return Role(\n      id: id ?? this.id,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n      name: name ?? this.name,\n      users: users ?? this.users,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is RoleEntity &&\n        other.id == id &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt &&\n        other.name == name &&\n        ListEquality<UserEntity>(\n          DefaultEquality<UserEntity>(),\n        ).equals(other.users, users);\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, createdAt, updatedAt, name, users]);\n  }\n\n  @override\n  String toString() {\n    return 'Role(id=$id, createdAt=$createdAt, updatedAt=$updatedAt, name=$name, users=$users)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return RoleSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst UserSerializer userSerializer = UserSerializer();\n\nclass UserEncoder extends Converter<User, Map> {\n  const UserEncoder();\n\n  @override\n  Map convert(User model) => UserSerializer.toMap(model);\n}\n\nclass UserDecoder extends Converter<Map, User> {\n  const UserDecoder();\n\n  @override\n  User convert(Map map) => UserSerializer.fromMap(map);\n}\n\nclass UserSerializer extends Codec<User, Map> {\n  const UserSerializer();\n\n  @override\n  UserEncoder get encoder => const UserEncoder();\n\n  @override\n  UserDecoder get decoder => const UserDecoder();\n\n  static User fromMap(Map map) {\n    return User(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      username: map['username'] as String?,\n      password: map['password'] as String?,\n      email: map['email'] as String?,\n      roles: map['roles'] is Iterable\n          ? List.unmodifiable(\n              ((map['roles'] as Iterable).whereType<Map>()).map(\n                RoleSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(UserEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'username': model.username,\n      'password': model.password,\n      'email': model.email,\n      'roles': model.roles.map((m) => RoleSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class UserFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    username,\n    password,\n    email,\n    roles,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String username = 'username';\n\n  static const String password = 'password';\n\n  static const String email = 'email';\n\n  static const String roles = 'roles';\n}\n\nconst RoleUserSerializer roleUserSerializer = RoleUserSerializer();\n\nclass RoleUserEncoder extends Converter<RoleUser, Map> {\n  const RoleUserEncoder();\n\n  @override\n  Map convert(RoleUser model) => RoleUserSerializer.toMap(model);\n}\n\nclass RoleUserDecoder extends Converter<Map, RoleUser> {\n  const RoleUserDecoder();\n\n  @override\n  RoleUser convert(Map map) => RoleUserSerializer.fromMap(map);\n}\n\nclass RoleUserSerializer extends Codec<RoleUser, Map> {\n  const RoleUserSerializer();\n\n  @override\n  RoleUserEncoder get encoder => const RoleUserEncoder();\n\n  @override\n  RoleUserDecoder get decoder => const RoleUserDecoder();\n\n  static RoleUser fromMap(Map map) {\n    return RoleUser(\n      role: map['role'] != null\n          ? RoleSerializer.fromMap(map['role'] as Map)\n          : null,\n      user: map['user'] != null\n          ? UserSerializer.fromMap(map['user'] as Map)\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(RoleUserEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'role': RoleSerializer.toMap(model.role),\n      'user': UserSerializer.toMap(model.user),\n    };\n  }\n}\n\nabstract class RoleUserFields {\n  static const List<String> allFields = <String>[role, user];\n\n  static const String role = 'role';\n\n  static const String user = 'user';\n}\n\nconst RoleSerializer roleSerializer = RoleSerializer();\n\nclass RoleEncoder extends Converter<Role, Map> {\n  const RoleEncoder();\n\n  @override\n  Map convert(Role model) => RoleSerializer.toMap(model);\n}\n\nclass RoleDecoder extends Converter<Map, Role> {\n  const RoleDecoder();\n\n  @override\n  Role convert(Map map) => RoleSerializer.fromMap(map);\n}\n\nclass RoleSerializer extends Codec<Role, Map> {\n  const RoleSerializer();\n\n  @override\n  RoleEncoder get encoder => const RoleEncoder();\n\n  @override\n  RoleDecoder get decoder => const RoleDecoder();\n\n  static Role fromMap(Map map) {\n    return Role(\n      id: map['id'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n      name: map['name'] as String?,\n      users: map['users'] is Iterable\n          ? List.unmodifiable(\n              ((map['users'] as Iterable).whereType<Map>()).map(\n                UserSerializer.fromMap,\n              ),\n            )\n          : [],\n    );\n  }\n\n  static Map<String, dynamic> toMap(RoleEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {\n      'id': model.id,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n      'name': model.name,\n      'users': model.users.map((m) => UserSerializer.toMap(m)).toList(),\n    };\n  }\n}\n\nabstract class RoleFields {\n  static const List<String> allFields = <String>[\n    id,\n    createdAt,\n    updatedAt,\n    name,\n    users,\n  ];\n\n  static const String id = 'id';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n\n  static const String name = 'name';\n\n  static const String users = 'users';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/world.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:optional/optional.dart';\n\npart 'world.g.dart';\n\n@serializable\n@Orm(tableName: 'world')\nabstract class WorldEntity {\n  @primaryKey\n  int? id;\n\n  @Column()\n  int? randomnumber;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/models/world.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'world.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass WorldMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('world', (table) {\n      table.integer('id').primaryKey();\n      table.integer('randomnumber');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('world');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass WorldQuery extends Query<World, WorldQueryWhere> {\n  WorldQuery({super.parent, Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = WorldQueryWhere(this);\n  }\n\n  @override\n  final WorldQueryValues values = WorldQueryValues();\n\n  List<String> _selectedFields = [];\n\n  WorldQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'world';\n  }\n\n  @override\n  List<String> get fields {\n    const localFields = ['id', 'randomnumber'];\n    return _selectedFields.isEmpty\n        ? localFields\n        : localFields\n              .where((field) => _selectedFields.contains(field))\n              .toList();\n  }\n\n  WorldQuery select(List<String> selectedFields) {\n    _selectedFields = selectedFields;\n    return this;\n  }\n\n  @override\n  WorldQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  WorldQueryWhere newWhereClause() {\n    return WorldQueryWhere(this);\n  }\n\n  Optional<World> parseRow(List row) {\n    if (row.every((x) => x == null)) {\n      return Optional.empty();\n    }\n    var model = World(\n      id: fields.contains('id') ? mapToInt(row[0]) : null,\n      randomnumber: fields.contains('randomnumber') ? mapToInt(row[1]) : null,\n    );\n    return Optional.of(model);\n  }\n\n  @override\n  Optional<World> deserialize(List row) {\n    return parseRow(row);\n  }\n}\n\nclass WorldQueryWhere extends QueryWhere {\n  WorldQueryWhere(WorldQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      randomnumber = NumericSqlExpressionBuilder<int>(query, 'randomnumber');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final NumericSqlExpressionBuilder<int> randomnumber;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, randomnumber];\n  }\n}\n\nclass WorldQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  int? get id {\n    return (values['id'] as int?);\n  }\n\n  set id(int? value) => values['id'] = value;\n\n  int? get randomnumber {\n    return (values['randomnumber'] as int?);\n  }\n\n  set randomnumber(int? value) => values['randomnumber'] = value;\n\n  void copyFrom(World model) {\n    id = model.id;\n    randomnumber = model.randomnumber;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass World extends WorldEntity {\n  World({this.id, this.randomnumber});\n\n  @override\n  int? id;\n\n  @override\n  int? randomnumber;\n\n  World copyWith({int? id, int? randomnumber}) {\n    return World(\n      id: id ?? this.id,\n      randomnumber: randomnumber ?? this.randomnumber,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is WorldEntity &&\n        other.id == id &&\n        other.randomnumber == randomnumber;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, randomnumber]);\n  }\n\n  @override\n  String toString() {\n    return 'World(id=$id, randomnumber=$randomnumber)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return WorldSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst WorldSerializer worldSerializer = WorldSerializer();\n\nclass WorldEncoder extends Converter<World, Map> {\n  const WorldEncoder();\n\n  @override\n  Map convert(World model) => WorldSerializer.toMap(model);\n}\n\nclass WorldDecoder extends Converter<Map, World> {\n  const WorldDecoder();\n\n  @override\n  World convert(Map map) => WorldSerializer.fromMap(map);\n}\n\nclass WorldSerializer extends Codec<World, Map> {\n  const WorldSerializer();\n\n  @override\n  WorldEncoder get encoder => const WorldEncoder();\n\n  @override\n  WorldDecoder get decoder => const WorldDecoder();\n\n  static World fromMap(Map map) {\n    return World(\n      id: map['id'] as int?,\n      randomnumber: map['randomnumber'] as int?,\n    );\n  }\n\n  static Map<String, dynamic> toMap(WorldEntity? model) {\n    if (model == null) {\n      throw FormatException(\"Required field [model] cannot be null\");\n    }\n    return {'id': model.id, 'randomnumber': model.randomnumber};\n  }\n}\n\nabstract class WorldFields {\n  static const List<String> allFields = <String>[id, randomnumber];\n\n  static const String id = 'id';\n\n  static const String randomnumber = 'randomnumber';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/performance_test.dart",
    "content": "// ignore: library_annotations\n@Skip('Only used for debugging issues')\nimport 'dart:async';\nimport 'dart:math';\n\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:test/test.dart';\n\nimport 'models/fortune.dart';\nimport 'models/world.dart';\n\nvoid performanceTests(\n  FutureOr<QueryExecutor> Function() createExecutor, {\n  FutureOr<void> Function(QueryExecutor)? close,\n}) {\n  QueryExecutor? executor;\n\n  //int _sampleSize = 1000;\n\n  int concurrency = 200;\n\n  // Generate a random number between 1 and 10000\n  int genRandomId() {\n    var rand = Random();\n    return rand.nextInt(10000) + 1;\n  }\n\n  setUp(() async {\n    print(\"Run setup\");\n    executor = await createExecutor();\n\n    /*\n    for (var i = 0; i < _sampleSize; i++) {\n      var query = WorldQuery();\n      query.values.randomNumber = _genRandomId();\n      var world = (await query.insert(executor!)).value;\n    }\n\n    for (var i = 0; i < _sampleSize; i++) {\n      var query = FortuneQuery();\n      query.values.message = \"message ${_genRandomId()}\";\n      var fortune = (await query.insert(executor!)).value;\n    }\n    */\n  });\n\n  tearDown(() => close!(executor!));\n\n  test('select all concurrency', () async {\n    var stopwatch = Stopwatch();\n    stopwatch.start();\n\n    // Fire and forget\n    for (var i = 0; i < concurrency; i++) {\n      FortuneQuery().get(executor!);\n    }\n\n    print(\"Loop time elapsed: ${stopwatch.elapsed.inMilliseconds}\");\n\n    var result = await FortuneQuery().get(executor!);\n\n    print(\"Final Time elapsed: ${stopwatch.elapsed.inMilliseconds}\");\n    stopwatch.stop();\n\n    expect(result, isNotNull);\n  });\n\n  test('select one concurrency', () async {\n    var stopwatch = Stopwatch();\n    stopwatch.start();\n\n    var id = genRandomId();\n    var query = WorldQuery()..where?.id.equals(id);\n    var result = await query.get(executor!);\n\n    print(\"Time elapsed: ${stopwatch.elapsed.inMilliseconds}\");\n    stopwatch.stop();\n\n    expect(result, isNotNull);\n  });\n\n  test('update concurrency', () async {\n    var stopwatch = Stopwatch();\n    stopwatch.start();\n\n    var id = genRandomId();\n    var query = WorldQuery()..where?.id.equals(id);\n    var result = await query.get(executor!);\n\n    print(\"Time elapsed: ${stopwatch.elapsed.inMilliseconds}\");\n    stopwatch.stop();\n\n    expect(result, isNotNull);\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/standalone_test.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:logging/logging.dart';\nimport 'package:mysql_client/mysql_client.dart';\nimport 'package:test/test.dart';\nimport 'common.dart';\nimport 'models/car.dart';\n\nfinal DateTime y2k = DateTime(2000, 1, 1);\n\nvoid main() {\n  Logger.root.level = Level.ALL; // defaults to Level.INFO\n  Logger.root.onRecord.listen((record) {\n    print('${record.loggerName}: ${record.time}: ${record.message}');\n  });\n\n  late MySQLConnection conn;\n  late QueryExecutor executor;\n  late MigrationRunner runner;\n\n  setUp(() async {\n    conn = await openMySqlConnection();\n    executor = await createExecutor(conn);\n    runner = await createTables(conn, [CarMigration()]);\n  });\n\n  tearDown(() async {\n    await dropTables(runner);\n    if (conn.connected) {\n      await conn.close();\n    }\n  });\n\n  group('queries', () {\n    group('selects', () {\n      test('select all', () async {\n        var cars = await CarQuery().get(executor);\n        expect(cars, []);\n      });\n\n      group('with data', () {\n        Car? ferrari;\n\n        setUp(() async {\n          var query = CarQuery();\n          query.values\n            ..make = 'Ferrari東'\n            ..createdAt = y2k\n            ..updatedAt = y2k\n            ..description = 'Vroom vroom!'\n            ..price = 120000.00\n            ..familyFriendly = false;\n          ferrari = (await query.insert(executor)).value;\n        });\n\n        test('where clause is applied', () async {\n          var query = CarQuery()..where!.familyFriendly.isTrue;\n          var cars = await query.get(executor);\n          expect(cars, isEmpty);\n\n          var sportsCars = CarQuery()..where!.familyFriendly.isFalse;\n          cars = await sportsCars.get(executor);\n          print(cars.map((c) => c.toJson()));\n\n          var car = cars.first;\n          expect(car.make, ferrari!.make);\n          expect(car.description, ferrari!.description);\n          expect(car.familyFriendly, ferrari!.familyFriendly);\n          expect(car.recalledAt, isNull);\n        });\n\n        test('union', () async {\n          var query1 = CarQuery()..where?.make.like('%Fer%');\n          var query2 = CarQuery()..where?.familyFriendly.isTrue;\n          var query3 = CarQuery()..where?.description.equals('Submarine');\n          var union = query1.union(query2).unionAll(query3);\n          //print(union.compile({}));\n          var cars = await union.get(executor);\n          expect(cars, hasLength(1));\n        });\n\n        test('or clause', () async {\n          var query = CarQuery()\n            ..where!.make.like('Fer%')\n            ..orWhere(\n              (where) => where\n                ..familyFriendly.isTrue\n                ..make.equals('Honda'),\n            );\n          //print(query.compile({}));\n          var cars = await query.get(executor);\n          expect(cars, hasLength(1));\n        });\n\n        test('limit obeyed', () async {\n          var query = CarQuery()..limit(0);\n          //print(query.compile({}));\n          var cars = await query.get(executor);\n          expect(cars, isEmpty);\n        });\n\n        test('get one', () async {\n          var id = int.parse(ferrari!.id!);\n          var query = CarQuery()..where!.id.equals(id);\n          var carOpt = await query.getOne(executor);\n          expect(carOpt.isPresent, true);\n          carOpt.ifPresent((car) {\n            expect(car, ferrari);\n          });\n        });\n\n        test('delete one', () async {\n          var id = int.parse(ferrari!.id!);\n          var query = CarQuery()..where!.id.equals(id);\n          var carOpt = await query.deleteOne(executor);\n          expect(carOpt.isPresent, true);\n          carOpt.ifPresent((car) {\n            var car = carOpt.value;\n            expect(car.toJson(), ferrari!.toJson());\n          });\n\n          var cars = await CarQuery().get(executor);\n          expect(cars, isEmpty);\n        });\n\n        test('delete stream', () async {\n          var query = CarQuery()\n            ..where!.make.equals('Ferrari東')\n            ..orWhere((w) => w.familyFriendly.isTrue);\n          //print(query.compile({}, preamble: 'DELETE FROM \"cars\"'));\n\n          var cars = await query.delete(executor);\n          expect(cars, hasLength(1));\n          expect(cars.first.toJson(), ferrari!.toJson());\n        });\n\n        test('update', () async {\n          var query = CarQuery()\n            ..where!.id.equals(int.parse(ferrari!.id!))\n            ..values.make = 'Hyundai';\n          var cars = await query.update(executor);\n          expect(cars, hasLength(1));\n          expect(cars.first.make, 'Hyundai');\n        });\n\n        test('update car', () async {\n          var cloned = ferrari!.copyWith(make: 'Angel');\n          var query = CarQuery()..values.copyFrom(cloned);\n          var carOpt = await (query.updateOne(executor));\n          expect(carOpt.isPresent, true);\n          carOpt.ifPresent((car) {\n            var car = carOpt.value;\n            //print(car.toJson());\n            expect(car.toJson(), cloned.toJson());\n          });\n        });\n      });\n    });\n\n    test('insert', () async {\n      var recalledAt = DateTime(2000, 1, 1, 0, 0, 0, 0, 0);\n      var query = CarQuery();\n      var now = DateTime.now();\n      query.values\n        ..make = 'Honda'\n        ..description = 'Hello'\n        ..familyFriendly = true\n        ..recalledAt = recalledAt\n        ..createdAt = now\n        ..updatedAt = now;\n      var carOpt = await query.insert(executor);\n      expect(carOpt.isPresent, true);\n      carOpt.ifPresent((car) {\n        var car = carOpt.value;\n        expect(car.id, isNotNull);\n        expect(car.make, 'Honda');\n        expect(car.description, 'Hello');\n        expect(car.familyFriendly, isTrue);\n\n        // MySQL driver consistently return time off by 1 sec.\n        // So ignore second for now\n        //expect(\n        //    dateYmdHms.format(car.recalledAt!), dateYmdHms.format(recalledAt));\n        //expect(dateYmdHms.format(car.createdAt!), dateYmdHms.format(now));\n      });\n    });\n\n    test('insert car', () async {\n      var recalledAt = DateTime.now();\n      var beetle = Car(\n        make: 'Beetle',\n        description: 'Herbie',\n        familyFriendly: true,\n        recalledAt: recalledAt,\n      );\n      var query = CarQuery()..values.copyFrom(beetle);\n      var carOpt = await (query.insert(executor));\n      expect(carOpt.isPresent, true);\n      carOpt.ifPresent((car) {\n        //print(car.toJson());\n        expect(car.make, beetle.make);\n        expect(car.description, beetle.description);\n        expect(car.familyFriendly, beetle.familyFriendly);\n\n        // MySQL driver consistently return time off by 1 sec.\n        // So ignore second for now\n        //expect(dateYmdHms.format(car.recalledAt!),\n        //    dateYmdHms.format(beetle.recalledAt!));\n      });\n    });\n\n    test('to where', () {\n      var query = CarQuery();\n      query.where\n        ?..familyFriendly.isTrue\n        ..recalledAt.lessThanOrEqualTo(y2k, includeTime: false);\n      var whereClause = query.where?.compile(tableName: 'cars');\n      //print('Where clause: $whereClause');\n      expect(\n        whereClause,\n        'cars.family_friendly = TRUE AND cars.recalled_at <= \\'2000-01-01\\'',\n      );\n    });\n\n    test('parseRow', () {\n      // 'id', 'created_at',  'updated_at', 'make', 'description', 'family_friendly', 'recalled_at'\n      // var row = [0, 'Mazda', 'CX9', true, y2k, y2k, y2k];\n      var row = [0, y2k, y2k, 'Mazda', 'CX9', true, y2k, 80000.00];\n      //print(row);\n      var carOpt = CarQuery().deserialize(row);\n      expect(carOpt.isPresent, true);\n      carOpt.ifPresent((car) {\n        //print(car.toJson());\n        expect(car.id, '0');\n        expect(car.make, 'Mazda');\n        expect(car.description, 'CX9');\n        expect(car.familyFriendly, true);\n        expect(\n          y2k.toIso8601String(),\n          startsWith(car.recalledAt!.toIso8601String()),\n        );\n        expect(\n          y2k.toIso8601String(),\n          startsWith(car.createdAt!.toIso8601String()),\n        );\n        expect(\n          y2k.toIso8601String(),\n          startsWith(car.updatedAt!.toIso8601String()),\n        );\n        expect(car.price, 80000.00);\n      });\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_mysql/test/util.dart",
    "content": "import 'dart:io';\nimport 'package:io/ansi.dart';\n\nvoid printSeparator(String title) {\n  var b = StringBuffer('===${title.toUpperCase()}');\n\n  int columns = 80;\n  if (stdout.hasTerminal) {\n    columns = stdout.terminalColumns - 3;\n  }\n  for (var i = b.length; i < columns; i++) {\n    b.write('=');\n  }\n  for (var i = 0; i < 3; i++) {\n    print(magenta.wrap(b.toString()));\n  }\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project."
  },
  {
    "path": "packages/orm/angel_orm_service/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.2\n\n* Updated examples and test cases\n* Updated README\n\n## 8.2.1\n\n* Updated dependencies\n* [BREAKING] Updated `postgres` to 3.2.0\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0\n\n* Skipped release\n\n## 2.0.1\n\n* Updated linter to `package:lints`\n\n## 2.0.0\n\n* Fixed NNBD issues\n\n## 2.0.0-beta.1\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 1.0.0\n\n* First version.\n"
  },
  {
    "path": "packages/orm/angel_orm_service/LICENSE",
    "content": "\nBSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/orm/angel_orm_service/README.md",
    "content": "# Angel3 ORM Service\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm_service?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service/LICENSE)\n\nService implementation that wraps over Angel3 ORM Query classes.\n\n## Installation\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n    angel3_orm_service: ^8.0.0\n```\n\n## Usage\n\nBrief snippet (check `example/main.dart` for setup, etc.):\n\n```dart\n// Create an ORM-backed service.\n  var todoService = OrmService<int, Todo, TodoQuery>(\n      executor, () => TodoQuery(),\n      readData: (req, res) => todoSerializer.decode(req.bodyAsMap));\n\n  // Because we provided `readData`, the todoService can face the Web.\n  // **IMPORTANT: Providing the type arguments is an ABSOLUTE MUST, if your\n  // model has `int` ID's (this is the case when using `angel_orm_generator` and `Model`).\n  // **\n  app.use<int, Todo, OrmService<int, Todo, TodoQuery>>(\n      '/api/todos', todoService);\n```\n"
  },
  {
    "path": "packages/orm/angel_orm_service/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/orm/angel_orm_service/example/connect.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_orm_postgres/angel3_orm_postgres.dart';\nimport 'package:postgres/postgres.dart';\n\nFuture<Connection> dbConnection() async {\n  return Connection.open(\n    Endpoint(\n      host: 'localhost',\n      port: 5432,\n      database: 'angel_orm_service_test',\n      username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres',\n      password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password',\n    ),\n  );\n}\n\nFuture<PostgreSqlExecutor> connect() async {\n  final conn = await dbConnection();\n\n  var executor = PostgreSqlExecutor(conn);\n  return executor;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/example/main.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_orm_service/angel3_orm_service.dart';\nimport 'package:logging/logging.dart';\nimport 'connect.dart';\nimport 'todo.dart';\n\nvoid main() async {\n  // Logging, connection setup.\n  hierarchicalLoggingEnabled = true;\n  var app = Angel(logger: Logger.detached('orm_service'));\n  var http = AngelHttp(app);\n  var executor = await connect();\n  app.logger.onRecord.listen((rec) {\n    print(rec);\n    if (rec.error != null) print(rec.error);\n    if (rec.stackTrace != null) print(rec.stackTrace);\n  });\n\n  // Create an ORM-backed service.\n  var todoService = OrmService<int, Todo, TodoQuery>(\n    executor,\n    () => TodoQuery(),\n    readData: (req, res) => todoSerializer.decode(req.bodyAsMap),\n  );\n\n  // Because we provided `readData`, the todoService can face the Web.\n  // **IMPORTANT: Providing the type arguments is an ABSOLUTE MUST, if your\n  // model has `int` ID's (this is the case when using `angel_orm_generator` and `Model`).\n  // **\n  app.use<int, Todo, OrmService<int, Todo, TodoQuery>>(\n    '/api/todos',\n    todoService,\n  );\n\n  // Clean up when we are done.\n  app.shutdownHooks.add((_) => executor.close());\n\n  await http.startServer('127.0.0.1', 3000);\n  print('Listening at ${http.uri}');\n  print('Todos API: ${http.uri}/api/todos');\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/example/migrate.dart",
    "content": "import 'package:angel3_migration_runner/angel3_migration_runner.dart';\nimport 'package:angel3_migration_runner/postgres.dart';\nimport 'connect.dart';\nimport 'todo.dart';\n\nFuture main(List<String> args) async {\n  final conn = await dbConnection();\n\n  var runner = PostgresMigrationRunner(conn, migrations: [TodoMigration()]);\n  return runMigrations(runner, args);\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/example/todo.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:optional/optional.dart';\npart 'todo.g.dart';\n\n@serializable\n@orm\nabstract class _Todo extends Model {\n  @notNull\n  String? get text;\n\n  @DefaultsTo(false)\n  bool? isComplete;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/example/todo.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'todo.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass TodoMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('todos', (table) {\n      table.serial('id').primaryKey();\n      table.boolean('is_complete').defaultsTo(false);\n      table.varChar('text');\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('todos');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass TodoQuery extends Query<Todo, TodoQueryWhere> {\n  TodoQuery({Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = TodoQueryWhere(this);\n  }\n\n  @override\n  final TodoQueryValues values = TodoQueryValues();\n\n  TodoQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'todos';\n  }\n\n  @override\n  List<String> get fields {\n    return const ['id', 'is_complete', 'text', 'created_at', 'updated_at'];\n  }\n\n  @override\n  TodoQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  TodoQueryWhere newWhereClause() {\n    return TodoQueryWhere(this);\n  }\n\n  static Todo? parseRow(List row) {\n    if (row.every((x) => x == null)) return null;\n    var model = Todo(\n      id: row[0].toString(),\n      isComplete: (row[1] as bool?),\n      text: (row[2] as String?),\n      createdAt: (row[3] as DateTime?),\n      updatedAt: (row[4] as DateTime?),\n    );\n    return model;\n  }\n\n  @override\n  Optional<Todo> deserialize(List row) {\n    return Optional.ofNullable(parseRow(row));\n  }\n}\n\nclass TodoQueryWhere extends QueryWhere {\n  TodoQueryWhere(TodoQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      isComplete = BooleanSqlExpressionBuilder(query, 'is_complete'),\n      text = StringSqlExpressionBuilder(query, 'text'),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final BooleanSqlExpressionBuilder isComplete;\n\n  final StringSqlExpressionBuilder text;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, isComplete, text, createdAt, updatedAt];\n  }\n}\n\nclass TodoQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n  bool? get isComplete {\n    return (values['is_complete'] as bool?);\n  }\n\n  set isComplete(bool? value) => values['is_complete'] = value;\n  String? get text {\n    return (values['text'] as String?);\n  }\n\n  set text(String? value) => values['text'] = value;\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n  void copyFrom(Todo model) {\n    isComplete = model.isComplete;\n    text = model.text;\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Todo extends _Todo {\n  Todo({\n    this.id,\n    this.isComplete = false,\n    required this.text,\n    this.createdAt,\n    this.updatedAt,\n  });\n\n  @override\n  final String? id;\n\n  @override\n  final bool? isComplete;\n\n  @override\n  final String? text;\n\n  @override\n  final DateTime? createdAt;\n\n  @override\n  final DateTime? updatedAt;\n\n  Todo copyWith({\n    String? id,\n    bool? isComplete,\n    String? text,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n  }) {\n    return Todo(\n      id: id ?? this.id,\n      isComplete: isComplete ?? this.isComplete,\n      text: text ?? this.text,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is _Todo &&\n        other.id == id &&\n        other.isComplete == isComplete &&\n        other.text == text &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([id, isComplete, text, createdAt, updatedAt]);\n  }\n\n  @override\n  String toString() {\n    return 'Todo(id=$id, isComplete=$isComplete, text=$text, createdAt=$createdAt, updatedAt=$updatedAt)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return TodoSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst TodoSerializer todoSerializer = TodoSerializer();\n\nclass TodoEncoder extends Converter<Todo, Map> {\n  const TodoEncoder();\n\n  @override\n  Map convert(Todo model) => TodoSerializer.toMap(model);\n}\n\nclass TodoDecoder extends Converter<Map, Todo> {\n  const TodoDecoder();\n\n  @override\n  Todo convert(Map map) => TodoSerializer.fromMap(map);\n}\n\nclass TodoSerializer extends Codec<Todo, Map> {\n  const TodoSerializer();\n\n  @override\n  TodoEncoder get encoder => const TodoEncoder();\n  @override\n  TodoDecoder get decoder => const TodoDecoder();\n  static Todo fromMap(Map map) {\n    if (map['text'] == null) {\n      throw FormatException(\"Missing required field 'text' on Todo.\");\n    }\n\n    return Todo(\n      id: map['id'] as String?,\n      isComplete: map['is_complete'] as bool? ?? false,\n      text: map['text'] as String?,\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime?)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime?)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(_Todo model) {\n    if (model.text == null) {\n      throw FormatException(\"Missing required field 'text' on Todo.\");\n    }\n\n    return {\n      'id': model.id,\n      'is_complete': model.isComplete,\n      'text': model.text,\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n    };\n  }\n}\n\nabstract class TodoFields {\n  static const List<String> allFields = <String>[\n    id,\n    isComplete,\n    text,\n    createdAt,\n    updatedAt,\n  ];\n\n  static const String id = 'id';\n\n  static const String isComplete = 'is_complete';\n\n  static const String text = 'text';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/lib/angel3_orm_service.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart' hide Query;\nimport 'package:angel3_orm/angel3_orm.dart';\n\n/// A [Service] implementation that wraps over a [Query] class generated\n/// via the Angel ORM.\nclass OrmService<Id, Data, TQuery extends Query<Data, QueryWhere>>\n    extends Service<Id, Data> {\n  /// The [QueryExecutor] used to communicate with a database.\n  final QueryExecutor executor;\n\n  /// A callback that produces an instance of [TQuery].\n  final FutureOr<TQuery> Function() queryCreator;\n\n  /// The name of the primary key in the database table.\n  ///\n  /// Defaults to `'id'`.\n  final String idField;\n\n  /// If set to `true`, clients can remove all items by passing a `null` `id` to `remove`.\n  ///\n  /// `false` by default.\n  final bool allowRemoveAll;\n\n  /// If set to `true`, parameters in `req.queryParameters` are applied to the database query.\n  final bool allowQuery;\n\n  /// In most cases, you will want to provide [readData].\n  ///\n  /// Note that you won't need to call `RequestContext.parseBody`, as by the time\n  /// `readData` is invoked, the body will have already been parsed.\n  OrmService(\n    this.executor,\n    this.queryCreator, {\n    this.idField = 'id',\n    this.allowRemoveAll = false,\n    this.allowQuery = true,\n    super.readData,\n  });\n\n  SqlExpressionBuilder _findBuilder(TQuery query, String name) {\n    return query.where!.expressionBuilders.firstWhere(\n      (b) => b.columnName == name,\n      orElse: (() => throw ArgumentError(\n        '${query.where.runtimeType} has no expression builder for a column named \"$name\".',\n      )),\n    );\n  }\n\n  void _apply(TQuery query, String name, dynamic value) {\n    var builder = _findBuilder(query, name);\n    try {\n      (builder as dynamic).equals(value);\n    } on NoSuchMethodError {\n      throw UnsupportedError(\n        '${builder.runtimeType} has no `equals` method, so it cannot be given a value from the dynamic query parameter \"$name\".',\n      );\n    }\n  }\n\n  Future<void> _applyQuery(TQuery query, Map<String, dynamic>? params) async {\n    if (params == null || params.isEmpty) return;\n\n    if (allowQuery || !params.containsKey('provider')) {\n      var queryObj = params['query'];\n\n      if (queryObj is Function(TQuery)) {\n        await queryObj(query);\n      } else if (queryObj is Map) {\n        queryObj.forEach((k, v) {\n          if (k == r'$sort') {\n            if (v is Map) {\n              v.forEach((key, value) {\n                var descending = false;\n                if (value is String) {\n                  descending = value == '-1';\n                } else if (value is num) {\n                  descending = value.toInt() == -1;\n                }\n                query.orderBy(key.toString(), descending: descending);\n              });\n            } else if (v is String) {\n              query.orderBy(v);\n            }\n          } else if (k is String &&\n              v is! RequestContext &&\n              v is! ResponseContext) {\n            _apply(query, k, v);\n          }\n        });\n      }\n    }\n  }\n\n  @override\n  Future<List<Data>> readMany(\n    List<Id> ids, [\n    Map<String, dynamic>? params,\n  ]) async {\n    if (ids.isEmpty) {\n      throw ArgumentError.value(ids, 'ids', 'cannot be empty');\n    }\n\n    var query = await queryCreator();\n    var builder = _findBuilder(query, idField);\n\n    try {\n      (builder as dynamic).isIn(ids);\n    } on NoSuchMethodError {\n      throw UnsupportedError(\n        '${builder.runtimeType} `$idField` has no `isIn` method, and therefore does not support `readMany`.',\n      );\n    }\n\n    await _applyQuery(query, params);\n    return await query.get(executor);\n  }\n\n  @override\n  Future<List<Data>> index([Map<String, dynamic>? params]) async {\n    var query = await queryCreator();\n    await _applyQuery(query, params);\n    return await query.get(executor);\n  }\n\n  @override\n  Future<Data> read(Id id, [Map<String, dynamic>? params]) async {\n    var query = await queryCreator();\n    _apply(query, idField, id);\n    await _applyQuery(query, params);\n    var result = await query.getOne(executor);\n    if (result.isPresent) return result.value;\n    throw AngelHttpException.notFound(message: 'No record found for ID $id');\n  }\n\n  @override\n  Future<Data> findOne([\n    Map<String, dynamic>? params,\n    String errorMessage = 'No record was found matching the given query.',\n  ]) async {\n    var query = await queryCreator();\n    await _applyQuery(query, params);\n    var result = await query.getOne(executor);\n    if (result.isPresent) return result.value;\n    throw AngelHttpException.notFound(message: errorMessage);\n  }\n\n  @override\n  Future<Data> create(Data data, [Map<String, dynamic>? params]) async {\n    var query = await queryCreator();\n\n    try {\n      (query.values as dynamic).copyFrom(data);\n    } on NoSuchMethodError {\n      throw UnsupportedError(\n        '${query.values.runtimeType} has no `copyFrom` method, but OrmService requires this for insertions.',\n      );\n    }\n\n    var result = await query.insert(executor);\n\n    return result.value;\n  }\n\n  @override\n  Future<Data> modify(Id id, Data data, [Map<String, dynamic>? params]) {\n    return update(id, data, params);\n  }\n\n  @override\n  Future<Data> update(Id id, Data data, [Map<String, dynamic>? params]) async {\n    var query = await queryCreator();\n    _apply(query, idField, id);\n    await _applyQuery(query, params);\n\n    try {\n      (query.values as dynamic).copyFrom(data);\n    } on NoSuchMethodError {\n      throw UnsupportedError(\n        '${query.values.runtimeType} has no `copyFrom` method, but OrmService requires this for updates.',\n      );\n    }\n\n    var result = await query.updateOne(executor);\n    if (result.isPresent) return result.value;\n    throw AngelHttpException.notFound(message: 'No record found for ID $id');\n  }\n\n  @override\n  Future<Data> remove(Id id, [Map<String, dynamic>? params]) async {\n    var query = await queryCreator();\n\n    if (id == null || id == 'null') {\n      // Remove everything...\n      if (!(allowRemoveAll == true ||\n          params?.containsKey('provider') != true)) {\n        throw AngelHttpException.forbidden(\n          message: 'Clients are not allowed to delete all items.',\n        );\n      }\n    } else {\n      _apply(query, idField, id);\n      await _applyQuery(query, params);\n    }\n\n    var result = await query.deleteOne(executor);\n    if (result.isPresent) return result.value;\n    throw AngelHttpException.notFound(message: 'No record found for ID $id');\n  }\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/melos_angel3_orm_service.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/orm/angel_orm_service/pubspec.yaml",
    "content": "name: angel3_orm_service\nversion: 8.5.0\ndescription: Service implementation that wraps over Angel3 ORM Query classes.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  angel3_orm: ^8.2.0\n  postgres: ^3.2.0\n  optional: ^6.0.0\ndev_dependencies:\n  angel3_migration: ^8.3.0\n  angel3_migration_runner: ^8.3.0\n  angel3_orm_generator: ^8.3.0\n  angel3_orm_postgres: ^8.2.0\n  angel3_serialize: ^8.2.0\n  build_runner: ^2.4.0\n  logging: ^1.2.0\n  test: ^1.24.0\n  lints: ^6.0.0\n\n"
  },
  {
    "path": "packages/orm/angel_orm_service/test/all_test.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_orm_postgres/angel3_orm_postgres.dart';\nimport 'package:angel3_orm_service/angel3_orm_service.dart';\nimport 'package:logging/logging.dart';\nimport 'package:postgres/postgres.dart';\nimport 'package:test/test.dart';\nimport 'pokemon.dart';\n\nvoid main() {\n  late Logger logger;\n  late PostgreSqlExecutor executor;\n  late Service<int?, Pokemon> pokemonService;\n\n  setUp(() async {\n    var conn = await Connection.open(\n      Endpoint(\n        host: 'localhost',\n        port: 5432,\n        database: 'angel_orm_service_test',\n        username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres',\n        password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password',\n      ),\n    );\n    hierarchicalLoggingEnabled = true;\n    logger = Logger.detached('orm_service');\n    logger.level = Level.ALL;\n    if (Platform.environment['log'] == '1') logger.onRecord.listen(print);\n    executor = PostgreSqlExecutor(conn, logger: logger);\n\n    await conn.execute('''\n    CREATE TEMPORARY TABLE pokemons (\n      id serial,\n      species varchar,\n      name varchar,\n      level integer,\n      type1 integer,\n      type2 integer,\n      created_at timestamp,\n      updated_at timestamp\n    );\n    ''');\n\n    pokemonService = OrmService(executor, () => PokemonQuery());\n  });\n\n  tearDown(() async {\n    await executor.close();\n    pokemonService.close();\n    logger.clearListeners();\n  });\n\n  test('create', () async {\n    var blaziken = await pokemonService.create(\n      Pokemon(\n        species: 'Blaziken',\n        level: 100,\n        type1: PokemonType.fire,\n        type2: PokemonType.fighting,\n      ),\n    );\n    print(blaziken);\n    expect(blaziken.id, isNotNull);\n    expect(blaziken.species, 'Blaziken');\n    expect(blaziken.level, 100);\n    expect(blaziken.type1, PokemonType.fire);\n    expect(blaziken.type2, PokemonType.fighting);\n  });\n\n  group('after create', () {\n    late Pokemon giratina;\n    late Pokemon pikachu;\n\n    setUp(() async {\n      giratina = await pokemonService.create(\n        Pokemon(\n          species: 'Giratina',\n          name: 'My First Legendary',\n          level: 54,\n          type1: PokemonType.ghost,\n          type2: PokemonType.dragon,\n        ),\n      );\n      pikachu = await pokemonService.create(\n        Pokemon(species: 'Pikachu', level: 100, type1: PokemonType.electric),\n      );\n    });\n\n    group('index', () {\n      test('default', () async {\n        expect(await pokemonService.index(), contains(giratina));\n        expect(await pokemonService.index(), contains(pikachu));\n      });\n\n      test('with callback', () async {\n        var result = await pokemonService.index({\n          'query': (PokemonQuery query) async {\n            query.where!.level.equals(pikachu.level!);\n          },\n        });\n\n        expect(result, [pikachu]);\n      });\n\n      test('search params', () async {\n        Future<List<Pokemon>> searchByType1(PokemonType type1) async {\n          var query = {PokemonFields.type1: type1};\n          var params = {'query': query};\n          return await pokemonService.index(params);\n        }\n\n        expect(await searchByType1(PokemonType.ghost), [giratina]);\n        expect(await searchByType1(PokemonType.electric), [pikachu]);\n        expect(await searchByType1(PokemonType.grass), []);\n      });\n\n      group(r'$sort', () {\n        test('by name', () async {\n          expect(\n            await pokemonService.index({\n              'query': {r'$sort': 'level'},\n            }),\n            [giratina, pikachu],\n          );\n        });\n\n        test('map number', () async {\n          expect(\n            await pokemonService.index({\n              'query': {\n                r'$sort': {'type1': -1},\n              },\n            }),\n            [giratina, pikachu],\n          );\n          expect(\n            await pokemonService.index({\n              'query': {\n                r'$sort': {'type1': 100},\n              },\n            }),\n            [pikachu, giratina],\n          );\n        });\n\n        test('map string', () async {\n          expect(\n            await pokemonService.index({\n              'query': {\n                r'$sort': {'type1': '-1'},\n              },\n            }),\n            [giratina, pikachu],\n          );\n          expect(\n            await pokemonService.index({\n              'query': {\n                r'$sort': {'type1': 'foo'},\n              },\n            }),\n            [pikachu, giratina],\n          );\n        });\n      });\n    });\n\n    group('findOne', () {\n      test('default', () async {\n        expect(\n          await pokemonService.findOne({\n            'query': {PokemonFields.name: giratina.name},\n          }),\n          giratina,\n        );\n        expect(\n          await pokemonService.findOne({\n            'query': {PokemonFields.level: pikachu.level},\n          }),\n          pikachu,\n        );\n        expect(\n          () => pokemonService.findOne({\n            'query': {PokemonFields.level: pikachu.level! * 3},\n          }),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n\n      test('nonexistent throws 404', () {\n        expect(\n          () => pokemonService.findOne({\n            'query': {PokemonFields.type1: PokemonType.poison},\n          }),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n    });\n\n    group('read', () {\n      test('default', () async {\n        expect(await pokemonService.read(pikachu.idAsInt), pikachu);\n        expect(await pokemonService.read(giratina.idAsInt), giratina);\n      });\n\n      test('nonexistent throws 404', () {\n        expect(\n          () => pokemonService.read(999),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n    });\n\n    test('readMany', () async {\n      expect(\n        pokemonService.readMany([giratina.idAsInt, pikachu.idAsInt]),\n        completion([giratina, pikachu]),\n      );\n      expect(\n        pokemonService.readMany([giratina.idAsInt]),\n        completion([giratina]),\n      );\n      expect(pokemonService.readMany([pikachu.idAsInt]), completion([pikachu]));\n      expect(() => pokemonService.readMany([]), throwsArgumentError);\n    });\n\n    group('update', () {\n      test('default', () async {\n        expect(\n          await pokemonService.update(\n            giratina.idAsInt,\n            giratina.copyWith(name: 'Hello'),\n          ),\n          giratina.copyWith(name: 'Hello'),\n        );\n      });\n\n      test('nonexistent throws 404', () {\n        expect(\n          () => pokemonService.update(999, giratina.copyWith(name: 'Hello')),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n    });\n\n    group('remove', () {\n      test('default', () async {\n        expect(pokemonService.read(giratina.idAsInt), completion(giratina));\n        expect(pokemonService.read(pikachu.idAsInt), completion(pikachu));\n      });\n\n      test('nonexistent throws 404', () {\n        expect(\n          () => pokemonService.remove(999),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n\n      test('cannot remove all unless explicitly set', () async {\n        expect(\n          () => pokemonService.remove(null, {'provider': Providers.rest}),\n          throwsA(TypeMatcher<AngelHttpException>()),\n        );\n      });\n    });\n  });\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/test/pokemon.dart",
    "content": "import 'package:angel3_migration/angel3_migration.dart';\nimport 'package:angel3_serialize/angel3_serialize.dart';\nimport 'package:angel3_orm/angel3_orm.dart';\nimport 'package:optional/optional.dart';\npart 'pokemon.g.dart';\n\nenum PokemonType {\n  fire,\n  grass,\n  water,\n  dragon,\n  poison,\n  dark,\n  fighting,\n  electric,\n  ghost,\n}\n\n@serializable\n@orm\nabstract class _Pokemon extends Model {\n  @notNull\n  String? get species;\n\n  String? get name;\n\n  @notNull\n  int? get level;\n\n  @notNull\n  PokemonType? get type1;\n\n  PokemonType? get type2;\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_service/test/pokemon.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'pokemon.dart';\n\n// **************************************************************************\n// MigrationGenerator\n// **************************************************************************\n\nclass PokemonMigration extends Migration {\n  @override\n  void up(Schema schema) {\n    schema.create('pokemons', (table) {\n      table.serial('id').primaryKey();\n      table.varChar('species');\n      table.varChar('name');\n      table.integer('level');\n      table.integer('type1');\n      table.integer('type2');\n      table.timeStamp('created_at');\n      table.timeStamp('updated_at');\n    });\n  }\n\n  @override\n  void down(Schema schema) {\n    schema.drop('pokemons');\n  }\n}\n\n// **************************************************************************\n// OrmGenerator\n// **************************************************************************\n\nclass PokemonQuery extends Query<Pokemon, PokemonQueryWhere> {\n  PokemonQuery({Set<String>? trampoline}) {\n    trampoline ??= <String>{};\n    trampoline.add(tableName);\n    _where = PokemonQueryWhere(this);\n  }\n\n  @override\n  final PokemonQueryValues values = PokemonQueryValues();\n\n  PokemonQueryWhere? _where;\n\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  @override\n  String get tableName {\n    return 'pokemons';\n  }\n\n  @override\n  List<String> get fields {\n    return const [\n      'id',\n      'species',\n      'name',\n      'level',\n      'type1',\n      'type2',\n      'created_at',\n      'updated_at',\n    ];\n  }\n\n  @override\n  PokemonQueryWhere? get where {\n    return _where;\n  }\n\n  @override\n  PokemonQueryWhere newWhereClause() {\n    return PokemonQueryWhere(this);\n  }\n\n  static Pokemon? parseRow(List row) {\n    if (row.every((x) => x == null)) return null;\n    var model = Pokemon(\n      id: row[0].toString(),\n      species: (row[1] as String?),\n      name: (row[2] as String?),\n      level: (row[3] as int?),\n      type1: row[4] == null ? null : PokemonType.values[(row[4] as int)],\n      type2: row[5] == null ? null : PokemonType.values[(row[5] as int)],\n      createdAt: (row[6] as DateTime?),\n      updatedAt: (row[7] as DateTime?),\n    );\n    return model;\n  }\n\n  @override\n  Optional<Pokemon> deserialize(List row) {\n    return Optional.ofNullable(parseRow(row));\n  }\n}\n\nclass PokemonQueryWhere extends QueryWhere {\n  PokemonQueryWhere(PokemonQuery query)\n    : id = NumericSqlExpressionBuilder<int>(query, 'id'),\n      species = StringSqlExpressionBuilder(query, 'species'),\n      name = StringSqlExpressionBuilder(query, 'name'),\n      level = NumericSqlExpressionBuilder<int>(query, 'level'),\n      type1 = EnumSqlExpressionBuilder<PokemonType>(\n        query,\n        'type1',\n        (v) => v.index,\n      ),\n      type2 = EnumSqlExpressionBuilder<PokemonType>(\n        query,\n        'type2',\n        (v) => v.index,\n      ),\n      createdAt = DateTimeSqlExpressionBuilder(query, 'created_at'),\n      updatedAt = DateTimeSqlExpressionBuilder(query, 'updated_at');\n\n  final NumericSqlExpressionBuilder<int> id;\n\n  final StringSqlExpressionBuilder species;\n\n  final StringSqlExpressionBuilder name;\n\n  final NumericSqlExpressionBuilder<int> level;\n\n  final EnumSqlExpressionBuilder<PokemonType> type1;\n\n  final EnumSqlExpressionBuilder<PokemonType> type2;\n\n  final DateTimeSqlExpressionBuilder createdAt;\n\n  final DateTimeSqlExpressionBuilder updatedAt;\n\n  @override\n  List<SqlExpressionBuilder> get expressionBuilders {\n    return [id, species, name, level, type1, type2, createdAt, updatedAt];\n  }\n}\n\nclass PokemonQueryValues extends MapQueryValues {\n  @override\n  Map<String, String> get casts {\n    return {};\n  }\n\n  String? get id {\n    return (values['id'] as String?);\n  }\n\n  set id(String? value) => values['id'] = value;\n  String? get species {\n    return (values['species'] as String?);\n  }\n\n  set species(String? value) => values['species'] = value;\n  String? get name {\n    return (values['name'] as String?);\n  }\n\n  set name(String? value) => values['name'] = value;\n  int? get level {\n    return (values['level'] as int?);\n  }\n\n  set level(int? value) => values['level'] = value;\n  PokemonType get type1 {\n    return PokemonType.values[(values['type1'] as int)];\n  }\n\n  set type1(PokemonType? value) => values['type1'] = value?.index;\n  PokemonType get type2 {\n    return PokemonType.values[(values['type2'] as int)];\n  }\n\n  set type2(PokemonType? value) => values['type2'] = value?.index;\n  DateTime? get createdAt {\n    return (values['created_at'] as DateTime?);\n  }\n\n  set createdAt(DateTime? value) => values['created_at'] = value;\n  DateTime? get updatedAt {\n    return (values['updated_at'] as DateTime?);\n  }\n\n  set updatedAt(DateTime? value) => values['updated_at'] = value;\n  void copyFrom(Pokemon model) {\n    species = model.species;\n    name = model.name;\n    level = model.level;\n    type1 = model.type1;\n    type2 = model.type2;\n    createdAt = model.createdAt;\n    updatedAt = model.updatedAt;\n  }\n}\n\n// **************************************************************************\n// JsonModelGenerator\n// **************************************************************************\n\n@generatedSerializable\nclass Pokemon extends _Pokemon {\n  Pokemon({\n    this.id,\n    required this.species,\n    this.name,\n    required this.level,\n    required this.type1,\n    this.type2,\n    this.createdAt,\n    this.updatedAt,\n  });\n\n  @override\n  final String? id;\n\n  @override\n  final String? species;\n\n  @override\n  final String? name;\n\n  @override\n  final int? level;\n\n  @override\n  final PokemonType? type1;\n\n  @override\n  final PokemonType? type2;\n\n  @override\n  final DateTime? createdAt;\n\n  @override\n  final DateTime? updatedAt;\n\n  Pokemon copyWith({\n    String? id,\n    String? species,\n    String? name,\n    int? level,\n    PokemonType? type1,\n    PokemonType? type2,\n    DateTime? createdAt,\n    DateTime? updatedAt,\n  }) {\n    return Pokemon(\n      id: id ?? this.id,\n      species: species ?? this.species,\n      name: name ?? this.name,\n      level: level ?? this.level,\n      type1: type1 ?? this.type1,\n      type2: type2 ?? this.type2,\n      createdAt: createdAt ?? this.createdAt,\n      updatedAt: updatedAt ?? this.updatedAt,\n    );\n  }\n\n  @override\n  bool operator ==(other) {\n    return other is _Pokemon &&\n        other.id == id &&\n        other.species == species &&\n        other.name == name &&\n        other.level == level &&\n        other.type1 == type1 &&\n        other.type2 == type2 &&\n        other.createdAt == createdAt &&\n        other.updatedAt == updatedAt;\n  }\n\n  @override\n  int get hashCode {\n    return hashObjects([\n      id,\n      species,\n      name,\n      level,\n      type1,\n      type2,\n      createdAt,\n      updatedAt,\n    ]);\n  }\n\n  @override\n  String toString() {\n    return 'Pokemon(id=$id, species=$species, name=$name, level=$level, type1=$type1, type2=$type2, createdAt=$createdAt, updatedAt=$updatedAt)';\n  }\n\n  Map<String, dynamic> toJson() {\n    return PokemonSerializer.toMap(this);\n  }\n}\n\n// **************************************************************************\n// SerializerGenerator\n// **************************************************************************\n\nconst PokemonSerializer pokemonSerializer = PokemonSerializer();\n\nclass PokemonEncoder extends Converter<Pokemon, Map> {\n  const PokemonEncoder();\n\n  @override\n  Map convert(Pokemon model) => PokemonSerializer.toMap(model);\n}\n\nclass PokemonDecoder extends Converter<Map, Pokemon> {\n  const PokemonDecoder();\n\n  @override\n  Pokemon convert(Map map) => PokemonSerializer.fromMap(map);\n}\n\nclass PokemonSerializer extends Codec<Pokemon, Map> {\n  const PokemonSerializer();\n\n  @override\n  PokemonEncoder get encoder => const PokemonEncoder();\n  @override\n  PokemonDecoder get decoder => const PokemonDecoder();\n  static Pokemon fromMap(Map map) {\n    if (map['species'] == null) {\n      throw FormatException(\"Missing required field 'species' on Pokemon.\");\n    }\n\n    if (map['level'] == null) {\n      throw FormatException(\"Missing required field 'level' on Pokemon.\");\n    }\n\n    if (map['type1'] == null) {\n      throw FormatException(\"Missing required field 'type1' on Pokemon.\");\n    }\n\n    return Pokemon(\n      id: map['id'] as String?,\n      species: map['species'] as String?,\n      name: map['name'] as String?,\n      level: map['level'] as int?,\n      type1: map['type1'] is PokemonType\n          ? (map['type1'] as PokemonType?)\n          : (map['type1'] is int\n                ? PokemonType.values[map['type1'] as int]\n                : null),\n      type2: map['type2'] is PokemonType\n          ? (map['type2'] as PokemonType?)\n          : (map['type2'] is int\n                ? PokemonType.values[map['type2'] as int]\n                : null),\n      createdAt: map['created_at'] != null\n          ? (map['created_at'] is DateTime\n                ? (map['created_at'] as DateTime?)\n                : DateTime.parse(map['created_at'].toString()))\n          : null,\n      updatedAt: map['updated_at'] != null\n          ? (map['updated_at'] is DateTime\n                ? (map['updated_at'] as DateTime?)\n                : DateTime.parse(map['updated_at'].toString()))\n          : null,\n    );\n  }\n\n  static Map<String, dynamic> toMap(_Pokemon model) {\n    if (model.species == null) {\n      throw FormatException(\"Missing required field 'species' on Pokemon.\");\n    }\n\n    if (model.level == null) {\n      throw FormatException(\"Missing required field 'level' on Pokemon.\");\n    }\n\n    if (model.type1 == null) {\n      throw FormatException(\"Missing required field 'type1' on Pokemon.\");\n    }\n\n    return {\n      'id': model.id,\n      'species': model.species,\n      'name': model.name,\n      'level': model.level,\n      'type1': model.type1 == null\n          ? null\n          : PokemonType.values.indexOf(model.type1!),\n      'type2': model.type2 == null\n          ? null\n          : PokemonType.values.indexOf(model.type2!),\n      'created_at': model.createdAt?.toIso8601String(),\n      'updated_at': model.updatedAt?.toIso8601String(),\n    };\n  }\n}\n\nabstract class PokemonFields {\n  static const List<String> allFields = <String>[\n    id,\n    species,\n    name,\n    level,\n    type1,\n    type2,\n    createdAt,\n    updatedAt,\n  ];\n\n  static const String id = 'id';\n\n  static const String species = 'species';\n\n  static const String name = 'name';\n\n  static const String level = 'level';\n\n  static const String type1 = 'type1';\n\n  static const String type2 = 'type2';\n\n  static const String createdAt = 'created_at';\n\n  static const String updatedAt = 'updated_at';\n}\n"
  },
  {
    "path": "packages/orm/angel_orm_test/README.md",
    "content": "# Angel3 ORM Test\n\n**Removed since 8.5 release**\nThese are basically test cases for angel3_orm_mysql and angel3_orm_postgres. Hence, they have been moved to their respective packages for better handling of the code generated for model based on respective databases.\n"
  },
  {
    "path": "packages/paginate/.analysis-options",
    "content": "analyzer:\n  strong-mode: true"
  },
  {
    "path": "packages/paginate/.gitignore",
    "content": "# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n### JetBrains template\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff:\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/dictionaries\n\n# Sensitive or high-churn files:\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.xml\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n\n# Gradle:\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# Mongo Explorer plugin:\n.idea/**/mongoSettings.xml\n\n## File-based project format:\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\n/out/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n.dart_tool"
  },
  {
    "path": "packages/paginate/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/paginate/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.0\n\n* Updated repository link\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.1.0\n\n* Updated linter to `package:lints`\n\n## 3.0.1\n\n* Updated README\n\n## 3.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 2.0.0\n\n* Dart2 + Angel2 update.\n  "
  },
  {
    "path": "packages/paginate/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/paginate/README.md",
    "content": "# Angel3 Paginate\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_paginate?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/paginate/LICENSE)\n\nPlatform-agnostic pagination library, with custom support for the [Angel3](https://angel3-framework.web.app/).\n\n## Installation\n\nIn your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  angel3_paginate: ^6.0.0\n```\n\n## Usage\n\nThis library exports a `Paginator<T>`, which can be used to efficiently produce instances of `PaginationResult<T>`. Pagination results, when serialized to JSON, look like this:\n\n```json\n{\n  \"total\" : 75,\n  \"items_per_page\" : 10,\n  \"previous_page\" : 3,\n  \"current_page\" : 4,\n  \"next_page\" : 5,\n  \"start_index\" : 30,\n  \"end_index\" : 39,\n  \"data\" : [\"<items...>\"]\n}\n```\n\nResults can be parsed from Maps using the `PaginationResult<T>.fromMap` constructor, and serialized via their `toJson()` method.\n\nTo create a paginator:\n\n```dart\nimport 'package:angel3_paginate/angel3_paginate.dart';\n\nvoid main() {\n  var p = new Paginator(iterable);\n  \n  // Get the current page (default: page 1)\n  var page = p.current;\n  print(page.total);\n  print(page.startIndex);\n  print(page.data); // The actual items on this page.\n  p.next(); // Advance a page\n  p.back(); // Back one page\n  p.goToPage(10); // Go to page number (1-based, not a 0-based index)\n}\n```\n\nThe entire Paginator API is documented, so check out the DartDocs.\n\nPaginators by default cache paginations, to improve performance as you shift through pages. This can be especially helpful in a client-side application where your UX involves a fast response time, i.e. a search page.\n"
  },
  {
    "path": "packages/paginate/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/paginate/example/main.dart",
    "content": "import 'package:angel3_paginate/angel3_paginate.dart';\n\nvoid main() {\n  var iterable = [1, 2, 3, 4];\n  var p = Paginator(iterable);\n\n  // Get the current page (default: page 1)\n  var page = p.current!;\n  print(page.total);\n  print(page.startIndex);\n  print(page.data); // The actual items on this page.\n  p.next(); // Advance a page\n  p.back(); // Back one page\n  p.goToPage(10); // Go to page number (1-based, not a 0-based index)\n}\n"
  },
  {
    "path": "packages/paginate/lib/angel3_paginate.dart",
    "content": "/// Efficiently paginates collections of items in an object-oriented manner.\nclass Paginator<T> {\n  final Map<int, PaginationResult<T>> _cache = {};\n  PaginationResult<T>? _current;\n  int _page = 0;\n\n  /// The collection of items to be paginated.\n  final Iterable<T> _items;\n\n  /// The maximum number of items to be shown per page.\n  final int itemsPerPage;\n\n  /// If `true` (default), then the results of paginations will be saved by page number.\n  ///\n  /// For example, you would only have to paginate page 1 once. Future calls would return a cached version.\n  final bool useCache;\n\n  Paginator(this._items, {this.itemsPerPage = 5, this.useCache = true});\n\n  /// Returns `true` if there are more items at lesser page indices than the current one.\n  bool get canGoBack => _page > 0;\n\n  /// Returns `true` if there are more items at greater page indices than the current one.\n  bool get canGoForward => _page < _lastPage();\n\n  /// The current page index.\n  int get index => _page;\n\n  /// Returns the greatest possible page number for this collection, given the number of [itemsPerPage].\n  int get lastPageNumber => _lastPage();\n\n  /// The current page number. This is not the same as [index].\n  ///\n  /// This getter will return user-friendly numbers. The lowest value it will ever return is `1`.\n  int get pageNumber => _page < 1 ? 1 : (_page + 1);\n\n  /// Fetches the current page. This will be cached until [back] or [next] is called.\n  ///\n  /// If [useCache] is `true` (default), then computations will be cached even after the page changes.\n  PaginationResult<T>? get current {\n    if (_current != null) {\n      return _current;\n    } else {\n      return _current = _getPage();\n    }\n  }\n\n  PaginationResult<T> _computePage() {\n    var len = _items.length;\n    //var it = _items.skip(_page * (itemsPerPage ?? 5));\n    var it = _items.skip(_page * (itemsPerPage));\n    var offset = len - it.length;\n    it = it.take(itemsPerPage);\n    var last = _lastPage();\n    // print('cur: $_page, last: $last');\n    return _PaginationResultImpl(\n      it,\n      currentPage: _page + 1,\n      previousPage: _page <= 0 ? -1 : _page,\n      nextPage: _page >= last - 1 ? -1 : _page + 2,\n      startIndex: it.isEmpty ? -1 : offset,\n      endIndex: offset + it.length - 1,\n      itemsPerPage: itemsPerPage < _items.length ? itemsPerPage : _items.length,\n      total: len,\n    );\n  }\n\n  PaginationResult<T> _getPage() {\n    if (useCache != false) {\n      return _cache.putIfAbsent(_page, () => _computePage());\n    } else {\n      return _computePage();\n    }\n  }\n\n  int _lastPage() {\n    var n = (_items.length / itemsPerPage).round();\n    // print('items: ${_items.length}');\n    // print('per page: $itemsPerPage');\n    // print('quotient: $n');\n    var remainder = _items.length - (n * itemsPerPage);\n    // print('remainder: $remainder');\n    return (remainder <= 0) ? n : n + 1;\n  }\n\n  /// Attempts to go the specified page. If it fails, then it will remain on the current page.\n  ///\n  /// Keep in mind - this just not be a zero-based index, but a one-based page number. The lowest\n  /// allowed value is `1`.\n  void goToPage(int page) {\n    if (page > 0 && page <= _lastPage()) {\n      _page = page - 1;\n      _current = null;\n    }\n  }\n\n  /// Moves the paginator back one page, if possible.\n  void back() {\n    if (_page > 0) {\n      _page--;\n      _current = null;\n    }\n  }\n\n  /// Advances the paginator one page, if possible.\n  void next() {\n    if (_page < _lastPage()) {\n      _page++;\n      _current = null;\n    }\n  }\n}\n\n/// Stores the result of a pagination.\nabstract class PaginationResult<T> {\n  factory PaginationResult.fromMap(Map<String, dynamic> map) =>\n      _PaginationResultImpl(\n        (map['data'] as List).cast<T>(),\n        currentPage: map['current_page'] as int?,\n        endIndex: map['end_index'] as int?,\n        itemsPerPage: map['items_per_page'] as int?,\n        nextPage: map['next_page'] as int?,\n        previousPage: map['previous_page'] as int?,\n        startIndex: map['start_index'] as int?,\n        total: map['total'] as int?,\n      );\n\n  Iterable<T> get data;\n\n  int? get currentPage;\n\n  int? get previousPage;\n\n  int? get nextPage;\n\n  int? get itemsPerPage;\n\n  int? get total;\n\n  int? get startIndex;\n\n  int? get endIndex;\n\n  Map<String, dynamic> toJson();\n}\n\nclass _PaginationResultImpl<T> implements PaginationResult<T> {\n  final Iterable<T> _data;\n  Iterable<T>? _cachedData;\n\n  @override\n  final int? currentPage;\n\n  _PaginationResultImpl(\n    this._data, {\n    this.currentPage,\n    this.endIndex,\n    this.itemsPerPage,\n    this.nextPage,\n    this.previousPage,\n    this.startIndex,\n    this.total,\n  });\n\n  @override\n  Iterable<T> get data => _cachedData ?? (_cachedData = List<T>.from(_data));\n\n  @override\n  final int? endIndex;\n\n  @override\n  final int? itemsPerPage;\n\n  @override\n  final int? nextPage;\n\n  @override\n  final int? previousPage;\n\n  @override\n  final int? startIndex;\n\n  @override\n  final int? total;\n\n  @override\n  Map<String, dynamic> toJson() {\n    return {\n      'total': total,\n      'items_per_page': itemsPerPage,\n      'previous_page': previousPage,\n      'current_page': currentPage,\n      'next_page': nextPage,\n      'start_index': startIndex,\n      'end_index': endIndex,\n      'data': data,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/paginate/melos_angel3_paginate.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/paginate/pubspec.yaml",
    "content": "name: angel3_paginate\nversion: 8.5.0\ndescription: Platform-agnostic pagination library, with custom support for the Angel3 framework.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/paginate\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  logging: ^1.2.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/paginate/test/all_test.dart",
    "content": "import 'package:test/test.dart';\nimport 'bounds_test.dart' as bounds;\nimport 'paginate_test.dart' as paginate;\n\nvoid main() {\n  group('bounds', bounds.main);\n  group('paginate', paginate.main);\n}\n"
  },
  {
    "path": "packages/paginate/test/bounds_test.dart",
    "content": "import 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_paginate/angel3_paginate.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nfinal List<Map<String, String>> mjAlbums = [\n  {'billie': 'jean'},\n  {'off': 'the_wall'},\n  {'michael': 'jackson'},\n];\n\nvoid main() {\n  late TestClient client;\n\n  setUp(() async {\n    var app = Angel();\n\n    app.get('/api/songs', (req, res) {\n      var p = Paginator(mjAlbums, itemsPerPage: mjAlbums.length);\n      p.goToPage(int.parse(req.queryParameters['page'] as String? ?? '1'));\n      return p.current;\n    });\n\n    client = await connectTo(app);\n\n    app.logger = Logger('angel_paginate')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n  });\n\n  tearDown(() => client.close());\n\n  test('limit exceeds size of collection', () async {\n    var response = await client.get(\n      Uri(\n        path: '/api/songs',\n        queryParameters: {r'$limit': (mjAlbums.length + 1).toString()},\n      ),\n    );\n\n    var page = PaginationResult<Map<String, dynamic>>.fromMap(\n      json.decode(response.body) as Map<String, dynamic>,\n    );\n\n    print('page: ${page.toJson()}');\n\n    expect(page.total, mjAlbums.length);\n    expect(page.itemsPerPage, mjAlbums.length);\n    expect(page.previousPage, -1);\n    expect(page.currentPage, 1);\n    expect(page.nextPage, -1);\n    expect(page.startIndex, 0);\n    expect(page.endIndex, mjAlbums.length - 1);\n    expect(page.data, mjAlbums);\n  });\n}\n"
  },
  {
    "path": "packages/paginate/test/paginate_test.dart",
    "content": "import 'package:angel3_paginate/angel3_paginate.dart';\nimport 'package:test/test.dart';\n\n// Count-down from 100, then 101 at the end...\nfinal List<int> data = List<int>.generate(100, (i) => 100 - i)..add(101);\n\nvoid main() {\n  group('cache', () {\n    var cached = Paginator<int>(data),\n        uncached = Paginator<int>(data, useCache: false);\n\n    test('always cache current', () {\n      expect(cached.current, cached.current);\n      expect(uncached.current, uncached.current);\n    });\n\n    test('only cache prev/next if useCache != false', () {\n      var cached1 = cached.current;\n      cached.goToPage(4);\n      var cached4 = cached.current;\n      cached.goToPage(1);\n      expect(cached.current, cached1);\n      cached.goToPage(4);\n      expect(cached.current, cached4);\n\n      var uncached1 = uncached.current;\n      uncached.goToPage(4);\n      var uncached4 = uncached.current;\n      uncached.goToPage(1);\n      expect(uncached.current, isNot(uncached1));\n      uncached.goToPage(4);\n      expect(uncached.current, isNot(uncached4));\n    });\n  });\n\n  test('default state', () {\n    var paginator = Paginator<int>(data);\n    expect(paginator.index, 0);\n    expect(paginator.pageNumber, 1);\n    expect(paginator.itemsPerPage, 5);\n    expect(paginator.useCache, true);\n    expect(paginator.canGoBack, false);\n    expect(paginator.canGoForward, true);\n    expect(paginator.lastPageNumber, 21);\n\n    // Going back should do nothing\n    var p = paginator.pageNumber;\n    paginator.back();\n    expect(paginator.pageNumber, p);\n  });\n\n  group('paginate', () {\n    test('first page', () {\n      var paginator = Paginator<int>(data);\n      expect(paginator.pageNumber, 1);\n      var r = paginator.current!;\n      print(r.toJson());\n      expect(r.total, data.length);\n      expect(r.itemsPerPage, 5);\n      expect(r.previousPage, -1);\n      expect(r.currentPage, 1);\n      expect(r.nextPage, 2);\n      expect(r.startIndex, 0);\n      expect(r.endIndex, 4);\n      expect(r.data, data.skip(r.startIndex!).take(r.itemsPerPage!).toList());\n    });\n  });\n\n  test('third page', () {\n    var paginator = Paginator<int>(data)..goToPage(3);\n    expect(paginator.pageNumber, 3);\n    var r = paginator.current!;\n    print(r.toJson());\n    expect(r.total, data.length);\n    expect(r.itemsPerPage, 5);\n    expect(r.previousPage, 2);\n    expect(r.currentPage, 3);\n    expect(r.nextPage, 4);\n    expect(r.startIndex, 10);\n    expect(r.endIndex, 14);\n    expect(r.data, data.skip(r.startIndex!).take(r.itemsPerPage!).toList());\n\n    paginator.back();\n    expect(paginator.pageNumber, 2);\n  });\n\n  test('last page', () {\n    var paginator = Paginator<int>(data);\n    paginator.goToPage(paginator.lastPageNumber);\n    var r = paginator.current!;\n    expect(r.total, data.length);\n    expect(r.itemsPerPage, 5);\n    expect(r.previousPage, paginator.lastPageNumber - 1);\n    expect(r.currentPage, paginator.lastPageNumber);\n    expect(r.nextPage, -1);\n    expect(r.startIndex, (paginator.lastPageNumber - 1) * 5);\n    expect(r.endIndex, r.startIndex);\n    expect(r.data, [data.last]);\n    expect(r.data, data.skip(r.startIndex!).take(r.itemsPerPage!).toList());\n  });\n\n  test('dump pages', () {\n    var paginator = Paginator<int>(data);\n    print('${paginator.lastPageNumber} page(s) of data:');\n\n    do {\n      print('  * Page #${paginator.pageNumber}: ${paginator.current!.data}');\n      paginator.next();\n    } while (paginator.canGoForward);\n  });\n\n  test('empty collection', () {\n    var paginator = Paginator([]);\n    var page = paginator.current!;\n    print(page.toJson());\n\n    expect(page.total, 0);\n    expect(page.previousPage, -1);\n    expect(page.nextPage, -1);\n    expect(page.currentPage, 1);\n    expect(page.startIndex, -1);\n    expect(page.endIndex, -1);\n    expect(page.data, isEmpty);\n    expect(paginator.canGoBack, isFalse);\n    expect(paginator.canGoForward, isFalse);\n  });\n}\n"
  },
  {
    "path": "packages/production/.pubignore",
    "content": "dev.key\ndev.pem\n"
  },
  {
    "path": "packages/production/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/production/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.6.0\n\n* Require Dart >= 3.11\n\n## 8.5.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.4.1\n\n* Updated `intl` to 0.20.0\n\n## 8.4.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.2.1\n\n* Updated repository link\n\n## 8.2.0\n\n* Updated `lints` to 3.0.0\n* Updated `intl` to 0.19.0\n* Fixed linter warnings\n\n## 8.1.0\n\n* Added optional `responseHeaders` and `removeResponseHeaders` to `Runner`\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.1.2\n\n* Updated repo link\n* Fixed null safety warnings\n\n## 3.1.1\n\n* Fixed license link\n\n## 3.1.0\n\n* Updated to use `belatuk_pub_sub` package\n\n## 3.0.3\n\n* Upgraded from `pendantic` to `lints` linter\n\n## 3.0.2\n\n* Fixed NNBD issues\n* Updated references to `angel3` framework\n* Updated README\n\n## 3.0.1\n\n* Fixed static analysis warnings\n\n## 3.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 2.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 1.0.0\n\n* Support SSL/HTTP2.\n* Support muting the logger via `--quiet`.\n\n## 1.0.0-alpha.1\n\n* Import `framework/http`.\n\n## 1.0.0-alpha\n\n* Initial version.\n"
  },
  {
    "path": "packages/production/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/production/README.md",
    "content": "# Angel3 Production Runner\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_production?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dart-backend/angel/tree/master/packages/production/LICENSE)\n\nHelpers for concurrency, message-passing, rotating loggers, and other production functionality in Angel3 framework.\n\n![Screenshot](angel3-screenshot.png)\n\nThis will become the de-facto way to run Angel3 applications in deployed environments, as it takes care of inter-isolate communication, respawning dead processes, and other housekeeping for you automatically. Most users will want to use the `Runner` class.\n\n## `Runner`\n\n`Runner` is a utility, powered by `package:args`, that is intended to be the entry point of your application.\n\nInstantiate it as follows, and your file will become a command-line executable that spawns multiple instances of your application:\n\n```dart\nimport 'dart:async';\nimport 'dart:isolate';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_production/angel3_production.dart';\n\nvoid main(List<String> args) => Runner('example', configureServer).run(args);\n\nFuture configureServer(Angel app) async {\n  app.get('/', (req, res) => 'Hello, production world!');\n\n  app.get('/crash', (req, res) {\n    // We'll crash this instance deliberately, but the Runner will auto-respawn for us.\n    Timer(const Duration(seconds: 3), Isolate.current.kill);\n    return 'Crashing in 3s...';\n  });\n}\n```\n\n`Runner` will automatically re-spawn crashed instances, unless `--no-respawn` is passed. This can prevent your server from entirely going down at the first error, and adds a layer of fault tolerance to your infrastructure.\n\nWhen combined with `systemd`, deploying Angel3 applications on Linux can be very simple.\n\n## Message Passing\n\nThe `Runner` class uses [`belatuk_pub_sub`](<https://pub.dev/packages/belatuk_pub_sub>) to coordinate\nmessage passing between isolates. When one isolate sends a message, all other isolates will receive the same message, except for the isolate that sent it. It is injected into your application's `Container` as `pub_sub.Client`, so you can use it as follows:\n\n```dart\n// Use the injected `pub_sub.Client` to send messages.\nvar client = app.container.make<Client>();\n\n// We can listen for an event to perform some behavior.\n//\n// Here, we use message passing to synchronize some common state.\nvar onGreetingChanged = await client.subscribe('user_upgraded');\nonGreetingChanged\n    .cast<User>()\n    .listen((user) {\n      // Do something...\n    });\n```\n\n## Customising Response Header\n\nAdditional parameters can be passed to the `Runner` class to:\n\n1. Remove headers from HTTP response.\n2. Add headers to HTTP response.\n\nFor example, the following code snippet removes `X-FRAME-OPTIONS` and adds `X-XSRF-TOKEN` to the response header.\n\n```dart\n\nvoid main(List<String> args) {\n  // Remove 'X-FRAME-OPTIONS'\n  var removeHeader = {'X-FRAME-OPTIONS': 'SAMEORIGIN'};\n\n  // Add 'X-XSRF-TOKEN'\n  var customHeader = {\n    'X-XSRF-TOKEN':\n        'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e'\n  };\n\n  Runner('example', configureServer,\n          removeResponseHeaders: removeHeader, responseHeaders: customHeader)\n      .run(args);\n}\n\n```\n\n## Run-time Metadata\n\nAt run-time, you may want to know information about the currently-running instance, for example, which number instance. For this, the `InstanceInfo` class is injected into each instance:\n\n```dart\nvar instanceInfo = app.container.make<InstanceInfo>();\nprint('This is instance #${instanceInfo.id}');\n```\n\n## Command-line Options\n\nThe `Runner` class supplies options like the following:\n\n```bash\nappuser$ dart example/main.dart --help\n     _    _   _  ____ _____ _     _____ \n    / \\  | \\ | |/ ___| ____| |   |___ / \n   / _ \\ |  \\| | |  _|  _| | |     |_ \\ \n  / ___ \\| |\\  | |_| | |___| |___ ___) |\n /_/   \\_\\_| \\_|\\____|_____|_____|____/                                                                                 \n\nA batteries-included, full-featured, full-stack framework in Dart.\n\nhttps://angel3-framework.web.app\n\nOptions:\n-h, --help                    Print this help information.\n    --[no-]respawn            Automatically respawn crashed application instances.\n                              (defaults to on)\n\n    --use-zone                Create a new Zone for each request.\n    --quiet                   Completely mute logging.\n    --ssl                     Listen for HTTPS instead of HTTP.\n    --http2                   Listen for HTTP/2 instead of HTTP/1.1.\n-a, --address                 The address to listen on.\n                              (defaults to \"127.0.0.1\")\n\n-j, --concurrency             The number of isolates to spawn.\n                              (defaults to \"4\")\n\n-p, --port                    The port to listen on.\n                              (defaults to \"3000\")\n\n    --certificate-file        The PEM certificate file to read.\n    --certificate-password    The PEM certificate file password.\n    --key-file                The PEM key file to read.\n    --key-password            The PEM key file password.\n```\n"
  },
  {
    "path": "packages/production/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/production/example/main.dart",
    "content": "import 'dart:async';\nimport 'dart:isolate';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_production/angel3_production.dart';\nimport 'package:belatuk_pub_sub/belatuk_pub_sub.dart';\n\nvoid main(List<String> args) {\n  Runner('example', configureServer).run(args);\n}\n\nFuture configureServer(Angel app) async {\n  // Use the injected `pub_sub.Client` to send messages.\n  var client = app.container.make<Client>();\n\n  var greeting = 'Hello! This is the default greeting.';\n\n  // We can listen for an event to perform some behavior.\n  //\n  // Here, we use message passing to synchronize some common state.\n  var onGreetingChanged = await client.subscribe('greeting_changed');\n  onGreetingChanged.cast<String>().listen(\n    (newGreeting) => greeting = newGreeting,\n  );\n\n  // Add some routes...\n  app.get('/', (req, res) => 'Hello, production world!');\n\n  app.get('/404', (req, res) {\n    res.statusCode = 404;\n    return res.close();\n  });\n\n  // Create some routes to demonstrate message passing.\n  app.get('/greeting', (req, res) => greeting);\n\n  // This route will push a new value for `greeting`.\n  app.get('/change_greeting/:newGreeting', (req, res) {\n    greeting = (req.params['newGreeting'] as String? ?? '');\n    client.publish('greeting_changed', greeting);\n    return 'Changed greeting -> $greeting';\n  });\n\n  // The `Runner` helps with fault tolerance.\n  app.get('/crash', (req, res) {\n    // We'll crash this instance deliberately, but the Runner will auto-respawn for us.\n    Timer(const Duration(seconds: 3), Isolate.current.kill);\n    return 'Crashing in 3s...';\n  });\n}\n"
  },
  {
    "path": "packages/production/lib/angel3_production.dart",
    "content": "export 'src/instance_info.dart';\nexport 'src/options.dart';\nexport 'src/runner.dart';\n"
  },
  {
    "path": "packages/production/lib/src/instance_info.dart",
    "content": "/// Information about the currently-running instance.\nclass InstanceInfo {\n  final int? id;\n\n  const InstanceInfo({this.id});\n}\n"
  },
  {
    "path": "packages/production/lib/src/options.dart",
    "content": "import 'dart:io';\nimport 'package:args/args.dart';\n\n/// Options for executing Runner.\nclass RunnerOptions {\n  /// Command line arguements\n  static final ArgParser argParser = ArgParser()\n    ..addFlag(\n      'help',\n      abbr: 'h',\n      help: 'Print this help information.',\n      negatable: false,\n    )\n    ..addFlag(\n      'respawn',\n      help: 'Automatically respawn crashed application instances.',\n      defaultsTo: true,\n      negatable: true,\n    )\n    ..addFlag(\n      'use-zone',\n      negatable: false,\n      help: 'Create a new Zone for each request.',\n    )\n    ..addFlag('quiet', negatable: false, help: 'Completely mute logging.')\n    ..addFlag(\n      'ssl',\n      negatable: false,\n      help: 'Listen for HTTPS instead of HTTP.',\n    )\n    ..addFlag(\n      'http2',\n      negatable: false,\n      help: 'Listen for HTTP/2 instead of HTTP/1.1.',\n    )\n    ..addOption(\n      'address',\n      abbr: 'a',\n      defaultsTo: '127.0.0.1',\n      help: 'The address to listen on.',\n    )\n    ..addOption(\n      'concurrency',\n      abbr: 'j',\n      defaultsTo: Platform.numberOfProcessors.toString(),\n      help: 'The number of isolates to spawn.',\n    )\n    ..addOption(\n      'port',\n      abbr: 'p',\n      defaultsTo: '3000',\n      help: 'The port to listen on.',\n    )\n    ..addOption('certificate-file', help: 'The PEM certificate file to read.')\n    ..addOption(\n      'certificate-password',\n      help: 'The PEM certificate file password.',\n    )\n    ..addOption('key-file', help: 'The PEM key file to read.')\n    ..addOption('key-password', help: 'The PEM key file password.');\n\n  final String hostname;\n  final String? certificateFile, keyFile, certificatePassword, keyPassword;\n  final int concurrency, port;\n  final bool useZone, respawn, quiet, ssl, http2;\n  final Map<String, Object> removeResponseHeaders = {};\n  final Map<String, Object> responseHeaders = {};\n\n  RunnerOptions({\n    this.hostname = '127.0.0.1',\n    this.port = 3000,\n    this.concurrency = 1,\n    this.useZone = false,\n    this.respawn = true,\n    this.quiet = false,\n    this.certificateFile,\n    this.keyFile,\n    this.ssl = false,\n    this.http2 = false,\n    this.certificatePassword,\n    this.keyPassword,\n  });\n\n  factory RunnerOptions.fromArgResults(ArgResults argResults) {\n    return RunnerOptions(\n      hostname: argResults['address'] as String,\n      port: int.parse(argResults['port'] as String),\n      concurrency: int.parse(argResults['concurrency'] as String),\n      useZone: argResults['use-zone'] as bool? ?? false,\n      respawn: argResults['respawn'] as bool? ?? true,\n      quiet: argResults['quiet'] as bool? ?? false,\n      certificateFile: argResults['certificate-file'] as String?,\n      keyFile: argResults['key-file'] as String?,\n      ssl: argResults['ssl'] as bool? ?? false,\n      http2: argResults['http2'] as bool? ?? false,\n      certificatePassword: argResults['certificate-password'] as String?,\n      keyPassword: argResults['key-password'] as String?,\n    );\n  }\n}\n"
  },
  {
    "path": "packages/production/lib/src/runner.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'dart:isolate';\nimport 'package:belatuk_pub_sub/belatuk_pub_sub.dart';\nimport 'package:belatuk_pub_sub/isolate.dart';\nimport 'package:intl/intl.dart';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_framework/http2.dart';\nimport 'package:args/args.dart';\nimport 'package:io/ansi.dart';\nimport 'package:io/io.dart';\nimport 'package:logging/logging.dart';\nimport 'instance_info.dart';\nimport 'options.dart';\n\n/// A command-line utility for easier running of multiple instances of an Angel application.\n///\n/// Makes it easy to do things like configure SSL, log messages, and send messages between\n/// all running instances.\nclass Runner {\n  final String name;\n  final AngelConfigurer configureServer;\n  final Reflector reflector;\n\n  final Map<String, Object> removeResponseHeaders;\n  final Map<String, Object> responseHeaders;\n\n  Runner(\n    this.name,\n    this.configureServer, {\n    this.reflector = const EmptyReflector(),\n    this.removeResponseHeaders = const {},\n    this.responseHeaders = const {},\n  });\n\n  static const String _asciiArt = '''\n\n     _    _   _  ____ _____ _     _____ \n    / \\\\  | \\\\ | |/ ___| ____| |   |___ / \n   / _ \\\\ |  \\\\| | |  _|  _| | |     |_ \\\\ \n  / ___ \\\\| |\\\\  | |_| | |___| |___ ___) |\n /_/   \\\\_\\\\_| \\\\_|\\\\____|_____|_____|____/                                                                                 \n''';\n\n  static final DateFormat _defaultDateFormat = DateFormat(\n    'yyyy-MM-dd HH:mm:ss',\n  );\n\n  /// LogRecord handler\n  static void handleLogRecord(LogRecord? record, RunnerOptions options) {\n    if (options.quiet || record == null) return;\n    var code = chooseLogColor(record.level);\n\n    var now = _defaultDateFormat.format(DateTime.now());\n\n    if (record.error == null) {\n      //print(code.wrap(record.message));\n      print(\n        code.wrap(\n          '$now ${record.level.name} [${record.loggerName}]: ${record.message}',\n        ),\n      );\n    }\n\n    if (record.error != null) {\n      var err = record.error;\n      if (err is AngelHttpException && err.statusCode != 500) return;\n      //print(code.wrap(record.message + '\\n'));\n      print(\n        code.wrap(\n          '$now ${record.level.name} [${record.loggerName}]: ${record.message} \\n',\n        ),\n      );\n      print(\n        code.wrap(\n          '$now ${record.level.name} [${record.loggerName}]: ${err.toString()}',\n        ),\n      );\n\n      if (record.stackTrace != null) {\n        print(\n          code.wrap(\n            '$now ${record.level.name} [${record.loggerName}]: ${record.stackTrace.toString()}',\n          ),\n        );\n      }\n    }\n  }\n\n  /// Chooses a color based on the logger [level].\n  static AnsiCode chooseLogColor(Level level) {\n    if (level == Level.SHOUT) {\n      return backgroundRed;\n    } else if (level == Level.SEVERE) {\n      return red;\n    } else if (level == Level.WARNING) {\n      return yellow;\n    } else if (level == Level.INFO) {\n      return cyan;\n    } else if (level == Level.FINER || level == Level.FINEST) {\n      return lightGray;\n    }\n    return resetAll;\n  }\n\n  /// Spawns a new instance of the application in a separate isolate.\n  ///\n  /// If the command-line arguments permit, then the instance will be respawned on crashes.\n  ///\n  /// The returned [Future] completes when the application instance exits.\n  ///\n  /// If respawning is enabled, the [Future] will *never* complete.\n  Future spawnIsolate(int id, RunnerOptions options, SendPort pubSubSendPort) {\n    return _spawnIsolate(id, Completer(), options, pubSubSendPort);\n  }\n\n  Future _spawnIsolate(\n    int id,\n    Completer c,\n    RunnerOptions options,\n    SendPort pubSubSendPort,\n  ) {\n    var onLogRecord = ReceivePort();\n    var onExit = ReceivePort();\n    var onError = ReceivePort();\n    var runnerArgs = RunnerArgs(\n      name,\n      configureServer,\n      options,\n      reflector,\n      onLogRecord.sendPort,\n      pubSubSendPort,\n    );\n    var argsWithId = RunnerArgsWithId(id, runnerArgs);\n\n    Isolate.spawn(\n      isolateMain,\n      argsWithId,\n      onExit: onExit.sendPort,\n      onError: onError.sendPort,\n      errorsAreFatal: true && false,\n    ).then((isolate) {}).catchError((e) {\n      c.completeError(e as Object);\n      return null;\n    });\n\n    onLogRecord.listen((msg) => handleLogRecord(msg as LogRecord?, options));\n\n    onError.listen((msg) {\n      if (msg is List) {\n        dynamic e = msg[0];\n        var st = StackTrace.fromString(msg[1].toString());\n        handleLogRecord(\n          LogRecord(Level.SEVERE, 'Fatal error', runnerArgs.loggerName, e, st),\n          options,\n        );\n      } else {\n        handleLogRecord(\n          LogRecord(Level.SEVERE, 'Fatal error', runnerArgs.loggerName, msg),\n          options,\n        );\n      }\n    });\n\n    onExit.listen((_) {\n      if (options.respawn) {\n        handleLogRecord(\n          LogRecord(\n            Level.WARNING,\n            'Instance #$id at ${DateTime.now()} crashed. Respawning immediately...',\n            runnerArgs.loggerName,\n          ),\n          options,\n        );\n        _spawnIsolate(id, c, options, pubSubSendPort);\n      } else {\n        c.complete();\n      }\n    });\n\n    return c.future\n        .whenComplete(onExit.close)\n        .whenComplete(onError.close)\n        .whenComplete(onLogRecord.close);\n  }\n\n  /// Starts a number of isolates, running identical instances of an Angel application.\n  Future run(List<String> args) async {\n    Server? server;\n\n    try {\n      var argResults = RunnerOptions.argParser.parse(args);\n\n      var options = RunnerOptions.fromArgResults(argResults);\n      options.responseHeaders.addAll(responseHeaders);\n      options.removeResponseHeaders.addAll(removeResponseHeaders);\n\n      if (options.ssl || options.http2) {\n        if (options.certificateFile == null) {\n          throw ArgParserException('Missing --certificate-file option.');\n        } else if (options.keyFile == null) {\n          throw ArgParserException('Missing --key-file option.');\n        }\n      }\n\n      print(\n        darkGray.wrap(\n          '$_asciiArt\\n\\nA batteries-included, full-featured, full-stack framework in Dart.\\n\\nhttps://angel3-framework.web.app\\n',\n        ),\n      );\n\n      if (argResults['help'] == true) {\n        stdout\n          ..writeln('Options:')\n          ..writeln(RunnerOptions.argParser.usage);\n        return;\n      }\n\n      print('Starting `$name` application...');\n\n      var adapter = IsolateAdapter();\n      server = Server([adapter]);\n\n      // Register clients\n      // for (var i = 0; i < Platform.numberOfProcessors; i++) {\n      for (var i = 0; i < options.concurrency; i++) {\n        server.registerClient(ClientInfo('client$i'));\n      }\n\n      server.start();\n\n      await Future.wait(\n        List.generate(\n          options.concurrency,\n          (id) => spawnIsolate(id, options, adapter.receivePort.sendPort),\n        ),\n      );\n    } on ArgParserException catch (e) {\n      stderr\n        ..writeln(red.wrap(e.message))\n        ..writeln()\n        ..writeln(red.wrap('Options:'))\n        ..writeln(red.wrap(RunnerOptions.argParser.usage));\n      exitCode = ExitCode.usage.code;\n    } catch (e, st) {\n      stderr\n        ..writeln(red.wrap('fatal error: $e'))\n        ..writeln(red.wrap(st.toString()));\n      exitCode = 1;\n    } finally {\n      await server?.close();\n    }\n  }\n\n  /// Run with main isolate\n  static void isolateMain(RunnerArgsWithId argsWithId) {\n    var args = argsWithId.args;\n    hierarchicalLoggingEnabled = false;\n\n    var zone = Zone.current.fork(\n      specification: ZoneSpecification(\n        print: (self, parent, zone, msg) {\n          args.loggingSendPort.send(\n            LogRecord(Level.INFO, msg, args.loggerName),\n          );\n        },\n      ),\n    );\n\n    zone.run(() async {\n      var client = IsolateClient('client${argsWithId.id}', args.pubSubSendPort);\n\n      var app = Angel(reflector: args.reflector)\n        ..container.registerSingleton<Client>(client)\n        ..container.registerSingleton(InstanceInfo(id: argsWithId.id));\n\n      app.shutdownHooks.add((_) => client.close());\n\n      await app.configure(args.configureServer);\n\n      app.logger = Logger(args.loggerName)\n        ..onRecord.listen((rec) => Runner.handleLogRecord(rec, args.options));\n\n      AngelHttp http;\n      late SecurityContext securityContext;\n      Uri serverUrl;\n\n      if (args.options.ssl || args.options.http2) {\n        securityContext = SecurityContext();\n        var certificateFile = args.options.certificateFile;\n        if (certificateFile != null) {\n          securityContext.useCertificateChain(\n            certificateFile,\n            password: args.options.certificatePassword,\n          );\n        }\n\n        var keyFile = args.options.keyFile;\n        if (keyFile != null) {\n          securityContext.usePrivateKey(\n            keyFile,\n            password: args.options.keyPassword,\n          );\n        }\n      }\n\n      if (args.options.ssl) {\n        http = AngelHttp.custom(\n          app,\n          startSharedSecure(securityContext),\n          useZone: args.options.useZone,\n        );\n      } else {\n        http = AngelHttp.custom(\n          app,\n          startShared,\n          useZone: args.options.useZone,\n        );\n      }\n\n      Driver driver;\n\n      if (args.options.http2) {\n        securityContext.setAlpnProtocols(['h2'], true);\n        var http2 = AngelHttp2.custom(\n          app,\n          securityContext,\n          startSharedHttp2,\n          useZone: args.options.useZone,\n        );\n        http2.onHttp1.listen(http.handleRequest);\n        driver = http2;\n      } else {\n        driver = http;\n      }\n\n      await driver.startServer(args.options.hostname, args.options.port);\n\n      // Only apply the headers to AngelHttp instance\n      if (driver is AngelHttp) {\n        driver.addResponseHeader(args.options.responseHeaders);\n        driver.removeResponseHeader(args.options.removeResponseHeaders);\n      }\n\n      serverUrl = driver.uri;\n      if (args.options.ssl || args.options.http2) {\n        serverUrl = serverUrl.replace(scheme: 'https');\n      }\n      print('Instance #${argsWithId.id} listening at $serverUrl');\n    });\n  }\n}\n\nclass RunnerArgsWithId {\n  final int id;\n  final RunnerArgs args;\n\n  RunnerArgsWithId(this.id, this.args);\n}\n\nclass RunnerArgs {\n  final String name;\n\n  final AngelConfigurer configureServer;\n\n  final RunnerOptions options;\n\n  final Reflector reflector;\n\n  final SendPort loggingSendPort, pubSubSendPort;\n\n  RunnerArgs(\n    this.name,\n    this.configureServer,\n    this.options,\n    this.reflector,\n    this.loggingSendPort,\n    this.pubSubSendPort,\n  );\n\n  String get loggerName => name;\n}\n"
  },
  {
    "path": "packages/production/melos_angel3_production.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/production/pubspec.yaml",
    "content": "name: angel3_production\nversion: 8.6.0\ndescription: Helpers for concurrency, message-passing, rotating loggers, and other production functionality in Angel3.\nhomepage: https://angel3-framework.web.app\nrepository: https://github.com/dart-backend/angel/tree/master/packages/production\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_container: ^8.0.0\n  angel3_framework: ^8.4.0\n  belatuk_pub_sub: ^6.1.0\n  args: ^2.4.0\n  io: ^1.0.0\n  logging: ^1.2.0\n  intl: ^0.20.0\ndev_dependencies:\n  lints: ^6.0.0\n\n\n"
  },
  {
    "path": "packages/redis/.gitignore",
    "content": "# See https://www.dartlang.org/tools/private-files.html\n\n# Files and directories created by pub\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n.dart_tool\ndump.rdb\n"
  },
  {
    "path": "packages/redis/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/redis/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0\n\n* Skipped release\n\n## 2.0.1\n\n* Updated linter to `package:lints`\n\n## 2.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 1.0.0\n\n* First version.\n"
  },
  {
    "path": "packages/redis/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/redis/README.md",
    "content": "# Angel3 Redis\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_redis?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/redis/LICENSE)\n\n**Forked from `angel_redis` to support NNBD**\n\nRedis-enabled services for the Angel3 framework. `RedisService` can be used alone, *or* as the backend of a [`CacheService`](https://pub.dev/packages/angel3_cache), and thereby cache the results of calling an upstream database.\n\n## Installation\n\n`package:angel3_redis` requires Angel3.\n\nIn your `pubspec.yaml`:\n\n```yaml\ndependencies:\n    angel3_framework: ^8.0.0\n    angel3_redis: ^8.0.0\n```\n\n## Usage\n\nPass an instance of `RespCommandsTier2` (from `package:resp_client`) to the `RedisService` constructor. You can also pass an optional prefix, which is recommended if you are using `angel3_redis` for multiple logically-separate collections. Redis is a flat key-value store; by prefixing the keys used, `angel3_redis` can provide the experience of using separate stores, rather than a single node.\n\nWithout a prefix, there's a chance that different collections can overwrite one another's data.\n\n## Notes\n\n* Neither `index`, nor `modify` is atomic; each performs two separate queries.`angel3_redis` stores data as JSON strings, rather than as Redis hashes, so an update-in-place is impossible.\n* `index` uses Redis' `KEYS` functionality, so use it sparingly in production, if at all. In a larger database, it can quickly\nbecome a bottleneck.\n* `remove` uses `MULTI`+`EXEC` in a transaction.\n* Prefer using `update`, rather than `modify`. The former only performs one query, though it does overwrite the current\ncontents for a given key.\n* When calling `create`, it's possible that you may already have an `id` in mind to insert into the store. For example,\nwhen caching another database, you'll preserve the ID or primary key of an item. `angel3_redis` heeds this. If no\n`id` is present, then an ID will be created via an `INCR` call.\n\n## Example\n\nAlso present at `example/main.dart`:\n\n```dart\nimport 'package:angel3_redis/angel3_redis.dart';\nimport 'package:resp_client/resp_client.dart';\nimport 'package:resp_client/resp_commands.dart';\nimport 'package:resp_client/resp_server.dart';\n\nmain() async {\n  var connection = await connectSocket('localhost');\n  var client = RespClient(connection);\n  var service = RedisService(RespCommandsTier2(client), prefix: 'example');\n\n  // Create an object\n  await service.create({'id': 'a', 'hello': 'world'});\n\n  // Read it...\n  var read = await service.read('a');\n  print(read['hello']);\n\n  // Delete it.\n  await service.remove('a');\n\n  // Close the connection.\n  await connection.close();\n}\n```\n"
  },
  {
    "path": "packages/redis/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/redis/example/main.dart",
    "content": "import 'package:angel3_redis/angel3_redis.dart';\nimport 'package:resp_client/resp_client.dart';\nimport 'package:resp_client/resp_commands.dart';\nimport 'package:resp_client/resp_server.dart';\n\nvoid main() async {\n  var connection = await connectSocket('localhost');\n  var client = RespClient(connection);\n  var service = RedisService(RespCommandsTier2(client), prefix: 'example');\n\n  // Create an object\n  await service.create({'id': 'a', 'hello': 'world'});\n\n  // Read it...\n  var read = await (service.read('a'));\n  print(read['hello']);\n\n  // Delete it.\n  await service.remove('a');\n\n  // Close the connection.\n  await connection.close();\n}\n"
  },
  {
    "path": "packages/redis/lib/angel3_redis.dart",
    "content": "export 'src/redis_service.dart';\n"
  },
  {
    "path": "packages/redis/lib/src/redis_service.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:resp_client/resp_client.dart';\nimport 'package:resp_client/resp_commands.dart';\n\n/// An Angel service that reads and writes JSON within a Redis store.\nclass RedisService extends Service<String, Map<String, dynamic>> {\n  final RespCommandsTier2 respCommands;\n\n  /// An optional string prefixed to keys before they are inserted into Redis.\n  ///\n  /// Consider using this if you are using several different Redis collections\n  /// within a single application.\n  final String? prefix;\n\n  RedisService(this.respCommands, {this.prefix});\n\n  String? _applyPrefix(String? id) => prefix == null ? id : '$prefix:$id';\n\n  @override\n  Future<List<Map<String, dynamic>>> index([\n    Map<String, dynamic>? params,\n  ]) async {\n    var result =\n        //await respCommands.client.writeArrayOfBulk(['KEYS', _applyPrefix('*')]);\n        await respCommands.tier1.tier0.execute(['KEYS', _applyPrefix('*')]);\n    var keys = result.payload.map((RespType s) => s.payload) as Iterable;\n    if (keys.isEmpty) return [];\n    //result = await respCommands.client.writeArrayOfBulk(['MGET']..addAll(keys));\n    result = await respCommands.tier1.tier0.execute(['MGET', ...keys]);\n\n    if (result.isArray) {\n      return (result as List<RespType>)\n          .map<Map<String, dynamic>>(\n            (RespType s) =>\n                json.decode(s.payload as String) as Map<String, dynamic>,\n          )\n          .toList();\n    } else {\n      // TODO: To be reviewed for handling none array objects\n      return [json.decode(result.payload as String) as Map<String, dynamic>];\n    }\n  }\n\n  @override\n  Future<Map<String, dynamic>> read(\n    String id, [\n    Map<String, dynamic>? params,\n  ]) async {\n    var value = await respCommands.get(_applyPrefix(id)!);\n\n    if (value == null) {\n      throw AngelHttpException.notFound(message: 'No record found for ID $id');\n    } else {\n      return json.decode(value) as Map<String, dynamic>;\n    }\n  }\n\n  @override\n  Future<Map<String, dynamic>> create(\n    Map<String, dynamic>? data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    String? id;\n    if (data!['id'] != null) {\n      id = data['id'] as String?;\n    } else {\n      var keyVar = await respCommands.tier1.tier0.execute([\n        'INCR',\n        _applyPrefix('angel_redis:id'),\n      ]);\n      id = keyVar.payload.toString();\n      data = Map<String, dynamic>.from(data)..['id'] = id;\n    }\n\n    await respCommands.set(_applyPrefix(id)!, json.encode(data));\n    return data;\n  }\n\n  @override\n  Future<Map<String, dynamic>> modify(\n    String id,\n    Map<String, dynamic>? data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    var input = await (read(id));\n    input.addAll(data!);\n    return await update(id, input, params);\n  }\n\n  @override\n  Future<Map<String, dynamic>> update(\n    String id,\n    Map<String, dynamic>? data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    data = Map<String, dynamic>.from(data!)..['id'] = id;\n    await respCommands.set(_applyPrefix(id)!, json.encode(data));\n    return data;\n  }\n\n  @override\n  Future<Map<String, dynamic>> remove(\n    String id, [\n    Map<String, dynamic>? params,\n  ]) async {\n    var client = respCommands.tier1.tier0;\n    await client.execute(['MULTI']);\n    await client.execute(['GET', _applyPrefix(id)]);\n    await client.execute(['DEL', _applyPrefix(id)]);\n    var result = await client.execute(['EXEC']);\n    var str = result.payload[0] as RespBulkString;\n\n    if (str.payload == null) {\n      throw AngelHttpException.notFound(message: 'No record found for ID $id');\n    } else {\n      return json.decode(str.payload!) as Map<String, dynamic>;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/redis/melos_angel3_redis.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/redis/pubspec.yaml",
    "content": "name: angel3_redis\nversion: 8.5.0\ndescription: An Angel3 service provider for Redis. Works well for caching volatile data.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/redis\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  angel3_http_exception: ^8.0.0\n  resp_client: ^1.2.0\ndev_dependencies:\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/redis/test/all_test.dart",
    "content": "import 'package:angel3_http_exception/angel3_http_exception.dart';\nimport 'package:angel3_redis/angel3_redis.dart';\nimport 'package:resp_client/resp_client.dart';\nimport 'package:resp_client/resp_commands.dart';\nimport 'package:resp_client/resp_server.dart';\nimport 'package:test/test.dart';\n\nvoid main() async {\n  late RespServerConnection connection;\n  late RedisService service;\n\n  setUp(() async {\n    connection = await connectSocket('localhost');\n    service = RedisService(\n      RespCommandsTier2(RespClient(connection)),\n      prefix: 'angel_redis_test',\n    );\n  });\n\n  tearDown(() => connection.close());\n\n  test('index', () async {\n    // Wipe\n    await service.respCommands.flushDb();\n    await service.create({'id': '0', 'name': 'Tobe'});\n    await service.create({'id': '1', 'name': 'Osakwe'});\n\n    var output = await service.index();\n    expect(output, hasLength(2));\n    expect(output[1], <String, dynamic>{'id': '0', 'name': 'Tobe'});\n    expect(output[0], <String, dynamic>{'id': '1', 'name': 'Osakwe'});\n  });\n\n  test('create with id', () async {\n    var input = {'id': 'foo', 'bar': 'baz'};\n    var output = await service.create(input);\n    expect(input, output);\n  });\n\n  test('create without id', () async {\n    var input = {'bar': 'baz'};\n    var output = await (service.create(input));\n    print(output);\n    expect(output.keys, contains('id'));\n    expect(output, containsPair('bar', 'baz'));\n  });\n\n  test('read', () async {\n    var id = 'poobah${DateTime.now().millisecondsSinceEpoch}';\n    var input = await service.create({'id': id, 'bar': 'baz'});\n    expect(await service.read(id), input);\n  });\n\n  test('modify', () async {\n    var id = 'jamboree${DateTime.now().millisecondsSinceEpoch}';\n    await service.create({'id': id, 'bar': 'baz', 'yes': 'no'});\n    var output = await service.modify(id, {'bar': 'quux'});\n    expect(output, {'id': id, 'bar': 'quux', 'yes': 'no'});\n    expect(await service.read(id), output);\n  });\n\n  test('update', () async {\n    var id = 'hoopla${DateTime.now().millisecondsSinceEpoch}';\n    await service.create({'id': id, 'bar': 'baz'});\n    var output = await service.update(id, {'yes': 'no'});\n    expect(output, {'id': id, 'yes': 'no'});\n    expect(await service.read(id), output);\n  });\n\n  test('remove', () async {\n    var id = 'gelatin${DateTime.now().millisecondsSinceEpoch}';\n    var input = await service.create({'id': id, 'bar': 'baz'});\n    expect(await service.remove(id), input);\n    expect(await service.respCommands.exists([id]), 0);\n  });\n\n  test('remove nonexistent', () async {\n    expect(\n      () => service.remove('definitely_does_not_exist'),\n      throwsA(const TypeMatcher<AngelHttpException>()),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/sembast/.gitignore",
    "content": "# See https://www.dartlang.org/guides/libraries/private-files\n\n# Files and directories created by pub\n.dart_tool/\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n*.db"
  },
  {
    "path": "packages/sembast/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/sembast/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.1\n\n* Updated README\n\n## 3.0.0\n\n* Updated linter to `package:lints`\n* Updated min SDK to 2.14.x\n\n## 2.0.1\n\n* Updated pubspec description\n* Updated README\n\n## 2.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 1.0.1\n\n* Fix flaw where clients could remove all records, even if `allowRemoveAll` were `false`.\n\n## 1.0.0\n\n* First release\n"
  },
  {
    "path": "packages/sembast/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/sembast/README.md",
    "content": "# Sembast Persistent Service for Angel3\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_sembast?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/sembast/LICENSE)\n\nA plugin service that persist data to Sembast for Angel3 framework.\n\n## Installation\n\nAdd the following to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  angel3_sembast: ^8.0.0\n```\n\n## Usage\n\nThis library exposes one main class: `SembastService`.\n\n### SembastService\n\nThis class interacts with a `Database` and `Store` (from `package:sembast`) and serializes data to and from Maps.\n\n### Querying\n\nYou can query these services as follows:\n\n```curl\n/path/to/service?foo=bar\n```\n\nThe above will query the database to find records where 'foo' equals 'bar'.\n\nThe former will sort result in ascending order of creation, and so will the latter.\n\n```dart\nList queried = await MyService.index({r\"query\": where.id(Finder(filter: Filter(...))));\n```\n\nOf course, you can use `package:sembast` queries. Just pass it as `query` within `params`.\n\nSee the tests for more usage examples.\n"
  },
  {
    "path": "packages/sembast/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/sembast/example/main.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_sembast/angel3_sembast.dart';\nimport 'package:logging/logging.dart';\nimport 'package:sembast/sembast_io.dart';\n\nvoid main() async {\n  var app = Angel();\n  var db = await databaseFactoryIo.openDatabase('todos.db');\n\n  app\n    ..logger = (Logger('angel_sembast_example')..onRecord.listen(print))\n    ..use('/api/todos', SembastService(db, store: 'todos'))\n    ..shutdownHooks.add((_) => db.close());\n\n  var http = AngelHttp(app);\n  var server = await http.startServer('127.0.0.1', 3000);\n  var uri = Uri(\n    scheme: 'http',\n    host: server.address.address,\n    port: server.port,\n  );\n  print('angel_sembast example listening at $uri');\n}\n"
  },
  {
    "path": "packages/sembast/lib/angel3_sembast.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:sembast/sembast.dart';\n\nclass SembastService extends Service<String, Map<String, dynamic>> {\n  final Database database;\n  final StoreRef<int, Map<String, dynamic>> store;\n\n  /// If set to `true`, clients can remove all items by passing a `null` `id` to `remove`.\n  ///\n  /// `false` by default.\n  final bool allowRemoveAll;\n\n  /// If set to `true`, parameters in `req.query` are applied to the database query.\n  final bool allowQuery;\n\n  SembastService(\n    this.database, {\n    String? store,\n    this.allowRemoveAll = false,\n    this.allowQuery = true,\n  }) : store = intMapStoreFactory.store(store),\n       super();\n\n  Finder? _makeQuery([Map<String, dynamic>? params]) {\n    params = Map<String, dynamic>.from(params ?? {});\n    Filter? out;\n    var sort = <SortOrder>[];\n\n    // You can pass a Finder as 'query':\n    if (params['query'] is Finder) {\n      return params['query'] as Finder?;\n    }\n\n    for (var key in params.keys) {\n      if (key == r'$sort' &&\n          (allowQuery == true || !params.containsKey('provider'))) {\n        var v = params[key];\n\n        if (v is! Map) {\n          sort.add(SortOrder(v.toString(), true));\n        } else {\n          var m = v;\n          m.forEach((k, sorter) {\n            if (sorter is SortOrder) {\n              sort.add(sorter);\n            } else if (sorter is String) {\n              sort.add(SortOrder(k.toString(), sorter == '-1'));\n            } else if (sorter is num) {\n              sort.add(SortOrder(k.toString(), sorter == -1));\n            }\n          });\n        }\n      } else if (key == 'query' &&\n          (allowQuery == true || !params.containsKey('provider'))) {\n        var queryObj = params[key];\n\n        if (queryObj is Map) {\n          queryObj.forEach((k, v) {\n            if (k != 'provider' &&\n                !const ['__requestctx', '__responsectx'].contains(k)) {\n              var filter = Filter.equals(k.toString(), v);\n              if (out == null) {\n                out = filter;\n              } else {\n                out = Filter.or([out!, filter]);\n              }\n            }\n          });\n        }\n      }\n    }\n\n    return Finder(filter: out, sortOrders: sort);\n  }\n\n  Map<String, dynamic> _withId(Map<String, dynamic> data, String id) =>\n      Map<String, dynamic>.from(data)..['id'] = id;\n\n  @override\n  Future<Map<String, dynamic>> findOne([\n    Map<String, dynamic>? params,\n    String errorMessage = 'No record was found matching the given query.',\n  ]) async {\n    var result = (await store.findFirst(\n      database,\n      finder: _makeQuery(params),\n    ))?.value;\n    if (result == null) {\n      return {};\n    }\n\n    return result;\n  }\n\n  @override\n  Future<List<Map<String, dynamic>>> index([\n    Map<String, dynamic>? params,\n  ]) async {\n    var records = await store.find(database, finder: _makeQuery(params));\n    return records\n        //.where((r) => r.value != null)\n        .map((r) => _withId(r.value, r.key.toString()))\n        .toList();\n  }\n\n  @override\n  Future<Map<String, dynamic>> read(\n    String id, [\n    Map<String, dynamic>? params,\n  ]) async {\n    var record = await store.record(int.parse(id)).getSnapshot(database);\n\n    if (record == null) {\n      throw AngelHttpException.notFound(message: 'No record found for ID $id');\n    }\n\n    return _withId(record.value, id);\n  }\n\n  @override\n  Future<Map<String, dynamic>> create(\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    return await database.transaction((txn) async {\n      var key = await store.add(txn, data);\n      var id = key.toString();\n      return _withId(data, id);\n    });\n  }\n\n  @override\n  Future<Map<String, dynamic>> modify(\n    String id,\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    return await database.transaction((txn) async {\n      var record = store.record(int.parse(id));\n      data = await record.put(txn, data, merge: true);\n      return _withId(data, id);\n    });\n  }\n\n  @override\n  Future<Map<String, dynamic>> update(\n    String id,\n    Map<String, dynamic> data, [\n    Map<String, dynamic>? params,\n  ]) async {\n    return await database.transaction((txn) async {\n      var record = store.record(int.parse(id));\n      data = await record.put(txn, data);\n      return _withId(data, id);\n    });\n  }\n\n  @override\n  Future<Map<String, dynamic>> remove(\n    String? id, [\n    Map<String, dynamic>? params,\n  ]) async {\n    if (id == null || id == 'null') {\n      // Remove everything...\n      if (!(allowRemoveAll == true ||\n          params?.containsKey('provider') != true)) {\n        throw AngelHttpException.forbidden(\n          message: 'Clients are not allowed to delete all items.',\n        );\n      } else {\n        await store.delete(database);\n        return {};\n      }\n    }\n\n    return database.transaction((txn) async {\n      var record = store.record(int.parse(id));\n      var snapshot = await record.getSnapshot(txn);\n\n      if (snapshot == null) {\n        throw AngelHttpException.notFound(\n          message: 'No record found for ID $id',\n        );\n      } else {\n        await record.delete(txn);\n      }\n\n      return _withId(snapshot.value, id);\n    });\n  }\n}\n"
  },
  {
    "path": "packages/sembast/melos_angel3_sembast.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/sembast/pubspec.yaml",
    "content": "name: angel3_sembast\nversion: 8.5.0\ndescription: A plugin service that persist data to Sembast for Angel3 framework.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/sembast\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  sembast: ^3.1.1\ndev_dependencies:\n  angel3_http_exception: ^8.0.0\n  logging: ^1.2.0\n  lints: ^6.0.0\n  test: ^1.24.0\n\n"
  },
  {
    "path": "packages/sembast/test/all_test.dart",
    "content": "import 'dart:collection';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_sembast/angel3_sembast.dart';\nimport 'package:sembast/sembast_io.dart';\nimport 'package:test/test.dart';\n\nvoid main() async {\n  late Database database;\n  late SembastService service;\n\n  setUp(() async {\n    database = await databaseFactoryIo.openDatabase('test.db');\n    service = SembastService(database);\n  });\n\n  tearDown(() => database.close());\n\n  test('index', () async {\n    await service.create({'id': '0', 'name': 'Tobe'});\n    await service.create({'id': '1', 'name': 'Osakwe'});\n\n    var output = await service.index();\n    print(output);\n    expect(output, hasLength(2));\n    expect(output[0], <String, dynamic>{'id': '1', 'name': 'Tobe'});\n    expect(output[1], <String, dynamic>{'id': '2', 'name': 'Osakwe'});\n  });\n\n  test('create', () async {\n    var input = {'bar': 'baz'};\n    var output = await service.create(input);\n    print(output);\n    expect(output.keys, contains('id'));\n    expect(output, containsPair('bar', 'baz'));\n  });\n\n  test('read', () async {\n    var name = 'poobah${DateTime.now().millisecondsSinceEpoch}';\n    var input = await service.create({'name': name, 'bar': 'baz'});\n    print(input);\n    expect(await service.read(input['id'] as String), input);\n  });\n\n  test('modify', () async {\n    var input = await service.create({'bar': 'baz', 'yes': 'no'});\n    var id = input['id'] as String;\n    var output = await service.modify(id, {'bar': 'quux'});\n    expect(\n      SplayTreeMap.from(output),\n      SplayTreeMap.from({'id': id, 'bar': 'quux', 'yes': 'no'}),\n    );\n    expect(await service.read(id), output);\n  });\n\n  test('update', () async {\n    var input = await service.create({'bar': 'baz'});\n    var id = input['id'] as String;\n    var output = await service.update(id, {'yes': 'no'});\n    expect(output, {'id': id, 'yes': 'no'});\n    expect(await service.read(id), output);\n  });\n\n  test('remove', () async {\n    var input = await service.create({'bar': 'baz'});\n    var id = input['id'] as String?;\n    expect(await service.remove(id), input);\n    expect(await StoreRef.main().record(id).get(database), isNull);\n  });\n\n  test('remove', () async {\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n\n    expect(await service.index(), isNotEmpty);\n    await service.remove(null);\n    expect(await service.index(), isEmpty);\n  });\n\n  test('cannot remove all unless explicitly set', () async {\n    expect(\n      () => service.remove(null, {'provider': Providers.rest}),\n      throwsA(const TypeMatcher<AngelHttpException>()),\n    );\n    expect(\n      () => service.remove(null, {'provider': Providers.rest}),\n      throwsA(\n        predicate(\n          (dynamic x) => x is AngelHttpException && x.statusCode == 403,\n          'throws forbidden',\n        ),\n      ),\n    );\n    expect(\n      () => service.remove('null', {'provider': Providers.rest}),\n      throwsA(const TypeMatcher<AngelHttpException>()),\n    );\n    expect(\n      () => service.remove('null', {'provider': Providers.rest}),\n      throwsA(\n        predicate(\n          (dynamic x) => x is AngelHttpException && x.statusCode == 403,\n          'throws forbidden',\n        ),\n      ),\n    );\n  });\n\n  test('can remove all on server side', () async {\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n    await service.remove(null);\n    expect(await service.index(), isEmpty);\n\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n    await service.create({'bar': 'baz'});\n    await service.remove('null');\n    expect(await service.index(), isEmpty);\n  });\n\n  test('remove nonexistent', () async {\n    expect(\n      () => service.remove('440'),\n      throwsA(const TypeMatcher<AngelHttpException>()),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/seo/.gitignore",
    "content": "# See https://www.dartlang.org/guides/libraries/private-files\n\n# Files and directories created by pub\n.dart_tool/\n.packages\n.pub/\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\npubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n"
  },
  {
    "path": "packages/seo/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/seo/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.0\n\n* Updated linter to `package:lints`\n\n## 4.0.0\n\n* Updated to use `angel3` packages\n* Published with `angel3` prefix\n\n## 3.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 2.0.0\n\n* Angel 2 updates.\n\n## 1.0.0\n\n* Initial release\n"
  },
  {
    "path": "packages/seo/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/seo/README.md",
    "content": "# Angel3 SEO\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_seo?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/seo/LICENSE)\n\nHelpers for building SEO-friendly Web pages in Angel. The goal of `package:angel3_seo` is to speed up perceived client page loads, prevent the infamous [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content), and other SEO optimizations that can easily become tedious to perform by hand.\n\n## Disabling inlining per-element\n\nAdd a `data-no-inline` attribute to a `link` or `script` to prevent inlining it:\n\n```html\n<script src=\"main.dart.js\" data-no-inline></script>\n```\n\n## `inlineAssets`\n\nA [response finalizer](https://angel3-docs.dukefirehawk.com/guides/request-lifecycle) that can be used in any application to patch HTML responses, including those sent with a templating engine like Jael3.\n\nIn any `text/html` response sent down, `link` and `script` elements that point to internal resources will have the contents of said file read, and inlined into the HTML page itself.\n\nIn this case, \"internal resources\" refers to a URI *without* a scheme, i.e. `/site.css` or `foo/bar/baz.js`.\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_seo/angel3_seo.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\n\nvoid main() async {\n  var app = Angel()..lazyParseBodies = true;\n  var fs = const LocalFileSystem();\n  var http = AngelHttp(app);\n\n  app.responseFinalizers.add(inlineAssets(fs.directory('web')));\n\n  app.use(() => throw AngelHttpException.notFound());\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n```\n\n## `inlineAssetsFromVirtualDirectory`\n\nThis function is a simple one; it wraps a `VirtualDirectory` to patch the way it sends `.html` files. Produces the same functionality as `inlineAssets`.\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_seo/angel3_seo.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\n\nvoid main() async {\n  var app = Angel()..lazyParseBodies = true;\n  var fs = const LocalFileSystem();\n  var http = AngelHttp(app);\n\n  var vDir = inlineAssets(\n    VirtualDirectory(\n      app,\n      fs,\n      source: fs.directory('web'),\n    ),\n  );\n\n  app.use(vDir.handleRequest);\n\n  app.use(() => throw AngelHttpException.notFound());\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n```\n"
  },
  {
    "path": "packages/seo/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/seo/example/main.dart",
    "content": "import 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_seo/angel3_seo.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\nimport 'package:http_parser/http_parser.dart';\n\nvoid main() async {\n  var app = Angel();\n  var fs = const LocalFileSystem();\n  var http = AngelHttp(app);\n\n  // You can wrap a [VirtualDirectory]\n  var vDir = inlineAssetsFromVirtualDirectory(\n    VirtualDirectory(app, fs, source: fs.directory('web')),\n  );\n\n  app.fallback(vDir.handleRequest);\n\n  // OR, just add a finalizer. Note that [VirtualDirectory] *streams* its response,\n  // so a response finalizer does not touch its contents.\n  //\n  // You likely won't need to use both; it just depends on your use case.\n  app.responseFinalizers.add(inlineAssets(fs.directory('web')));\n\n  app.get('/using_response_buffer', (req, res) async {\n    var indexHtml = fs.directory('web').childFile('index.html');\n    var contents = await indexHtml.readAsString();\n    res\n      ..contentType = MediaType('text', 'html', {'charset': 'utf-8'})\n      ..buffer!.add(utf8.encode(contents));\n  });\n\n  app.fallback((req, res) => throw AngelHttpException.notFound());\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/seo/example/web/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\"\n          content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <link rel=\"stylesheet\" href=\"site.css\">\n    <link rel=\"stylesheet\" href=\"not-inlined.css\" data-no-inline>\n    <script src=\"site.js\"></script>\n    <script src=\"not-inlined.js\" data-no-inline></script>\n    <title>Angel SEO</title>\n</head>\n<body>\n<h1>Angel SEO</h1>\n<p>Embrace the power of inlined styles, etc.</p>\n</body>\n</html>"
  },
  {
    "path": "packages/seo/example/web/not-inlined.css",
    "content": "p {\n    font-style: italic;\n}"
  },
  {
    "path": "packages/seo/example/web/not-inlined.js",
    "content": "window.addEventListener('load', function() {\n  console.log('THIS message was not from an inlined file.');\n});"
  },
  {
    "path": "packages/seo/example/web/site.css",
    "content": "h1 {\n    color: pink;\n}"
  },
  {
    "path": "packages/seo/example/web/site.js",
    "content": "window.addEventListener('load', function() {\n  console.log('Hello, inline world!');\n});"
  },
  {
    "path": "packages/seo/lib/angel3_seo.dart",
    "content": "export 'src/inline_assets.dart';\n"
  },
  {
    "path": "packages/seo/lib/src/inline_assets.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/file.dart';\nimport 'package:html/dom.dart' as html;\nimport 'package:html/parser.dart' as html;\nimport 'package:path/path.dart' as p;\n\n/// Inlines assets into buffered responses, resolving paths from an [assetDirectory].\n///\n/// In any `.html` file sent down, `link` and `script` elements that point to internal resources\n/// will have the contents of said file read, and inlined into the HTML page itself.\n///\n/// In this case, \"internal resources\" refers to a URI *without* a scheme, i.e. `/site.css` or\n/// `foo/bar/baz.js`.\nRequestHandler inlineAssets(Directory assetDirectory) {\n  return (req, res) {\n    if (!res.isOpen ||\n        !res.isBuffered ||\n        res.contentType.mimeType != 'text/html') {\n      return Future<bool>.value(true);\n    } else {\n      var doc = html.parse(utf8.decode(res.buffer!.takeBytes()));\n      return inlineAssetsIntoDocument(doc, assetDirectory).then((_) {\n        res.buffer!.add(utf8.encode(doc.outerHtml));\n        return false;\n      });\n    }\n  };\n}\n\n/// Wraps a `VirtualDirectory` to patch the way it sends\n/// `.html` files.\n///\n/// In any `.html` file sent down, `link` and `script` elements that point to internal resources\n/// will have the contents of said file read, and inlined into the HTML page itself.\n///\n/// In this case, \"internal resources\" refers to a URI *without* a scheme, i.e. `/site.css` or\n/// `foo/bar/baz.js`.\nVirtualDirectory inlineAssetsFromVirtualDirectory(VirtualDirectory vDir) =>\n    _InlineAssets(vDir);\n\n/// Replaces `link` and `script` tags within a [doc] with the static contents they would otherwise trigger an HTTP request to.\n///\n/// Powers both [inlineAssets] and [inlineAssetsFromVirtualDirectory].\nFuture inlineAssetsIntoDocument(\n  html.Document doc,\n  Directory? assetDirectory,\n) async {\n  var linksWithRel =\n      doc.head\n          ?.getElementsByTagName('link')\n          .where((link) => link.attributes['rel'] == 'stylesheet') ??\n      <html.Element>[];\n\n  for (var link in linksWithRel) {\n    if (link.attributes.containsKey('data-no-inline')) {\n      link.attributes.remove('data-no-inline');\n    } else {\n      var uri = Uri.parse(link.attributes['href']!);\n\n      if (uri.scheme.isEmpty) {\n        var styleFile = assetDirectory!.childFile(uri.path);\n\n        if (await styleFile.exists()) {\n          var style = html.Element.tag('style')\n            ..innerHtml = await styleFile.readAsString();\n          link.replaceWith(style);\n        }\n      }\n    }\n  }\n\n  var scripts = doc\n      .getElementsByTagName('script')\n      .where((script) => script.attributes.containsKey('src'));\n\n  for (var script in scripts) {\n    if (script.attributes.containsKey('data-no-inline')) {\n      script.attributes.remove('data-no-inline');\n    } else {\n      var uri = Uri.parse(script.attributes['src']!);\n\n      if (uri.scheme.isEmpty) {\n        var scriptFile = assetDirectory!.childFile(uri.path);\n        if (await scriptFile.exists()) {\n          script.attributes.remove('src');\n          script.innerHtml = await scriptFile.readAsString();\n        }\n      }\n    }\n  }\n}\n\nclass _InlineAssets extends VirtualDirectory {\n  final VirtualDirectory inner;\n\n  _InlineAssets(this.inner)\n    : super(\n        inner.app,\n        inner.fileSystem,\n        source: inner.source,\n        indexFileNames: inner.indexFileNames,\n        publicPath: inner.publicPath,\n        callback: inner.callback,\n        allowDirectoryListing: inner.allowDirectoryListing,\n      );\n\n  @override\n  Future<bool> serveFile(\n    File file,\n    FileStat stat,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    if (p.extension(file.path) == '.html') {\n      var contents = await file.readAsString();\n      var doc = html.parse(contents, sourceUrl: file.uri.toString());\n      await inlineAssetsIntoDocument(doc, inner.source);\n\n      res\n        ..headers['content-type'] = 'text/html; charset=utf8'\n        ..add(utf8.encode(doc.outerHtml));\n      return false;\n    } else {\n      return await inner.serveFile(file, stat, req, res);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/seo/melos_angel3_seo.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/seo/pubspec.yaml",
    "content": "name: angel3_seo\nversion: 8.5.0\ndescription: Helper infrastructure for building SEO-friendly Web backends in Angel3.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/angel3/packages/seo\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  angel3_static: ^8.2.0\n  file: ^7.0.0\n  html: ^0.15.0\n  http_parser: ^4.0.0\n  path: ^1.9.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  logging: ^1.2.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/seo/test/inline_assets_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_seo/angel3_seo.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:file/file.dart';\nimport 'package:file/memory.dart';\nimport 'package:html/dom.dart' as html;\nimport 'package:html/parser.dart' as html;\nimport 'package:http_parser/http_parser.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('inlineAssets', () {\n    group(\n      'buffer',\n      inlineAssetsTests((app, dir) {\n        app.get('/', (req, res) async {\n          var indexHtml = dir.childFile('index.html');\n          var contents = await indexHtml.readAsBytes();\n          res\n            ..useBuffer()\n            ..contentType = MediaType.parse('text/html; charset=utf-8')\n            ..buffer!.add(contents);\n        });\n\n        app.responseFinalizers.add(inlineAssets(dir));\n      }),\n    );\n\n    group(\n      'virtual_directory',\n      inlineAssetsTests((app, dir) {\n        var vDir = inlineAssetsFromVirtualDirectory(\n          VirtualDirectory(app, dir.fileSystem, source: dir),\n        );\n        app.fallback(vDir.handleRequest);\n      }),\n    );\n  });\n}\n\n/// Typedef for backwards-compatibility with Dart 1.\ntypedef InlineAssetTest = void Function(Angel app, Directory dir);\n\nvoid Function() inlineAssetsTests(InlineAssetTest f) {\n  return () {\n    late TestClient client;\n\n    setUp(() async {\n      var app = Angel();\n      var fs = MemoryFileSystem();\n      var dir = fs.currentDirectory;\n      f(app, dir);\n      client = await connectTo(app);\n\n      for (var path in contents.keys) {\n        var file = fs.file(path);\n        await file.writeAsString(contents[path]!.trim());\n      }\n\n      app.logger = Logger('angel_seo')\n        ..onRecord.listen((rec) {\n          print(rec);\n          if (rec.error != null) print(rec.error);\n          if (rec.stackTrace != null) print(rec.stackTrace);\n        });\n    });\n\n    tearDown(() => client.close());\n\n    group('sends html', () {\n      late html.Document doc;\n\n      setUp(() async {\n        var res = await client.get(\n          Uri.parse('/'),\n          headers: {'accept': 'text/html'},\n        );\n        print(res.body);\n        doc = html.parse(res.body);\n      });\n\n      group('stylesheets', () {\n        test('replaces <link> with <style>', () {\n          expect(doc.querySelectorAll('link'), hasLength(1));\n        });\n\n        test('populates a <style>', () {\n          var style = doc.querySelector('style');\n          expect(style?.innerHtml.trim(), contents['site.css']);\n        });\n\n        test('heeds data-no-inline', () {\n          var link = doc.querySelector('link')!;\n          expect(link.attributes, containsPair('rel', 'stylesheet'));\n          expect(link.attributes, containsPair('href', 'not-inlined.css'));\n          expect(link.attributes.keys, isNot(contains('data-no-inline')));\n        });\n\n        test('preserves other attributes', () {\n          var link = doc.querySelector('link')!;\n          expect(link.attributes, containsPair('data-foo', 'bar'));\n        });\n      });\n\n      group('scripts', () {\n        test('does not replace <script> with anything', () {\n          expect(doc.querySelectorAll('script'), hasLength(2));\n        });\n\n        test('populates innerHtml', () {\n          var script0 = doc.querySelectorAll('script')[0];\n          expect(script0.innerHtml.trim(), contents['site.js']);\n        });\n\n        test('heeds data-no-inline', () {\n          var script1 = doc.querySelectorAll('script')[1];\n          expect(script1.attributes, containsPair('src', 'not-inlined.js'));\n          expect(script1.attributes.keys, isNot(contains('data-no-inline')));\n        });\n\n        test('preserves other attributes', () {\n          var script0 = doc.querySelectorAll('script')[0];\n          var script1 = doc.querySelectorAll('script')[1];\n          expect(script0.attributes, containsPair('data-foo', 'bar'));\n          expect(script1.attributes, containsPair('type', 'text/javascript'));\n        });\n      });\n    });\n  };\n}\n\nvar contents = <String, String>{\n  'index.html': '''<!doctype html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\"\n          content=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <link rel=\"stylesheet\" href=\"site.css\">\n    <link data-foo=\"bar\" rel=\"stylesheet\" href=\"not-inlined.css\" data-no-inline>\n    <script data-foo=\"bar\" src=\"site.js\"></script>\n    <script type=\"text/javascript\" src=\"not-inlined.js\" data-no-inline></script>\n    <title>Angel SEO</title>\n</head>\n<body>\n<h1>Angel SEO</h1>\n<p>Embrace the power of inlined styles, etc.</p>\n</body>\n</html>''',\n  'not-inlined.css': '''p {\n    font-style: italic;\n}''',\n  'not-inlined.js': '''window.addEventListener('load', function() {\n  console.log('THIS message was not from an inlined file.');\n});''',\n  'site.css': '''h1 {\n    color: pink;\n}''',\n  'site.js': '''window.addEventListener('load', function() {\n  console.log('Hello, inline world!');\n});''',\n};\n"
  },
  {
    "path": "packages/shelf/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/shelf/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.0.0-beta-4\n\n* Require Dart >= 3.11.0\n\n## 8.0.0-beta-3\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.0.0-beta.2\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.0.0-beta.1\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n* Fixed linter warnings\n* Updated repository link\n\n## 7.0.0-beta.2\n\n* Fixed `BytesBuilder` warnings\n\n## 7.0.0-beta.1\n\n* Require Dart >= 2.17\n\n## 6.0.0-beta.2\n\n* Fixed AngelHttpException error\n\n## 6.0.0-beta.1\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0-dev.3\n\n* Fixed null safety warnings\n\n## 3.0.0-dev.2\n\n* Updated to use `package:belatuk_pretty_logging`\n\n## 3.0.0-dev.1\n\n* Migrated to support Dart >= 2.12 NNBD\n* Updated linter to `package:lints`\n\n## 2.1.0\n\n* `pedantic` lints.\n* Add the `AngelShelf` driver class, which allows you to embed Angel within shelf.\n\n## 2.0.0\n\n* Removed `supportShelf`.\n\n## 1.2.0\n\n* Upgraded for `>=1.1.0` compatibility.\n"
  },
  {
    "path": "packages/shelf/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/shelf/README.md",
    "content": "# Angel3 Shelf\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_shelf?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dart-backend/angel/tree/master/packages/shelf/LICENSE)\n\n**Replacement of `package:angel_shelf` with breaking changes to support NNBD.**\n\nShelf interop with Angel3. This package lets you run `package:shelf` handlers via a custom adapter. Use the code in this repo to embed existing Angel/shelf apps into other Angel/shelf applications. This way, you can migrate legacy applications without having to rewrite your business logic. This will make it easy to layer your API over a production application, rather than having to port code.\n\n- [Angel3 Shelf](#angel3-shelf)\n  - [Usage](#usage)\n    - [embedShelf](#embedshelf)\n    - [Communicating with Angel with embedShelf](#communicating-with-angel-with-embedshelf)\n    - [AngelShelf](#angelshelf)\n\n## Usage\n\n### embedShelf\n\nThis is a compliant `shelf` adapter that acts as an Angel request handler. You can use it as a middleware,\nor attach it to individual routes.\n\n```dart\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_shelf/angel3_shelf.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'api/api.dart';\n\nvoid main() async {\n  var app = Angel();\n  var http = AngelHttp(app);\n\n  // Angel routes on top\n  await app.mountController<ApiController>();\n\n  // Re-route all other traffic to an\n  // existing application.\n  app.fallback(embedShelf(\n    shelf.Pipeline()\n      .addMiddleware(shelf.logRequests())\n      .addHandler(_echoRequest)\n  ));\n\n  // Or, only on a specific route:\n  app.get('/shelf', wrappedShelfHandler);\n\n  await http.startServer(InternetAddress.loopbackIPV4, 3000);\n  print(http.uri);\n}\n```\n\n### Communicating with Angel with embedShelf\n\nYou can communicate with Angel3:\n\n```dart\nhandleRequest(shelf.Request request) {\n  // Access original Angel request...\n  var req = request.context['angel_shelf.request'] as RequestContext;\n\n  // ... And then interact with it.\n  req.container.registerNamedSingleton<Foo>('from_shelf', Foo());\n\n  // `req.container` is also available.\n  var container = request.context['angel_shelf.container'] as Container;\n  container.make<Truck>().drive();\n}\n```\n\n### AngelShelf\n\nAngel3 brought about the generic `Driver` class, which is implemented by `AngelHttp`, `AngelHttp2`, `AngelGopher`, etc., and provides the core infrastructure for request handling in Angel. `AngelShelf` is an implementation that wraps shelf requests and responses in their Angel equivalents. Using it is as simple using as using `AngelHttp`, or any other driver:\n\n```dart\n// Create an AngelShelf driver.\n// If we have startup hooks we want to run, we need to call\n// `startServer`. Otherwise, it can be omitted.\n// Of course, if you call `startServer`, know that to run\n// shutdown/cleanup logic, you need to call `close` eventually,\n// too.\nvar angelShelf = AngelShelf(app);\nawait angelShelf.startServer();\n\nawait shelf_io.serve(angelShelf.handler, InternetAddress.loopbackIPv4, 8081);\n```\n\nYou can also use the `AngelShelf` driver as a shelf middleware - just use\n`angelShelf.middleware` instead of `angelShelf.handler`. When used as a middleware,\nif the Angel response context is still open after all handlers run (i.e. no routes were\nmatched), the next shelf handler will be called.\n\n```dart\nvar handler = shelf.Pipeline()\n  .addMiddleware(angelShelf.middleware)\n  .addHandler(createStaticHandler(...));\n```\n"
  },
  {
    "path": "packages/shelf/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/shelf/example/angel_in_shelf.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_shelf/angel3_shelf.dart';\nimport 'package:logging/logging.dart';\nimport 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'package:shelf/shelf_io.dart' as shelf_io;\nimport 'package:shelf_static/shelf_static.dart';\n\nvoid main() async {\n  Logger.root\n    ..level = Level.ALL\n    ..onRecord.listen(prettyLog);\n\n  // Create a basic Angel server, with some routes.\n  var app = Angel(\n    logger: Logger('angel3_shelf_demo'),\n    reflector: MirrorsReflector(),\n  );\n\n  app.get('/angel', (req, res) {\n    res.write('Angel embedded within shelf!');\n    return false;\n  });\n\n  app.get(\n    '/hello',\n    ioc((@Query('name') String name) {\n      return {'hello': name};\n    }),\n  );\n\n  // Next, create an AngelShelf driver.\n  //\n  // If we have startup hooks we want to run, we need to call\n  // `startServer`. Otherwise, it can be omitted.\n  // Of course, if you call `startServer`, know that to run\n  // shutdown/cleanup logic, you need to call `close` eventually,\n  // too.\n  var angelShelf = AngelShelf(app);\n  await angelShelf.startServer();\n\n  // Create, and mount, a shelf pipeline...\n  // You can also embed Angel as a middleware...\n  var mwHandler = shelf.Pipeline()\n      .addMiddleware(angelShelf.middleware)\n      .addHandler(\n        createStaticHandler(\n          '.',\n          defaultDocument: 'index.html',\n          listDirectories: true,\n        ),\n      );\n\n  // Run the servers.\n  await shelf_io.serve(mwHandler, InternetAddress.loopbackIPv4, 8080);\n  await shelf_io.serve(angelShelf.handler, InternetAddress.loopbackIPv4, 8081);\n  print('Angel as middleware: http://localhost:8080');\n  print('Angel as only handler: http://localhost:8081');\n}\n"
  },
  {
    "path": "packages/shelf/example/main.dart",
    "content": "import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_shelf/angel3_shelf.dart';\nimport 'package:logging/logging.dart';\nimport 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';\nimport 'package:shelf_static/shelf_static.dart';\n\nvoid main() async {\n  Logger.root\n    ..level = Level.ALL\n    ..onRecord.listen(prettyLog);\n\n  var app = Angel(logger: Logger('angel3_shelf_demo'));\n  var http = AngelHttp(app);\n\n  // `shelf` request handler\n  var shelfHandler = createStaticHandler(\n    '.',\n    defaultDocument: 'index.html',\n    listDirectories: true,\n  );\n\n  // Use `embedShelf` to adapt a `shelf` handler for use within Angel.\n  var wrappedHandler = embedShelf(shelfHandler);\n\n  // A normal Angel route.\n  app.get('/angel', (req, ResponseContext res) {\n    res.write('Hooray for `package:angel3_shelf`!');\n    return false; // End execution of handlers, so we don't proxy to dartlang.org when we don't need to.\n  });\n\n  // Pass any other request through to the static file handler\n  app.fallback(wrappedHandler);\n\n  await http.startServer(InternetAddress.loopbackIPv4, 8080);\n  print('Running at ${http.uri}');\n}\n"
  },
  {
    "path": "packages/shelf/lib/angel3_shelf.dart",
    "content": "export 'src/convert.dart';\nexport 'src/embed_shelf.dart';\nexport 'src/shelf_driver.dart';\nexport 'src/shelf_request.dart';\nexport 'src/shelf_response.dart';\n"
  },
  {
    "path": "packages/shelf/lib/src/convert.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:path/path.dart' as p;\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'package:stream_channel/stream_channel.dart';\n\n/// Creates a [shelf.Request]  analogous to the input [req].\n///\n/// The request's `context` will contain [req.container] as `angel3_shelf.container`, as well as\n/// the provided [context], if any.\n///\n/// The context will also have the original request available as `angel3_shelf.request`.\n///\n/// If you want to read the request body, you *must* set `keepRawRequestBuffers` to `true`\n/// on your application instance.\nFuture<shelf.Request> convertRequest(\n  RequestContext req,\n  ResponseContext res, {\n  String? handlerPath,\n  Map<String, Object>? context,\n}) async {\n  var app = req.app;\n  var headers = <String, String>{};\n  req.headers!.forEach((k, v) {\n    headers[k] = v.join(',');\n  });\n\n  headers.remove(HttpHeaders.transferEncodingHeader);\n\n  void Function(void Function(StreamChannel<List<int>>)) onHijack;\n  String protocolVersion;\n  Uri requestedUri;\n\n  protocolVersion = '1.1';\n  requestedUri = Uri.parse('http://${req.hostname}');\n  requestedUri = requestedUri.replace(path: req.uri!.path);\n\n  onHijack = (void Function(StreamChannel<List<int>> channel) hijack) async {\n    try {\n      print('a');\n      await res.detach();\n      print('b');\n      var ctrl = StreamChannelController<List<int>>();\n      if (req.hasParsedBody) {\n        req.body!.listen(\n          ctrl.local.sink.add,\n          onError: ctrl.local.sink.addError,\n          onDone: ctrl.local.sink.close,\n        );\n      } else {\n        await ctrl.local.sink.close();\n      }\n      scheduleMicrotask(() => ctrl.local.stream.pipe(res));\n      hijack(ctrl.foreign);\n    } catch (e, st) {\n      app?.logger.severe(\n        'An error occurred while hijacking a shelf request',\n        e,\n        st,\n      );\n    }\n  };\n\n  var url = req.uri!;\n\n  if (p.isAbsolute(url.path)) {\n    url = url.replace(path: url.path.substring(1));\n  }\n\n  return shelf.Request(\n    req.method,\n    requestedUri,\n    protocolVersion: protocolVersion,\n    headers: headers,\n    handlerPath: handlerPath,\n    url: url,\n    body: req.body,\n    context: {'angel3_shelf.request': req}\n      ..addAll({'angel3_shelf.container': req.container!})\n      ..addAll(context ?? {}),\n    onHijack: onHijack,\n  );\n}\n\n/// Applies the state of the [shelfResponse] into the [angelResponse].\n///\n/// Merges all headers, sets the status code, and writes the body.\n///\n/// In addition, the response's context will be available in `angelResponse.properties`\n/// as `shelf_context`.\nFuture mergeShelfResponse(\n  shelf.Response shelfResponse,\n  ResponseContext angelResponse,\n) {\n  angelResponse.headers.addAll(shelfResponse.headers);\n  angelResponse.statusCode = shelfResponse.statusCode;\n  angelResponse.properties['shelf_context'] = shelfResponse.context;\n  angelResponse.properties['shelf_response'] = shelfResponse;\n  return shelfResponse.read().pipe(angelResponse);\n}\n"
  },
  {
    "path": "packages/shelf/lib/src/embed_shelf.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'convert.dart';\n\n/// Simply passes an incoming request to a `shelf` handler.\n///\n/// If the handler does not return a [shelf.Response], then the\n/// result will be passed down the Angel middleware pipeline, like with\n/// any other request handler.\n///\n/// If [throwOnNullResponse] is `true` (default: `false`), then a 500 error will be thrown\n/// if the [handler] returns `null`.\nRequestHandler embedShelf(\n  shelf.Handler handler, {\n  String? handlerPath,\n  Map<String, Object>? context,\n  bool throwOnNullResponse = false,\n}) {\n  return (RequestContext req, ResponseContext res) async {\n    var shelfRequest = await convertRequest(\n      req,\n      res,\n      handlerPath: handlerPath,\n      context: context,\n    );\n    try {\n      var result = await handler(shelfRequest);\n      if (throwOnNullResponse == true) {\n        throw AngelHttpException(message: 'Internal Server Error');\n      }\n      await mergeShelfResponse(result, res);\n      return false;\n    } on shelf.HijackException {\n      // On hijack, do nothing, because the hijack handlers already call res.detach();\n      return null;\n    } catch (e) {\n      rethrow;\n    }\n  };\n}\n"
  },
  {
    "path": "packages/shelf/lib/src/shelf_driver.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'package:shelf/shelf.dart';\nimport 'shelf_request.dart';\nimport 'shelf_response.dart';\n\nFuture<Stream<Request>> process(dynamic param1, int param2) {\n  return Future.value(Stream.empty());\n}\n\nclass AngelShelf\n    extends\n        Driver<\n          shelf.Request,\n          ShelfResponseContext?,\n          Stream<shelf.Request>,\n          ShelfRequestContext,\n          ShelfResponseContext\n        > {\n  final StreamController<shelf.Request> incomingRequests = StreamController();\n\n  final FutureOr<shelf.Response> Function()? notFound;\n\n  AngelShelf(Angel app, {FutureOr<shelf.Response> Function()? notFound})\n    : notFound = notFound ?? (() => shelf.Response.notFound('Not Found')),\n      super(app, process, useZone: false) {\n    // Inject a final handler that will keep responses open, if we are using the\n    // driver as a middleware.\n    app.fallback((req, res) {\n      if (res is ShelfResponseContext) {\n        res.closeSilently();\n      }\n      return true;\n    });\n  }\n\n  @override\n  Future<void> close() {\n    incomingRequests.close();\n    return super.close();\n  }\n\n  @override\n  Future<Stream<shelf.Request>> Function(dynamic, int) get serverGenerator =>\n      (_, _) async => incomingRequests.stream;\n\n  static UnsupportedError _unsupported() => UnsupportedError(\n    'AngelShelf cannot mount a standalone server, or return a URI.',\n  );\n\n  Future<shelf.Response> handler(shelf.Request request) async {\n    var response = ShelfResponseContext(app);\n    var result = await handleRawRequest(request, response);\n    if (result is shelf.Response) {\n      return result;\n    } else if (!response.isOpen) {\n      return response.shelfResponse;\n    } else {\n      // return await handler(request);\n      return notFound!();\n    }\n  }\n\n  shelf.Handler middleware(shelf.Handler handler) {\n    return (request) async {\n      var response = ShelfResponseContext(app);\n      var result = await handleRawRequest(request, response);\n      if (result is shelf.Response) {\n        return result;\n      } else if (!response.isOpen) {\n        return response.shelfResponse;\n      } else {\n        return await handler(request);\n      }\n    };\n  }\n\n  @override\n  Future<shelf.Response> handleAngelHttpException(\n    AngelHttpException e,\n    StackTrace st,\n    RequestContext? req,\n    ResponseContext? res,\n    shelf.Request request,\n    ShelfResponseContext? response, {\n    bool ignoreFinalizers = false,\n  }) async {\n    await super.handleAngelHttpException(\n      e,\n      st,\n      req,\n      res,\n      request,\n      response,\n      ignoreFinalizers: ignoreFinalizers,\n    );\n    return response!.shelfResponse;\n  }\n\n  @override\n  void addCookies(ShelfResponseContext? response, Iterable<Cookie> cookies) {\n    // Don't do anything here, otherwise you get duplicate cookies.\n    // response.cookies.addAll(cookies);\n  }\n\n  @override\n  Future closeResponse(ShelfResponseContext? response) {\n    return response!.close();\n  }\n\n  @override\n  Uri get uri => throw _unsupported();\n\n  static final RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\n  @override\n  Future<ShelfRequestContext> createRequestContext(\n    shelf.Request request,\n    ShelfResponseContext? response,\n  ) {\n    var path = request.url.path.replaceAll(_straySlashes, '');\n    if (path.isEmpty) path = '/';\n    var rq = ShelfRequestContext(\n      app,\n      app.container.createChild(),\n      request,\n      path,\n    );\n    return Future.value(rq);\n  }\n\n  @override\n  Future<ShelfResponseContext> createResponseContext(\n    shelf.Request request,\n    ShelfResponseContext? response, [\n    ShelfRequestContext? correspondingRequest,\n  ]) {\n    // Return the original response.\n    return Future.value(response!..correspondingRequest = correspondingRequest);\n  }\n\n  @override\n  Stream<ShelfResponseContext?> createResponseStreamFromRawRequest(\n    shelf.Request request,\n  ) {\n    return Stream.fromIterable([null]);\n  }\n\n  @override\n  void setChunkedEncoding(ShelfResponseContext? response, bool value) {\n    response!.chunked = value;\n  }\n\n  @override\n  void setContentLength(ShelfResponseContext? response, int length) {\n    response!.contentLength = length;\n  }\n\n  @override\n  void setHeader(ShelfResponseContext? response, String key, String value) {\n    response!.headers[key] = value;\n  }\n\n  @override\n  void setStatusCode(ShelfResponseContext? response, int value) {\n    response!.statusCode = value;\n  }\n\n  @override\n  void writeStringToResponse(ShelfResponseContext? response, String value) {\n    response!.write(value);\n  }\n\n  @override\n  void writeToResponse(ShelfResponseContext? response, List<int> data) {\n    response!.add(data);\n  }\n}\n"
  },
  {
    "path": "packages/shelf/lib/src/shelf_request.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\nimport 'package:angel3_container/angel3_container.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_mock_request/angel3_mock_request.dart';\nimport 'package:shelf/shelf.dart' as shelf;\n\nclass ShelfRequestContext extends RequestContext {\n  final Angel angelApp;\n\n  @override\n  final Container container;\n  @override\n  final shelf.Request rawRequest;\n  @override\n  final String path;\n\n  List<Cookie>? _cookies;\n\n  @override\n  final MockHttpHeaders headers = MockHttpHeaders();\n\n  ShelfRequestContext(\n    this.angelApp,\n    this.container,\n    this.rawRequest,\n    this.path,\n  ) {\n    rawRequest.headers.forEach(headers.add);\n  }\n\n  @override\n  Stream<List<int>> get body => rawRequest.read();\n\n  @override\n  List<Cookie> get cookies {\n    if (_cookies == null) {\n      // Parse cookies\n      _cookies = [];\n      var value = headers.value('cookie');\n      if (value != null) {\n        var cookieStrings = value.split(';').map((s) => s.trim());\n\n        for (var cookieString in cookieStrings) {\n          try {\n            _cookies!.add(Cookie.fromSetCookieValue(cookieString));\n          } catch (_) {\n            // Ignore malformed cookies, and just don't add them to the container.\n          }\n        }\n      }\n    }\n    return _cookies!;\n  }\n\n  @override\n  String get hostname => rawRequest.headers['host']!;\n\n  @override\n  String get method {\n    if (!angelApp.allowMethodOverrides) {\n      return originalMethod;\n    } else {\n      return headers.value('x-http-method-override')?.toUpperCase() ??\n          originalMethod;\n    }\n  }\n\n  @override\n  String get originalMethod => rawRequest.method;\n\n  @override\n  // TODO: implement remoteAddress\n  InternetAddress get remoteAddress => InternetAddress.loopbackIPv4;\n\n  @override\n  // TODO: implement session\n  HttpSession? get session => null;\n\n  @override\n  Uri get uri => rawRequest.url;\n}\n"
  },
  {
    "path": "packages/shelf/lib/src/shelf_response.dart",
    "content": "import 'dart:async';\nimport 'dart:convert';\nimport 'dart:typed_data';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'shelf_request.dart';\n\nclass ShelfResponseContext extends ResponseContext<ShelfResponseContext> {\n  final Angel angelApp;\n\n  final StreamController<List<int>> _ctrl = StreamController();\n  bool _isOpen = true;\n  bool _isDetached = false;\n  final bool _wasClosedByHandler = false;\n  bool _handlersAreDone = false;\n\n  ShelfResponseContext(this.angelApp);\n\n  ShelfRequestContext? _correspondingRequest;\n\n  bool get wasClosedByHandler => _wasClosedByHandler;\n\n  void closeSilently() => _handlersAreDone = true;\n\n  @override\n  ShelfRequestContext? get correspondingRequest => _correspondingRequest;\n\n  set correspondingRequest(ShelfRequestContext? value) {\n    if (_correspondingRequest == null) {\n      _correspondingRequest = value;\n    } else {\n      throw StateError('The corresponding request has already been assigned.');\n    }\n  }\n\n  shelf.Response get shelfResponse {\n    return shelf.Response(statusCode, body: _ctrl.stream, headers: headers);\n  }\n\n  @override\n  Future<void> close() {\n    if (!_handlersAreDone) {\n      _isOpen = false;\n    }\n    _ctrl.close();\n    return super.close();\n  }\n\n  Iterable<String>? __allowedEncodings;\n\n  Iterable<String>? get _allowedEncodings {\n    return __allowedEncodings ??= correspondingRequest!.headers\n        .value('accept-encoding')\n        ?.split(',')\n        .map((s) => s.trim())\n        .where((s) => s.isNotEmpty)\n        .map((str) {\n          // Ignore quality specifications in accept-encoding\n          // ex. gzip;q=0.8\n          if (!str.contains(';')) return str;\n          return str.split(';')[0];\n        });\n  }\n\n  @override\n  Future addStream(Stream<List<int>> stream) {\n    if (!isOpen && isBuffered) throw ResponseContext.closed();\n    var output = stream;\n\n    if (encoders.isNotEmpty && correspondingRequest != null) {\n      if (_allowedEncodings != null) {\n        for (var encodingName in _allowedEncodings!) {\n          Converter<List<int>, List<int>>? encoder;\n          var key = encodingName;\n\n          if (encoders.containsKey(encodingName)) {\n            encoder = encoders[encodingName];\n          } else if (encodingName == '*') {\n            encoder = encoders[key = encoders.keys.first];\n          }\n\n          if (encoder != null) {\n            output = encoders[key]!.bind(output);\n            break;\n          }\n        }\n      }\n    }\n\n    return _ctrl.addStream(output);\n  }\n\n  @override\n  void add(List<int> data) {\n    if (!isOpen && isBuffered) {\n      throw ResponseContext.closed();\n    } else if (_isOpen) {\n      if (encoders.isNotEmpty && correspondingRequest != null) {\n        if (_allowedEncodings != null) {\n          for (var encodingName in _allowedEncodings!) {\n            Converter<List<int>, List<int>>? encoder;\n            var key = encodingName;\n\n            if (encoders.containsKey(encodingName)) {\n              encoder = encoders[encodingName];\n            } else if (encodingName == '*') {\n              encoder = encoders[key = encoders.keys.first];\n            }\n\n            if (encoder != null) {\n              data = encoders[key]!.convert(data);\n              break;\n            }\n          }\n        }\n      }\n\n      _ctrl.add(data);\n    }\n  }\n\n  @override\n  BytesBuilder? get buffer => null;\n\n  @override\n  FutureOr<ShelfResponseContext> detach() {\n    _isDetached = true;\n    return this;\n  }\n\n  @override\n  bool get isBuffered => false;\n\n  @override\n  bool get isOpen => _isOpen && !_isDetached;\n\n  @override\n  void useBuffer() {}\n\n  @override\n  ShelfResponseContext get rawResponse => this;\n}\n"
  },
  {
    "path": "packages/shelf/melos_angel3_shelf.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/shelf/pubspec.yaml",
    "content": "name: angel3_shelf\nversion: 8.0.0-beta-4\ndescription: Shelf interop with Angel3. Use this to wrap existing server code.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/master/packages/shelf\nresolution: workspace\nenvironment:\n  sdk: \">=3.11.0 <4.0.0\"\npublish_to: none\ndependencies:\n  angel3_framework: ^8.4.0\n  angel3_container: ^8.2.0\n  angel3_mock_request: ^8.2.0\n  path: ^1.9.0\n  shelf: ^1.3.0\n  stream_channel: ^2.1.0\n  logging: ^1.2.0\n  charcode: ^1.3.0\n  http: ^1.0.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  belatuk_pretty_logging: ^6.1.0\n  shelf_static: ^1.1.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/shelf/test/all.dart",
    "content": "import 'package:test/test.dart';\nimport 'embed_shelf_test.dart' as embed_shelf;\n\nvoid main() {\n  group('embed_shelf', embed_shelf.main);\n}\n"
  },
  {
    "path": "packages/shelf/test/embed_shelf_test.dart",
    "content": "import 'dart:convert';\nimport 'dart:io';\nimport 'package:angel3_container/mirrors.dart';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_shelf/angel3_shelf.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:charcode/charcode.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:logging/logging.dart';\nimport 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';\nimport 'package:shelf/shelf.dart' as shelf;\nimport 'package:stream_channel/stream_channel.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  late http.Client client;\n  late HttpServer server;\n\n  Uri path(String p) {\n    return Uri(\n      scheme: 'http',\n      host: server.address.address,\n      port: server.port,\n      path: p,\n    );\n  }\n\n  setUp(() async {\n    client = http.Client();\n    var handler = shelf.Pipeline().addHandler((shelf.Request request) {\n      if (request.url.path == 'two') {\n        return shelf.Response(200, body: json.encode(2));\n      } else if (request.url.path == 'error') {\n        throw AngelHttpException.notFound();\n      } else if (request.url.path == 'status') {\n        return shelf.Response.notModified(headers: {'foo': 'bar'});\n      } else if (request.url.path == 'hijack') {\n        request.hijack((StreamChannel<List<int>> channel) {\n          print('a');\n          var sink = channel.sink;\n          sink.add(utf8.encode('HTTP/1.1 200 OK\\r\\n'));\n          sink.add([$lf]);\n          sink.add(utf8.encode(json.encode({'error': 'crime'})));\n          sink.close();\n          print('b');\n        });\n        //} else if (request.url.path == 'throw') {\n        //  return null;\n      } else {\n        return shelf.Response.ok('Request for \"${request.url}\"');\n      }\n    });\n\n    var logger = Logger.detached('angel3_shelf')..onRecord.listen(prettyLog);\n    var app = Angel(logger: logger, reflector: MirrorsReflector());\n    var httpDriver = AngelHttp(app);\n    app.get('/angel', (req, res) => 'Angel');\n    app.fallback(embedShelf(handler, throwOnNullResponse: true));\n\n    server = await httpDriver.startServer(InternetAddress.loopbackIPv4, 0);\n  });\n\n  tearDown(() async {\n    client.close();\n    await server.close(force: true);\n  });\n\n  test('expose angel side', () async {\n    var response = await client.get(path('/angel'));\n    expect(json.decode(response.body), equals('Angel'));\n  });\n\n  test('expose shelf side', () async {\n    var response = await client.get(path('/foo'));\n    expect(response, hasStatus(200));\n    expect(response.body, equals('Request for \"foo\"'));\n  });\n\n  test('shelf can return arbitrary values', () async {\n    var response = await client.get(path('/two'));\n    expect(response, isJson(2));\n  });\n\n  test('shelf can hijack', () async {\n    try {\n      var client = HttpClient();\n      var rq = await client.openUrl('GET', path('/hijack'));\n      var rs = await rq.close();\n      var body = await rs.cast<List<int>>().transform(utf8.decoder).join();\n      print('Response: $body');\n      expect(json.decode(body), {'error': 'crime'});\n    } on HttpException catch (e, st) {\n      print('HTTP Exception: ${e.message}');\n      print(st);\n      rethrow;\n    }\n  });\n\n  test('shelf can set status code', () async {\n    var response = await client.get(path('/status'));\n    expect(response, allOf(hasStatus(304), hasHeader('foo', 'bar')));\n  });\n\n  test('shelf can throw error', () async {\n    var response = await client.get(path('/error'));\n    expect(response, hasStatus(404));\n  });\n\n  test('throw on null', () async {\n    var response = await client.get(path('/throw'));\n    expect(response, hasStatus(500));\n  });\n}\n"
  },
  {
    "path": "packages/static/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/static/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n* [Breaking] Updated `CacheAccessLevel` to enhanced Enum. Changed `PUBLIC` to `public` and `PRIVATE` to `private`.\n* [Breaking] Removed `accessLevelToString` as the functionality is provided by enhanced Enum\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.0\n\n* Updated to use `belatuk_range_header` package\n* Upgraded from `pendantic` to `lints` linter\n\n## 4.0.2\n\n* Updated README\n\n## 4.0.1\n\n* Fixed NNBD related issues\n* Added logging to `VirtualDirectory` and `CachingVirtualDirectory` to capture exception\n* Auto detect and change file separator when POSIX file system is used on Windows and vice versa\n* Fixed `push_state_test` unit test failure on Windows\n* 12/12 unit tests passed\n\n## 4.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 3.0.0\n\n* Migrated to work with Dart >= 2.12 Non NNBD\n\n## 2.1.3+2\n\n* Prepare for upcoming change to File.openRead()\n\n## 2.1.3+1\n\n* Apply control flow lints.\n\n## 2.1.3\n\n* Apply lints.\n* Pin to Dart `>=2.0.0 <3.0.0`.\n* Use at least version `2.0.0-rc.0` of `angel_framework`.\n\n## 2.1.2+1\n\n* Fix a typo that prevented `Range` requests from working.\n\n## 2.1.2\n\n* Patch support for range+streaming in Caching server.\n\n## 2.1.1\n\n* URI-encode paths in directory listing. This produces correct URL's, always.\n\n## 2.1.0\n\n* Include support for the `Range` header.\n* Use MD5 for etags, instead of a weak ETag.\n\n## 2.0.2\n\n* Fixed invalid HTML for directory listings.\n\n## 2.0.1\n\n* Remove use of `sendFile`.\n* Add a `p.isWithin` check to ensure that paths do not escape the `source` directory.\n* Handle `HEAD` requests.\n\n## 2.0.0\n\n* Upgrade dependencies to Angel 2 + file@5.\n* Replace `useStream` with `useBuffer`.\n* Remove `package:intl`, just use `HttpDate` instead.\n\n## 1.3.0+1\n\n* Dart 2 fixes.\n* Enable optionally writing responses to the buffer instead of streaming.\n\n## 1.3.0\n\n* `pushState` uses `strict` mode when `accepts` is passed.\n\n## 1.3.0-alpha+2\n\n* Added an `accepts` option to `pushState`.\n* Added optional directory listings.\n\n## 1.3.0-alpha+1\n\n* ETags once again only encode the first 50 bytes of files. Resolves [#27](https://github.com/angel-dart/static/issues/27).\n\n## 1.3.0-alpha\n\n* Removed file transformers.\n* `VirtualDirectory` is no longer an `AngelPlugin`, and instead exposes a `handleRequest` middleware.\n* Added `pushState` to `VirtualDirectory`.\n\n## 1.2.5\n\n* Fixed a bug where `onlyInProduction` was not properly adhered to.\n* Fixed another bug where `Accept-Encoding` was not properly adhered to.\n* Setting `maxAge` to `null` will now prevent a `CachingVirtualDirectory` from sending an `Expires` header.\n* Pre-built assets can now be mass-deleted with `VirtualDirectory.cleanFromDisk()`.\nResolves [#22](https://github.com/angel-dart/static/issues/22).\n\n## 1.2.4+1\n\nFixed a bug where `Accept-Encoding` was not properly adhered to.\n\n## 1.2.4\n\nFixes <https://github.com/angel-dart/angel/issues/44>.\n\n* MIME types will now default to `application/octet-stream`.\n* When `streamToIO` is `true`, the body will only be sent gzipped if the request explicitly allows it.\n\n## 1.2.3\n\nFixed #40 and #41, which dealt with paths being improperly served when using a\n`publicPath`.\n"
  },
  {
    "path": "packages/static/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/static/README.md",
    "content": "# Angel3 Static Files Handler\n\n[![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/angel3_static)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dart-backend/angel/tree/angel3/packages/static/LICENSE)\n\nThis library provides a virtual directory to serve static files such as html, css and js for [Angel3 framework](https://pub.dev/packages/angel3). It can also handle `Range` requests, making it suitable for media streaming, i.e. music, video, etc.*\n\n## Installation\n\nIn `pubspec.yaml`:\n\n```yaml\ndependencies:\n    angel3_static: ^8.0.0\n```\n\n## Usage\n\nTo serve files from a directory, you need to create a `VirtualDirectory`. Keep in mind that `angel3_static` uses `package:file` instead of `dart:io`.\n\n```dart\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\n\nvoid main() async {\n  var app = Angel();\n  var fs = const LocalFileSystem();\n\n  // Normal static server\n  var vDir = VirtualDirectory(app, fs, source: Directory('./public'));\n\n  // Send Cache-Control, ETag, etc. as well\n  var vDir = CachingVirtualDirectory(app, fs, source: Directory('./public'));\n\n  // Mount the VirtualDirectory's request handler\n  app.fallback(vDir.handleRequest);\n\n  // Start your server!!!\n  await AngelHttp(app).startServer();\n}\n```\n\n## Push State\n\n`VirtualDirectory` also exposes a `pushState` method that returns a request handler that serves the file at a given path as a fallback, unless the user is requesting that file. This can be very useful for SPA's.\n\n```dart\n// Create VirtualDirectory as well\nvar vDir = CachingVirtualDirectory(...);\n\n// Mount it\napp.fallback(vDir.handleRequest);\n\n// Fallback to index.html on 404\napp.fallback(vDir.pushState('index.html'));\n```\n\n## Options\n\nThe `VirtualDirectory` API accepts a few named parameters:\n\n- **source**: A `Directory` containing the files to be served. If left null, then Angel3 will serve either from `web` (in development) or\n    `build/web` (in production), depending on your `ANGEL_ENV`.\n- **indexFileNames**: A `List<String>` of filenames that should be served as index pages. Default is `['index.html']`.\n- **publicPath**: To serve index files, you need to specify the virtual path under which\n    angel3_static is serving your files. If you are not serving static files at the site root,\n    please include this.\n- **callback**: Runs before sending a file to a client. Use this to set headers, etc. If it returns anything other than `null` or `true`, then the callback's result will be sent to the user, instead of the file contents.\n"
  },
  {
    "path": "packages/static/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/static/example/main.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\n\nvoid main(List<String> args) async {\n  var app = Angel();\n  var http = AngelHttp(app);\n  var fs = const LocalFileSystem();\n  var vDir = CachingVirtualDirectory(\n    app,\n    fs,\n    allowDirectoryListing: true,\n    source: args.isEmpty ? fs.currentDirectory : fs.directory(args[0]),\n    maxAge: const Duration(days: 24).inSeconds,\n  );\n\n  app.mimeTypeResolver\n    ..addExtension('', 'text/plain')\n    ..addExtension('dart', 'text/dart')\n    ..addExtension('lock', 'text/plain')\n    ..addExtension('markdown', 'text/plain')\n    ..addExtension('md', 'text/plain')\n    ..addExtension('yaml', 'text/plain');\n\n  app.logger = Logger('example')\n    ..onRecord.listen((rec) {\n      print(rec);\n      if (rec.error != null) print(rec.error);\n      if (rec.stackTrace != null) print(rec.stackTrace);\n    });\n\n  app.fallback(vDir.handleRequest);\n  app.fallback((req, res) => throw AngelHttpException.notFound());\n\n  var server = await http.startServer('127.0.0.1', 3000);\n  print('Serving from ${vDir.source.path}');\n  print('Listening at http://${server.address.address}:${server.port}');\n}\n"
  },
  {
    "path": "packages/static/lib/angel3_static.dart",
    "content": "library;\n\nexport 'src/cache.dart';\nexport 'src/virtual_directory.dart';\n"
  },
  {
    "path": "packages/static/lib/src/cache.dart",
    "content": "import 'dart:async';\nimport 'dart:io' show HttpDate;\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:file/file.dart';\nimport 'package:logging/logging.dart';\nimport 'virtual_directory.dart';\n\n/// A `VirtualDirectory` that also sets `Cache-Control` headers.\nclass CachingVirtualDirectory extends VirtualDirectory {\n  final _log = Logger('CachingVirtualDirectory');\n\n  final Map<String, String> _etags = {};\n\n  /// Either `public` or `private`.\n  final CacheAccessLevel accessLevel;\n\n  /// If `true`, responses will always have `private, max-age=0` as their `Cache-Control` header.\n  final bool noCache;\n\n  /// If `true` (default), `Cache-Control` headers will only be set if the application is in production mode.\n  final bool onlyInProduction;\n\n  /// If `true` (default), ETags will be computed and sent along with responses.\n  final bool useEtags;\n\n  /// The `max-age` for `Cache-Control`.\n  ///\n  /// Set this to `null` to leave no `Expires` header on responses.\n  final int maxAge;\n\n  CachingVirtualDirectory(\n    super.app,\n    super.fileSystem, {\n    this.accessLevel = CacheAccessLevel.public,\n    super.source,\n    bool debug = false,\n    super.indexFileNames,\n    this.maxAge = 0,\n    this.noCache = false,\n    this.onlyInProduction = false,\n    this.useEtags = true,\n    super.allowDirectoryListing,\n    super.useBuffer,\n    super.publicPath,\n    super.callback,\n  });\n\n  @override\n  Future<bool> serveFile(\n    File file,\n    FileStat stat,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    res.headers['accept-ranges'] = 'bytes';\n\n    if (onlyInProduction == true && req.app?.environment.isProduction != true) {\n      return super.serveFile(file, stat, req, res);\n    }\n\n    if (req.headers == null) {\n      _log.severe('Missing headers in the RequestContext');\n      throw ArgumentError('Missing headers in the RequestContext');\n    }\n    var reqHeaders = req.headers!;\n\n    var shouldNotCache = noCache == true;\n\n    if (!shouldNotCache) {\n      shouldNotCache =\n          reqHeaders.value('cache-control') == 'no-cache' ||\n          reqHeaders.value('pragma') == 'no-cache';\n    }\n\n    if (shouldNotCache) {\n      res.headers['cache-control'] = 'private, max-age=0, no-cache';\n      return super.serveFile(file, stat, req, res);\n    } else {\n      var ifModified = reqHeaders.ifModifiedSince;\n      var ifRange = false;\n\n      try {\n        if (reqHeaders.value('if-range') != null) {\n          ifModified = HttpDate.parse(reqHeaders.value('if-range')!);\n          ifRange = true;\n        }\n      } catch (_) {\n        // Fail silently...\n      }\n\n      if (ifModified != null) {\n        try {\n          var ifModifiedSince = ifModified;\n\n          if (ifModifiedSince.compareTo(stat.modified) >= 0) {\n            res.statusCode = 304;\n            setCachedHeaders(stat.modified, req, res);\n\n            if (useEtags && _etags.containsKey(file.absolute.path)) {\n              if (_etags[file.absolute.path] != null) {\n                res.headers['ETag'] = _etags[file.absolute.path]!;\n              }\n            }\n\n            if (ifRange) {\n              // Send the 206 like normal\n              res.statusCode = 206;\n              return super.serveFile(file, stat, req, res);\n            }\n\n            return Future.value(false);\n          } else if (ifRange) {\n            return super.serveFile(file, stat, req, res);\n          }\n        } catch (_) {\n          _log.severe(\n            'Invalid date for ${ifRange ? 'if-range' : 'if-not-modified-since'} header.',\n          );\n          throw AngelHttpException.badRequest(\n            message:\n                'Invalid date for ${ifRange ? 'if-range' : 'if-not-modified-since'} header.',\n          );\n        }\n      }\n\n      // If-modified didn't work; try etags\n\n      if (useEtags == true) {\n        var etagsToMatchAgainst = reqHeaders['if-none-match'] ?? [];\n        ifRange = false;\n\n        if (etagsToMatchAgainst.isEmpty) {\n          etagsToMatchAgainst = reqHeaders['if-range'] ?? [];\n          ifRange = etagsToMatchAgainst.isNotEmpty;\n        }\n\n        if (etagsToMatchAgainst.isNotEmpty) {\n          var hasBeenModified = false;\n\n          for (var etag in etagsToMatchAgainst) {\n            if (etag == '*') {\n              hasBeenModified = true;\n            } else {\n              hasBeenModified =\n                  !_etags.containsKey(file.absolute.path) ||\n                  _etags[file.absolute.path] != etag;\n            }\n          }\n\n          if (!ifRange) {\n            if (!hasBeenModified) {\n              res.statusCode = 304;\n              setCachedHeaders(stat.modified, req, res);\n              return Future.value(false);\n            }\n          } else {\n            return super.serveFile(file, stat, req, res);\n          }\n        }\n      }\n\n      return file.lastModified().then((stamp) {\n        if (useEtags) {\n          res.headers['ETag'] = _etags[file.absolute.path] = stamp\n              .millisecondsSinceEpoch\n              .toString();\n        }\n\n        setCachedHeaders(stat.modified, req, res);\n        return super.serveFile(file, stat, req, res);\n      });\n    }\n  }\n\n  void setCachedHeaders(\n    DateTime modified,\n    RequestContext req,\n    ResponseContext res,\n  ) {\n    var privacy = accessLevel.level;\n\n    res.headers\n      ..['cache-control'] = '$privacy, max-age=$maxAge'\n      ..['last-modified'] = HttpDate.format(modified);\n\n    //if (maxAge != null) {\n    var expiry = DateTime.now().add(Duration(seconds: maxAge));\n    res.headers['expires'] = HttpDate.format(expiry);\n    //}\n  }\n}\n\nenum CacheAccessLevel {\n  public('public'),\n  private('private');\n\n  const CacheAccessLevel(this.level);\n  final String level;\n}\n"
  },
  {
    "path": "packages/static/lib/src/virtual_directory.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:file/file.dart';\nimport 'package:http_parser/http_parser.dart';\nimport 'package:path/path.dart' as p;\nimport 'package:logging/logging.dart';\nimport 'package:belatuk_range_header/belatuk_range_header.dart';\n\nfinal RegExp _param = RegExp(r':([A-Za-z0-9_]+)(\\((.+)\\))?');\nfinal RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');\n\nString _pathify(String path) {\n  var p = path.replaceAll(_straySlashes, '');\n\n  var replace = {};\n\n  for (Match match in _param.allMatches(p)) {\n    if (match[3] != null) replace[match[0]] = ':${match[1]}';\n  }\n\n  replace.forEach((k, v) {\n    if (k is String && v is String) {\n      p = p.replaceAll(k, v);\n    }\n  });\n\n  return p;\n}\n\n/// A static server plug-in.\nclass VirtualDirectory {\n  final _log = Logger('VirtualDirectory');\n\n  late String _prefix;\n  late Directory _source;\n\n  /// The directory to serve files from.\n  Directory get source => _source;\n\n  /// An optional callback to run before serving files.\n  final Function(File file, RequestContext req, ResponseContext res)? callback;\n\n  final Angel app;\n  final FileSystem fileSystem;\n\n  /// Filenames to be resolved within directories as indices.\n  final Iterable<String> indexFileNames;\n\n  /// An optional public path to map requests to.\n  final String publicPath;\n\n  /// If `true` (default: `false`), then if a directory does not contain any of the specific [indexFileNames], a default directory listing will be served.\n  final bool allowDirectoryListing;\n\n  /// If `true` (default: `true`), then files will be opened as streams and piped into the request.\n  ///\n  /// If not, the response buffer will be used instead.\n  final bool useBuffer;\n\n  VirtualDirectory(\n    this.app,\n    this.fileSystem, {\n    Directory? source,\n    this.indexFileNames = const ['index.html'],\n    this.publicPath = '/',\n    this.callback,\n    this.allowDirectoryListing = false,\n    this.useBuffer = false,\n  }) {\n    _prefix = publicPath.replaceAll(_straySlashes, '');\n    if (source != null) {\n      _source = source;\n    } else {\n      var dirPath = app.environment.isProduction ? './build/web' : './web';\n      _source = fileSystem.directory(dirPath);\n    }\n  }\n\n  /// Responds to incoming HTTP requests.\n  Future<bool> handleRequest(RequestContext req, ResponseContext res) {\n    if (req.method != 'GET' && req.method != 'HEAD') {\n      return Future<bool>.value(true);\n    }\n    var path = req.uri!.path.replaceAll(_straySlashes, '');\n\n    if (_prefix.isNotEmpty == true && !path.startsWith(_prefix)) {\n      return Future<bool>.value(true);\n    }\n\n    return servePath(path, req, res);\n  }\n\n  /// A handler that serves the file at the given path, unless the user has requested that path.\n  ///\n  /// You can also limit this functionality to specific values of the `Accept` header, ex. `text/html`.\n  /// If [accepts] is `null`, OR at least one of the content types in [accepts] is present,\n  /// the view will be served.\n  RequestHandler pushState(String path, {Iterable? accepts}) {\n    var vPath = path.replaceAll(_straySlashes, '');\n    if (_prefix.isNotEmpty == true) vPath = '$_prefix/$vPath';\n\n    return (RequestContext req, ResponseContext res) {\n      var path = req.path.replaceAll(_straySlashes, '');\n      if (path == vPath) return Future<bool>.value(true);\n\n      if (accepts?.isNotEmpty == true) {\n        if (!accepts!.any((x) => req.accepts(x, strict: true))) {\n          return Future<bool>.value(true);\n        }\n      }\n\n      return servePath(vPath, req, res);\n    };\n  }\n\n  /// Writes the file at the given virtual [path] to a response.\n  Future<bool> servePath(\n    String path,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    if (_prefix.isNotEmpty) {\n      // Only replace the *first* incidence\n      // Resolve: https://github.com/angel-dart/angel/issues/41\n      path = path.replaceFirst(RegExp('^${_pathify(_prefix)}'), '');\n    }\n\n    if (path.isEmpty) path = '.';\n    path = path.replaceAll(_straySlashes, '');\n\n    var absolute = source.absolute.uri.resolve(path).toFilePath();\n    var parent = source.absolute.uri.toFilePath();\n\n    if (!p.isWithin(parent, absolute) && !p.equals(parent, absolute)) {\n      return true;\n    }\n\n    // Update to the correct file separator based on file system\n    if (absolute.contains('\\\\') && fileSystem.path.separator == '/') {\n      absolute = absolute.replaceAll('\\\\', '/');\n      _log.warning(\n        'Incompatible file system type is used. Changed file separator from \"\\\\\" to \"/\".',\n      );\n    } else if (absolute.contains('/') && fileSystem.path.separator == '\\\\') {\n      absolute = absolute.replaceAll('/', '\\\\');\n      _log.warning(\n        'Incompatible file system type. Changed file separator from \"/\" to \"\\\\\".',\n      );\n    }\n\n    var stat = await fileSystem.stat(absolute);\n    return await serveStat(absolute, path, stat, req, res);\n  }\n\n  /// Writes the file at the path given by the [stat] to a response.\n  Future<bool> serveStat(\n    String absolute,\n    String relative,\n    FileStat stat,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    if (stat.type == FileSystemEntityType.directory) {\n      return await serveDirectory(\n        fileSystem.directory(absolute),\n        relative,\n        stat,\n        req,\n        res,\n      );\n    } else if (stat.type == FileSystemEntityType.file) {\n      return await serveFile(fileSystem.file(absolute), stat, req, res);\n    } else if (stat.type == FileSystemEntityType.link) {\n      var link = fileSystem.link(absolute);\n      return await servePath(await link.resolveSymbolicLinks(), req, res);\n    } else {\n      return true;\n    }\n  }\n\n  /// Serves the index file of a [directory], if it exists.\n  Future<bool> serveDirectory(\n    Directory directory,\n    String relative,\n    FileStat stat,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    for (var indexFileName in indexFileNames) {\n      final index = fileSystem.file(\n        directory.absolute.uri.resolve(indexFileName),\n      );\n      if (await index.exists()) {\n        return await serveFile(index, stat, req, res);\n      }\n    }\n\n    if (allowDirectoryListing == true) {\n      res.contentType = MediaType('text', 'html');\n      res\n        ..write('<!DOCTYPE html>')\n        ..write('<html>')\n        ..write(\n          '<head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">',\n        )\n        ..write('<style>ul { list-style-type: none; }</style>')\n        ..write('</head><body>');\n\n      res.write('<li><a href=\"..\">..</a></li>');\n\n      var entities = await directory\n          .list(followLinks: false)\n          .toList()\n          .then((l) => List.from(l));\n      entities.sort((a, b) {\n        if (a is Directory) {\n          if (b is Directory) {\n            return a.path.compareTo(b.path);\n          }\n          return -1;\n        } else if (a is File) {\n          if (b is Directory) {\n            return 1;\n          } else if (b is File) {\n            return a.path.compareTo(b.path);\n          }\n          return -1;\n        } else if (a is Link) {\n          if (b is Directory) {\n            return 1;\n          } else if (b is Link) {\n            return a.path.compareTo(b.path);\n          }\n          return -1;\n        }\n\n        return 1;\n      });\n\n      for (var entity in entities) {\n        String stub;\n        String type;\n\n        if (entity is File) {\n          type = '[File]';\n          stub = p.basename(entity.path);\n        } else if (entity is Directory) {\n          type = '[Directory]';\n          stub = p.basename(entity.path);\n        } else if (entity is Link) {\n          type = '[Link]';\n          stub = p.basename(entity.path);\n        } else {\n          _log.severe('Unknown file entity. Not a file, directory or link.');\n          type = '[]';\n          stub = '';\n        }\n        var href = stub;\n\n        if (relative.isNotEmpty) {\n          href = '/$relative/$stub';\n        }\n\n        if (entity is Directory) {\n          if (href == '') {\n            href = '/';\n          } else {\n            href += '/';\n          }\n        }\n        href = Uri.encodeFull(href);\n\n        res.write('<li><a href=\"$href\">$type $stub</a></li>');\n      }\n\n      res.write('</body></html>');\n      return false;\n    }\n\n    return true;\n  }\n\n  void _ensureContentTypeAllowed(String mimeType, RequestContext req) {\n    var value = req.headers?.value('accept');\n    var acceptable =\n        value == null ||\n        value.isNotEmpty != true ||\n        (mimeType.isNotEmpty == true && value.contains(mimeType) == true) ||\n        value.contains('*/*') == true;\n    if (!acceptable) {\n      _log.severe('Mime type [$value] is not supported');\n      throw AngelHttpException(\n        //UnsupportedError(\n        //    'Client requested $value, but server wanted to send $mimeType.'),\n        errors: [\n          'Client requested $value, but server wanted to send $mimeType.',\n        ],\n        statusCode: 406,\n        message: '406 Not Acceptable',\n      );\n    }\n  }\n\n  /// Writes the contents of a file to a response.\n  Future<bool> serveFile(\n    File file,\n    FileStat stat,\n    RequestContext req,\n    ResponseContext res,\n  ) async {\n    res.headers['accept-ranges'] = 'bytes';\n\n    if (callback != null) {\n      return await req.app?.executeHandler(\n            (RequestContext req, ResponseContext res) =>\n                callback!(file, req, res),\n            req,\n            res,\n          ) ??\n          true;\n    }\n\n    var type =\n        app.mimeTypeResolver.lookup(file.path) ?? 'application/octet-stream';\n    res.headers['accept-ranges'] = 'bytes';\n    _ensureContentTypeAllowed(type, req);\n    res.headers['accept-ranges'] = 'bytes';\n    res.contentType = MediaType.parse(type);\n    if (useBuffer == true) res.useBuffer();\n\n    if (req.headers == null) {\n      _log.severe('Missing headers in the RequestContext');\n      throw ArgumentError('Missing headers in the RequestContext');\n    }\n    var reqHeaders = req.headers!;\n\n    if (reqHeaders.value('range')?.startsWith('bytes=') != true) {\n      await res.streamFile(file);\n    } else {\n      var header = RangeHeader.parse(reqHeaders.value('range')!);\n      var items = RangeHeader.foldItems(header.items);\n      header = RangeHeader(items);\n\n      var totalFileSize = await file.length();\n\n      for (var item in header.items) {\n        var invalid = false;\n\n        if (item.start != -1) {\n          invalid = item.end != -1 && item.end < item.start;\n        } else {\n          invalid = item.end == -1;\n        }\n\n        if (invalid) {\n          throw AngelHttpException(\n            //Exception('Semantically invalid, or unbounded range.'),\n            errors: ['Semantically invalid, or unbounded range.'],\n            statusCode: 416,\n            message: 'Semantically invalid, or unbounded range.',\n          );\n        }\n\n        // Ensure it's within range.\n        if (item.start >= totalFileSize || item.end >= totalFileSize) {\n          throw AngelHttpException(\n            //Exception('Given range $item is out of bounds.'),\n            errors: ['Given range $item is out of bounds.'],\n            statusCode: 416,\n            message: 'Given range $item is out of bounds.',\n          );\n        }\n      }\n\n      if (header.items.isEmpty) {\n        throw AngelHttpException(\n          statusCode: 416,\n          message: '`Range` header may not be empty.',\n        );\n      } else if (header.items.length == 1) {\n        var item = header.items[0];\n        Stream<List<int>> stream;\n        var len = 0;\n\n        var total = totalFileSize;\n\n        if (item.start == -1) {\n          if (item.end == -1) {\n            len = total;\n            stream = file.openRead();\n          } else {\n            len = item.end + 1;\n            stream = file.openRead(0, item.end + 1);\n          }\n        } else {\n          if (item.end == -1) {\n            len = total - item.start;\n            stream = file.openRead(item.start);\n          } else {\n            len = item.end - item.start + 1;\n            stream = file.openRead(item.start, item.end + 1);\n          }\n        }\n\n        res.contentType = MediaType.parse(\n          app.mimeTypeResolver.lookup(file.path) ?? 'application/octet-stream',\n        );\n        res.statusCode = 206;\n        res.headers['content-length'] = len.toString();\n        res.headers['content-range'] = 'bytes ${item.toContentRange(total)}';\n        await stream.cast<List<int>>().pipe(res);\n        return false;\n      } else {\n        var transformer = RangeHeaderTransformer(\n          header,\n          app.mimeTypeResolver.lookup(file.path) ?? 'application/octet-stream',\n          await file.length(),\n        );\n        res.statusCode = 206;\n        res.headers['content-length'] = transformer\n            .computeContentLength(totalFileSize)\n            .toString();\n        res.contentType = MediaType('multipart', 'byteranges', {\n          'boundary': transformer.boundary,\n        });\n        await file\n            .openRead()\n            .cast<List<int>>()\n            .transform(transformer)\n            .pipe(res);\n        return false;\n      }\n    }\n\n    return false;\n  }\n}\n"
  },
  {
    "path": "packages/static/melos_angel3_static.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/static/pubspec.yaml",
    "content": "name: angel3_static\nversion: 8.5.0\ndescription: This library provides a virtual directory to serve static files for Angel3 framework.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/angel3/packages/static\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  belatuk_range_header: ^6.1.0\n  convert: ^3.0.0\n  crypto: ^3.0.1\n  file: ^7.0.0\n  http_parser: ^4.0.0\n  path: ^1.9.0\n  logging: ^1.2.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  http: ^1.0.0\n  matcher: ^0.12.10\n  lints: ^6.0.0\n  test: ^1.24.0\n\n"
  },
  {
    "path": "packages/static/test/HELLO.md",
    "content": "# hello\nworld!"
  },
  {
    "path": "packages/static/test/all_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\nimport 'package:http/http.dart' show Client;\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  Angel app;\n  late AngelHttp http;\n  var testDir = const LocalFileSystem().directory('test');\n  late String url;\n  var client = Client();\n\n  setUp(() async {\n    app = Angel();\n    http = AngelHttp(app);\n    app.logger = Logger('angel')..onRecord.listen(print);\n\n    app.fallback(\n      VirtualDirectory(\n        app,\n        const LocalFileSystem(),\n        source: testDir,\n        publicPath: '/virtual',\n        indexFileNames: ['index.txt'],\n      ).handleRequest,\n    );\n\n    app.fallback(\n      VirtualDirectory(\n        app,\n        const LocalFileSystem(),\n        source: testDir,\n        useBuffer: true,\n        indexFileNames: ['index.php', 'index.txt'],\n      ).handleRequest,\n    );\n\n    app.fallback((req, res) => 'Fallback');\n\n    app.dumpTree(showMatchers: true);\n\n    var server = await http.startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    if (http.server != null) await http.server!.close(force: true);\n  });\n\n  test('can serve files, with correct Content-Type', () async {\n    var response = await client.get(Uri.parse('$url/sample.txt'));\n    expect(response.body, equals('Hello world'));\n    expect(response.headers['content-type'], contains('text/plain'));\n  });\n\n  test('can serve child directories', () async {\n    var response = await client.get(Uri.parse('$url/nested'));\n    expect(response.body, equals('Bird'));\n    expect(response.headers['content-type'], contains('text/plain'));\n  });\n\n  test('non-existent files are skipped', () async {\n    var response = await client.get(Uri.parse('$url/nonexist.ent'));\n    expect(response.body, equals('\"Fallback\"'));\n  });\n\n  test('can match index files', () async {\n    var response = await client.get(Uri.parse(url));\n    expect(response.body, equals('index!'));\n  });\n\n  test('virtualRoots can match index', () async {\n    var response = await client.get(Uri.parse('$url/virtual'));\n    expect(response.body, equals('index!'));\n  });\n\n  test('chrome accept', () async {\n    var response = await client.get(\n      Uri.parse('$url/virtual'),\n      headers: {\n        'accept':\n            'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',\n      },\n    );\n    expect(response.body, equals('index!'));\n  });\n}\n"
  },
  {
    "path": "packages/static/test/cache_sample.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\n\nvoid main() async {\n  Angel app;\n  AngelHttp http;\n  var testDir = const LocalFileSystem().directory('test');\n  app = Angel();\n  http = AngelHttp(app);\n\n  app.fallback(\n    CachingVirtualDirectory(\n      app,\n      const LocalFileSystem(),\n      source: testDir,\n      maxAge: 350,\n      onlyInProduction: false,\n      indexFileNames: ['index.txt'],\n    ).handleRequest,\n  );\n\n  app.get('*', (req, res) => 'Fallback');\n\n  app.dumpTree(showMatchers: true);\n\n  var server = await http.startServer();\n  print('Open at http://${server.address.host}:${server.port}');\n}\n"
  },
  {
    "path": "packages/static/test/cache_test.dart",
    "content": "import 'dart:io' show HttpDate;\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:file/local.dart';\nimport 'package:http/http.dart' show Client;\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  Angel app;\n  late AngelHttp http;\n  var testDir = const LocalFileSystem().directory('test');\n  late String url;\n  var client = Client();\n\n  setUp(() async {\n    app = Angel();\n    http = AngelHttp(app);\n\n    app.fallback(\n      CachingVirtualDirectory(\n        app,\n        const LocalFileSystem(),\n        source: testDir,\n        maxAge: 350,\n        onlyInProduction: false,\n        //publicPath: '/virtual',\n        indexFileNames: ['index.txt'],\n      ).handleRequest,\n    );\n\n    app.get('*', (req, res) => 'Fallback');\n\n    app.dumpTree(showMatchers: true);\n\n    app.logger = Logger('angel_static')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    var server = await http.startServer();\n    url = 'http://${server.address.host}:${server.port}';\n  });\n\n  tearDown(() async {\n    if (http.server != null) await http.server!.close(force: true);\n  });\n\n  test('sets etag, cache-control, expires, last-modified', () async {\n    var response = await client.get(Uri.parse(url));\n\n    print('Response status: ${response.statusCode}');\n    print('Response body: ${response.body}');\n    print('Response headers: ${response.headers}');\n\n    expect(response.statusCode, equals(200));\n    expect(\n      ['etag', 'cache-control', 'expires', 'last-modified'],\n      everyElement(\n        predicate(\n          response.headers.containsKey,\n          'contained in response headers',\n        ),\n      ),\n    );\n  });\n\n  test('if-modified-since', () async {\n    var response = await client.get(\n      Uri.parse(url),\n      headers: {\n        'if-modified-since': HttpDate.format(\n          DateTime.now().add(Duration(days: 365)),\n        ),\n      },\n    );\n\n    print('Response status: ${response.statusCode}');\n\n    expect(response.statusCode, equals(304));\n    expect(\n      ['cache-control', 'expires', 'last-modified'],\n      everyElement(\n        predicate(\n          response.headers.containsKey,\n          'contained in response headers',\n        ),\n      ),\n    );\n  });\n}\n"
  },
  {
    "path": "packages/static/test/foo.mustache",
    "content": "<h1>{{foo}}</h1>"
  },
  {
    "path": "packages/static/test/index.txt",
    "content": "index!"
  },
  {
    "path": "packages/static/test/issue41_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:file/file.dart';\nimport 'package:file/local.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nfinal Directory swaggerUiDistDir = const LocalFileSystem().directory(\n  'test/node_modules/swagger-ui-dist',\n);\n\nvoid main() async {\n  late TestClient client;\n  late String swaggerUiCssContents, swaggerTestJsContents;\n\n  setUp(() async {\n    // Load file contents\n    swaggerUiCssContents = await const LocalFileSystem()\n        .file(swaggerUiDistDir.uri.resolve('swagger-ui.css'))\n        .readAsString();\n    swaggerTestJsContents = await const LocalFileSystem()\n        .file(swaggerUiDistDir.uri.resolve('test.js'))\n        .readAsString();\n\n    // Initialize app\n    var app = Angel();\n    app.logger = Logger('angel')..onRecord.listen(print);\n\n    app.fallback(\n      VirtualDirectory(\n        app,\n        const LocalFileSystem(),\n        source: swaggerUiDistDir,\n        publicPath: 'swagger/',\n      ).handleRequest,\n    );\n\n    app.dumpTree();\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  test('prefix is not replaced in file paths', () async {\n    var response = await client.get(Uri.parse('/swagger/swagger-ui.css'));\n    print('Response: ${response.body}');\n    expect(response, hasBody(swaggerUiCssContents));\n  });\n\n  test('get a file without prefix in name', () async {\n    var response = await client.get(Uri.parse('/swagger/test.js'));\n    print('Response: ${response.body}');\n    expect(response, hasBody(swaggerTestJsContents));\n  });\n\n  test('trailing slash at root', () async {\n    var response = await client.get(Uri.parse('/swagger'));\n    var body1 = response.body;\n    print('Response #1: $body1');\n\n    response = await client.get(Uri.parse('/swagger/'));\n    var body2 = response.body;\n    print('Response #2: $body2');\n\n    expect(body1, body2);\n  });\n}\n"
  },
  {
    "path": "packages/static/test/nested/index.txt",
    "content": "Bird"
  },
  {
    "path": "packages/static/test/push_state_test.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_static/angel3_static.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:file/memory.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  Angel app;\n  MemoryFileSystem fileSystem;\n  late TestClient client;\n\n  setUp(() async {\n    // For teting on Linux/MacOS\n    fileSystem = MemoryFileSystem();\n\n    // For testing on Windows\n    //fileSystem = MemoryFileSystem(style: FileSystemStyle.windows);\n\n    var webDir = fileSystem.directory('web');\n    await webDir.create(recursive: true);\n\n    var indexFile = webDir.childFile('index.html');\n    await indexFile.writeAsString('index');\n\n    app = Angel();\n\n    var vDir = VirtualDirectory(app, fileSystem, source: webDir);\n\n    app\n      ..fallback(vDir.handleRequest)\n      ..fallback(vDir.pushState('index.html'))\n      ..fallback((req, res) => 'Fallback');\n\n    app.logger = Logger('push_state')\n      ..onRecord.listen((rec) {\n        print(rec);\n        if (rec.error != null) print(rec.error);\n        if (rec.stackTrace != null) print(rec.stackTrace);\n      });\n\n    client = await connectTo(app);\n  });\n\n  tearDown(() => client.close());\n\n  test('serves as fallback', () async {\n    var response = await client.get(Uri.parse('/nope'));\n    print(response);\n    expect(response.body, 'index');\n  });\n}\n"
  },
  {
    "path": "packages/static/test/sample.txt",
    "content": "Hello world"
  },
  {
    "path": "packages/static/test/web/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Push Test</title>\n  </head>\n  <body>\n    <h1>Hello!</h1>\n    <i>Hooray for testing...</i>\n  </body>\n</html>\n"
  },
  {
    "path": "packages/sync/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/sync/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0\n\n* Require Dart >= 2.17\n\n## 6.0.0\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.1.1\n\n* Fixed license link\n\n## 4.1.0\n\n* Updated to use `belatuk_pub_sub` package\n* Upgraded from `pendantic` to `lints` linter\n\n## 4.0.0\n\n* Updated to use `angel3` packages\n* Published with `angel3` prefix\n\n## 3.0.0\n\n* Migrated to support Dart >= 2.12 NNBD\n\n## 2.0.0\n\n* Dart 2 + Angel 2 updates.\n* Extend `StreamChannel`, instead of the defunct `WebSocketSynchronizer`.\n"
  },
  {
    "path": "packages/sync/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/sync/README.md",
    "content": "# Angel3 Sync\n\n[![version](https://img.shields.io/badge/pub-v4.1.1-brightgreen)](https://pub.dev/packages/angel3_sync)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dart-backend/angel/tree/angel3/packages/sync/LICENSE)\n\nEasily synchronize and scale WebSockets using [belatuk_pub_sub](<https://pub.dev/packages/belatuk_pub_sub>).\n\n## Usage\n\nThis package exposes `PubSubSynchronizationChannel`, which can simply be dropped into any `AngelWebSocket` constructor. Once you've set that up, instances of your application will automatically fire events in-sync. That's all you have to do to scale a real-time application with Angel3!\n\n```dart\nawait app.configure(AngelWebSocket(\n    synchronizationChannel: PubSubSynchronizationChannel(\n        pub_sub.IsolateClient('<client-id>', adapter.receivePort.sendPort),\n    ),\n));\n```\n"
  },
  {
    "path": "packages/sync/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/sync/example/main.dart",
    "content": "import 'dart:isolate';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_sync/angel3_sync.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:angel3_websocket/io.dart' as client;\nimport 'package:angel3_websocket/server.dart';\nimport 'package:belatuk_pub_sub/isolate.dart' as pub_sub;\nimport 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app1, app2;\n  late TestClient app1Client;\n  late client.WebSockets app2Client;\n  late pub_sub.Server server;\n  late ReceivePort app1Port, app2Port;\n\n  setUp(() async {\n    var adapter = pub_sub.IsolateAdapter();\n\n    server = pub_sub.Server([adapter])\n      ..registerClient(const pub_sub.ClientInfo('angel_sync1'))\n      ..registerClient(const pub_sub.ClientInfo('angel_sync2'))\n      ..start();\n\n    app1 = Angel();\n    app2 = Angel();\n\n    app1.post('/message', (req, res) async {\n      // Manually broadcast. Even though app1 has no clients, it *should*\n      // propagate to app2.\n      var ws = req.container!.make<AngelWebSocket>();\n\n      //var body = await req.parseBody();\n      var body = {};\n      await ws.batchEvent(\n        WebSocketEvent(eventName: 'message', data: body['message']),\n      );\n      return 'Sent: ${body['message']}';\n    });\n\n    app1Port = ReceivePort();\n    var ws1 = AngelWebSocket(\n      app1,\n      synchronizationChannel: PubSubSynchronizationChannel(\n        pub_sub.IsolateClient('angel_sync1', adapter.receivePort.sendPort),\n      ),\n    );\n    await app1.configure(ws1.configureServer);\n    app1.get('/ws', ws1.handleRequest);\n    app1Client = await connectTo(app1);\n\n    app2Port = ReceivePort();\n    var ws2 = AngelWebSocket(\n      app2,\n      synchronizationChannel: PubSubSynchronizationChannel(\n        pub_sub.IsolateClient('angel_sync2', adapter.receivePort.sendPort),\n      ),\n    );\n    await app2.configure(ws2.configureServer);\n    app2.get('/ws', ws2.handleRequest);\n\n    var http = AngelHttp(app2);\n    await http.startServer();\n    var wsPath = http.uri\n        .replace(scheme: 'ws', path: '/ws')\n        .removeFragment()\n        .toString();\n    print(wsPath);\n    app2Client = client.WebSockets(wsPath);\n    await app2Client.connect();\n  });\n\n  tearDown(() {\n    server.close();\n    app1Port.close();\n    app2Port.close();\n    app1.close();\n    app2.close();\n    app1Client.close();\n    app2Client.close();\n  });\n\n  test('events propagate', () async {\n    // The point of this test is that neither app1 nor app2\n    // is aware that the other even exists.\n    //\n    // Regardless, a WebSocket event broadcast in app1 will be\n    // broadcast by app2 as well.\n\n    var stream = app2Client.on['message'];\n    var response = await app1Client.post(\n      Uri.parse('/message'),\n      body: {'message': 'Hello, world!'},\n    );\n    print('app1 response: ${response.body}');\n\n    var msg = await stream.first.timeout(const Duration(seconds: 5));\n    print('app2 got message: ${msg.data}');\n  });\n}\n"
  },
  {
    "path": "packages/sync/lib/angel3_sync.dart",
    "content": "import 'dart:async';\nimport 'package:angel3_websocket/angel3_websocket.dart';\nimport 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;\nimport 'package:stream_channel/stream_channel.dart';\n\n/// Synchronizes WebSockets using `package:pub_sub`.\nclass PubSubSynchronizationChannel extends StreamChannelMixin<WebSocketEvent> {\n  /// The event name used to synchronize events on the server.\n  static const String eventName = 'angel_sync::event';\n\n  final StreamChannelController<WebSocketEvent> _ctrl =\n      StreamChannelController<WebSocketEvent>();\n\n  pub_sub.ClientSubscription? _subscription;\n\n  final pub_sub.Client client;\n\n  PubSubSynchronizationChannel(this.client) {\n    _ctrl.local.stream.listen((e) {\n      client\n          .publish(eventName, e.toJson())\n          .catchError(_ctrl.local.sink.addError);\n    });\n\n    client\n        .subscribe(eventName)\n        .then((sub) {\n          _subscription = sub\n            ..listen((data) {\n              // Incoming is a Map\n              if (data is Map) {\n                var e = WebSocketEvent.fromJson(data);\n                _ctrl.local.sink.add(e);\n              }\n            }, onError: _ctrl.local.sink.addError);\n        })\n        .catchError((error) {\n          _ctrl.local.sink.addError(error as Object);\n        });\n  }\n\n  @override\n  Stream<WebSocketEvent> get stream => _ctrl.foreign.stream;\n\n  @override\n  StreamSink<WebSocketEvent> get sink => _ctrl.foreign.sink;\n\n  Future close() {\n    if (_subscription != null) {\n      _subscription!.unsubscribe().then((_) => client.close());\n    } else {\n      client.close();\n    }\n    return _ctrl.local.sink.close();\n  }\n}\n"
  },
  {
    "path": "packages/sync/melos_angel3_sync.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/sync/pubspec.yaml",
    "content": "name: angel3_sync\nversion: 8.5.0\ndescription: Easily synchronize and scale WebSockets using belatuk_pub_sub in Angel3.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/angel3/packages/sync\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  angel3_websocket: ^8.2.0\n  belatuk_pub_sub: ^6.1.0\n  stream_channel: ^2.1.0\ndev_dependencies:\n  angel3_test: ^8.2.0\n  test: ^1.24.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "packages/sync/test/all_test.dart",
    "content": "import 'dart:isolate';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\nimport 'package:angel3_sync/angel3_sync.dart';\nimport 'package:angel3_test/angel3_test.dart';\nimport 'package:angel3_websocket/io.dart' as client;\nimport 'package:angel3_websocket/server.dart';\nimport 'package:belatuk_pub_sub/isolate.dart' as pub_sub;\nimport 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub;\nimport 'package:test/test.dart';\n\nvoid main() {\n  late Angel app1, app2;\n  late TestClient app1Client;\n  late client.WebSockets app2Client;\n  late pub_sub.Server server;\n  late ReceivePort app1Port, app2Port;\n\n  setUp(() async {\n    var adapter = pub_sub.IsolateAdapter();\n\n    server = pub_sub.Server([adapter])\n      ..registerClient(const pub_sub.ClientInfo('angel_sync1'))\n      ..registerClient(const pub_sub.ClientInfo('angel_sync2'))\n      ..start();\n\n    app1 = Angel();\n    app2 = Angel();\n\n    app1.post('/message', (req, res) async {\n      // Manually broadcast. Even though app1 has no clients, it *should*\n      // propagate to app2.\n      var ws = req.container!.make<AngelWebSocket>();\n\n      // TODO: body is void\n      //var body = await req.parseBody();\n      var body = {};\n      await ws.batchEvent(\n        WebSocketEvent(eventName: 'message', data: body['message']),\n      );\n      return 'Sent: ${body['message']}';\n    });\n\n    app1Port = ReceivePort();\n    var ws1 = AngelWebSocket(\n      app1,\n      synchronizationChannel: PubSubSynchronizationChannel(\n        pub_sub.IsolateClient('angel_sync1', adapter.receivePort.sendPort),\n      ),\n    );\n    await app1.configure(ws1.configureServer);\n    app1.get('/ws', ws1.handleRequest);\n    app1Client = await connectTo(app1);\n\n    app2Port = ReceivePort();\n    var ws2 = AngelWebSocket(\n      app2,\n      synchronizationChannel: PubSubSynchronizationChannel(\n        pub_sub.IsolateClient('angel_sync2', adapter.receivePort.sendPort),\n      ),\n    );\n    await app2.configure(ws2.configureServer);\n    app2.get('/ws', ws2.handleRequest);\n\n    var http = AngelHttp(app2);\n    await http.startServer();\n    var wsPath = http.uri\n        .replace(scheme: 'ws', path: '/ws')\n        .removeFragment()\n        .toString();\n    print(wsPath);\n    app2Client = client.WebSockets(wsPath);\n    await app2Client.connect();\n  });\n\n  tearDown(() {\n    server.close();\n    app1Port.close();\n    app2Port.close();\n    app1.close();\n    app2.close();\n    app1Client.close();\n    app2Client.close();\n  });\n\n  test('events propagate', () async {\n    // The point of this test is that neither app1 nor app2\n    // is aware that the other even exists.\n    //\n    // Regardless, a WebSocket event broadcast in app1 will be\n    // broadcast by app2 as well.\n\n    var stream = app2Client.on['message'];\n    var response = await app1Client.post(\n      Uri.parse('/message'),\n      body: {'message': 'Hello, world!'},\n    );\n    print('app1 response: ${response.body}');\n\n    var msg = await stream.first.timeout(const Duration(seconds: 5));\n    print('app2 got message: ${msg.data}');\n  });\n}\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/AUTHORS.md",
    "content": "Primary Authors\n===============\n\n* __[Thomas Hii](dukefirehawk.apps@gmail.com)__\n\n    Thomas is the current maintainer of the code base. He has refactored and migrated the \n    code base to support NNBD.\n\n* __[Tobe O](thosakwe@gmail.com)__\n\n    Tobe has written much of the original code prior to NNBD migration. He has moved on and\n    is no longer involved with the project.\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/CHANGELOG.md",
    "content": "# Change Log\n\n## 8.5.0\n\n* Require Dart >= 3.11\n\n## 8.4.0\n\n* Require Dart >= 3.8\n* Updated `lints` to 6.0.0\n* Updated dependencies to the latest release\n\n## 8.3.0\n\n* Require Dart >= 3.6\n* Updated `lints` to 5.0.0\n* Updated dependencies to the latest release\n\n## 8.2.0\n\n* Require Dart >= 3.3\n* Updated `lints` to 4.0.0\n\n## 8.1.1\n\n* Updated repository link\n\n## 8.1.0\n\n* Updated `lints` to 3.0.0\n* Fixed linter warnings\n\n## 8.0.0\n\n* Require Dart >= 3.0\n\n## 7.0.0-beta.1\n\n* Require Dart >= 2.17\n\n## 6.0.0-beta.1\n\n* Require Dart >= 2.16\n\n## 5.0.0\n\n* Skipped release\n\n## 4.0.0\n\n* Skipped release\n\n## 3.0.0-beta.1\n\n* Migrated to support Dart >= 2.12 NNBD\n* Upgraded from `pendantic` to `lints` linter\n\n## 2.0.0\n\n* Angel 2 + Dart 2 updates\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2021, dukefirehawk.com\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/README.md",
    "content": "# Angel3 User Agent\n\n![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_user_agent?include_prereleases)\n[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)\n[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)\n[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dart-backend/angel/tree/angel3/packages/user_agent/angel_user_agent/LICENSE)\n\n**Replacement of `package:angel_user_agent` with breaking changes to support NNBD.**\n\nMiddleware to inject a User Agent object into requests. For convenience's sake, it also exports the `user_agent` library.\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/analysis_options.yaml",
    "content": "include: package:lints/recommended.yaml"
  },
  {
    "path": "packages/user_agent/angel_user_agent/example/example.dart",
    "content": "//import 'dart:io';\nimport 'package:angel3_framework/angel3_framework.dart';\nimport 'package:angel3_framework/http.dart';\n//import 'package:angel3_user_agent/angel3_user_agent.dart';\n//import 'package:user_agent_analyzer/user_agent_analyzer.dart';\n\nvoid main() async {\n  var app = Angel();\n  // ignore: unused_local_variable\n  var http = AngelHttp(app);\n\n  //TODO: To be reviewed\n  /*\n  app.get(\n    '/',\n    waterfall([\n      parseUserAgent,\n      (req, res) {\n        var ua = req.container.make<UserAgent>() as UserAgent;\n        return ua.isChrome\n            ? 'Woohoo! You are running Chrome.'\n            : 'Sorry, we only support Google Chrome.';\n      },\n    ]),\n  );\n\n  var server = await http.startServer(InternetAddress.anyIPv4, 3000);\n  print('Listening at http://${server.address.address}:${server.port}');\n  */\n}\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/lib/angel3_user_agent.dart",
    "content": "import 'package:angel3_framework/angel3_framework.dart';\nimport 'package:user_agent_analyzer/user_agent_analyzer.dart';\n\n/// Injects a [UserAgent] factory into requests.\n///\n/// Because it is an injected factory, the user agent will not be\n/// parsed until you request it via `req.container.make<UserAgent>()`.\nbool parseUserAgent(RequestContext req, ResponseContext res) {\n  req.container!.registerFactory<UserAgent>((container) {\n    var agentString = req.headers!.value('user-agent');\n\n    if (agentString?.trim().isNotEmpty != true) {\n      throw AngelHttpException.badRequest(\n        message: 'User-Agent header is required.',\n      );\n    } else if (agentString != null) {\n      var userAgent = UserAgent(agentString);\n      container.registerSingleton<UserAgent>(userAgent);\n      return userAgent;\n    }\n\n    // TODO: To be reviewed\n    return UserAgent('unknown');\n  });\n\n  return true;\n}\n"
  },
  {
    "path": "packages/user_agent/angel_user_agent/melos_angel3_user_agent.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/test\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.dart_tool\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/.pub\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build\" />\n    </content>\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Dart SDK\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Dart Packages\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "packages/user_agent/angel_user_agent/pubspec.yaml",
    "content": "name: angel3_user_agent\nversion: 8.5.0\ndescription: Angel3 middleware to parse and inject a User Agent object into requests.\nhomepage: https://angel3-framework.web.app/\nrepository: https://github.com/dart-backend/angel/tree/angel3/packages/user_agent/angel_user_agent\nresolution: workspace\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\ndependencies:\n  angel3_framework: ^8.4.0\n  user_agent_analyzer: ^5.0.0\n  lints: ^6.0.0\n"
  },
  {
    "path": "pubspec.yaml",
    "content": "name: angel3\n\npublish_to: none\nenvironment:\n  sdk: '>=3.11.0 <4.0.0'\n\nworkspace:\n  - packages/http_exception\n  - packages/route\n  - packages/model\n  - packages/serialize/angel_serialize\n  - packages/serialize/angel_serialize_generator\n  - packages/container/angel_container\n  - packages/container/angel_container_generator\n  - packages/mock_request\n  - packages/framework\n  - packages/user_agent/angel_user_agent\n  - packages/validate\n  - packages/redis\n  - packages/cache\n  - packages/configuration\n  - packages/cors\n  - packages/auth\n  - packages/auth_oauth2\n#  - packages/auth_twitter\n  - packages/file_service\n  - packages/html\n  - packages/client\n  - packages/websocket\n  - packages/hot\n  - packages/production\n  - packages/test\n  - packages/sync\n  - packages/oauth2\n  - packages/security\n  - packages/proxy\n  - packages/paginate\n  - packages/static\n  - packages/jael/jael\n  - packages/jael/jael_preprocessor\n  - packages/jael/angel_jael\n  - packages/jael/jael_language_server\n  - packages/jael/jael_web\n  - packages/jinja\n  - packages/markdown\n  - packages/mustache\n  - packages/seo\n  - packages/mongo\n  - packages/rethinkdb\n  - packages/sembast\n  - packages/orm/angel_migration\n  - packages/orm/angel_migration_runner\n  - packages/orm/angel_orm\n  - packages/orm/angel_orm_generator\n  - packages/orm/angel_orm_postgres\n  - packages/orm/angel_orm_mysql\n  - packages/orm/angel_orm_service\n  - packages/shelf\n\ndependencies:\n  melos: ^7.3.0\n\nmelos:\n\n"
  }
]